zoulei 1 år sedan
förälder
incheckning
4a640e25ac

+ 6 - 6
XdCxRhDW.App/EditForms/X2D1DTOParamEditor.cs

@@ -100,12 +100,12 @@ namespace XdCxRhDW.App.EditForms
                 this.txtRefLocation.Text = $"{0},{0}";
             }
 
-            txtsatStation.Text = "43.7,12.9";
-            txtcdbStation.Text = "43.7,12.9";
-            txtDtoSx.Text = "6348.6030";
-            txtDtoCdb.Text = "246616.0330";
-            ucEphXYZMain.SetXYZ("a", 1, (11265194.9906, 40486056.6399, -2055810.5412), Color.Red);
-            ucEphXYZAdaj.SetXYZ("b", 1, (25525328.3455, 33539987.1755, -49504.0378), Color.Red);
+            //txtsatStation.Text = "43.7,12.9";
+            //txtcdbStation.Text = "43.7,12.9";
+            //txtDtoSx.Text = "6348.6030";
+            //txtDtoCdb.Text = "246616.0330";
+            //ucEphXYZMain.SetXYZ("a", 1, (11265194.9906, 40486056.6399, -2055810.5412), Color.Red);
+            //ucEphXYZAdaj.SetXYZ("b", 1, (25525328.3455, 33539987.1755, -49504.0378), Color.Red);
 
             //double tarLon = 43.065, tarLat = 11.519;
             //double recLon = 45, recLat = 13;

+ 34 - 0
XdCxRhDW.DataEmulation/Program.cs

@@ -1,21 +1,55 @@
 using DevExpress.LookAndFeel;
 using DevExpress.Skins;
 using DevExpress.UserSkins;
+using DevExpress.XtraEditors;
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
+using System.Reflection;
 using System.Windows.Forms;
 
 namespace XdCxRhDW.DataEmulation
 {
     internal static class Program
     {
+        static Program()
+        {
+            AppDomain.CurrentDomain.SetData("PRIVATE_BINPATH", "AddIns;");
+            var m = typeof(AppDomainSetup).GetMethod("UpdateContextProperty", BindingFlags.NonPublic | BindingFlags.Static);
+            var funsion = typeof(AppDomain).GetMethod("GetFusionContext", BindingFlags.NonPublic | BindingFlags.Instance);
+            m.Invoke(null, new object[] { funsion.Invoke(AppDomain.CurrentDomain, null), "PRIVATE_BINPATH", "AddIns;" });
+            AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
+            {
+                var args = e.ExceptionObject as Exception;
+                DxHelper.MsgBoxHelper.ShowError("出现未处理的异常,程序即将退出!");
+            };
+            Application.ThreadException += (sender, e) =>
+            {
+                DxHelper.MsgBoxHelper.ShowError(e.Exception.Message);
+            };
+        }
         /// <summary>
         /// The main entry point for the application.
         /// </summary>
         [STAThread]
         static void Main()
         {
+            WindowsFormsSettings.AllowDpiScale = true;
+            WindowsFormsSettings.AllowHoverAnimation = DevExpress.Utils.DefaultBoolean.True;
+            WindowsFormsSettings.AllowDefaultSvgImages = DevExpress.Utils.DefaultBoolean.True;
+            WindowsFormsSettings.AllowRoundedWindowCorners = DevExpress.Utils.DefaultBoolean.True;
+            WindowsFormsSettings.AnimationMode = AnimationMode.EnableAll;
+            WindowsFormsSettings.BackgroundSkinningMode = BackgroundSkinningMode.AllColors;
+            WindowsFormsSettings.DefaultAllowHtmlDraw = true;
+            WindowsFormsSettings.DefaultLookAndFeel.SetSkinStyle(SkinStyle.WXICompact);
+            WindowsFormsSettings.DefaultFont = new System.Drawing.Font("微软雅黑", 10f);
+            WindowsFormsSettings.SetPerMonitorDpiAware();
+            if (Debugger.IsAttached)
+            {
+                //DevExpress23.2以上版本查看未本地化的资源
+                //DevExpress.Utils.Localization.XtraLocalizer.EnableTraceSource();
+            }
             Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);
             Application.Run(new Form1());

+ 3 - 1
XdCxRhDW.DataEmulation/XdCxRhDW.DataEmulation.csproj

@@ -34,7 +34,6 @@
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="Accessibility" />
-    <Reference Include="DevExpress.BonusSkins.v23.2" />
     <Reference Include="DevExpress.Data.Desktop.v23.2" />
     <Reference Include="DevExpress.Data.v23.2" />
     <Reference Include="DevExpress.Utils.v23.2" />
@@ -62,6 +61,9 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="..\XdCxRhDW.App\DxHelper\MsgBoxHelper.cs">
+      <Link>DxHelper\MsgBoxHelper.cs</Link>
+    </Compile>
     <Compile Include="DataEmulationHelper.cs" />
     <Compile Include="Form1.cs">
       <SubType>Form</SubType>

+ 7 - 5
XdCxRhDW.Sender/Form1.cs

@@ -107,7 +107,7 @@ namespace XdCxRhDW.Sender
                                             return;
                                         }
                                         //Thread.Sleep(1000);
-                                        Log($"已向[{txtAddr1.Text}]发送第{idx++}条仿真结果");
+                                        Log($"已向[{txtAddr1.Text}]发送第{idx++}条仿真结果,时差={dto.XdDto},测向值={dto.CxRes}");
                                         dt = dt.AddSeconds(1000).AddSeconds(idx).AddMilliseconds(267);
                                     }
                                 }
@@ -165,7 +165,7 @@ namespace XdCxRhDW.Sender
                                             return;
                                         }
                                         Thread.Sleep(1000);
-                                        Log($"已向[{txtAddr1.Text}]发送第{idx++}条仿真结果");
+                                        Log($"已向[{txtAddr1.Text}]发送第{idx++}条仿真结果.双星时差={X2D1PosDto.SxDto},主星超短时差={X2D1PosDto.XdDto}");
                                     }
                                 }
                                 if (tskType == "X2D1NoPar")//两星一地无参定位
@@ -178,7 +178,7 @@ namespace XdCxRhDW.Sender
                                         Log($"{result.msg}");
                                         return;
                                     }
-                                    Log($"已向[{txtAddr1.Text}]发送两星一地无参定位仿真结果");
+                                    Log($"已向[{txtAddr1.Text}]发送两星一地无参定位仿真结果.双星时差={res.SxDto},主星超短时差={res.XdDto}");
                                 }
                                 if (tskType == "RH")//融合定位
                                 {
@@ -317,7 +317,7 @@ namespace XdCxRhDW.Sender
                                             return;
                                         }
                                         Thread.Sleep(1000);
-                                        Log($"已向[{txtAddr1.Text}]发送第{idx++}条仿真结果");
+                                        Log($"已向[{txtAddr1.Text}]发送第{idx++}条仿真结果,时差={dto.XdDto},测向值={dto.CxRes}");
                                     }
                                 }
                                 if (tskType == "X2D1NoXL")//两星一地定位无星历
@@ -362,7 +362,8 @@ namespace XdCxRhDW.Sender
                                             return;
                                         }
                                         Thread.Sleep(1000);
-                                        Log($"已向[{txtAddr1.Text}]发送第{idx++}条仿真结果");
+                                        Log($"已向[{txtAddr1.Text}]发送两星一地无参定位仿真结果.双星时差={X2D1NoXlPosDto.SxDto},主星超短时差={X2D1NoXlPosDto.XdDto}");
+
                                     }
                                 }
                                 if (tskType == "X2D1NoParNoXL")//两星一地无参定位无星历
@@ -375,6 +376,7 @@ namespace XdCxRhDW.Sender
                                         Log($"{result.msg}");
                                         return;
                                     }
+                                    Log($"已向[{txtAddr1.Text}]发送两星一地无参定位仿真结果.双星时差={res.SxDto},主星超短时差={res.XdDto}");
                                     Log($"已向[{txtAddr1.Text}]发送两星一地无参定位仿真结果");
                                 }
                                 if (tskType == "RHNoXL")//融合定位无星历