gongqiuhong 1 year ago
parent
commit
bfc28ab8d1

+ 1 - 0
XdCxRhDW.App/DxHelper/SvgHelper.cs

@@ -188,6 +188,7 @@ namespace DxHelper
             return svg;
         }
 
+
         #region exportImg
         public static SvgImage CreateExportImg()
         {

+ 19 - 4
XdCxRhDW.App/ExtensionsDev/MapControlEx.cs

@@ -837,7 +837,15 @@ public static class MapControlEx
         ctrl.SetCenterPoint(new GeoPoint(lat, lon), animated);
         return ctrl;
     }
-
+    /// <summary>
+    /// 地图上添加图片
+    /// </summary>
+    /// <param name="ctrl"></param>
+    /// <param name="tag"></param>
+    /// <param name="imgLat"></param>
+    /// <param name="imgLon"></param>
+    /// <param name="img"></param>
+    /// <param name="toolTip"></param>
     public static void DrawFixedImg(this MapControl ctrl, string tag, double imgLat, double imgLon, Image img, string toolTip = "")
     {
         var innerData = ctrl.Tag as InnerData;
@@ -849,6 +857,16 @@ public static class MapControlEx
         item.ToolTipPattern = toolTip;
         innerData.mMapStorageFixed.Items.Add(item);
     }
+    /// <summary>
+    /// 地图上添加指定大小图片
+    /// </summary>
+    /// <param name="ctrl"></param>
+    /// <param name="tag"></param>
+    /// <param name="imgLat"></param>
+    /// <param name="imgLon"></param>
+    /// <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 = "")
     {
         var innerData = ctrl.Tag as InnerData;
@@ -1597,9 +1615,6 @@ public static class MapControlEx
                 {
                     innerData.mMapStorage.Items.Clear();
                 }
-                //临时
-                if (innerData.mMapStorageFixed != null && innerData.mMapStorageFixed.Items.Any())
-                    innerData.mMapStorageFixed.Items.Clear();
             }
             catch (Exception ex)
             {

+ 0 - 11
XdCxRhDW.App/Properties/licenses.licx

@@ -1,11 +0,0 @@
-DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.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.XtraBars.Docking.DockManager, 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.TextEdit, DevExpress.XtraEditors.v23.2, 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.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraEditors.ComboBoxEdit, 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.ButtonEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

+ 50 - 1
XdCxRhDW.App/UserControl/CtrlHome.cs

@@ -80,13 +80,15 @@ namespace XdCxRhDW.App.UserControl
                 listPos.AddRange(items);
             }
             this.gridHomePosRes.DataSource = listPos;
-            mapControl1.SetPosDataSource(listPos.Where(p => p.PosLon <= 180));
+            mapControl1.SetPosDataSource(listPos.Where(p => p.PosLon <= 180), false);
         }
         private async void CtrlHome_Load(object sender, EventArgs e)
         {
             gridView1.FocusedRowObjectChanged += GridView1_FocusedRowObjectChanged;
             try
             {
+                List<SatInfo> satList = new List<SatInfo>();
+                List<TxInfo> txList = new List<TxInfo>();
                 using (RHDWContext db = new RHDWContext())
                 {
                     var qq = db.TaskInfos.OrderByDescending(p => p.CreateTime).ToList();
@@ -97,7 +99,54 @@ namespace XdCxRhDW.App.UserControl
                         item.TaskState = EnumTaskState.Stopped;
                     }
                     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(32, 32), $"{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(32, 32), $"[{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(32, 32), $"[{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(32, 32), $"[{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(32, 32), $"[{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(32, 32), $"参考站经度:{txitem.Lon}°\r\n参考站纬度:{txitem.Lat}°\r\n");
+                                    break;
+                                default:
+                                    break;
+                            }
+                        }));
+                    }
+                }
+
+
             }
             catch (Exception ex)
             {

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

@@ -14,6 +14,7 @@ using System.Windows.Documents;
 using System.Windows.Forms;
 using XdCxRhDW.App.EFContext;
 using System.IO;
+using System.Data.Entity.Migrations;
 
 namespace XdCxRhDW.App.UserControl
 {
@@ -88,9 +89,9 @@ namespace XdCxRhDW.App.UserControl
                     {
                         res.ServerIp = txtIp.Text;
                         res.Port = Convert.ToInt32(txtPort.Text);
-                        res.XLDirectory = txtXLDirectory.Text;
-                        res.MapService= txtMapService.Text;
+                        res.XLDirectory = textEdit1.Text;
                     }
+                    
                     await db.SaveChangesAsync();
                     DxHelper.MsgBoxHelper.ShowInfo("配置信息保存成功!");
                 }

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

@@ -357,7 +357,6 @@
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
     <None Include="packages.config" />
-    <EmbeddedResource Include="Properties\licenses.licx" />
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>