gongqiuhong 1 year ago
parent
commit
8541644ef6

+ 1 - 0
XdCxRhDW.App/Api/PosApi.cs

@@ -240,6 +240,7 @@ namespace XdCxRhDW.App.Api
             X3_PosNoRef20240305_Core(mainSat, adjaSat1, adjaSat2, satStation, satStation, satStation, zone, tarDto1, tarDto2, res);
             return ConvertToGeoPoint(res);
         }
+
         /// <summary>
         /// 三星双频差带参,返回经度纬度高度及镜像点,数组长度为6
         /// </summary>

+ 37 - 0
XdCxRhDW.App/ObServer/PosObServer.cs

@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using XdCxRhDW.App.Model;
+using XdCxRhDW.App.UserControl;
+
+namespace XdCxRhDW.App.ObServer
+{
+    public  class PosObServer
+    {
+        private static PosObServer _ins =new PosObServer();
+        private PosObServer()
+        { 
+        }
+        public static PosObServer Instance => _ins;
+        /// <summary>
+        /// 定位推送事件
+        /// </summary>
+        public  event Action<PosRes> OnPosChanged;
+
+        public void Sub(Action<PosRes> action)
+        {
+            OnPosChanged += action;
+        }
+        public void DisposeSub(Action<PosRes> action)
+        {
+            OnPosChanged -= action;
+        }
+
+        public void Pub(PosRes data)
+        {
+            OnPosChanged?.Invoke(data);
+        }
+    }
+}

+ 61 - 61
XdCxRhDW.App/UserControl/CtrlHome.Designer.cs

@@ -34,16 +34,16 @@ namespace XdCxRhDW.App.UserControl
         private void InitializeComponent()
         {
             this.components = new System.ComponentModel.Container();
-            DevExpress.XtraEditors.ButtonsPanelControl.ButtonImageOptions buttonImageOptions10 = new DevExpress.XtraEditors.ButtonsPanelControl.ButtonImageOptions();
+            DevExpress.XtraEditors.ButtonsPanelControl.ButtonImageOptions buttonImageOptions1 = new DevExpress.XtraEditors.ButtonsPanelControl.ButtonImageOptions();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CtrlHome));
-            DevExpress.Utils.SuperToolTip superToolTip10 = new DevExpress.Utils.SuperToolTip();
-            DevExpress.Utils.ToolTipItem toolTipItem10 = new DevExpress.Utils.ToolTipItem();
-            DevExpress.XtraEditors.ButtonsPanelControl.ButtonImageOptions buttonImageOptions11 = new DevExpress.XtraEditors.ButtonsPanelControl.ButtonImageOptions();
-            DevExpress.Utils.SuperToolTip superToolTip11 = new DevExpress.Utils.SuperToolTip();
-            DevExpress.Utils.ToolTipItem toolTipItem11 = new DevExpress.Utils.ToolTipItem();
-            DevExpress.XtraEditors.ButtonsPanelControl.ButtonImageOptions buttonImageOptions12 = new DevExpress.XtraEditors.ButtonsPanelControl.ButtonImageOptions();
-            DevExpress.Utils.SuperToolTip superToolTip12 = new DevExpress.Utils.SuperToolTip();
-            DevExpress.Utils.ToolTipItem toolTipItem12 = new DevExpress.Utils.ToolTipItem();
+            DevExpress.Utils.SuperToolTip superToolTip1 = new DevExpress.Utils.SuperToolTip();
+            DevExpress.Utils.ToolTipItem toolTipItem1 = new DevExpress.Utils.ToolTipItem();
+            DevExpress.XtraEditors.ButtonsPanelControl.ButtonImageOptions buttonImageOptions2 = new DevExpress.XtraEditors.ButtonsPanelControl.ButtonImageOptions();
+            DevExpress.Utils.SuperToolTip superToolTip2 = new DevExpress.Utils.SuperToolTip();
+            DevExpress.Utils.ToolTipItem toolTipItem2 = new DevExpress.Utils.ToolTipItem();
+            DevExpress.XtraEditors.ButtonsPanelControl.ButtonImageOptions buttonImageOptions3 = new DevExpress.XtraEditors.ButtonsPanelControl.ButtonImageOptions();
+            DevExpress.Utils.SuperToolTip superToolTip3 = new DevExpress.Utils.SuperToolTip();
+            DevExpress.Utils.ToolTipItem toolTipItem3 = new DevExpress.Utils.ToolTipItem();
             this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
             this.mapControl1 = new DevExpress.XtraMap.MapControl();
             this.gridHomePosRes = new DevExpress.XtraGrid.GridControl();
@@ -70,14 +70,14 @@ namespace XdCxRhDW.App.UserControl
             this.btnStop = new DevExpress.XtraBars.BarButtonItem();
             this.btnDelPos = new DevExpress.XtraBars.BarButtonItem();
             this.btnTar = new DevExpress.XtraBars.BarButtonItem();
-            this.popupMenu1 = new DevExpress.XtraBars.PopupMenu(this.components);
-            this.htmlTemplateCollection1 = new DevExpress.Utils.Html.HtmlTemplateCollection();
-            this.htmlTemplate1 = new DevExpress.Utils.Html.HtmlTemplate();
-            this.popupMenu2 = new DevExpress.XtraBars.PopupMenu(this.components);
             this.btnDrawDto = new DevExpress.XtraBars.BarButtonItem();
             this.btnDrawDfo = new DevExpress.XtraBars.BarButtonItem();
             this.btnDrawCX = new DevExpress.XtraBars.BarButtonItem();
             this.btnGDOP = new DevExpress.XtraBars.BarButtonItem();
+            this.popupMenu1 = new DevExpress.XtraBars.PopupMenu(this.components);
+            this.htmlTemplateCollection1 = new DevExpress.Utils.Html.HtmlTemplateCollection();
+            this.htmlTemplate1 = new DevExpress.Utils.Html.HtmlTemplate();
+            this.popupMenu2 = new DevExpress.XtraBars.PopupMenu(this.components);
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
             this.layoutControl1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.mapControl1)).BeginInit();
@@ -195,22 +195,22 @@ namespace XdCxRhDW.App.UserControl
             // 
             // layoutControlGroup1
             // 
-            buttonImageOptions10.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("buttonImageOptions10.SvgImage")));
-            buttonImageOptions10.SvgImageSize = new System.Drawing.Size(20, 20);
-            toolTipItem10.Text = "新建任务";
-            superToolTip10.Items.Add(toolTipItem10);
-            buttonImageOptions11.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("buttonImageOptions11.SvgImage")));
-            buttonImageOptions11.SvgImageSize = new System.Drawing.Size(20, 20);
-            toolTipItem11.Text = "编辑任务";
-            superToolTip11.Items.Add(toolTipItem11);
-            buttonImageOptions12.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("buttonImageOptions12.SvgImage")));
-            buttonImageOptions12.SvgImageSize = new System.Drawing.Size(20, 20);
-            toolTipItem12.Text = "删除任务";
-            superToolTip12.Items.Add(toolTipItem12);
+            buttonImageOptions1.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("buttonImageOptions1.SvgImage")));
+            buttonImageOptions1.SvgImageSize = new System.Drawing.Size(20, 20);
+            toolTipItem1.Text = "新建任务";
+            superToolTip1.Items.Add(toolTipItem1);
+            buttonImageOptions2.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("buttonImageOptions2.SvgImage")));
+            buttonImageOptions2.SvgImageSize = new System.Drawing.Size(20, 20);
+            toolTipItem2.Text = "编辑任务";
+            superToolTip2.Items.Add(toolTipItem2);
+            buttonImageOptions3.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("buttonImageOptions3.SvgImage")));
+            buttonImageOptions3.SvgImageSize = new System.Drawing.Size(20, 20);
+            toolTipItem3.Text = "删除任务";
+            superToolTip3.Items.Add(toolTipItem3);
             this.layoutControlGroup1.CustomHeaderButtons.AddRange(new DevExpress.XtraEditors.ButtonPanel.IBaseButton[] {
-            new DevExpress.XtraEditors.ButtonsPanelControl.GroupBoxButton("新建任务", false, buttonImageOptions10, DevExpress.XtraBars.Docking2010.ButtonStyle.PushButton, "", -1, true, superToolTip10, true, false, true, null, -1),
-            new DevExpress.XtraEditors.ButtonsPanelControl.GroupBoxButton("编辑任务", false, buttonImageOptions11, DevExpress.XtraBars.Docking2010.ButtonStyle.PushButton, "", -1, true, superToolTip11, true, false, true, null, -1),
-            new DevExpress.XtraEditors.ButtonsPanelControl.GroupBoxButton("删除任务", false, buttonImageOptions12, DevExpress.XtraBars.Docking2010.ButtonStyle.PushButton, "", -1, true, superToolTip12, true, false, true, null, -1)});
+            new DevExpress.XtraEditors.ButtonsPanelControl.GroupBoxButton("新建任务", false, buttonImageOptions1, DevExpress.XtraBars.Docking2010.ButtonStyle.PushButton, "", -1, true, superToolTip1, true, false, true, null, -1),
+            new DevExpress.XtraEditors.ButtonsPanelControl.GroupBoxButton("编辑任务", false, buttonImageOptions2, DevExpress.XtraBars.Docking2010.ButtonStyle.PushButton, "", -1, true, superToolTip2, true, false, true, null, -1),
+            new DevExpress.XtraEditors.ButtonsPanelControl.GroupBoxButton("删除任务", false, buttonImageOptions3, DevExpress.XtraBars.Docking2010.ButtonStyle.PushButton, "", -1, true, superToolTip3, true, false, true, null, -1)});
             this.layoutControlGroup1.HeaderButtonsLocation = DevExpress.Utils.GroupElementLocation.AfterText;
             this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
             this.layoutControlItem1});
@@ -355,6 +355,35 @@ namespace XdCxRhDW.App.UserControl
             this.btnTar.Name = "btnTar";
             this.btnTar.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btnTar_ItemClick);
             // 
+            // btnDrawDto
+            // 
+            this.btnDrawDto.Caption = "绘制时差线";
+            this.btnDrawDto.Id = 7;
+            this.btnDrawDto.Name = "btnDrawDto";
+            this.btnDrawDto.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btnDrawDto_ItemClick);
+            // 
+            // btnDrawDfo
+            // 
+            this.btnDrawDfo.Caption = "绘制频差线";
+            this.btnDrawDfo.Id = 8;
+            this.btnDrawDfo.Name = "btnDrawDfo";
+            this.btnDrawDfo.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btnDrawDfo_ItemClick);
+            // 
+            // btnDrawCX
+            // 
+            this.btnDrawCX.Caption = "绘制测向线";
+            this.btnDrawCX.Id = 9;
+            this.btnDrawCX.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("btnDrawCX.ImageOptions.SvgImage")));
+            this.btnDrawCX.Name = "btnDrawCX";
+            this.btnDrawCX.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btnDrawCX_ItemClick);
+            // 
+            // btnGDOP
+            // 
+            this.btnGDOP.Caption = "GDOP分析";
+            this.btnGDOP.Id = 10;
+            this.btnGDOP.Name = "btnGDOP";
+            this.btnGDOP.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btnGDOP_ItemClick);
+            // 
             // popupMenu1
             // 
             this.popupMenu1.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] {
@@ -386,35 +415,6 @@ namespace XdCxRhDW.App.UserControl
             this.popupMenu2.Manager = this.barManager1;
             this.popupMenu2.Name = "popupMenu2";
             // 
-            // btnDrawDto
-            // 
-            this.btnDrawDto.Caption = "绘制时差线";
-            this.btnDrawDto.Id = 7;
-            this.btnDrawDto.Name = "btnDrawDto";
-            this.btnDrawDto.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btnDrawDto_ItemClick);
-            // 
-            // btnDrawDfo
-            // 
-            this.btnDrawDfo.Caption = "绘制频差线";
-            this.btnDrawDfo.Id = 8;
-            this.btnDrawDfo.Name = "btnDrawDfo";
-            this.btnDrawDfo.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btnDrawDfo_ItemClick);
-            // 
-            // btnDrawCX
-            // 
-            this.btnDrawCX.Caption = "绘制测向线";
-            this.btnDrawCX.Id = 9;
-            this.btnDrawCX.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("btnDrawCX.ImageOptions.SvgImage")));
-            this.btnDrawCX.Name = "btnDrawCX";
-            this.btnDrawCX.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btnDrawCX_ItemClick);
-            // 
-            // btnGDOP
-            // 
-            this.btnGDOP.Caption = "GDOP分析";
-            this.btnGDOP.Id = 10;
-            this.btnGDOP.Name = "btnGDOP";
-            this.btnGDOP.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btnGDOP_ItemClick);
-            // 
             // CtrlHome
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
@@ -455,11 +455,7 @@ namespace XdCxRhDW.App.UserControl
         #endregion
 
         private DevExpress.XtraLayout.LayoutControl layoutControl1;
-        private DevExpress.XtraMap.MapControl mapControl1;
-        private DevExpress.XtraGrid.GridControl gridHomePosRes;
-        private DevExpress.XtraGrid.Views.Grid.GridView gridView2;
         private DevExpress.XtraGrid.GridControl gridHomeTask;
-        private DevExpress.XtraGrid.Views.Grid.GridView gridView1;
         private DevExpress.XtraLayout.LayoutControlGroup Root;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3;
         private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup1;
@@ -488,5 +484,9 @@ namespace XdCxRhDW.App.UserControl
         private DevExpress.XtraBars.BarButtonItem btnDrawDfo;
         private DevExpress.XtraBars.BarButtonItem btnDrawCX;
         private DevExpress.XtraBars.BarButtonItem btnGDOP;
+        public DevExpress.XtraMap.MapControl mapControl1;
+        public DevExpress.XtraGrid.GridControl gridHomePosRes;
+        public DevExpress.XtraGrid.Views.Grid.GridView gridView2;
+        public DevExpress.XtraGrid.Views.Grid.GridView gridView1;
     }
 }

+ 40 - 33
XdCxRhDW.App/UserControl/CtrlHome.cs

@@ -24,17 +24,8 @@ using XdCxRhDW.App.Api.时差线;
 using XdCxRhDW.App.EditForms;
 using XdCxRhDW.App.EFContext;
 using XdCxRhDW.App.Model;
-using XdCxRhDW.App.WebAPI;
-using XdCxRhDW.Dto;
-using XdCxRhDW.App.Api;
-using System.Windows.Controls;
-using XdCxRhDW.App.WebAPI;
-using Microsoft.Owin.Hosting;
-using XdCxRhDW.App.App.Properties;
-using System.Web.Http;
-using System.Data.Entity.Migrations;
-using XdCxRhDW.App.Api.时差线;
 using System.Windows.Documents;
+using XdCxRhDW.App.ObServer;
 
 namespace XdCxRhDW.App.UserControl
 {
@@ -64,20 +55,36 @@ namespace XdCxRhDW.App.UserControl
             .UseExportCsv()
             .SetMapLayerType(mapService)
             //.SetMapLayerType("")
-             //.UseHJ(item =>
-             //{
-             //    (double Lon, double Lat) = item;
-             //    PosRes pos = new PosRes();
-             //    pos.PosLon = Lon;
-             //    pos.PosLat = Lat;
-             //    pos.SigTime = DateTime.Now;
-             //    mapControl1.AddHJPosItem(pos);
-             //})
+            //.UseHJ(item =>
+            //{
+            //    (double Lon, double Lat) = item;
+            //    PosRes pos = new PosRes();
+            //    pos.PosLon = Lon;
+            //    pos.PosLat = Lat;
+            //    pos.SigTime = DateTime.Now;
+            //    mapControl1.AddHJPosItem(pos);
+            //})
             .UseDrawRect(rect =>
             {
                 (double startLon, double startLat, double centerLon, double centerLat, double endLon, double endLat, double lonRange, double latRange) = rect;
             });
 
+            PosObServer.Instance.Sub(PosSubEvent);
+        }
+
+        private void PosSubEvent(PosRes posRes)
+        {
+            var currentTask = gridView1.GetFocusedRow() as TaskInfo;
+            if (currentTask.ID == posRes.TaskInfoID)
+            {
+                var ds = this.gridHomePosRes.DataSource as List<PosRes>;
+                ds.Insert(0, posRes);
+                this.Invoke(new Action(() =>
+                {
+                    gridView2.RefreshData();
+                    mapControl1.AddPosItem(posRes);
+                }));
+            }
         }
         private async void GridView1_FocusedRowObjectChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowObjectChangedEventArgs e)
         {
@@ -91,7 +98,7 @@ namespace XdCxRhDW.App.UserControl
                 var items = await db.PosRes.Where(p => p.TaskInfoID == tsk.ID).OrderByDescending(p => p.SigTime).ToListAsync();
                 listPos.AddRange(items);
             }
-           
+
             this.gridHomePosRes.DataSource = listPos;
             mapControl1.SetPosDataSource(listPos.Where(p => p.PosLon <= 180), false);
         }
@@ -171,11 +178,11 @@ namespace XdCxRhDW.App.UserControl
                     var posType = GetPosRes(item, "绘制频差线");
                     DrawDfoLine(item, posType);
                 })
-               //.AddPosMenu<PosRes>("绘制GDOP", SvgHelper.LoadFromFile("Image\\GDOP.svg"), item =>
-               // {
-               //     var posType = GetPosRes(item, "绘制GDOP");
-               //     DrawGDOP(item.SigTime, posType);
-               // })
+                 //.AddPosMenu<PosRes>("绘制GDOP", SvgHelper.LoadFromFile("Image\\GDOP.svg"), item =>
+                 // {
+                 //     var posType = GetPosRes(item, "绘制GDOP");
+                 //     DrawGDOP(item.SigTime, posType);
+                 // })
                  .AddPosMenu<PosRes>("绘制测向线", btnDrawCX.ImageOptions.SvgImage, item =>
                   {
                       DrawCXLine(item);
@@ -204,7 +211,7 @@ namespace XdCxRhDW.App.UserControl
                 {
                     StartOptions options = new StartOptions();
                     options.Urls.Add($"http://+:{settings.HttpPort}");
-                    httpServer = WebApp.Start<Startup>(options);
+                    httpServer = WebApp.Start<WebAPI.Startup>(options);
                 }
                 catch (System.Reflection.TargetInvocationException ex)
                 {
@@ -284,7 +291,7 @@ namespace XdCxRhDW.App.UserControl
         private void gridView2_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
         {
             if (gridView2.FocusedRowHandle < 0) return;
-           
+
             if (!gridView2.GetSelectedRows().Any())
             {
                 btnDelPos.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
@@ -297,7 +304,7 @@ namespace XdCxRhDW.App.UserControl
             switch (posRes.Item2)
             {
                 case EnumPosType.X1D1CX:
-                    btnGDOP.Visibility= DevExpress.XtraBars.BarItemVisibility.Never;
+                    btnGDOP.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
                     break;
                 case EnumPosType.X2D1:
                     btnGDOP.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
@@ -421,7 +428,7 @@ namespace XdCxRhDW.App.UserControl
                             {
                                 StartOptions options = new StartOptions();
                                 options.Urls.Add($"http://+:{settings.HttpPort}");
-                                httpServer = WebApp.Start<Startup>(options);
+                                httpServer = WebApp.Start<WebAPI.Startup>(options);
                             }
                             catch (Exception ex)
                             {
@@ -485,7 +492,7 @@ namespace XdCxRhDW.App.UserControl
                 e.DrawHtml(htmlTemplate1);
             }
         }
-      
+
 
         private async void btnDelPos_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
         {
@@ -868,11 +875,11 @@ namespace XdCxRhDW.App.UserControl
                     DxHelper.MsgBoxHelper.ShowWarning($"测向站信息为空!");
                     return;
                 }
-                double startdeg =360;
-                double deg = startdeg- cx.Fx;//向北顺时针方向为夹角
+                double startdeg = 360;
+                double deg = startdeg - cx.Fx;//向北顺时针方向为夹角
                 //计算测向站到定位点之间的距离
                 var km = MapControlEx.CalcLineKm(satTx.Lon, satTx.Lat, item.PosLon, item.PosLat);
-                var endpoint = MapControlEx.CalcSituation(satTx.Lon, satTx.Lat, deg, (km+100) * 1000);
+                var endpoint = MapControlEx.CalcSituation(satTx.Lon, satTx.Lat, deg, (km + 100) * 1000);
                 List<(double, double)> points = new List<(double, double)>();
                 points.Add((satTx.Lon, satTx.Lat));
                 points.Add((endpoint.Item1, endpoint.Item2));

+ 3 - 3
XdCxRhDW.App/UserControl/CtrlHome.resx

@@ -121,7 +121,7 @@
     <value>391, 17</value>
   </metadata>
   <assembly alias="DevExpress.Data.v23.2" name="DevExpress.Data.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
-  <data name="buttonImageOptions10.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="buttonImageOptions1.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIzLjIsIFZlcnNpb249MjMuMi4z
         LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
@@ -140,7 +140,7 @@
         DQogIDwvZz4NCjwvc3ZnPgs=
 </value>
   </data>
-  <data name="buttonImageOptions11.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="buttonImageOptions2.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIzLjIsIFZlcnNpb249MjMuMi4z
         LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
@@ -161,7 +161,7 @@
         ICA8L2c+DQo8L3N2Zz4L
 </value>
   </data>
-  <data name="buttonImageOptions12.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="buttonImageOptions3.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIzLjIsIFZlcnNpb249MjMuMi4z
         LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl

+ 3 - 1
XdCxRhDW.App/WebAPI/Controllers/PosController.cs

@@ -23,6 +23,7 @@ using XdCxRhDW.App.App.Properties;
 using XdCxRhDW.App.Basic;
 using XdCxRhDW.App.EFContext;
 using XdCxRhDW.App.Model;
+using XdCxRhDW.App.ObServer;
 using XdCxRhDW.App.WebAPI.DTO;
 using XdCxRhDW.Dto;
 using static System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox;
@@ -177,8 +178,9 @@ namespace XdCxRhDW.App.WebAPI
                     MirrLon = Math.Round(res[3], 4),
                     MirrLat = Math.Round(res[4], 4),
                 };
-                db.PosRes.Add(posRes);
+                posRes=db.PosRes.Add(posRes);
                 await db.SaveChangesAsync();
+                PosObServer.Instance.Pub(posRes);
                 return Success(posRes);
             }
         }

+ 0 - 16
XdCxRhDW.App/WebAPI/CtrlHelper/CtrlHelper.cs

@@ -1,16 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace XdCxRhDW.App.WebAPI.CtrlHelper
-{
-    /// <summary>
-    /// 连接UI
-    /// </summary>
-    public class CtrlHelper
-    {
-
-    }
-}

+ 1 - 1
XdCxRhDW.App/XdCxRhDW.App.csproj

@@ -388,7 +388,7 @@
     <Compile Include="WebAPI\Controllers\DetectCgController.cs" />
     <Compile Include="WebAPI\Controllers\XlController.cs" />
     <Compile Include="WebAPI\Controllers\PosController.cs" />
-    <Compile Include="WebAPI\CtrlHelper\CtrlHelper.cs" />
+    <Compile Include="ObServer\PosObServer.cs" />
     <Compile Include="WebAPI\DTO\Test.cs" />
     <Compile Include="WebAPI\Startup.cs" />
     <EmbeddedResource Include="CorTools\DetectToolForm.resx">