gongqiuhong преди 1 година
родител
ревизия
68bd1c923e

BIN
Database.db


+ 48 - 6
XdCxRhDW.App/ExtensionsDev/MapControlEx.cs

@@ -104,13 +104,13 @@ public class ToolTipAttribute : Attribute
 /// <summary>
 /// 定位点绑定到地图的对象
 /// </summary>
-public class PosData:BaseModel<long>
+public class PosData : BaseModel<long>
 {
     /// <summary>
     /// 信号时刻
     /// </summary>
     [Display(Name = "信号时刻")]
-    [DisplayFormat(DataFormatString ="yyyy-MM-dd HH:mm:ss.fff")]
+    [DisplayFormat(DataFormatString = "yyyy-MM-dd HH:mm:ss.fff")]
     [ExportCell(ColumnIndex = 0)]//如果导出了SigTime,则内部会自动按照SigTime降序排列后再导出
     [ToolTip(Index = 0)]
     public DateTime SigTime { get; set; }
@@ -151,7 +151,7 @@ public class PosData:BaseModel<long>
     /// <summary>
     /// 当前点是否被选中(默认false)
     /// </summary>
-    [Display(Name = "是否选中",AutoGenerateField =false)]
+    [Display(Name = "是否选中", AutoGenerateField = false)]
     [NotMapped]
     public bool Selected { get; set; }
 
@@ -259,7 +259,49 @@ public static class MapControlEx
     private static List<MapControl> listMapCtrl = new List<MapControl>();
     private const int _dotSize = 8;
     private const int _selectedDotSize = 16;
-
+    public static MapControl SetMapLayerType(this MapControl ctrl, string wmsUrl)
+    {
+        if (!string.IsNullOrWhiteSpace(wmsUrl))
+        {
+            //DevExpress.XtraMap.WmsLayer
+            var provider = new WmsDataProvider();//地图瓦片提供者
+            provider.ServerUri = wmsUrl;
+            //provider.
+            ctrl.GetImageLayer().DataProvider = provider;
+        }
+        else
+        {
+            bool localGmdbDataEnable = false;//本地Data.Gmdb是否可用,可用时读取本地瓦片,否则执行Http请求资源
+            var files = Directory.GetFiles(Application.StartupPath, "Data.gmdb", SearchOption.AllDirectories);
+            if (files.Length > 0)
+            {
+                try
+                {
+                    string conStr = string.Format("Data Source=\"{0}\";Page Size=32768", files[0]);
+                    var con = new SQLiteConnection(conStr);
+                    con.Open();
+                    con.Close();
+                    localGmdbDataEnable = true;
+                }
+                catch (Exception ex)
+                {
+                    Console.Error.WriteLine(ex.Message);
+                }
+            }
+            if (localGmdbDataEnable)
+            {
+                var provider = new ImageTileDataProvider();//地图瓦片提供者
+                provider.TileSource = new ImageTileSource();//地图瓦片数据源接口实现
+                ctrl.GetImageLayer().DataProvider = provider;
+            }
+            else
+            {
+                var provider = new HttpMapDataProvider();
+                ctrl.GetImageLayer().DataProvider = provider;
+            }
+        }
+        return ctrl;
+    }
     /// <summary>
     /// <para>设置地图通用属性并创建4个Layer.</para>
     /// <para>ImageLayer:绘制地图瓦片</para>
@@ -435,7 +477,7 @@ public static class MapControlEx
         ctrl.NavigationPanelOptions.BackgroundStyle.Fill = Color.Transparent;
         ctrl.NavigationPanelOptions.ShowScrollButtons = false;
         ctrl.NavigationPanelOptions.ShowZoomTrackbar = false;
-       // ctrl.NavigationPanelOptions.ShowCoordinates = true;
+        // ctrl.NavigationPanelOptions.ShowCoordinates = true;
         //ctrl.NavigationPanelOptions.ShowKilometersScale = false;
         //ctrl.NavigationPanelOptions.ShowMilesScale = false;
         ctrl.NavigationPanelOptions.CoordinatesStyle.Font = new Font("微软雅黑", 10F);
@@ -1563,7 +1605,7 @@ public static class MapControlEx
             {
             }
         }));
-       
+
     }
     private static void DistanceLine_ItemClick(object sender, ItemClickEventArgs e)
     {

+ 9 - 12
XdCxRhDW.App/MainForm.cs

@@ -48,17 +48,16 @@ namespace XdCxRhDW
         }
         private async void XlScan()
         {
-            using (RHDWContext db = new RHDWContext())
+            await Task.Run(async () =>
             {
-                var settings = await db.SysSetings.FirstOrDefaultAsync();
-
-                if (settings.XLDirectory == null || !Directory.Exists(settings.XLDirectory))
-                    return;
-                string line = null;
-                await Task.Run(async () =>
+                while (true)
                 {
-                    while (true)
+                    await Task.Delay(10000);
+                    using (RHDWContext db = new RHDWContext())
                     {
+                        var settings = await db.SysSetings.FirstOrDefaultAsync();
+                        if (settings.XLDirectory == null || !Directory.Exists(settings.XLDirectory))
+                            continue;
                         string[] files = Directory.GetFiles(settings.XLDirectory, "*.txt");
                         foreach (string file in files)
                         {
@@ -67,7 +66,6 @@ namespace XdCxRhDW
                             List<XlInfo> tmp = new List<XlInfo>();
                             for (int i = 0; i < lines.Count; i += 3)
                             {
-                                line = lines[i];
                                 var satName = lines[i].Trim();
                                 if (satName.StartsWith("0 "))
                                     satName = satName.Substring(2).Trim();
@@ -107,10 +105,9 @@ namespace XdCxRhDW
                             Directory.CreateDirectory(baseDirectory);
                             File.Move(file, baseDirectory + "\\" + System.IO.Path.GetFileName(file));//修改名称
                         }
-                        Thread.Sleep(10000);
                     }
-                });
-            }
+                }
+            });
         }
         private void btn_ItemClick(object sender, ItemClickEventArgs e)
         {

+ 1 - 2
XdCxRhDW.App/Model/SysSetings.cs

@@ -13,9 +13,8 @@ namespace XdCxRhDW.App.Model
     {
         public string ServerIp { get; set; }
         public int Port { get; set; }
-
         public int HttpPort { get; set; }
-
         public string XLDirectory { get; set; }
+        public string MapService { get; set; }
     }
 }

+ 12 - 8
XdCxRhDW.App/UserControl/CtrlPosRes.cs

@@ -20,7 +20,6 @@ namespace XdCxRhDW.App.UserControl
 {
     public partial class CtrlPosRes : DevExpress.XtraEditors.XtraUserControl
     {
-        List<PosRes> list = new List<PosRes>();
         public CtrlPosRes()
         {
             InitializeComponent();
@@ -87,21 +86,26 @@ namespace XdCxRhDW.App.UserControl
 
         private async void btnSearch_Click(object sender, EventArgs e)
         {
-            var startTime = Convert.ToDateTime(txtStartTime.EditValue);
-            var endTime = Convert.ToDateTime(txtEndTime.EditValue);
-            if (startTime.Year == 1 )
+
+            if (string.IsNullOrEmpty(txtStartTime.Text) && !string.IsNullOrEmpty(txtEndTime.Text))
             {
                 DxHelper.MsgBoxHelper.ShowInfo("请输入开始时间");
                 return;
             }
-            if (startTime.Year == 1)
+            if (!string.IsNullOrEmpty(txtStartTime.Text) && string.IsNullOrEmpty(txtEndTime.Text))
             {
-                DxHelper.MsgBoxHelper.ShowInfo("请输入开始时间");
-                return;
+                txtEndTime.EditValue = DateTime.Now;
             }
+            var startTime = Convert.ToDateTime(txtStartTime.EditValue);
+            var endTime = Convert.ToDateTime(txtEndTime.EditValue);
             using (RHDWContext db = new RHDWContext())
             {
-                var searchRes = await db.PosRes.Where(p => p.SigTime >= startTime && p.SigTime <= endTime).ToListAsync();
+                var searchRes = new List<PosRes>();
+                if (string.IsNullOrEmpty(txtStartTime.Text) && string.IsNullOrEmpty(txtEndTime.Text))
+                    searchRes = await db.PosRes.OrderByDescending(p => p.SigTime).ToListAsync();
+                else
+                    searchRes = await db.PosRes.Where(p => p.SigTime >= startTime && p.SigTime <= endTime).OrderByDescending(p => p.SigTime).ToListAsync();
+
                 gridPos.DataSource = searchRes;
             }
         }

+ 98 - 68
XdCxRhDW.App/UserControl/CtrlSysSettings.Designer.cs

@@ -35,13 +35,15 @@ namespace XdCxRhDW.App.UserControl
             this.txtPort = new DevExpress.XtraEditors.TextEdit();
             this.txtIp = new DevExpress.XtraEditors.ComboBoxEdit();
             this.txtHttpPort = new DevExpress.XtraEditors.TextEdit();
+            this.txtXLDirectory = new DevExpress.XtraEditors.TextEdit();
+            this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
             this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
             this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
-            this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
-            this.textEdit1 = new DevExpress.XtraEditors.TextEdit();
             this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.txtMapService = new DevExpress.XtraEditors.TextEdit();
+            this.layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem();
             ((System.ComponentModel.ISupportInitialize)(this.tablePanel1)).BeginInit();
             this.tablePanel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
@@ -49,13 +51,15 @@ namespace XdCxRhDW.App.UserControl
             ((System.ComponentModel.ISupportInitialize)(this.txtPort.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.txtIp.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.txtHttpPort.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtXLDirectory.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.textEdit1.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtMapService.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).BeginInit();
             this.SuspendLayout();
             // 
             // tablePanel1
@@ -67,43 +71,43 @@ namespace XdCxRhDW.App.UserControl
             this.tablePanel1.Controls.Add(this.layoutControl1);
             this.tablePanel1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.tablePanel1.Location = new System.Drawing.Point(0, 0);
-            this.tablePanel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.tablePanel1.Name = "tablePanel1";
             this.tablePanel1.Rows.AddRange(new DevExpress.Utils.Layout.TablePanelRow[] {
             new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.Relative, 1F),
-            new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.Absolute, 431.1992F),
+            new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.Absolute, 473.1992F),
             new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.Relative, 1F)});
-            this.tablePanel1.Size = new System.Drawing.Size(818, 807);
+            this.tablePanel1.Size = new System.Drawing.Size(716, 628);
             this.tablePanel1.TabIndex = 0;
             this.tablePanel1.UseSkinIndents = true;
             // 
             // layoutControl1
             // 
             this.tablePanel1.SetColumn(this.layoutControl1, 1);
+            this.layoutControl1.Controls.Add(this.txtMapService);
             this.layoutControl1.Controls.Add(this.btnSave);
             this.layoutControl1.Controls.Add(this.txtPort);
             this.layoutControl1.Controls.Add(this.txtIp);
             this.layoutControl1.Controls.Add(this.txtHttpPort);
-            this.layoutControl1.Controls.Add(this.textEdit1);
+            this.layoutControl1.Controls.Add(this.txtXLDirectory);
             this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.layoutControl1.HiddenItems.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
             this.layoutControlItem2});
-            this.layoutControl1.Location = new System.Drawing.Point(288, 130);
-            this.layoutControl1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+            this.layoutControl1.Location = new System.Drawing.Point(265, 131);
             this.layoutControl1.Name = "layoutControl1";
             this.layoutControl1.Root = this.Root;
             this.tablePanel1.SetRow(this.layoutControl1, 1);
-            this.layoutControl1.Size = new System.Drawing.Size(242, 546);
+            this.layoutControl1.Size = new System.Drawing.Size(186, 364);
             this.layoutControl1.TabIndex = 0;
             this.layoutControl1.Text = "layoutControl1";
             // 
             // btnSave
             // 
-            this.btnSave.Location = new System.Drawing.Point(13, 406);
-            this.btnSave.MaximumSize = new System.Drawing.Size(0, 28);
-            this.btnSave.MinimumSize = new System.Drawing.Size(0, 28);
+            this.btnSave.Location = new System.Drawing.Point(11, 330);
+            this.btnSave.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnSave.MaximumSize = new System.Drawing.Size(0, 22);
+            this.btnSave.MinimumSize = new System.Drawing.Size(0, 22);
             this.btnSave.Name = "btnSave";
-            this.btnSave.Size = new System.Drawing.Size(216, 28);
+            this.btnSave.Size = new System.Drawing.Size(164, 22);
             this.btnSave.StyleController = this.layoutControl1;
             this.btnSave.TabIndex = 4;
             this.btnSave.Text = "保存";
@@ -112,34 +116,53 @@ namespace XdCxRhDW.App.UserControl
             // txtPort
             // 
             this.txtPort.EditValue = "16010";
-            this.txtPort.Location = new System.Drawing.Point(13, 171);
-            this.txtPort.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+            this.txtPort.Location = new System.Drawing.Point(11, 133);
             this.txtPort.Name = "txtPort";
-            this.txtPort.Size = new System.Drawing.Size(197, 28);
+            this.txtPort.Size = new System.Drawing.Size(172, 20);
             this.txtPort.StyleController = this.layoutControl1;
             this.txtPort.TabIndex = 5;
             // 
             // txtIp
             // 
-            this.txtIp.Location = new System.Drawing.Point(13, 39);
-            this.txtIp.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+            this.txtIp.Location = new System.Drawing.Point(11, 27);
             this.txtIp.Name = "txtIp";
             this.txtIp.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
-            this.txtIp.Size = new System.Drawing.Size(216, 28);
+            this.txtIp.Size = new System.Drawing.Size(164, 20);
             this.txtIp.StyleController = this.layoutControl1;
             this.txtIp.TabIndex = 4;
             // 
             // txtHttpPort
             // 
             this.txtHttpPort.EditValue = "8091";
-            this.txtHttpPort.Location = new System.Drawing.Point(13, 169);
-            this.txtHttpPort.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+            this.txtHttpPort.Location = new System.Drawing.Point(11, 107);
             this.txtHttpPort.Name = "txtHttpPort";
-            this.txtHttpPort.Size = new System.Drawing.Size(216, 28);
+            this.txtHttpPort.Size = new System.Drawing.Size(164, 20);
             this.txtHttpPort.StyleController = this.layoutControl1;
             this.txtHttpPort.TabIndex = 5;
             // 
+            // txtXLDirectory
+            // 
+            this.txtXLDirectory.Location = new System.Drawing.Point(11, 187);
+            this.txtXLDirectory.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.txtXLDirectory.Name = "txtXLDirectory";
+            this.txtXLDirectory.Size = new System.Drawing.Size(164, 20);
+            this.txtXLDirectory.StyleController = this.layoutControl1;
+            this.txtXLDirectory.TabIndex = 6;
+            // 
+            // layoutControlItem2
+            // 
+            this.layoutControlItem2.Control = this.txtPort;
+            this.layoutControlItem2.Location = new System.Drawing.Point(0, 107);
+            this.layoutControlItem2.MinSize = new System.Drawing.Size(76, 61);
+            this.layoutControlItem2.Name = "layoutControlItem2";
+            this.layoutControlItem2.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 22, 2);
+            this.layoutControlItem2.Size = new System.Drawing.Size(201, 105);
+            this.layoutControlItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
+            this.layoutControlItem2.Text = "TCP接口端口";
+            this.layoutControlItem2.TextLocation = DevExpress.Utils.Locations.Top;
+            this.layoutControlItem2.TextSize = new System.Drawing.Size(76, 14);
+            // 
             // Root
             // 
             this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
@@ -148,43 +171,32 @@ namespace XdCxRhDW.App.UserControl
             this.layoutControlItem1,
             this.layoutControlItem3,
             this.layoutControlItem4,
-            this.layoutControlItem5});
+            this.layoutControlItem5,
+            this.layoutControlItem6});
             this.Root.Name = "Root";
-            this.Root.Size = new System.Drawing.Size(242, 546);
+            this.Root.Size = new System.Drawing.Size(186, 364);
             this.Root.TextVisible = false;
             // 
             // layoutControlItem1
             // 
             this.layoutControlItem1.Control = this.txtIp;
             this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
-            this.layoutControlItem1.MinSize = new System.Drawing.Size(102, 57);
+            this.layoutControlItem1.MaxSize = new System.Drawing.Size(0, 80);
+            this.layoutControlItem1.MinSize = new System.Drawing.Size(89, 80);
             this.layoutControlItem1.Name = "layoutControlItem1";
-            this.layoutControlItem1.Size = new System.Drawing.Size(220, 130);
+            this.layoutControlItem1.Size = new System.Drawing.Size(168, 80);
             this.layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItem1.Text = "本机IP";
             this.layoutControlItem1.TextLocation = DevExpress.Utils.Locations.Top;
-            this.layoutControlItem1.TextSize = new System.Drawing.Size(98, 18);
-            // 
-            // layoutControlItem2
-            // 
-            this.layoutControlItem2.Control = this.txtPort;
-            this.layoutControlItem2.Location = new System.Drawing.Point(0, 107);
-            this.layoutControlItem2.MinSize = new System.Drawing.Size(87, 78);
-            this.layoutControlItem2.Name = "layoutControlItem2";
-            this.layoutControlItem2.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 28, 3);
-            this.layoutControlItem2.Size = new System.Drawing.Size(201, 105);
-            this.layoutControlItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
-            this.layoutControlItem2.Text = "TCP接口端口";
-            this.layoutControlItem2.TextLocation = DevExpress.Utils.Locations.Top;
-            this.layoutControlItem2.TextSize = new System.Drawing.Size(87, 18);
+            this.layoutControlItem1.TextSize = new System.Drawing.Size(79, 14);
             // 
             // layoutControlItem3
             // 
             this.layoutControlItem3.Control = this.btnSave;
-            this.layoutControlItem3.Location = new System.Drawing.Point(0, 390);
-            this.layoutControlItem3.MinSize = new System.Drawing.Size(41, 33);
+            this.layoutControlItem3.Location = new System.Drawing.Point(0, 320);
+            this.layoutControlItem3.MinSize = new System.Drawing.Size(36, 26);
             this.layoutControlItem3.Name = "layoutControlItem3";
-            this.layoutControlItem3.Size = new System.Drawing.Size(220, 130);
+            this.layoutControlItem3.Size = new System.Drawing.Size(168, 28);
             this.layoutControlItem3.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
             this.layoutControlItem3.TextVisible = false;
@@ -194,44 +206,58 @@ namespace XdCxRhDW.App.UserControl
             this.layoutControlItem4.Control = this.txtHttpPort;
             this.layoutControlItem4.ControlAlignment = System.Drawing.ContentAlignment.TopLeft;
             this.layoutControlItem4.CustomizationFormText = "HTTP接口端口";
-            this.layoutControlItem4.Location = new System.Drawing.Point(0, 130);
-            this.layoutControlItem4.MinSize = new System.Drawing.Size(102, 57);
+            this.layoutControlItem4.Location = new System.Drawing.Point(0, 80);
+            this.layoutControlItem4.MaxSize = new System.Drawing.Size(0, 80);
+            this.layoutControlItem4.MinSize = new System.Drawing.Size(89, 80);
             this.layoutControlItem4.Name = "layoutControlItem4";
-            this.layoutControlItem4.Size = new System.Drawing.Size(220, 130);
+            this.layoutControlItem4.Size = new System.Drawing.Size(168, 80);
             this.layoutControlItem4.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItem4.Text = "HTTP接口端口";
             this.layoutControlItem4.TextLocation = DevExpress.Utils.Locations.Top;
-            this.layoutControlItem4.TextSize = new System.Drawing.Size(98, 18);
-            // 
-            // textEdit1
-            // 
-            this.textEdit1.Location = new System.Drawing.Point(13, 299);
-            this.textEdit1.Name = "textEdit1";
-            this.textEdit1.Size = new System.Drawing.Size(216, 28);
-            this.textEdit1.StyleController = this.layoutControl1;
-            this.textEdit1.TabIndex = 6;
+            this.layoutControlItem4.TextSize = new System.Drawing.Size(79, 14);
             // 
             // layoutControlItem5
             // 
-            this.layoutControlItem5.Control = this.textEdit1;
+            this.layoutControlItem5.Control = this.txtXLDirectory;
             this.layoutControlItem5.CustomizationFormText = "星厉检测目录";
-            this.layoutControlItem5.Location = new System.Drawing.Point(0, 260);
-            this.layoutControlItem5.MinSize = new System.Drawing.Size(102, 57);
+            this.layoutControlItem5.Location = new System.Drawing.Point(0, 160);
+            this.layoutControlItem5.MaxSize = new System.Drawing.Size(0, 80);
+            this.layoutControlItem5.MinSize = new System.Drawing.Size(89, 80);
             this.layoutControlItem5.Name = "layoutControlItem5";
-            this.layoutControlItem5.Size = new System.Drawing.Size(220, 130);
+            this.layoutControlItem5.Size = new System.Drawing.Size(168, 80);
             this.layoutControlItem5.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItem5.Text = "星厉检测目录";
             this.layoutControlItem5.TextLocation = DevExpress.Utils.Locations.Top;
-            this.layoutControlItem5.TextSize = new System.Drawing.Size(98, 18);
+            this.layoutControlItem5.TextSize = new System.Drawing.Size(79, 14);
+            // 
+            // txtMapService
+            // 
+            this.txtMapService.Location = new System.Drawing.Point(11, 267);
+            this.txtMapService.Name = "txtMapService";
+            this.txtMapService.Size = new System.Drawing.Size(164, 20);
+            this.txtMapService.StyleController = this.layoutControl1;
+            this.txtMapService.TabIndex = 7;
+            // 
+            // layoutControlItem6
+            // 
+            this.layoutControlItem6.Control = this.txtMapService;
+            this.layoutControlItem6.Location = new System.Drawing.Point(0, 240);
+            this.layoutControlItem6.MaxSize = new System.Drawing.Size(0, 80);
+            this.layoutControlItem6.MinSize = new System.Drawing.Size(73, 80);
+            this.layoutControlItem6.Name = "layoutControlItem6";
+            this.layoutControlItem6.Size = new System.Drawing.Size(168, 80);
+            this.layoutControlItem6.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
+            this.layoutControlItem6.Text = "地图服务";
+            this.layoutControlItem6.TextLocation = DevExpress.Utils.Locations.Top;
+            this.layoutControlItem6.TextSize = new System.Drawing.Size(79, 14);
             // 
             // CtrlSysSettings
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.Controls.Add(this.tablePanel1);
-            this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.Name = "CtrlSysSettings";
-            this.Size = new System.Drawing.Size(818, 807);
+            this.Size = new System.Drawing.Size(716, 628);
             this.Load += new System.EventHandler(this.CtrlSysSettings_Load);
             ((System.ComponentModel.ISupportInitialize)(this.tablePanel1)).EndInit();
             this.tablePanel1.ResumeLayout(false);
@@ -240,13 +266,15 @@ namespace XdCxRhDW.App.UserControl
             ((System.ComponentModel.ISupportInitialize)(this.txtPort.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.txtIp.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.txtHttpPort.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtXLDirectory.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.textEdit1.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtMapService.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).EndInit();
             this.ResumeLayout(false);
 
         }
@@ -264,7 +292,9 @@ namespace XdCxRhDW.App.UserControl
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3;
         private DevExpress.XtraEditors.TextEdit txtHttpPort;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4;
-        private DevExpress.XtraEditors.TextEdit textEdit1;
+        private DevExpress.XtraEditors.TextEdit txtXLDirectory;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5;
+        private DevExpress.XtraEditors.TextEdit txtMapService;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem6;
     }
 }

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

@@ -53,7 +53,9 @@ namespace XdCxRhDW.App.UserControl
                         this.txtPort.Text = res.Port.ToString();
                         this.txtHttpPort.Text = res.HttpPort.ToString();
                         if (!string.IsNullOrEmpty(res.XLDirectory))
-                            this.textEdit1.Text = res.XLDirectory.ToString();
+                            this.txtXLDirectory.Text = res.XLDirectory.ToString();
+                        if (!string.IsNullOrEmpty(res.MapService))
+                            this.txtMapService.Text = res.MapService.ToString();
                     }
                 }
             }
@@ -77,7 +79,8 @@ namespace XdCxRhDW.App.UserControl
                             ServerIp = txtIp.Text,
                             Port = Convert.ToInt32(txtPort.Text),
                             HttpPort = Convert.ToInt32(txtHttpPort.Text),
-                            XLDirectory = textEdit1.Text
+                            XLDirectory = txtXLDirectory.Text,
+                            MapService=txtMapService.Text,
                         };
                         db.SysSetings.Add(res);
                     }
@@ -85,7 +88,8 @@ namespace XdCxRhDW.App.UserControl
                     {
                         res.ServerIp = txtIp.Text;
                         res.Port = Convert.ToInt32(txtPort.Text);
-                        res.XLDirectory = textEdit1.Text;
+                        res.XLDirectory = txtXLDirectory.Text;
+                        res.MapService= txtMapService.Text;
                     }
                     await db.SaveChangesAsync();
                     DxHelper.MsgBoxHelper.ShowInfo("配置信息保存成功!");

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

@@ -13,6 +13,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
+using System.Net.Http;
 
 namespace XdCxRhDW.App.UserControl
 {

+ 2 - 2
XdCxRhDW.App/WebAPI/Controllers/BaseController.cs

@@ -102,7 +102,7 @@ namespace XdCxRhDW.App.WebAPI
         /// <param name="msg">返回的消息</param>
         /// <param name="data">返回的数据</param>
         /// <returns></returns>
-        protected AjaxResult Success(string msg, object data)
+        protected AjaxResult Success(object data,string msg= "请求成功!")
         {
             AjaxResult res = new AjaxResult
             {
@@ -118,7 +118,7 @@ namespace XdCxRhDW.App.WebAPI
         /// <param name="msg">返回的消息</param>
         /// <param name="data">返回的数据</param>
         /// <returns></returns>
-        protected AjaxResult<T> Success<T>(string msg, T data)
+        protected AjaxResult<T> Success<T>(T data, string msg = "请求成功!")
         {
             AjaxResult<T> res = new AjaxResult<T>
             {

+ 2 - 2
XdCxRhDW.App/WebAPI/Controllers/XlController.cs

@@ -33,7 +33,7 @@ namespace XdCxRhDW.App.WebAPI
         public async Task<AjaxResult<SatEphDto>> Calc(string tleStr, DateTime dt)
         {
             var ephMain = EphHelper.Calc(tleStr, dt);
-            return Success("成功!", ephMain);
+            return Success(ephMain);
         }
 
         /// <summary>
@@ -44,7 +44,7 @@ namespace XdCxRhDW.App.WebAPI
         public async Task<AjaxResult<List<SatEphDto>>> CalcMult(string tleStr, DateTime start, DateTime end, int spanSeconds)
         {
             var ephMain = EphHelper.CalcMult(tleStr, start,end, spanSeconds);
-            return Success("成功!", ephMain);
+            return Success(ephMain);
         }      
     }
 }

+ 2 - 0
XdCxRhDW.Sender/Properties/licenses.licx

@@ -0,0 +1,2 @@
+DevExpress.XtraCharts.Heatmap.HeatmapControl, DevExpress.XtraCharts.v23.2.UI, 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

+ 65 - 0
XdCxRhDW.Sender/UserControl1.Designer.cs

@@ -0,0 +1,65 @@
+namespace XdCxRhDW.Sender
+{
+    partial class UserControl1
+    {
+        /// <summary> 
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region 组件设计器生成的代码
+
+        /// <summary> 
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.mapControl1 = new DevExpress.XtraMap.MapControl();
+            this.wmsDataProvider1 = new DevExpress.XtraMap.WmsDataProvider();
+            this.imageLayer1 = new DevExpress.XtraMap.ImageLayer();
+            ((System.ComponentModel.ISupportInitialize)(this.mapControl1)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // mapControl1
+            // 
+            this.mapControl1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.mapControl1.Layers.Add(this.imageLayer1);
+            this.mapControl1.Location = new System.Drawing.Point(0, 0);
+            this.mapControl1.Name = "mapControl1";
+            this.mapControl1.Size = new System.Drawing.Size(750, 354);
+            this.mapControl1.TabIndex = 0;
+            this.imageLayer1.DataProvider = this.wmsDataProvider1;
+            // 
+            // UserControl1
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Controls.Add(this.mapControl1);
+            this.Name = "UserControl1";
+            this.Size = new System.Drawing.Size(750, 354);
+            ((System.ComponentModel.ISupportInitialize)(this.mapControl1)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private DevExpress.XtraMap.MapControl mapControl1;
+        private DevExpress.XtraMap.ImageLayer imageLayer1;
+        private DevExpress.XtraMap.WmsDataProvider wmsDataProvider1;
+    }
+}

+ 20 - 0
XdCxRhDW.Sender/UserControl1.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace XdCxRhDW.Sender
+{
+    public partial class UserControl1 : UserControl
+    {
+        public UserControl1()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 120 - 0
XdCxRhDW.Sender/UserControl1.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 19 - 0
XdCxRhDW.Sender/XdCxRhDW.Sender.csproj

@@ -38,15 +38,23 @@
   <ItemGroup>
     <Reference Include="Accessibility" />
     <Reference Include="DevExpress.BonusSkins.v23.2" />
+    <Reference Include="DevExpress.Charts.v23.2.Core, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
     <Reference Include="DevExpress.Data.Desktop.v23.2" />
     <Reference Include="DevExpress.Data.v23.2" />
+    <Reference Include="DevExpress.Map.v23.2.Core, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
     <Reference Include="DevExpress.Utils.v23.2" />
     <Reference Include="DevExpress.Sparkline.v23.2.Core" />
+    <Reference Include="DevExpress.Utils.v23.2.UI, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
     <Reference Include="DevExpress.XtraBars.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.XtraCharts.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
+    <Reference Include="DevExpress.XtraCharts.v23.2.UI, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.XtraCharts.v23.2.Wizard, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
     <Reference Include="DevExpress.XtraEditors.v23.2" />
     <Reference Include="DevExpress.Printing.v23.2.Core" />
     <Reference Include="DevExpress.Drawing.v23.2" />
     <Reference Include="DevExpress.XtraLayout.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.XtraMap.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.XtraPrinting.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
     <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
       <HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
       <Private>True</Private>
@@ -56,6 +64,7 @@
     <Reference Include="System.Configuration" />
     <Reference Include="System.Core" />
     <Reference Include="System.Data.Linq" />
+    <Reference Include="System.Net.Http" />
     <Reference Include="System.Numerics" />
     <Reference Include="System.Runtime.Serialization" />
     <Reference Include="System.Runtime.Serialization.Formatters.Soap" />
@@ -82,9 +91,16 @@
     </Compile>
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="UserControl1.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="UserControl1.Designer.cs">
+      <DependentUpon>UserControl1.cs</DependentUpon>
+    </Compile>
     <EmbeddedResource Include="Form1.resx">
       <DependentUpon>Form1.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Properties\licenses.licx" />
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -95,6 +111,9 @@
       <DependentUpon>Resources.resx</DependentUpon>
       <DesignTime>True</DesignTime>
     </Compile>
+    <EmbeddedResource Include="UserControl1.resx">
+      <DependentUpon>UserControl1.cs</DependentUpon>
+    </EmbeddedResource>
     <None Include="App.config" />
     <None Include="packages.config" />
     <None Include="Properties\Settings.settings">