|
@@ -25,7 +25,7 @@ public class Text_readNC
|
|
|
public double initlatitudes;
|
|
|
public double initlongitudes;
|
|
|
|
|
|
- public void GetNCData()
|
|
|
+ public bool GetNCData()
|
|
|
{
|
|
|
|
|
|
|
|
@@ -47,6 +47,9 @@ public class Text_readNC
|
|
|
|
|
|
JArray dataArray1 = (JArray)resultObject1["data"];
|
|
|
|
|
|
+ if (dataArray1 == null)
|
|
|
+ return false;
|
|
|
+
|
|
|
|
|
|
times = dataArray1.Count;
|
|
|
latitudes = ((JArray)dataArray1[0]).Count;
|
|
@@ -124,7 +127,8 @@ public class Text_readNC
|
|
|
|
|
|
|
|
|
JArray dataArray2 = (JArray)resultObject2["data"];
|
|
|
-
|
|
|
+ if (dataArray2 == null)
|
|
|
+ return false;
|
|
|
|
|
|
times1 = dataArray2.Count;
|
|
|
latitudes1 = ((JArray)dataArray2[0]).Count;
|
|
@@ -173,7 +177,8 @@ public class Text_readNC
|
|
|
|
|
|
|
|
|
JArray dataArray3 = (JArray)resultObject3["data"];
|
|
|
-
|
|
|
+ if (dataArray3 == null)
|
|
|
+ return false;
|
|
|
|
|
|
times2 = dataArray3.Count;
|
|
|
latitudes2 = ((JArray)dataArray3[0]).Count;
|
|
@@ -220,7 +225,8 @@ public class Text_readNC
|
|
|
|
|
|
|
|
|
JArray dataArray4 = (JArray)resultObject4["data"];
|
|
|
-
|
|
|
+ if (dataArray4 == null)
|
|
|
+ return false;
|
|
|
|
|
|
times3 = dataArray4.Count;
|
|
|
latitudes3 = ((JArray)dataArray4[0]).Count;
|
|
@@ -248,9 +254,10 @@ public class Text_readNC
|
|
|
windNCread.mwdArray = mwdArray;
|
|
|
}
|
|
|
}
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
- public void GetWaveHighData()
|
|
|
+ public bool GetWaveHighData()
|
|
|
{
|
|
|
|
|
|
string url1 = $"{Util.baseURl}rescue-platform-service/api/v1/dem/getNcInfos?ncPath=D:/data/haiyang/2023_mwd_currentV_waveHeight.nc&varName=hmax¢erLon=" + initlongitudes + "¢erLat=" + initlatitudes;
|
|
@@ -271,7 +278,8 @@ public class Text_readNC
|
|
|
|
|
|
|
|
|
JArray dataArray1 = (JArray)resultObject1["data"];
|
|
|
-
|
|
|
+ if (dataArray1 == null)
|
|
|
+ return false;
|
|
|
|
|
|
times4 = dataArray1.Count;
|
|
|
latitudes4 = ((JArray)dataArray1[0]).Count;
|
|
@@ -320,5 +328,6 @@ public class Text_readNC
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+ return true;
|
|
|
}
|
|
|
}
|