zoulei 1 year ago
parent
commit
ce02281a26

+ 58 - 24
XdCxRhDW.App/DxHelper/SvgHelper.cs

@@ -1,4 +1,5 @@
-using DevExpress.Utils;
+using DevExpress.Drawing.Internal.Fonts.Interop;
+using DevExpress.Utils;
 using DevExpress.Utils.Svg;
 using DevExpress.XtraMap.Native;
 using System;
@@ -10,6 +11,7 @@ using System.IO.Ports;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows.Media;
 using System.Xml;
 
 namespace DxHelper
@@ -132,16 +134,40 @@ namespace DxHelper
         }
         public static SvgImage CreateMarkDot()
         {
-            string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox='0 0 32 32'>" + "<path class=\"Blue\" d=\"M6,8c0,1.1-0.9,2-2,2c-1.1,0-2-0.9-2-2s0.9-2,2-2C5.1,6,6,6.9,6,8z M10,22c-1.1,0-2,0.9-2,2s0.9,2,2,2\r\n\tc1.1,0,2-0.9,2-2S11.1,22,10,22z M18,16c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2S19.1,16,18,16z M22,8c-1.1,0-2,0.9-2,2\r\n\tc0,1.1,0.9,2,2,2c1.1,0,2-0.9,2-2C24,8.9,23.1,8,22,8z M28,4c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2S29.1,4,28,4z\"/>\r\n<path class=\"Yellow\" d=\"M8,18c0,1.1-0.9,2-2,2c-1.1,0-2-0.9-2-2s0.9-2,2-2C7.1,16,8,16.9,8,18z M12,10c-1.1,0-2,0.9-2,2s0.9,2,2,2\r\n\tc1.1,0,2-0.9,2-2S13.1,10,12,10z M4,26c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2S5.1,26,4,26z M20,2c-1.1,0-2,0.9-2,2s0.9,2,2,2\r\n\tc1.1,0,2-0.9,2-2S21.1,2,20,2z M28,12c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2S29.1,12,28,12z\"/>"
+            string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox='0 0 32 32'>" + "<path class=\"Blue\" d=\"M6,8c0,1.1-0.9,2-2,2c-1.1,0-2-0.9-2-2s0.9-2,2-2C5.1,6,6,6.9,6,8z M10,22c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2S11.1,22,10,22z M18,16c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2S19.1,16,18,16z M22,8c-1.1,0-2,0.9-2,2c0,1.1,0.9,2,2,2c1.1,0,2-0.9,2-2C24,8.9,23.1,8,22,8z M28,4c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2S29.1,4,28,4z\"/><path class=\"Yellow\" d=\"M8,18c0,1.1-0.9,2-2,2c-1.1,0-2-0.9-2-2s0.9-2,2-2C7.1,16,8,16.9,8,18z M12,10c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2S13.1,10,12,10z M4,26c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2S5.1,26,4,26z M20,2c-1.1,0-2,0.9-2,2s0.9,2,2,2\r\n\tc1.1,0,2-0.9,2-2S21.1,2,20,2z M28,12c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2S29.1,12,28,12z\"/>"
                 + "</svg>";
             MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
             var svg = SvgLoader.LoadFromStream(ms);
             ms.Dispose();
             return svg;
         }
-        public static SvgImage CreateGeoDot(string color = "#D11C1C")
+
+        /// <summary>
+        /// 接收天线
+        /// </summary>
+        /// <param name="color"></param>
+        /// <param name="width"></param>
+        /// <param name="height"></param>
+        /// <returns></returns>
+        public static SvgImage CreateAnt(string color = "#1177D7", int width = 24, int height = 24)
         {
-            string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox='0 0 32 32'>" + $"<path fill='{color}' d='M16,2C10.5,2,6,6.5,6,12s10,18,10,18s10-12.5,10-18S21.5,2,16,2z M16,16c-2.2,0-4-1.8-4-4s1.8-4,4-4s4,1.8,4,4S18.2,16,16,16z'/>"
+            string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" width='{width}px' height='{height}px' viewBox='0 0 329.871 329.871'>" + $"<path fill='{color}' d='M104.839,60c-8.284,0-15,6.716-15,15c0,8.284,6.716,15,15,15c74.439,0,135,60.561,135,135c0,8.284,6.716,15,15,15c8.284,0,15-6.716,15-15C269.839,134.018,195.82,60,104.839,60z'/> <path fill='{color}' d='M159.141,191.91l18.878-18.877c5.858-5.857,5.858-15.355,0.001-21.213c-5.858-5.858-15.355-5.858-21.214,0l-18.878,18.877l-76.34-76.34c-5.857-5.857-15.355-5.857-21.213,0c-53.791,53.791-53.791,141.314,0,195.105c26.057,26.059,60.701,40.408,97.553,40.408c36.852,0,71.496-14.35,97.553-40.408c5.857-5.857,5.857-15.355,0-21.213L159.141,191.91z'/>"
+               + "</svg>";
+            MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
+            var svg = SvgLoader.LoadFromStream(ms);
+            ms.Dispose();
+            return svg;
+        }
+        /// <summary>
+        /// 圆点
+        /// </summary>
+        /// <param name="color"></param>
+        /// <param name="width"></param>
+        /// <param name="height"></param>
+        /// <returns></returns>
+        public static SvgImage CreateGeoDot(string color = "#D11C1C", int width = 24, int height = 24)
+        {
+            string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" width='{width}px' height='{height}px' viewBox='0 0 32 32'>" + $"<path fill='{color}' d='M16,2C10.5,2,6,6.5,6,12s10,18,10,18s10-12.5,10-18S21.5,2,16,2z M16,16c-2.2,0-4-1.8-4-4s1.8-4,4-4s4,1.8,4,4S18.2,16,16,16z'/>"
                 + "</svg>";
             MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
             var svg = SvgLoader.LoadFromStream(ms);
@@ -155,39 +181,47 @@ namespace DxHelper
         /// <param name="viewBoxHeight"></param>
         /// <param name="offsetX"></param>
         /// <returns></returns>
-        public static SvgImage CreatePentagram(string color = "#1177D7")
+        public static SvgImage CreatePentagram(string color = "#1177D7", int width = 24, int height = 24)
         {
-            string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' viewBox='0 0 32 32'>" + $"<polygon fill='{color}' points='16,4 19.9,11.9 28.6,13.2 22.3,19.3 23.8,28 16,23.9 8.2,28 9.7,19.3 3.4,13.2 12.1,11.9'/>"
-                + "</svg>";
+            string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>" + $"<polygon fill='{color}' points='16,4 19.9,11.9 28.6,13.2 22.3,19.3 23.8,28 16,23.9 8.2,28 9.7,19.3 3.4,13.2 12.1,11.9'/>"
+               + "</svg>";
             MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
             var svg = SvgLoader.LoadFromStream(ms);
             ms.Dispose();
             return svg;
         }
 
-        public static SvgImage CreateSat()
-        {
-            string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox='0 0 64 64'>" +
-                $"<path fill='#d0d0d0' d='M24.4 24.4c3.2-3.2 3.2-8.4 0-11.6L12.8 24.4c3.2 3.2 8.4 3.2 11.6 0'/>" +
-                $"<path fill='#94989b' d='M27 27c-4.3 4.3-4.3 4.3-6 2.6c-1.7-1.7-1.7-1.7 2.6-6s4.3-4.3 6-2.6c1.7 1.7 1.7 1.7-2.6 6'/>" +
-                $"<path fill='#7f8285' d='M37.2 37.2c-4.3 4.3-4.3 4.3-6 2.6l-6.9-6.9c-1.7-1.7-1.7-1.7 2.6-6s4.3-4.3 6-2.6l6.9 6.9c1.7 1.7 1.7 1.7-2.6 6'/>" +
-                $"<path fill='#646669' d='M39.6 39.6c-3.2 3.2-3.2 3.2-4.5 1.9c-1.3-1.3-1.3-1.3 1.9-4.5s3.2-3.2 4.5-1.9c1.3 1.2 1.3 1.2-1.9 4.5'/>" +
-                $"<path fill='#94989b' d='M22.2 15l-7.1-1.3c0-.3-.1-.5-.3-.7c-.4-.4-1.2-.4-1.6 0c-.4.4-.4 1.2 0 1.6c.2.2.4.3.6.3l1.4 7.2l.8-.8h-.2l-1.2-6.5c.1-.1.2-.1.3-.2c.1-.1.1-.1.1-.2l6.5 1.2v.2l.7-.8'/>" +
-                $"<path fill='#3e4347' d='M25.756 37.336l1.485-1.484l.919.92l-1.485 1.484z'/>" +
-                $"<path fill='#3e4347' d='M35.866 27.24l1.485-1.484l.919.919l-1.485 1.485z'/>" +
-                $"<path fill='#428bc1' d='M31.1 42.6c.2.2.2.5 0 .7L12.5 61.9c-.2.2-.5.2-.7 0l-9.7-9.7c-.1-.2-.1-.5 0-.7l18.6-18.6c.2-.2.5-.2.7 0l9.7 9.7'/>" +
-                $"<path fill='#428bc1' d='M61.9 11.9c.2.2.2.5 0 .7L43.3 31.1c-.2.2-.5.2-.7 0l-9.7-9.7c-.2-.2-.2-.5 0-.7L51.5 2.1c.2-.1.5-.1.6 0l9.8 9.8'/>" +
-                $"<path fill='#42ade2' d='M3.3 51.8l.7.7h16.4l5.1-5.1H7.7z'/>" +
-                $"<path fill='#42ade2' d='M29.2 42.3H12.8l-2.5 2.6H28l1.9-1.9z'/>" +
-                $"<path fill='#42ade2' d='M34.1 21l.7.7h16.4l5.1-5.1H38.5z'/>" +
-                $"<path fill='#42ade2' d='M60 11.5H43.6l-2.5 2.6h17.7l1.9-1.9z'/>"
+        /// <summary>
+        /// 卫星图
+        /// </summary>
+        /// <param name="color"></param>
+        /// <param name="width"></param>
+        /// <param name="height"></param>
+        /// <returns></returns>
+        public static SvgImage CreateSat(string color = "#1177D7", int width = 24, int height = 24)
+        {
+            string xml = $"<svg xmlns=\"http://www.w3.org/2000/svg\"  width='{width}px' height='{height}px' viewBox='0 0 297.131 297.131'>"
+              + $"<path fill='{color}' d='M196.826,68.171c17.691,0.002,32.084,14.405,32.084,32.108c0,5.54,4.492,10.033,10.033,10.033 c5.54,0,10.033-4.493,10.033-10.033c0-28.768-23.394-52.173-52.148-52.175h-0.001c-5.54,0-10.033,4.491-10.033,10.032 C186.794,63.679,191.286,68.171,196.826,68.171z'/>"
+              + $"<path fill='{color}' d='M196.827,34.094c36.476,0.002,66.15,29.692,66.15,66.186c0,5.54,4.492,10.033,10.033,10.033 c5.541,0,10.033-4.493,10.033-10.033c0-47.558-38.677-86.25-86.217-86.252c-5.54,0-10.033,4.491-10.033,10.033 C186.794,29.601,191.286,34.094,196.827,34.094z'/>"
+              + $"<path fill='{color}' d='M187.387,160.099c13.264-13.271,13.264-34.984,0-48.254l-2.119-2.12c-6.631-6.635-15.374-9.952-24.115-9.952 c-8.743,0-17.484,3.316-24.116,9.953l-27.294,27.307c-13.264,13.271-13.264,34.984,0,48.254l2.12,2.12 c6.631,6.635,15.374,9.952,24.114,9.952c8.744,0,17.485-3.316,24.117-9.953L187.387,160.099z'/> "
+              + $"<path fill='{color}' d='M98.388,125.684l27.295-27.307c7.865-7.869,17.917-12.782,28.811-14.212l-8.862-26.783 c-0.492-1.485-1.323-2.834-2.43-3.94L92.722,2.94C90.841,1.058,88.287,0,85.626,0c-2.662,0-5.215,1.059-7.097,2.94L3.001,78.505 c-3.915,3.918-3.915,10.269,0.002,14.186l50.48,50.501c1.106,1.107,2.456,1.938,3.941,2.432l26.752,8.861 C85.579,143.943,90.31,133.767,98.388,125.684z'/>"
+              + $"<path fill='{color}' d='M294.128,204.439l-50.481-50.499c-1.107-1.106-2.456-1.938-3.941-2.43l-26.753-8.864 c-1.403,10.541-6.134,20.718-14.212,28.8l-27.294,27.308c-7.865,7.869-17.916,12.782-28.809,14.212l8.862,26.781 c0.492,1.484,1.323,2.834,2.429,3.941l50.478,50.503c1.882,1.882,4.435,2.94,7.097,2.94s5.215-1.058,7.096-2.94l75.529-75.564 C298.045,214.708,298.045,208.357,294.128,204.439z'/>"
+              + "</svg>";
+            MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
+            var svg = SvgLoader.LoadFromStream(ms);
+            ms.Dispose();
+            return svg;
+        }
+        public static SvgImage CreateRect(string color = "#1177D7", int width = 24, int height = 24)
+        {
+            string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 512 512'>"
+              + $"<path fill='{color}' d='M0,0v512h512V0H0z M465.5,465.5H46.5V46.5h418.9V465.5z'/>"
               + "</svg>";
             MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
             var svg = SvgLoader.LoadFromStream(ms);
             ms.Dispose();
             return svg;
         }
-
 
         #region exportImg
         public static SvgImage CreateExportImg()

+ 1 - 1
XdCxRhDW.App/EditForms/EditorTar.cs

@@ -13,7 +13,6 @@ using System.Windows.Documents;
 using System.Windows.Forms;
 using XdCxRhDW.Repostory.EFContext;
 using XdCxRhDW.Repostory.Model;
-using XdCxRhDW.Repostory.Model;
 
 namespace XdCxRhDW.App.EditForms
 {
@@ -25,6 +24,7 @@ namespace XdCxRhDW.App.EditForms
         public EditorTar(TargetInfo info)
         {
             InitializeComponent();
+            this.layoutControl1.UseDefault();
             this.Text = "编辑目标";
             this.info = info;
             this.StartPosition = FormStartPosition.CenterParent;

+ 1 - 0
XdCxRhDW.App/EditForms/SatEditor.cs

@@ -23,6 +23,7 @@ namespace XdCxRhDW.App.EditForms
         public SatEditor()
         {
             InitializeComponent();
+            this.layoutControl1.UseDefault();
             this.Text = "添加卫星";
             info = new SatInfo();
             this.StartPosition = FormStartPosition.CenterParent;

+ 1 - 0
XdCxRhDW.App/EditForms/TargetEditor.cs

@@ -26,6 +26,7 @@ namespace XdCxRhDW.App.EditForms
         public TargetEditor()
         {
             InitializeComponent();
+            this.layoutControl1.UseDefault();
             this.Text = "添加目标";
             info = new TargetInfo();
             this.StartPosition = FormStartPosition.CenterParent;

+ 1 - 0
XdCxRhDW.App/EditForms/TaskEditor.cs

@@ -29,6 +29,7 @@ namespace XdCxRhDW.App.EditForms
         public TaskEditor()
         {
             InitializeComponent();
+            this.layoutControl1.UseDefault();
             this.Text = "添加任务";
             info = new TaskInfo();
             this.StartPosition = FormStartPosition.CenterParent;

+ 0 - 9
XdCxRhDW.App/ExtensionsDev/GridControlEx.cs

@@ -112,15 +112,6 @@ public static class GridControlEx
                 frm = searchLookUpEdit.FindForm();
             if (frm != null)
             {
-                //frm.FormClosing += (sender2, e2) =>
-                //{
-                //    if (e2.CloseReason == CloseReason.UserClosing || e2.CloseReason == CloseReason.MdiFormClosing)
-                //    {
-                //        Directory.CreateDirectory("Layout");
-                //        if (name == null) return;
-                //        grid.MainView?.SaveLayoutToXml($"Layout\\{name}.xml", OptionsLayoutBase.FullLayout);
-                //    }
-                //};
                 frm.VisibleChanged += (sender2, e2) =>
                 {
                     Directory.CreateDirectory("Layout");

+ 36 - 4
XdCxRhDW.App/ExtensionsDev/LayoutControlExtension.cs

@@ -1,4 +1,5 @@
-using DevExpress.XtraEditors;
+using DevExpress.Utils;
+using DevExpress.XtraEditors;
 using DevExpress.XtraLayout;
 using System;
 using System.Collections.Generic;
@@ -7,6 +8,8 @@ using System.IO;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows.Forms;
+using XdCxRhDW.Core;
 
 namespace ExtensionsDev
 {
@@ -16,12 +19,41 @@ namespace ExtensionsDev
         {
             ctrl.AllowTouchGestures = DevExpress.Utils.DefaultBoolean.False;
             ctrl.AllowDrop = false;
-            ctrl.AllowCustomization= false;
+            ctrl.AllowCustomization = false;
             ctrl.OptionsFocus.AllowFocusGroups = false;
             ctrl.OptionsFocus.AllowFocusTabbedGroups = false;
             ctrl.OptionsFocus.AllowFocusControlOnLabelClick = true;
-            ctrl.Root.GroupBordersVisible= false;
+            ctrl.Root.GroupBordersVisible = false;
+            System.Windows.Forms.Control findCtrl = ctrl;
+            string GetLayoutName()
+            {
+                while (findCtrl.Parent != null)
+                {
+                    findCtrl = findCtrl.Parent;
+                    if (findCtrl is System.Windows.Forms.UserControl) break;
+                }
+                return $"{findCtrl.Name}_{ctrl.Name}";
+            }
+            string name = GetLayoutName();
+            (findCtrl as UserControl).Load += (sender, e) =>
+            {
+                var frm = ctrl.FindForm();
+                if (frm != null)
+                {
+                    frm.VisibleChanged += (sender2, e2) =>
+                    {
+                        Directory.CreateDirectory("Layout");
+                        if (name == null) return;
+                        ctrl.SaveLayoutToXml($"Layout\\{name}.xml");
+                    };
+                }
+            };
+           
+            if (name != null && File.Exists($"Layout\\{name}.xml"))
+            {
+                ctrl.RestoreLayoutFromXml($"Layout\\{name}.xml");
+            }
         }
-      
+
     }
 }

+ 1 - 2
XdCxRhDW.App/ExtensionsDev/MapControlEx.cs

@@ -714,7 +714,7 @@ public static class MapControlEx
     /// <param name="img"></param>
     /// <param name="size"></param>
     /// <param name="toolTip"></param>
-    public static void DrawFixedImg(this MapControl ctrl, string tag, double imgLat, double imgLon, SvgImage img, Size size, string toolTip = "")
+    public static void DrawFixedImg(this MapControl ctrl, string tag, double imgLat, double imgLon, SvgImage img, string toolTip = "")
     {
         var innerData = ctrl.Tag as InnerData;
         var item = new MapCustomElement() { Tag = tag };
@@ -722,7 +722,6 @@ public static class MapControlEx
         item.BackgroundDrawingMode = ElementState.None;
         item.Location = new GeoPoint(imgLat, imgLon);
         item.SvgImage = img;
-        item.SvgImageSize = size;
         item.ToolTipPattern = toolTip;
         innerData.mMapStorageFixed.Items.Add(item);
     }

+ 10 - 7
XdCxRhDW.App/Properties/licenses.licx

@@ -1,12 +1,15 @@
-DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraEditors.ImageComboBoxEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraMap.MapControl, DevExpress.XtraMap.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraEditors.ButtonEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraBars.BarManager, DevExpress.XtraBars.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
 DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraBars.BarManager, DevExpress.XtraBars.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
 DevExpress.XtraEditors.SearchLookUpEdit, DevExpress.XtraGrid.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
 DevExpress.XtraEditors.DateEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.ButtonEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
 DevExpress.XtraCharts.ChartControl, DevExpress.XtraCharts.v23.2.UI, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraBars.Docking2010.DocumentManager, DevExpress.XtraBars.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraMap.MapControl, DevExpress.XtraMap.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraBars.Docking.DockManager, DevExpress.XtraBars.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
 DevExpress.XtraEditors.PictureEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.ImageComboBoxEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

+ 78 - 62
XdCxRhDW.App/UserControl/CtrlHome.cs

@@ -26,6 +26,7 @@ using XdCxRhDW.Core.Api;
 using XdCxRhDW.WebApi;
 using XdCxRhDW.Core.ObServer;
 using DevExpress.XtraBars.Docking2010;
+using ExtensionsDev;
 namespace XdCxRhDW.App.UserControl
 {
     public partial class CtrlHome : DevExpress.XtraEditors.XtraUserControl
@@ -36,6 +37,7 @@ namespace XdCxRhDW.App.UserControl
             InitializeComponent();
             gridHomeTask.Init<TaskInfo>();
             gridHomePosRes.Init<PosRes>().UseMultiSelect().UseRowNumber();
+            layoutControl1.UseDefault();
             btnDrawDto.ImageOptions.SvgImage = SvgHelper.LoadFromFile("Image\\DtoLine.svg");
             btnDrawDfo.ImageOptions.SvgImage = SvgHelper.LoadFromFile("Image\\DfoLine.svg");
             btnGDOP.ImageOptions.SvgImage = SvgHelper.LoadFromFile("Image\\GDOP.svg");
@@ -85,28 +87,14 @@ namespace XdCxRhDW.App.UserControl
                 }));
             }
         }
-        private async void GridView1_FocusedRowObjectChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowObjectChangedEventArgs e)
-        {
-            var tsk = (e.Row as TaskInfo);
-            var btnEdit = (layoutControlGroup1.CustomHeaderButtons[1] as GroupBoxButton);
-            var btnDel = (layoutControlGroup1.CustomHeaderButtons[2] as GroupBoxButton);
-            btnDel.Enabled = btnEdit.Enabled = tsk.TaskState != EnumTaskState.Running;
-            List<PosRes> listPos = new List<PosRes>();
-            using (RHDWContext db = new RHDWContext())
-            {
-                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);
-        }
+
         private async void CtrlHome_Load(object sender, EventArgs e)
         {
             gridView1.FocusedRowObjectChanged += GridView1_FocusedRowObjectChanged;
+            gridView2.FocusedRowObjectChanged += GridView2_FocusedRowObjectChanged;
             try
             {
-                List<SatInfo> satList = new List<SatInfo>();
                 List<TxInfo> txList = new List<TxInfo>();
                 using (RHDWContext db = new RHDWContext())
                 {
@@ -120,52 +108,10 @@ namespace XdCxRhDW.App.UserControl
                     await db.SaveChangesAsync();
 
                     var satres = db.SatInfos.OrderBy(p => p.SatName).OrderBy(p => p.SatName);
-                    satList.AddRange(await satres.ToListAsync());
 
                     var txres = await db.TxInfos.ToListAsync();
                     txList.AddRange(txres);
                 }
-                foreach (var sat in satList)
-                {
-                    if (!sat.SatLon.HasValue) continue;
-                    mapControl1.Invoke(new Action(() =>
-                    {
-                        mapControl1.DrawFixedImg("sat", 10, sat.SatLon.Value, DxHelper.SvgHelper.CreateSat(), new Size(24, 24), $"{sat.Sat}\r\n");
-                    }));
-                }
-
-                foreach (var txitem in txList)
-                {
-                    if ((txitem.Lon >= 180 || txitem.Lon <= 180) && txitem.Lat >= -90 || txitem.Lat <= 90)//画天线
-                    {
-                        mapControl1.Invoke(new Action(() =>
-                        {
-                            switch (txitem.TxType)
-                            {
-#warning 天线图片需要邹大哥给
-                                case EnumTxType.MainSat:
-                                    mapControl1.DrawFixedImg("MainSatTx", txitem.Lat, txitem.Lon, DxHelper.SvgHelper.CreatePentagram(), new Size(24, 24), $"[{txitem.Name}]\r\n主星天线经度:{txitem.Lon}°\r\n主星天线纬度:{txitem.Lat}°\r\n");
-                                    break;
-                                case EnumTxType.AdjaSat:
-                                    mapControl1.DrawFixedImg("AdjaSatTx", txitem.Lat, txitem.Lon, DxHelper.SvgHelper.CreatePentagram(), new Size(24, 24), $"[{txitem.Name}]\r\n邻星天线经度:{txitem.Lon}°\r\n邻星天线纬度:{txitem.Lat}°\r\n");
-                                    break;
-                                case EnumTxType.Cdb:
-                                    mapControl1.DrawFixedImg("CdbStation", txitem.Lat, txitem.Lon, DxHelper.SvgHelper.CreatePentagram(), new Size(24, 24), $"[{txitem.Name}]\r\n超短站经度:{txitem.Lon}°\r\n超短站纬度:{txitem.Lat}°\r\n");
-                                    break;
-                                case EnumTxType.Cx:
-                                    mapControl1.DrawFixedImg("CxStation", txitem.Lat, txitem.Lon, DxHelper.SvgHelper.CreatePentagram(), new Size(24, 24), $"[{txitem.Name}]\r\n测向站经度:{txitem.Lon}°\r\n测向站纬度:{txitem.Lat}°\r\n");
-                                    break;
-                                case EnumTxType.Ref:
-                                    mapControl1.DrawFixedImg("RefStation", txitem.Lat, txitem.Lon, DxHelper.SvgHelper.CreatePentagram(), new Size(24, 24), $"参考站经度:{txitem.Lon}°\r\n参考站纬度:{txitem.Lat}°\r\n");
-                                    break;
-                                default:
-                                    break;
-                            }
-                        }));
-                    }
-                }
-
-
 
                 mapControl1.AddPosMenu<PosRes>("绘制时差线", SvgHelper.LoadFromFile("Image\\DtoLine.svg"), item =>
                 {
@@ -300,11 +246,59 @@ namespace XdCxRhDW.App.UserControl
             WaitHelper.CloseForm();
         }
 
+        private async void GridView1_FocusedRowObjectChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowObjectChangedEventArgs e)
+        {
+            mapControl1.DelFixedImg("Sat");
+            mapControl1.DelFixedImg("Tx");
+            var tsk = (e.Row as TaskInfo);
+            if (tsk == null) return;
+            var btnEdit = (layoutControlGroup1.CustomHeaderButtons[1] as GroupBoxButton);
+            var btnDel = (layoutControlGroup1.CustomHeaderButtons[2] as GroupBoxButton);
+            btnDel.Enabled = btnEdit.Enabled = tsk.TaskState != EnumTaskState.Running;
+            List<PosRes> listPos = new List<PosRes>();
+            using (RHDWContext db = new RHDWContext())
+            {
+                var items = await db.PosRes.Where(p => p.TaskInfoID == tsk.ID).OrderByDescending(p => p.SigTime).ToListAsync();
+                listPos.AddRange(items);
+                var sat1 = db.SatInfos.Where(p => p.SatCode == tsk.MainSat).FirstOrDefault();
+                var sat2 = db.SatInfos.Where(p => p.SatCode == tsk.Adja1Sat).FirstOrDefault();
+                var sat3 = db.SatInfos.Where(p => p.SatCode == tsk.Adja2Sat).FirstOrDefault();
+                if (sat1 != null && sat1.SatLon != null)
+                    mapControl1.DrawFixedImg("Sat", 0, sat1.SatLon.Value, DxHelper.SvgHelper.CreateSat(), $"主星\r\n{sat1.Sat}\r\n");
+                if (sat2 != null && sat2.SatLon != null)
+                    mapControl1.DrawFixedImg("Sat", 0, sat2.SatLon.Value, DxHelper.SvgHelper.CreateSat(), $"邻1星\r\n{sat2.Sat}\r\n");
+                if (sat3 != null && sat3.SatLon != null)
+                    mapControl1.DrawFixedImg("Sat", 0, sat3.SatLon.Value, DxHelper.SvgHelper.CreateSat(), $"邻2星\r\n{sat3.Sat}\r\n");
+            }
+
+            this.gridHomePosRes.DataSource = listPos;
+            mapControl1.SetPosDataSource(listPos.Where(p => p.PosLon <= 180), false);
+        }
+        private void GridView2_FocusedRowObjectChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowObjectChangedEventArgs e)
+        {
+            var posItem = (e.Row as PosRes);
+            if (posItem == null) return;
+            using (RHDWContext db = new RHDWContext())
+            {
+                var station = db.StationRes.Where(p => p.ID == posItem.StationResID).FirstOrDefault();
+                if (station != null)
+                {
+                    mapControl1.DrawFixedImg("Tx", station.SatTxLat, station.SatTxLon, DxHelper.SvgHelper.CreateAnt(), $"[卫星接收天线]\r\n经度:{station.SatTxLon}°\r\n纬度:{station.SatTxLat}°");
+                    if (station.CdbTxLon != null)
+                        mapControl1.DrawFixedImg("Tx", station.CdbTxLat.Value, station.CdbTxLon.Value, DxHelper.SvgHelper.CreateAnt(), $"[超短接收天线]\r\n经度:{station.CdbTxLon.Value}°\r\n纬度:{station.CdbTxLat.Value}°");
+                    if (station.RefLon != null)
+                        mapControl1.DrawFixedImg("Tx", station.RefLat.Value, station.RefLon.Value, DxHelper.SvgHelper.CreateAnt(), $"[超短接收天线]\r\n经度:{station.RefLon.Value}°\r\n纬度:{station.RefLat.Value}°");
+                    if (station.CxLon != null)
+                        mapControl1.DrawFixedImg("Tx", station.CxLat.Value, station.CxLon.Value, DxHelper.SvgHelper.CreateAnt(), $"[超短接收天线]\r\n经度:{station.CxLon.Value}°\r\n纬度:{station.CxLat.Value}°");
+
+                }
+            }
+        }
         private void GridView1_RowClick(object sender, RowClickEventArgs e)
         {
             if (e.Clicks > 1)
             {
-                layoutControlGroup1_CustomButtonClick(null,new BaseButtonEventArgs(new GroupBoxButton() { Caption="编辑任务"} ));
+                layoutControlGroup1_CustomButtonClick(null, new BaseButtonEventArgs(new GroupBoxButton() { Caption = "编辑任务" }));
             }
         }
 
@@ -322,7 +316,7 @@ namespace XdCxRhDW.App.UserControl
 
         private void GridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
         {
-            if (e.Column.FieldName == nameof(TaskInfo.TaskName)&& (EnumTaskState)gridView1.GetRowCellValue(e.RowHandle, nameof(TaskInfo.TaskState)) == EnumTaskState.Running)
+            if (e.Column.FieldName == nameof(TaskInfo.TaskName) && (EnumTaskState)gridView1.GetRowCellValue(e.RowHandle, nameof(TaskInfo.TaskState)) == EnumTaskState.Running)
             {
                 var palette = SvgPaletteHelper.GetSvgPalette(this.LookAndFeel, ObjectState.Normal);
                 e.Cache.DrawSvgImage(svgImageCollection1[1], new Rectangle(new Point(e.Bounds.X + 4, e.Bounds.Y + (e.Bounds.Height - 16) / 2), new Size(16, 16)), palette);
@@ -437,6 +431,15 @@ namespace XdCxRhDW.App.UserControl
                             DxHelper.MsgBoxHelper.ShowWarning("任务名称重复");
                             return;
                         }
+                        if (addItem.PosType == EnumPosType.X1D1CX)
+                        {
+                            addItem.Adja1Sat = null;
+                            addItem.Adja2Sat = null;
+                        }
+                        else if (addItem.PosType == EnumPosType.X2D1 || addItem.PosType == EnumPosType.X2Dfo || addItem.PosType == EnumPosType.RH)
+                        {
+                            addItem.Adja2Sat = null;
+                        }
                         db.TaskInfos.Add(addItem);
                         await db.SaveChangesAsync();
                     }
@@ -472,8 +475,21 @@ namespace XdCxRhDW.App.UserControl
                         find.Freq = editItem.Freq;
                         find.Band = editItem.Band;
                         find.MainSat = editItem.MainSat;
-                        find.Adja1Sat= editItem.Adja1Sat;
-                        find.Adja2Sat= editItem.Adja2Sat;
+                        if (find.PosType == EnumPosType.X1D1CX)
+                        {
+                            find.Adja1Sat = null;
+                            find.Adja2Sat = null;
+                        }
+                        else if (find.PosType == EnumPosType.X2D1 || find.PosType == EnumPosType.X2Dfo || find.PosType == EnumPosType.RH)
+                        {
+                            find.Adja2Sat = null;
+                        }
+                        else
+                        {
+                            find.Adja1Sat = editItem.Adja1Sat;
+                            find.Adja2Sat = editItem.Adja2Sat;
+                        }
+
                         await db.SaveChangesAsync();
                     }
                     gridView1.RefreshData();

+ 2 - 0
XdCxRhDW.App/UserControl/CtrlPosRes.cs

@@ -1,6 +1,7 @@
 using DevExpress.XtraBars;
 using DevExpress.XtraEditors;
 using DevExpress.XtraGrid.Views.Grid;
+using ExtensionsDev;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -23,6 +24,7 @@ namespace XdCxRhDW.App.UserControl
         public CtrlPosRes()
         {
             InitializeComponent();
+            this.layoutControl1.UseDefault();
         }
 
         private async void CtrlPosRes_Load(object sender, EventArgs e)

+ 2 - 0
XdCxRhDW.App/UserControl/CtrlSysSettings.cs

@@ -16,6 +16,7 @@ using XdCxRhDW.Repostory.EFContext;
 using System.IO;
 using System.Data.Entity.Migrations;
 using XdCxRhDW.Repostory.Model;
+using ExtensionsDev;
 
 namespace XdCxRhDW.App.UserControl
 {
@@ -24,6 +25,7 @@ namespace XdCxRhDW.App.UserControl
         public CtrlSysSettings()
         {
             InitializeComponent();
+            this.layoutControl1.UseDefault();
         }
 
         private async void CtrlSysSettings_Load(object sender, EventArgs e)

+ 8 - 0
XdCxRhDW.App/UserControl/CtrlTx.cs

@@ -12,6 +12,7 @@ using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 using DevExpress.XtraEditors.Controls;
+using ExtensionsDev;
 
 namespace XdCxRhDW.App.UserControl
 {
@@ -22,6 +23,13 @@ namespace XdCxRhDW.App.UserControl
         public CtrlTx()
         {
             InitializeComponent();
+            this.layoutControl1.UseDefault();
+            this.layoutControl2.UseDefault();
+            this.layoutControl3.UseDefault();
+            this.layoutControl4.UseDefault();
+            this.layoutControl5.UseDefault();
+            this.layoutControl6.UseDefault();
+
         }
 
         private async void CtrlTx_Load(object sender, EventArgs e)

+ 2 - 0
XdCxRhDW.App/UserControl/CtrlXl.cs

@@ -14,6 +14,7 @@ using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 using System.Net.Http;
+using ExtensionsDev;
 
 namespace XdCxRhDW.App.UserControl
 {
@@ -23,6 +24,7 @@ namespace XdCxRhDW.App.UserControl
         public CtrlXl()
         {
             InitializeComponent();
+            this.layoutControl1.UseDefault();
         }
         private async void CtrlXl_Load(object sender, EventArgs e)
         {

+ 1 - 0
XdCxRhDW.App/UserControl/X1D1GDOPParam.cs

@@ -30,6 +30,7 @@ namespace XdCxRhDW.App.UserControl
         public X1D1GDOPParam(PosRes item)
         {
             InitializeComponent();
+            this.layoutControl1.UseDefault();
             txtCapTime.UseDefault();
             txtTleMain.UseDoubleClickToSelectAll();
             txtStationLocation1.UseDoubleClickToSelectAll();

+ 1 - 0
XdCxRhDW.App/UserControl/X2D1GDOPParam.cs

@@ -30,6 +30,7 @@ namespace XdCxRhDW.App.UserControl
         public X2D1GDOPParam(PosRes item)
         {
             InitializeComponent();
+            this.layoutControl1.UseDefault();
             txtCapTime.UseDefault();
             txtTleMain.UseDoubleClickToSelectAll();
             txtTleAdja.UseDoubleClickToSelectAll();

+ 1 - 0
XdCxRhDW.App/UserControl/X2DFGDOPParam.cs

@@ -32,6 +32,7 @@ namespace XdCxRhDW.App.UserControl
         public X2DFGDOPParam(PosRes item)
         {
             InitializeComponent();
+            this.layoutControl1.UseDefault();
             txtCapTime.UseDefault();
             txtTleLeo1.UseDoubleClickToSelectAll();
             txtTleLeo2.UseDoubleClickToSelectAll();

+ 1 - 0
XdCxRhDW.App/UserControl/X3DFGDOPParam .cs

@@ -33,6 +33,7 @@ namespace XdCxRhDW.App.UserControl
         public X3DFGDOPParam(PosRes item)
         {
             InitializeComponent();
+            this.layoutControl1.UseDefault();
             txtCapTime.UseDefault();
             txtTleLeo1.UseDoubleClickToSelectAll();
             txtTleLeo2.UseDoubleClickToSelectAll();

+ 1 - 0
XdCxRhDW.App/UserControl/X3GDOPParam.cs

@@ -28,6 +28,7 @@ namespace XdCxRhDW.App.UserControl
         public X3GDOPParam(PosRes item)
         {
             InitializeComponent();
+            this.layoutControl1.UseDefault();
             txtCapTime.UseDefault();
             txtTleMain.UseDoubleClickToSelectAll();
             txtTleAdja1.UseDoubleClickToSelectAll();