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

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

@@ -123,7 +123,9 @@ namespace XdCxRhDW.App.Controllers
                 };
                 posRes = db.PosRes.Add(posRes);
                 await db.SaveChangesAsync();
+                var a = MapModel(posRes);
                 Messenger.Defalut.Pub("新增定位点", MapModel(posRes));
+                var b = MapDto(posRes);
                 return Success(MapDto(posRes));
             }
         }
@@ -2272,7 +2274,7 @@ namespace XdCxRhDW.App.Controllers
                 PosLat = res.PosLat,
                 MirrLon = res.MirrLon,
                 MirrLat = res.MirrLat,
-                CheckType = res.CheckRes?.PosCheckType.GetEnumDisplayName(),
+                CheckType = res.CheckRes?.PosCheckType==null?"": res.CheckRes?.PosCheckType.GetEnumDisplayName(),
                 TargetState = (EnumTargetStateDto)res.TargetState,
                 PosResType = (EnumPosResTypeDto)res.PosResType
             };

+ 46 - 11
XdCxRhDW.App/EditForms/EditorTar.Designer.cs

@@ -39,6 +39,8 @@
             this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem();
             this.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem();
+            this.txtTarColor = new DevExpress.XtraEditors.ColorPickEdit();
+            this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
             this.layoutControl1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit1.Properties)).BeginInit();
@@ -49,10 +51,13 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtTarColor.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
             this.SuspendLayout();
             // 
             // layoutControl1
             // 
+            this.layoutControl1.Controls.Add(this.txtTarColor);
             this.layoutControl1.Controls.Add(this.btnOk);
             this.layoutControl1.Controls.Add(this.btnCancel);
             this.layoutControl1.Controls.Add(this.searchLookUpEdit1);
@@ -61,13 +66,13 @@
             this.layoutControl1.Name = "layoutControl1";
             this.layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new System.Drawing.Rectangle(831, 101, 650, 400);
             this.layoutControl1.Root = this.Root;
-            this.layoutControl1.Size = new System.Drawing.Size(258, 160);
+            this.layoutControl1.Size = new System.Drawing.Size(258, 195);
             this.layoutControl1.TabIndex = 0;
             this.layoutControl1.Text = "layoutControl1";
             // 
             // btnOk
             // 
-            this.btnOk.Location = new System.Drawing.Point(131, 90);
+            this.btnOk.Location = new System.Drawing.Point(131, 131);
             this.btnOk.Name = "btnOk";
             this.btnOk.Size = new System.Drawing.Size(105, 22);
             this.btnOk.StyleController = this.layoutControl1;
@@ -77,7 +82,7 @@
             // 
             // btnCancel
             // 
-            this.btnCancel.Location = new System.Drawing.Point(22, 90);
+            this.btnCancel.Location = new System.Drawing.Point(22, 131);
             this.btnCancel.Name = "btnCancel";
             this.btnCancel.Size = new System.Drawing.Size(105, 22);
             this.btnCancel.StyleController = this.layoutControl1;
@@ -113,18 +118,19 @@
             this.layoutControlItem1,
             this.layoutControlItem4,
             this.layoutControlItem5,
-            this.emptySpaceItem2});
+            this.emptySpaceItem2,
+            this.layoutControlItem2});
             this.Root.Name = "Root";
             this.Root.Padding = new DevExpress.XtraLayout.Utils.Padding(20, 20, 20, 20);
-            this.Root.Size = new System.Drawing.Size(258, 160);
+            this.Root.Size = new System.Drawing.Size(258, 195);
             this.Root.TextVisible = false;
             // 
             // emptySpaceItem1
             // 
             this.emptySpaceItem1.AllowHotTrack = false;
-            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 94);
+            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 135);
             this.emptySpaceItem1.Name = "emptySpaceItem1";
-            this.emptySpaceItem1.Size = new System.Drawing.Size(218, 26);
+            this.emptySpaceItem1.Size = new System.Drawing.Size(218, 20);
             this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
             // 
             // layoutControlItem1
@@ -143,7 +149,7 @@
             // layoutControlItem4
             // 
             this.layoutControlItem4.Control = this.btnCancel;
-            this.layoutControlItem4.Location = new System.Drawing.Point(0, 68);
+            this.layoutControlItem4.Location = new System.Drawing.Point(0, 109);
             this.layoutControlItem4.Name = "layoutControlItem4";
             this.layoutControlItem4.Size = new System.Drawing.Size(109, 26);
             this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0);
@@ -152,7 +158,7 @@
             // layoutControlItem5
             // 
             this.layoutControlItem5.Control = this.btnOk;
-            this.layoutControlItem5.Location = new System.Drawing.Point(109, 68);
+            this.layoutControlItem5.Location = new System.Drawing.Point(109, 109);
             this.layoutControlItem5.Name = "layoutControlItem5";
             this.layoutControlItem5.Size = new System.Drawing.Size(109, 26);
             this.layoutControlItem5.TextSize = new System.Drawing.Size(0, 0);
@@ -161,7 +167,7 @@
             // emptySpaceItem2
             // 
             this.emptySpaceItem2.AllowHotTrack = false;
-            this.emptySpaceItem2.Location = new System.Drawing.Point(0, 44);
+            this.emptySpaceItem2.Location = new System.Drawing.Point(0, 85);
             this.emptySpaceItem2.MaxSize = new System.Drawing.Size(0, 24);
             this.emptySpaceItem2.MinSize = new System.Drawing.Size(104, 24);
             this.emptySpaceItem2.Name = "emptySpaceItem2";
@@ -169,11 +175,36 @@
             this.emptySpaceItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.emptySpaceItem2.TextSize = new System.Drawing.Size(0, 0);
             // 
+            // txtTarColor
+            // 
+            this.txtTarColor.EditValue = System.Drawing.Color.Empty;
+            this.txtTarColor.Location = new System.Drawing.Point(22, 83);
+            this.txtTarColor.Name = "txtTarColor";
+            this.txtTarColor.Properties.AutomaticColor = System.Drawing.Color.Black;
+            this.txtTarColor.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            this.txtTarColor.Properties.NullColor = System.Drawing.Color.Empty;
+            this.txtTarColor.Properties.ShowSystemColors = false;
+            this.txtTarColor.Properties.ShowWebColors = false;
+            this.txtTarColor.Size = new System.Drawing.Size(214, 20);
+            this.txtTarColor.StyleController = this.layoutControl1;
+            this.txtTarColor.TabIndex = 9;
+            // 
+            // layoutControlItem2
+            // 
+            this.layoutControlItem2.Control = this.txtTarColor;
+            this.layoutControlItem2.Location = new System.Drawing.Point(0, 44);
+            this.layoutControlItem2.Name = "layoutControlItem2";
+            this.layoutControlItem2.Size = new System.Drawing.Size(218, 41);
+            this.layoutControlItem2.Text = "目标颜色";
+            this.layoutControlItem2.TextLocation = DevExpress.Utils.Locations.Top;
+            this.layoutControlItem2.TextSize = new System.Drawing.Size(48, 14);
+            // 
             // EditorTar
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(258, 160);
+            this.ClientSize = new System.Drawing.Size(258, 195);
             this.Controls.Add(this.layoutControl1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
             this.Name = "EditorTar";
@@ -189,6 +220,8 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtTarColor.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
             this.ResumeLayout(false);
 
         }
@@ -206,5 +239,7 @@
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5;
         private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem2;
+        private DevExpress.XtraEditors.ColorPickEdit txtTarColor;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
     }
 }

+ 6 - 0
XdCxRhDW.App/EditForms/EditorTar.cs

@@ -39,7 +39,11 @@ namespace XdCxRhDW.App.EditForms
             this.searchLookUpEdit1.UseDefault().SetData(infos,nameof(TargetInfo.TargetName)).UseDoubleClickToSelectAll();
             this.searchLookUpEdit1.Properties.View.RowCellStyle += View_RowCellStyle;
             if (info != null)
+            {
                 this.searchLookUpEdit1.Text = info.TargetName;
+                var clolrRes = ColorTranslator.FromHtml(info.TargeColor);
+                this.txtTarColor.EditValue = clolrRes;
+            }
         }
 
         private void View_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
@@ -67,11 +71,13 @@ namespace XdCxRhDW.App.EditForms
                 {
                     info.ID = tar.ID;
                     info.TargetName = tar.TargetName;
+                    info.TargeColor=tar.TargeColor;
                 }
                 else
                 {
                     info.ID = 0;
                     info.TargetName = "未知目标";
+                    info.TargeColor = "";
                 }
                 this.DialogResult = DialogResult.OK;
             }

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

@@ -35,6 +35,7 @@ using DevExpress.XtraPrinting.Native.Properties;
 using DevExpress.Utils.Drawing.Helpers;
 using DevExpress.Office.Crypto;
 using XdCxRhDW.App.Model;
+using DPP_YH_Core.Extensions;
 
 namespace XdCxRhDW.App.UserControl
 {
@@ -1378,7 +1379,7 @@ namespace XdCxRhDW.App.UserControl
                     {
                         dto.TarFrequpHz = Convert.ToInt64(txtFrequpMHz.EditValue);
                     }
-                    var res = await HttpHelper.PostRequestAsync<List<ModelPosRes>>(baseUrl + "Pos/GetPosResByLastHoursObsolete", dto, ct);
+                    var res = await HttpHelper.PostRequestAsync<List<PosRes>>(baseUrl + "Pos/GetPosResByLastHoursObsolete", dto, ct);
                     if (res.code == 200)
                     {
                         if (res.msg.Length > 10)

+ 13 - 1
XdCxRhDW.Entity/PosRes.cs

@@ -23,12 +23,21 @@ namespace XdCxRhDW.Entity
         [Display(Name = "站点ID")]
         public long StationResID { get; set; }
 
+        [Display(AutoGenerateField = false)]
+        public virtual StationRes StationRes { get; set; }
+
         [Display(Name = "测向编号")]
         public long? CxResID { get; set; }
 
+        [Display(AutoGenerateField = false)]
+        public virtual CxRes CxRes { get; set; }
+
         [Display(Name = "参估编号")]
         public long CgResID { get; set; }
 
+        [Display(AutoGenerateField = false)]
+        public virtual CgRes CgRes { get; set; }
+
         [Display(AutoGenerateField = false)]
         public int? TargetInfoID { get; set; }
 
@@ -37,7 +46,10 @@ namespace XdCxRhDW.Entity
         [Display(Name = "检测编号")]
         public long? CheckResID { get; set; }
 
-        public CheckRes CheckRes;
+        [Display(AutoGenerateField = false)]
+        public virtual CheckRes CheckRes { get; set; }
+
+        //public CheckRes CheckRes;
 
         [Display(Name = "定位点")]
         public string LonLat

+ 19 - 17
XdCxRhDW.Sender/Form1.cs

@@ -45,10 +45,10 @@ namespace XdCxRhDW.Sender
                     string tskType = txtTskType.EditValue.ToString();
                     await Task.Run(async () =>
                     {
-                    while (true)
-                    {
-                        if (cts1.IsCancellationRequested)
-                            break;
+                    //while (true)
+                    //{
+                    //    if (cts1.IsCancellationRequested)
+                    //        break;
                         using (var client = new HttpClient())
                             {
                                 try
@@ -64,15 +64,17 @@ namespace XdCxRhDW.Sender
                                             if (cts1.IsCancellationRequested) break;
                                             if (string.IsNullOrWhiteSpace(line)) continue;
                                             var items = line.Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
-                                        //CheckResDto checkResDto = new CheckResDto()
-                                        //{
-                                        //    SigTime = DateTime.Now,
-                                        //    FileName = "test",
-                                        //    StartSamp = 1,
-                                        //    SampCount = 2,
-                                        //    DetectionWay = DmcTypeDto.DAMA| DmcTypeDto.Ky5758,
-                                        //};
-                                        X1D1PosDto dto = new X1D1PosDto()
+                                            //CheckResDto checkResDto = new CheckResDto()
+                                            //{
+                                            //    UserName = "UserName",
+                                            //    FileName = "FileName",
+                                            //    SmpStart = 1,
+                                            //    SmpCount = 2,
+                                            //    ModType = "ModType",
+                                            //    PosCheckType = EnumPosCheckTypeDto.Ky5758,
+                                            //    ModRate=null
+                                            //};
+                                            X1D1PosDto dto = new X1D1PosDto()
                                             {
                                                 SigTime = DateTime.Now,
                                                 MainCode = 23467,
@@ -94,7 +96,7 @@ namespace XdCxRhDW.Sender
                                                 CxLat = IniFiles.ReadValue<double>("Station_Data2023.ini", "侧向站", "Lat"),
                                                 RefLon = IniFiles.ReadValue<double>("Station_Data2023.ini", "参考站", "Lon"),
                                                 RefLat = IniFiles.ReadValue<double>("Station_Data2023.ini", "参考站", "Lat"),
-                                               // CheckRes= checkResDto
+                                                //CheckRes= checkResDto
                                             };
                                             var result = await HttpHelper.PostRequestAsync<PosResDto>(url, dto);
                                             if (result.code != 200)
@@ -102,7 +104,7 @@ namespace XdCxRhDW.Sender
                                                 Log($"{result.msg}");
                                                 return;
                                             }
-                                            Thread.Sleep(1000);
+                                            //Thread.Sleep(1000);
                                             Log($"已向[{txtAddr1.Text}]发送第{idx++}条仿真结果");
                                         }
                                     }
@@ -469,8 +471,8 @@ namespace XdCxRhDW.Sender
                                     Log($"向[{txtAddr1.Text}]发送结果失败.{ex.Message}");
                                 }
                             }
-                            await Task.Delay(1000);
-                        }
+                        //    await Task.Delay(1000);
+                        //}
                     });
                 }
                 catch (Exception ex)