Browse Source

修改低轨双星未配置参考频点,提示天线查询出错

zoule 10 months ago
parent
commit
9dd7e95654

+ 29 - 5
Service/X1LeoTaskServer54/Service/TaskService.cs

@@ -398,11 +398,35 @@ namespace X1LeoTaskServer54.Service
         {
             await LogHelper.Info($"【获取一星配置信息");
             LeoSat1AppSettingDto settingDto = new LeoSat1AppSettingDto();
-            settingDto.CapDir = ConfigurationManager.AppSettings["CapDir"].Trim();
-            settingDto.Time1SatInfo = ConfigurationManager.AppSettings["Time1SatInfo"].Replace(",", ",").Trim();
-            settingDto.Time2SatInfo = ConfigurationManager.AppSettings["Time2SatInfo"].Replace(",", ",").Trim();
-            settingDto.Time3SatInfo = ConfigurationManager.AppSettings["Time3SatInfo"].Replace(",", ",").Trim();
-            return settingDto;
+            try
+            {
+                if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["CapDir"]))
+                {
+                    throw new Exception($"未配置采集数据目录");
+                }
+                if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["Time1SatInfo"]))
+                {
+                    throw new Exception($"未配置卫星及星历Time1SatInfo");
+                }
+                if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["Time2SatInfo"]))
+                {
+                    throw new Exception($"未配置卫星及星历Time2SatInfo");
+                }
+                if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["Time3SatInfo"]))
+                {
+                    throw new Exception($"未配置卫星及星历Time3SatInfo");
+                }
+                settingDto.CapDir = ConfigurationManager.AppSettings["CapDir"].Trim();
+                settingDto.Time1SatInfo = ConfigurationManager.AppSettings["Time1SatInfo"].Replace(",", ",").Trim();
+                settingDto.Time2SatInfo = ConfigurationManager.AppSettings["Time2SatInfo"].Replace(",", ",").Trim();
+                settingDto.Time3SatInfo = ConfigurationManager.AppSettings["Time3SatInfo"].Replace(",", ",").Trim();
+                return settingDto;
+            }
+            catch (Exception ex)
+            {
+                await LogHelper.Error($"【获取一星配置信息】异常:{ex.Message}");
+                throw new Exception($"【获取一星配置信息】异常:{ex.Message}");
+            }
         }
 
         private AdFile StringToAdFile(string file)

+ 22 - 5
Service/X2LeoTaskServer54/Service/TaskService.cs

@@ -482,18 +482,35 @@ namespace X2LeoTaskServer54.Service
             try
             {
                 await LogHelper.Info($"【获取两星配置信息");
-                var RefFreqDownMHzstr = ConfigurationManager.AppSettings["RefFreqDownMHz"].Trim();
-                RefFreqDownMHz = Convert.ToDouble(RefFreqDownMHzstr);
-               
+                var RefFreqDownMHzstr = ConfigurationManager.AppSettings["RefFreqDownMHz"];
+                if (string.IsNullOrWhiteSpace(RefFreqDownMHzstr))
+                {
+                    throw new Exception($"未配置参考下行频点");
+                }
+                double.TryParse(RefFreqDownMHzstr.Trim(), out RefFreqDownMHz);
+
+                if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["CapDir"]))
+                {
+                    throw new Exception($"未配置采集数据目录");
+                }
+                if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["MainSatInfo"]))
+                {
+                    throw new Exception($"未配置卫星及星历MainSatInfo");
+                }
+                if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["Adja1SatInfo"]))
+                {
+                    throw new Exception($"未配置卫星及星历Adja1SatInfo");
+                }
                 settingDto.CapDir = ConfigurationManager.AppSettings["CapDir"].Trim();
                 settingDto.MainSatInfo = ConfigurationManager.AppSettings["MainSatInfo"].Replace(",", ",").Trim();
                 settingDto.Adja1SatInfo = ConfigurationManager.AppSettings["Adja1SatInfo"].Replace(",", ",").Trim();
                 settingDto.RefFreqDownMHz = RefFreqDownMHz;
                 return settingDto;
             }
-            catch
+            catch (Exception ex)
             {
-                return settingDto;
+                await LogHelper.Error($"【获取两星配置信息】异常:{ex.Message}");
+                throw new Exception($"【获取两星配置信息】异常:{ex.Message}");
             }
         }
 

+ 30 - 5
Service/X3LeoTaskServer54/Service/TaskService.cs

@@ -394,11 +394,36 @@ namespace X3LeoTaskServer54.Service
         {
             await LogHelper.Info($"【获取三星配置信息");
             LeoSat3AppSettingDto settingDto = new LeoSat3AppSettingDto();
-            settingDto.CapDir = ConfigurationManager.AppSettings["CapDir"].Trim();
-            settingDto.MainSatInfo = ConfigurationManager.AppSettings["MainSatInfo"].Replace(",", ",").Trim();
-            settingDto.Adja1SatInfo = ConfigurationManager.AppSettings["Adja1SatInfo"].Replace(",", ",").Trim();
-            settingDto.Adja2SatInfo = ConfigurationManager.AppSettings["Adja2SatInfo"].Replace(",", ",").Trim(); ;
-            return settingDto;
+            try
+            {
+                if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["CapDir"]))
+                {
+                    throw new Exception($"未配置采集数据目录");
+                }
+                if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["MainSatInfo"]))
+                {
+                    throw new Exception($"未配置卫星及星历MainSatInfo");
+                }
+                if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["Adja1SatInfo"]))
+                {
+                    throw new Exception($"未配置卫星及星历Adja1SatInfo");
+                }
+                if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["Adja2SatInfo"]))
+                {
+                    throw new Exception($"未配置卫星及星历Adja2SatInfo");
+                }
+                settingDto.CapDir = ConfigurationManager.AppSettings["CapDir"].Trim();
+                settingDto.MainSatInfo = ConfigurationManager.AppSettings["MainSatInfo"].Replace(",", ",").Trim();
+                settingDto.Adja1SatInfo = ConfigurationManager.AppSettings["Adja1SatInfo"].Replace(",", ",").Trim();
+                settingDto.Adja2SatInfo = ConfigurationManager.AppSettings["Adja2SatInfo"].Replace(",", ",").Trim(); ;
+                return settingDto;
+            }
+            catch (Exception ex)
+            {
+                await LogHelper.Error($"【获取三星配置信息】异常:{ex.Message}");
+                throw new Exception($"【获取三星配置信息】异常:{ex.Message}");
+            }
+        
         }
 
         private AdFile StringToAdFile(string file)

+ 1 - 2
XdCxRhDW.App/EditForms/TarDfoLeoX2Calc.cs

@@ -114,9 +114,8 @@ namespace XdCxRhDW.App.EditForms
                 }
 
             }
-            catch (Exception)
+            catch (Exception )
             {
-
             }