yg 3 tháng trước cách đây
mục cha
commit
45f453fcff

+ 114 - 50
DW5S.App/EditForms/TaskEditor.Designer.cs

@@ -41,8 +41,8 @@
             txtAdja2Sat = new DevExpress.XtraEditors.SearchLookUpEdit();
             gridView2 = new DevExpress.XtraGrid.Views.Grid.GridView();
             txtTaskType = new DevExpress.XtraEditors.RadioGroup();
+            btnAsSave = new DevExpress.XtraEditors.SimpleButton();
             Root = new DevExpress.XtraLayout.LayoutControlGroup();
-            emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
             layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
             layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
             layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
@@ -52,7 +52,11 @@
             layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
             layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem();
             layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem();
+            emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
+            layAsSave = new DevExpress.XtraLayout.LayoutControlItem();
             dxErrorProvider = new DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider(components);
+            layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem();
+            layoutControlItem8 = new DevExpress.XtraLayout.LayoutControlItem();
             ((System.ComponentModel.ISupportInitialize)layoutControl1).BeginInit();
             layoutControl1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)txtTaskName.Properties).BeginInit();
@@ -65,7 +69,6 @@
             ((System.ComponentModel.ISupportInitialize)gridView2).BeginInit();
             ((System.ComponentModel.ISupportInitialize)txtTaskType.Properties).BeginInit();
             ((System.ComponentModel.ISupportInitialize)Root).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)emptySpaceItem1).BeginInit();
             ((System.ComponentModel.ISupportInitialize)layoutControlItem2).BeginInit();
             ((System.ComponentModel.ISupportInitialize)layoutControlItem3).BeginInit();
             ((System.ComponentModel.ISupportInitialize)layoutControlItem4).BeginInit();
@@ -75,7 +78,11 @@
             ((System.ComponentModel.ISupportInitialize)layoutControlItem1).BeginInit();
             ((System.ComponentModel.ISupportInitialize)layoutControlItem5).BeginInit();
             ((System.ComponentModel.ISupportInitialize)layoutControlItem7).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)emptySpaceItem1).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)layAsSave).BeginInit();
             ((System.ComponentModel.ISupportInitialize)dxErrorProvider).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)layoutControlItem6).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)layoutControlItem8).BeginInit();
             SuspendLayout();
             // 
             // layoutControl1
@@ -88,32 +95,33 @@
             layoutControl1.Controls.Add(txtAdja1Sat);
             layoutControl1.Controls.Add(txtAdja2Sat);
             layoutControl1.Controls.Add(txtTaskType);
+            layoutControl1.Controls.Add(btnAsSave);
             layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
             layoutControl1.Location = new System.Drawing.Point(0, 0);
             layoutControl1.Name = "layoutControl1";
             layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new System.Drawing.Rectangle(784, 215, 650, 400);
             layoutControl1.Root = Root;
-            layoutControl1.Size = new System.Drawing.Size(514, 254);
+            layoutControl1.Size = new System.Drawing.Size(541, 203);
             layoutControl1.TabIndex = 0;
             layoutControl1.Text = "layoutControl1";
             // 
             // btnFreq
             // 
-            btnFreq.Location = new System.Drawing.Point(296, 219);
+            btnFreq.Location = new System.Drawing.Point(247, 168);
             btnFreq.Name = "btnFreq";
-            btnFreq.Size = new System.Drawing.Size(96, 23);
+            btnFreq.Size = new System.Drawing.Size(86, 23);
             btnFreq.StyleController = layoutControl1;
-            btnFreq.TabIndex = 7;
+            btnFreq.TabIndex = 8;
             btnFreq.Text = "选择信号";
             btnFreq.Click += btnFreq_Click;
             // 
             // btnSave
             // 
-            btnSave.Location = new System.Drawing.Point(406, 219);
+            btnSave.Location = new System.Drawing.Point(347, 168);
             btnSave.Name = "btnSave";
-            btnSave.Size = new System.Drawing.Size(96, 23);
+            btnSave.Size = new System.Drawing.Size(86, 23);
             btnSave.StyleController = layoutControl1;
-            btnSave.TabIndex = 8;
+            btnSave.TabIndex = 9;
             btnSave.Text = "保存";
             btnSave.Click += btnSave_ClickAsync;
             // 
@@ -122,7 +130,7 @@
             txtTaskName.Location = new System.Drawing.Point(12, 39);
             txtTaskName.Name = "txtTaskName";
             txtTaskName.Properties.AutoHeight = false;
-            txtTaskName.Size = new System.Drawing.Size(252, 20);
+            txtTaskName.Size = new System.Drawing.Size(242, 20);
             txtTaskName.StyleController = layoutControl1;
             txtTaskName.TabIndex = 0;
             // 
@@ -134,20 +142,20 @@
             txtPosType.Properties.Appearance.BackColor = System.Drawing.Color.FromArgb(244, 244, 244);
             txtPosType.Properties.Appearance.Options.UseBackColor = true;
             txtPosType.Properties.Columns = 3;
-            txtPosType.Size = new System.Drawing.Size(490, 79);
+            txtPosType.Size = new System.Drawing.Size(517, 28);
             txtPosType.StyleController = layoutControl1;
             txtPosType.TabIndex = 3;
             txtPosType.EditValueChanged += txtPosType_EditValueChanged;
             // 
             // txtMainSat
             // 
-            txtMainSat.Location = new System.Drawing.Point(12, 185);
+            txtMainSat.Location = new System.Drawing.Point(12, 134);
             txtMainSat.Name = "txtMainSat";
             txtMainSat.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo) });
             txtMainSat.Properties.NullText = "";
             txtMainSat.Properties.PopupSizeable = false;
             txtMainSat.Properties.PopupView = searchLookUpEdit1View;
-            txtMainSat.Size = new System.Drawing.Size(160, 20);
+            txtMainSat.Size = new System.Drawing.Size(153, 20);
             txtMainSat.StyleController = layoutControl1;
             txtMainSat.TabIndex = 4;
             // 
@@ -160,13 +168,13 @@
             // 
             // txtAdja1Sat
             // 
-            txtAdja1Sat.Location = new System.Drawing.Point(176, 185);
+            txtAdja1Sat.Location = new System.Drawing.Point(169, 134);
             txtAdja1Sat.Name = "txtAdja1Sat";
             txtAdja1Sat.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo) });
             txtAdja1Sat.Properties.NullText = "";
             txtAdja1Sat.Properties.PopupSizeable = false;
             txtAdja1Sat.Properties.PopupView = gridView1;
-            txtAdja1Sat.Size = new System.Drawing.Size(160, 20);
+            txtAdja1Sat.Size = new System.Drawing.Size(154, 20);
             txtAdja1Sat.StyleController = layoutControl1;
             txtAdja1Sat.TabIndex = 5;
             // 
@@ -179,13 +187,13 @@
             // 
             // txtAdja2Sat
             // 
-            txtAdja2Sat.Location = new System.Drawing.Point(340, 185);
+            txtAdja2Sat.Location = new System.Drawing.Point(327, 134);
             txtAdja2Sat.Name = "txtAdja2Sat";
             txtAdja2Sat.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo) });
             txtAdja2Sat.Properties.NullText = "";
             txtAdja2Sat.Properties.PopupSizeable = false;
             txtAdja2Sat.Properties.PopupView = gridView2;
-            txtAdja2Sat.Size = new System.Drawing.Size(162, 20);
+            txtAdja2Sat.Size = new System.Drawing.Size(202, 20);
             txtAdja2Sat.StyleController = layoutControl1;
             txtAdja2Sat.TabIndex = 6;
             // 
@@ -199,43 +207,43 @@
             // txtTaskType
             // 
             txtTaskType.EditValue = 0;
-            txtTaskType.Location = new System.Drawing.Point(268, 37);
+            txtTaskType.Location = new System.Drawing.Point(258, 37);
             txtTaskType.Name = "txtTaskType";
             txtTaskType.Properties.Appearance.BackColor = System.Drawing.Color.FromArgb(244, 244, 244);
             txtTaskType.Properties.Appearance.Options.UseBackColor = true;
             txtTaskType.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
             txtTaskType.Properties.ColumnIndent = 3;
             txtTaskType.Properties.Columns = 3;
-            txtTaskType.Size = new System.Drawing.Size(234, 27);
+            txtTaskType.Size = new System.Drawing.Size(271, 27);
             txtTaskType.StyleController = layoutControl1;
             txtTaskType.TabIndex = 2;
             txtTaskType.SelectedIndexChanged += txtTaskType_SelectedIndexChanged;
             // 
+            // btnAsSave
+            // 
+            btnAsSave.Location = new System.Drawing.Point(447, 168);
+            btnAsSave.Name = "btnAsSave";
+            btnAsSave.Size = new System.Drawing.Size(82, 23);
+            btnAsSave.StyleController = layoutControl1;
+            btnAsSave.TabIndex = 7;
+            btnAsSave.Text = "另存";
+            // 
             // Root
             // 
             Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
             Root.GroupBordersVisible = false;
-            Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { emptySpaceItem1, layoutControlItem2, layoutControlItem3, layoutControlItem4, layoutControlItemAdja1, layoutControlItemAdja2, layoutControlGroup1, layoutControlItem7 });
+            Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem2, layoutControlItem3, layoutControlItem4, layoutControlItemAdja1, layoutControlItemAdja2, layoutControlGroup1, layoutControlItem7, emptySpaceItem1, layAsSave });
             Root.Name = "Root";
-            Root.Size = new System.Drawing.Size(514, 254);
+            Root.Size = new System.Drawing.Size(541, 203);
             Root.TextVisible = false;
             // 
-            // emptySpaceItem1
-            // 
-            emptySpaceItem1.AllowHotTrack = false;
-            emptySpaceItem1.Location = new System.Drawing.Point(0, 197);
-            emptySpaceItem1.Name = "emptySpaceItem1";
-            emptySpaceItem1.Size = new System.Drawing.Size(284, 37);
-            emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
-            // 
             // layoutControlItem2
             // 
             layoutControlItem2.Control = txtPosType;
             layoutControlItem2.Location = new System.Drawing.Point(0, 56);
-            layoutControlItem2.MaxSize = new System.Drawing.Size(0, 100);
-            layoutControlItem2.MinSize = new System.Drawing.Size(54, 100);
+            layoutControlItem2.MinSize = new System.Drawing.Size(54, 31);
             layoutControlItem2.Name = "layoutControlItem2";
-            layoutControlItem2.Size = new System.Drawing.Size(494, 100);
+            layoutControlItem2.Size = new System.Drawing.Size(521, 49);
             layoutControlItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             layoutControlItem2.Text = "定位模式";
             layoutControlItem2.TextLocation = DevExpress.Utils.Locations.Top;
@@ -244,11 +252,11 @@
             // layoutControlItem3
             // 
             layoutControlItem3.Control = btnSave;
-            layoutControlItem3.Location = new System.Drawing.Point(394, 197);
+            layoutControlItem3.Location = new System.Drawing.Point(335, 146);
             layoutControlItem3.MaxSize = new System.Drawing.Size(100, 37);
             layoutControlItem3.MinSize = new System.Drawing.Size(100, 37);
             layoutControlItem3.Name = "layoutControlItem3";
-            layoutControlItem3.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 12, 2);
+            layoutControlItem3.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 12, 12, 2);
             layoutControlItem3.Size = new System.Drawing.Size(100, 37);
             layoutControlItem3.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
@@ -257,9 +265,9 @@
             // layoutControlItem4
             // 
             layoutControlItem4.Control = txtMainSat;
-            layoutControlItem4.Location = new System.Drawing.Point(0, 156);
+            layoutControlItem4.Location = new System.Drawing.Point(0, 105);
             layoutControlItem4.Name = "layoutControlItem4";
-            layoutControlItem4.Size = new System.Drawing.Size(164, 41);
+            layoutControlItem4.Size = new System.Drawing.Size(157, 41);
             layoutControlItem4.Text = "主星";
             layoutControlItem4.TextLocation = DevExpress.Utils.Locations.Top;
             layoutControlItem4.TextSize = new System.Drawing.Size(48, 14);
@@ -267,9 +275,9 @@
             // layoutControlItemAdja1
             // 
             layoutControlItemAdja1.Control = txtAdja1Sat;
-            layoutControlItemAdja1.Location = new System.Drawing.Point(164, 156);
+            layoutControlItemAdja1.Location = new System.Drawing.Point(157, 105);
             layoutControlItemAdja1.Name = "layoutControlItemAdja1";
-            layoutControlItemAdja1.Size = new System.Drawing.Size(164, 41);
+            layoutControlItemAdja1.Size = new System.Drawing.Size(158, 41);
             layoutControlItemAdja1.Text = "邻星1";
             layoutControlItemAdja1.TextLocation = DevExpress.Utils.Locations.Top;
             layoutControlItemAdja1.TextSize = new System.Drawing.Size(48, 14);
@@ -278,9 +286,9 @@
             // layoutControlItemAdja2
             // 
             layoutControlItemAdja2.Control = txtAdja2Sat;
-            layoutControlItemAdja2.Location = new System.Drawing.Point(328, 156);
+            layoutControlItemAdja2.Location = new System.Drawing.Point(315, 105);
             layoutControlItemAdja2.Name = "layoutControlItemAdja2";
-            layoutControlItemAdja2.Size = new System.Drawing.Size(166, 41);
+            layoutControlItemAdja2.Size = new System.Drawing.Size(206, 41);
             layoutControlItemAdja2.Text = "邻星2";
             layoutControlItemAdja2.TextLocation = DevExpress.Utils.Locations.Top;
             layoutControlItemAdja2.TextSize = new System.Drawing.Size(48, 14);
@@ -292,7 +300,7 @@
             layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem1, layoutControlItem5 });
             layoutControlGroup1.Location = new System.Drawing.Point(0, 0);
             layoutControlGroup1.Name = "layoutControlGroup1";
-            layoutControlGroup1.Size = new System.Drawing.Size(494, 56);
+            layoutControlGroup1.Size = new System.Drawing.Size(521, 56);
             // 
             // layoutControlItem1
             // 
@@ -302,7 +310,7 @@
             layoutControlItem1.MinSize = new System.Drawing.Size(118, 56);
             layoutControlItem1.Name = "layoutControlItem1";
             layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 12, 7);
-            layoutControlItem1.Size = new System.Drawing.Size(256, 56);
+            layoutControlItem1.Size = new System.Drawing.Size(246, 56);
             layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             layoutControlItem1.Text = "任务名称";
             layoutControlItem1.TextLocation = DevExpress.Utils.Locations.Top;
@@ -313,11 +321,11 @@
             layoutControlItem5.Control = txtTaskType;
             layoutControlItem5.ControlAlignment = System.Drawing.ContentAlignment.TopLeft;
             layoutControlItem5.CustomizationFormText = "定位模式";
-            layoutControlItem5.Location = new System.Drawing.Point(256, 0);
+            layoutControlItem5.Location = new System.Drawing.Point(246, 0);
             layoutControlItem5.MinSize = new System.Drawing.Size(88, 37);
             layoutControlItem5.Name = "layoutControlItem5";
             layoutControlItem5.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 10, 2);
-            layoutControlItem5.Size = new System.Drawing.Size(238, 56);
+            layoutControlItem5.Size = new System.Drawing.Size(275, 56);
             layoutControlItem5.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             layoutControlItem5.Text = " ";
             layoutControlItem5.TextLocation = DevExpress.Utils.Locations.Top;
@@ -326,25 +334,74 @@
             // layoutControlItem7
             // 
             layoutControlItem7.Control = btnFreq;
-            layoutControlItem7.Location = new System.Drawing.Point(284, 197);
-            layoutControlItem7.MaxSize = new System.Drawing.Size(110, 37);
-            layoutControlItem7.MinSize = new System.Drawing.Size(110, 37);
+            layoutControlItem7.Location = new System.Drawing.Point(235, 146);
+            layoutControlItem7.MaxSize = new System.Drawing.Size(100, 37);
+            layoutControlItem7.MinSize = new System.Drawing.Size(100, 37);
             layoutControlItem7.Name = "layoutControlItem7";
             layoutControlItem7.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 12, 12, 2);
-            layoutControlItem7.Size = new System.Drawing.Size(110, 37);
+            layoutControlItem7.Size = new System.Drawing.Size(100, 37);
             layoutControlItem7.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             layoutControlItem7.TextSize = new System.Drawing.Size(0, 0);
             layoutControlItem7.TextVisible = false;
             // 
+            // emptySpaceItem1
+            // 
+            emptySpaceItem1.AllowHotTrack = false;
+            emptySpaceItem1.Location = new System.Drawing.Point(0, 146);
+            emptySpaceItem1.MinSize = new System.Drawing.Size(104, 24);
+            emptySpaceItem1.Name = "emptySpaceItem1";
+            emptySpaceItem1.Size = new System.Drawing.Size(235, 37);
+            emptySpaceItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
+            emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
+            // 
+            // layAsSave
+            // 
+            layAsSave.Control = btnAsSave;
+            layAsSave.Location = new System.Drawing.Point(435, 146);
+            layAsSave.MaxSize = new System.Drawing.Size(86, 37);
+            layAsSave.MinSize = new System.Drawing.Size(86, 37);
+            layAsSave.Name = "layAsSave";
+            layAsSave.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 12, 2);
+            layAsSave.Size = new System.Drawing.Size(86, 37);
+            layAsSave.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
+            layAsSave.TextSize = new System.Drawing.Size(0, 0);
+            layAsSave.TextVisible = false;
+            // 
             // dxErrorProvider
             // 
             dxErrorProvider.ContainerControl = this;
             // 
+            // layoutControlItem6
+            // 
+            layoutControlItem6.Control = btnSave;
+            layoutControlItem6.Location = new System.Drawing.Point(421, 146);
+            layoutControlItem6.MaxSize = new System.Drawing.Size(100, 37);
+            layoutControlItem6.MinSize = new System.Drawing.Size(100, 37);
+            layoutControlItem6.Name = "layoutControlItem3";
+            layoutControlItem6.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 12, 2);
+            layoutControlItem6.Size = new System.Drawing.Size(100, 37);
+            layoutControlItem6.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
+            layoutControlItem6.TextSize = new System.Drawing.Size(0, 0);
+            layoutControlItem6.TextVisible = false;
+            // 
+            // layoutControlItem8
+            // 
+            layoutControlItem8.Control = btnSave;
+            layoutControlItem8.Location = new System.Drawing.Point(421, 146);
+            layoutControlItem8.MaxSize = new System.Drawing.Size(100, 37);
+            layoutControlItem8.MinSize = new System.Drawing.Size(100, 37);
+            layoutControlItem8.Name = "layoutControlItem3";
+            layoutControlItem8.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 12, 2);
+            layoutControlItem8.Size = new System.Drawing.Size(100, 37);
+            layoutControlItem8.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
+            layoutControlItem8.TextSize = new System.Drawing.Size(0, 0);
+            layoutControlItem8.TextVisible = false;
+            // 
             // TaskEditor
             // 
             AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
             AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            ClientSize = new System.Drawing.Size(514, 254);
+            ClientSize = new System.Drawing.Size(541, 203);
             Controls.Add(layoutControl1);
             FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
             Name = "TaskEditor";
@@ -362,7 +419,6 @@
             ((System.ComponentModel.ISupportInitialize)gridView2).EndInit();
             ((System.ComponentModel.ISupportInitialize)txtTaskType.Properties).EndInit();
             ((System.ComponentModel.ISupportInitialize)Root).EndInit();
-            ((System.ComponentModel.ISupportInitialize)emptySpaceItem1).EndInit();
             ((System.ComponentModel.ISupportInitialize)layoutControlItem2).EndInit();
             ((System.ComponentModel.ISupportInitialize)layoutControlItem3).EndInit();
             ((System.ComponentModel.ISupportInitialize)layoutControlItem4).EndInit();
@@ -372,7 +428,11 @@
             ((System.ComponentModel.ISupportInitialize)layoutControlItem1).EndInit();
             ((System.ComponentModel.ISupportInitialize)layoutControlItem5).EndInit();
             ((System.ComponentModel.ISupportInitialize)layoutControlItem7).EndInit();
+            ((System.ComponentModel.ISupportInitialize)emptySpaceItem1).EndInit();
+            ((System.ComponentModel.ISupportInitialize)layAsSave).EndInit();
             ((System.ComponentModel.ISupportInitialize)dxErrorProvider).EndInit();
+            ((System.ComponentModel.ISupportInitialize)layoutControlItem6).EndInit();
+            ((System.ComponentModel.ISupportInitialize)layoutControlItem8).EndInit();
             ResumeLayout(false);
         }
 
@@ -402,5 +462,9 @@
         private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup1;
         private DevExpress.XtraEditors.SimpleButton btnFreq;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem7;
+        private DevExpress.XtraEditors.SimpleButton btnAsSave;
+        private DevExpress.XtraLayout.LayoutControlItem layAsSave;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem6;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem8;
     }
 }

+ 3 - 12
DW5S.App/EditForms/TaskEditor.cs

@@ -42,20 +42,10 @@ namespace DW5S.App.EditForms
             InitializeComponent();
             this.layoutControl1.UseDefault();
             this.Text = "添加任务";
+            layAsSave.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
             info = new TaskViewModel();
             this.StartPosition = FormStartPosition.CenterParent;
-            //加载DW类型
-            //var values = Enum.GetValues(typeof(EnumPosType));
-            //foreach (var item in values)
-            //{
-            //    this.txtPosType.Properties.Items.Add(new RadioGroupItem(Convert.ToInt32(item), ((EnumPosType)item).GetEnumDisplayName()));
-            //}
-
-            //values = Enum.GetValues(typeof(EnumTaskType));
-            //foreach (var item in values)
-            //{
-            //    this.txtTaskType.Properties.Items.Add(new RadioGroupItem(Convert.ToInt32(item), ((EnumTaskType)item).GetEnumDisplayName()));
-            //}
+           
             this.txtTaskType.Properties.AddEnum<EnumTaskType>();
             this.txtTaskType.SelectedIndex = 0;
             this.txtTaskType_SelectedIndexChanged(this, EventArgs.Empty);
@@ -69,6 +59,7 @@ namespace DW5S.App.EditForms
             this.Text = $"编辑任务[{info.TaskName}]";
             this.info = info;
             this.selectedItem = taskSigList;
+            layAsSave.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
         }
 
         private async void TaskEditor_Load(object sender, EventArgs e)

+ 164 - 0
DW5S.App/EditForms/TaskTemplate.Designer.cs

@@ -0,0 +1,164 @@
+namespace DW5S.App.EditForms
+{
+    partial class TaskTemplate
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
+            radioGroup1 = new DevExpress.XtraEditors.RadioGroup();
+            btnOk = new DevExpress.XtraEditors.SimpleButton();
+            btnCancle = new DevExpress.XtraEditors.SimpleButton();
+            Root = new DevExpress.XtraLayout.LayoutControlGroup();
+            layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem();
+            layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem();
+            layoutControlItem8 = new DevExpress.XtraLayout.LayoutControlItem();
+            ((System.ComponentModel.ISupportInitialize)layoutControl1).BeginInit();
+            layoutControl1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)radioGroup1.Properties).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)Root).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)layoutControlItem6).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)layoutControlItem7).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)layoutControlItem8).BeginInit();
+            SuspendLayout();
+            // 
+            // layoutControl1
+            // 
+            layoutControl1.BackColor = System.Drawing.SystemColors.Control;
+            layoutControl1.Controls.Add(radioGroup1);
+            layoutControl1.Controls.Add(btnOk);
+            layoutControl1.Controls.Add(btnCancle);
+            layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
+            layoutControl1.Location = new System.Drawing.Point(0, 0);
+            layoutControl1.Name = "layoutControl1";
+            layoutControl1.Root = Root;
+            layoutControl1.Size = new System.Drawing.Size(244, 214);
+            layoutControl1.TabIndex = 0;
+            layoutControl1.Text = "layoutControl1";
+            // 
+            // radioGroup1
+            // 
+            radioGroup1.Location = new System.Drawing.Point(12, 12);
+            radioGroup1.MaximumSize = new System.Drawing.Size(0, 160);
+            radioGroup1.MinimumSize = new System.Drawing.Size(0, 160);
+            radioGroup1.Name = "radioGroup1";
+            radioGroup1.Properties.Appearance.BackColor = System.Drawing.SystemColors.Control;
+            radioGroup1.Properties.Appearance.Options.UseBackColor = true;
+            radioGroup1.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
+            radioGroup1.Properties.Columns = 1;
+            radioGroup1.Properties.Items.AddRange(new DevExpress.XtraEditors.Controls.RadioGroupItem[] { new DevExpress.XtraEditors.Controls.RadioGroupItem(0, "无模板"), new DevExpress.XtraEditors.Controls.RadioGroupItem(1, "两星一地有参定位任务模板"), new DevExpress.XtraEditors.Controls.RadioGroupItem(2, "两星一地无参定位任务模板") });
+            radioGroup1.Size = new System.Drawing.Size(220, 160);
+            radioGroup1.StyleController = layoutControl1;
+            radioGroup1.TabIndex = 8;
+            // 
+            // btnOk
+            // 
+            btnOk.Location = new System.Drawing.Point(123, 176);
+            btnOk.Name = "btnOk";
+            btnOk.Size = new System.Drawing.Size(109, 22);
+            btnOk.StyleController = layoutControl1;
+            btnOk.TabIndex = 7;
+            btnOk.Text = "确定";
+            btnOk.Click += btnOk_Click;
+            // 
+            // btnCancle
+            // 
+            btnCancle.Location = new System.Drawing.Point(12, 176);
+            btnCancle.Name = "btnCancle";
+            btnCancle.Size = new System.Drawing.Size(107, 22);
+            btnCancle.StyleController = layoutControl1;
+            btnCancle.TabIndex = 6;
+            btnCancle.Text = "取消";
+            btnCancle.Click += btnCancle_Click;
+            // 
+            // Root
+            // 
+            Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
+            Root.GroupBordersVisible = false;
+            Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem6, layoutControlItem7, layoutControlItem8 });
+            Root.Name = "Root";
+            Root.Size = new System.Drawing.Size(244, 214);
+            Root.TextVisible = false;
+            // 
+            // layoutControlItem6
+            // 
+            layoutControlItem6.Control = btnCancle;
+            layoutControlItem6.Location = new System.Drawing.Point(0, 164);
+            layoutControlItem6.Name = "layoutControlItem6";
+            layoutControlItem6.Size = new System.Drawing.Size(111, 30);
+            layoutControlItem6.TextSize = new System.Drawing.Size(0, 0);
+            layoutControlItem6.TextVisible = false;
+            // 
+            // layoutControlItem7
+            // 
+            layoutControlItem7.Control = btnOk;
+            layoutControlItem7.Location = new System.Drawing.Point(111, 164);
+            layoutControlItem7.Name = "layoutControlItem7";
+            layoutControlItem7.Size = new System.Drawing.Size(113, 30);
+            layoutControlItem7.TextSize = new System.Drawing.Size(0, 0);
+            layoutControlItem7.TextVisible = false;
+            // 
+            // layoutControlItem8
+            // 
+            layoutControlItem8.Control = radioGroup1;
+            layoutControlItem8.Location = new System.Drawing.Point(0, 0);
+            layoutControlItem8.Name = "layoutControlItem8";
+            layoutControlItem8.Size = new System.Drawing.Size(224, 164);
+            layoutControlItem8.TextSize = new System.Drawing.Size(0, 0);
+            layoutControlItem8.TextVisible = false;
+            // 
+            // TaskTemplate
+            // 
+            AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
+            AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            ClientSize = new System.Drawing.Size(244, 214);
+            Controls.Add(layoutControl1);
+            FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            Name = "TaskTemplate";
+            Text = "RecEditor";
+            Load += CdbEditor_Load;
+            ((System.ComponentModel.ISupportInitialize)layoutControl1).EndInit();
+            layoutControl1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)radioGroup1.Properties).EndInit();
+            ((System.ComponentModel.ISupportInitialize)Root).EndInit();
+            ((System.ComponentModel.ISupportInitialize)layoutControlItem6).EndInit();
+            ((System.ComponentModel.ISupportInitialize)layoutControlItem7).EndInit();
+            ((System.ComponentModel.ISupportInitialize)layoutControlItem8).EndInit();
+            ResumeLayout(false);
+        }
+
+        #endregion
+
+        private DevExpress.XtraLayout.LayoutControl layoutControl1;
+        private DevExpress.XtraLayout.LayoutControlGroup Root;
+        private DevExpress.XtraEditors.SimpleButton btnOk;
+        private DevExpress.XtraEditors.SimpleButton btnCancle;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem6;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem7;
+        private DevExpress.XtraEditors.RadioGroup radioGroup1;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem8;
+    }
+}

+ 120 - 0
DW5S.App/EditForms/TaskTemplate.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>

+ 1 - 0
DW5S.App/ExtensionsDev/MapControlEx.cs

@@ -585,6 +585,7 @@ public static class MapControlEx
     public static void SetPosDataSource<T>(this MapControl ctrl, IEnumerable<T> items, bool clearDrawLayer = true) where T : PosData, new()
     {
         var innerData = ctrl.Tag as InnerData;
+        if (innerData == null) return;
         innerData._dataCache.Clear();
         if (clearDrawLayer)
             ctrl.ClearDrawObj();

+ 124 - 105
DW5S.App/UserControl/CtrlHome.cs

@@ -22,6 +22,7 @@ using System.Drawing;
 using System.Linq;
 using System.Threading;
 using System.Threading.Tasks;
+using System.Windows.Controls;
 using System.Windows.Forms;
 
 namespace DW5S.App.UserControl
@@ -116,10 +117,10 @@ namespace DW5S.App.UserControl
             if (settings == null)
             {
                 mapControl1.UseLocalDb();
-                return;
+
             }
 
-            OnSysSetingsChanged(settings);
+            //OnSysSetingsChanged(settings);
 
             try
             {
@@ -154,79 +155,79 @@ namespace DW5S.App.UserControl
             txtTimeCho_SelectedIndexChanged(null, null);
             WaitHelper.CloseForm();
 
-            await Task.Run(() =>
-           {
-               var refreshPosTime = AppConfigHelper.Get("RefreshPosTime", 5);
-               if (refreshPosTime < 1)
-                   refreshPosTime = 5;
-               refreshPosTime = refreshPosTime * 1000;
-               while (!this.IsDisposed && !this.Disposing)
-               {
-                   try
-                   {
-                       //表格处于筛选状态,不刷新数据
-                       if (!string.IsNullOrWhiteSpace(gridView2.FindFilterText) || !string.IsNullOrWhiteSpace(gridView2.FilterPanelText))
-                       {
-                           continue;
-                       }
-                       var currentTask = gridView1.GetFocusedRow() as TaskViewModel;
-                       IQueryable<PosResViewModel> refreshQuery = null;
-                       List<PosResViewModel> updateItems = null;
-                       long? currentFreq = null;
-                       if (txtFrequpMHz.EditValue != null)
-                           currentFreq = Convert.ToInt64(txtFrequpMHz.EditValue);
-                       List<long> freqs = null;
-                       lock (this)
-                       {
-                           refreshQuery = cache.AsQueryable();
-                           refreshQuery = refreshQuery.Where(p => p.TaskID == currentTask.Id);
-                           freqs = refreshQuery.Select(p => p.FrequpHz).Distinct().OrderBy(p => p).ToList();
-                           if (currentFreq != null)
-                               refreshQuery = refreshQuery.Where(p => p.FrequpHz == currentFreq.Value);
-
-                           if (!btnIncludeInvalidate.Checked)
-                           {
-                               refreshQuery = refreshQuery.Where(p => p.PosLon != 999);
-                           }
-                           updateItems = refreshQuery.Reverse().ToList();
-                           cache.Clear();
-                       }
-
-                       var items = txtFrequpMHz.Properties.Items.Where(p => p.Value != null).Select(t => Convert.ToInt64(t.Value)).ToList();
-                       foreach (var item in freqs)
-                       {
-                           if (!items.Contains(item))
-                           {
-                               this.Invoke(new Action(() =>
-                               {
-                                   this.txtFrequpMHz.Properties.Items.Add(new ImageComboBoxItem((item / 1e6).ToString("f3"), item));
-                               }));
-                           }
-                       }
-                       if (txtTimeCho.Text == "自定义") continue;
-                       if (!updateItems.Any()) continue;
-                       var hours = Convert.ToInt32(txtTimeCho.EditValue);
-                       var ds = this.gridHomePosRes.DataSource as List<PosResViewModel>;
-                       ds.InsertRange(0, updateItems);
-                       var max = ds.First().SigTime;
-                       ds.RemoveAll(p => (max - p.SigTime).TotalHours > hours);
-                       this.Invoke(new Action(() =>
-                       {
-                           mapControl1.DelPosItem<PosResViewModel>(p => (max - p.SigTime).TotalHours > hours);
-                           mapControl1.AddPosItems(updateItems);
-                           gridView2.RefreshData();
-                       }));
-                   }
-                   catch (Exception ex)
-                   {
-                       IocContainer.Logger.Error(ex, "刷新定位点出错");
-                   }
-                   finally
-                   {
-                       Thread.Sleep(refreshPosTime);
-                   }
-               }
-           });
+            // await Task.Run(() =>
+            //{
+            //    var refreshPosTime = AppConfigHelper.Get("RefreshPosTime", 5);
+            //    if (refreshPosTime < 1)
+            //        refreshPosTime = 5;
+            //    refreshPosTime = refreshPosTime * 1000;
+            //    while (!this.IsDisposed && !this.Disposing)
+            //    {
+            //        try
+            //        {
+            //            //表格处于筛选状态,不刷新数据
+            //            if (!string.IsNullOrWhiteSpace(gridView2.FindFilterText) || !string.IsNullOrWhiteSpace(gridView2.FilterPanelText))
+            //            {
+            //                continue;
+            //            }
+            //            var currentTask = gridView1.GetFocusedRow() as TaskViewModel;
+            //            IQueryable<PosResViewModel> refreshQuery = null;
+            //            List<PosResViewModel> updateItems = null;
+            //            long? currentFreq = null;
+            //            if (txtFrequpMHz.EditValue != null)
+            //                currentFreq = Convert.ToInt64(txtFrequpMHz.EditValue);
+            //            List<long> freqs = null;
+            //            lock (this)
+            //            {
+            //                refreshQuery = cache.AsQueryable();
+            //                refreshQuery = refreshQuery.Where(p => p.TaskID == currentTask.Id);
+            //                freqs = refreshQuery.Select(p => p.FrequpHz).Distinct().OrderBy(p => p).ToList();
+            //                if (currentFreq != null)
+            //                    refreshQuery = refreshQuery.Where(p => p.FrequpHz == currentFreq.Value);
+
+            //                if (!btnIncludeInvalidate.Checked)
+            //                {
+            //                    refreshQuery = refreshQuery.Where(p => p.PosLon != 999);
+            //                }
+            //                updateItems = refreshQuery.Reverse().ToList();
+            //                cache.Clear();
+            //            }
+
+            //            var items = txtFrequpMHz.Properties.Items.Where(p => p.Value != null).Select(t => Convert.ToInt64(t.Value)).ToList();
+            //            foreach (var item in freqs)
+            //            {
+            //                if (!items.Contains(item))
+            //                {
+            //                    this.Invoke(new Action(() =>
+            //                    {
+            //                        this.txtFrequpMHz.Properties.Items.Add(new ImageComboBoxItem((item / 1e6).ToString("f3"), item));
+            //                    }));
+            //                }
+            //            }
+            //            if (txtTimeCho.Text == "自定义") continue;
+            //            if (!updateItems.Any()) continue;
+            //            var hours = Convert.ToInt32(txtTimeCho.EditValue);
+            //            var ds = this.gridHomePosRes.DataSource as List<PosResViewModel>;
+            //            ds.InsertRange(0, updateItems);
+            //            var max = ds.First().SigTime;
+            //            ds.RemoveAll(p => (max - p.SigTime).TotalHours > hours);
+            //            this.Invoke(new Action(() =>
+            //            {
+            //                mapControl1.DelPosItem<PosResViewModel>(p => (max - p.SigTime).TotalHours > hours);
+            //                mapControl1.AddPosItems(updateItems);
+            //                gridView2.RefreshData();
+            //            }));
+            //        }
+            //        catch (Exception ex)
+            //        {
+            //            IocContainer.Logger.Error(ex, "刷新定位点出错");
+            //        }
+            //        finally
+            //        {
+            //            Thread.Sleep(refreshPosTime);
+            //        }
+            //    }
+            //});
         }
 
         private async Task<PageData> LoadPageData(PageQueryDto arg)
@@ -242,6 +243,9 @@ namespace DW5S.App.UserControl
         }
         private async Task<PageData> LoadPageDataPos(PageQueryDto arg)
         {
+            listPos.Clear();
+            gridView2.RefreshData();
+            mapControl1.SetPosDataSource(new List<PosResViewModel>() );
             if (tsk == null) return null;
             var repsPos = IocContainer.UnitOfWork.OfLong<PosRes>();
             var queryable = repsPos.AsQueryable();
@@ -269,9 +273,10 @@ namespace DW5S.App.UserControl
             }
             queryable = queryable.OrderByDescending(p => p.SigTime).ThenBy(p => p.FrequpHz);
             var pageData = await repsPos.GetPageData(arg, queryable);
-            listPos.Clear();
+            
             listPos.AddRange(pageData.Data.To<List<PosResViewModel>>());
             gridView2.RefreshData();
+            mapControl1.SetPosDataSource(listPos);
             return pageData;
         }
         private void GridView2_ColumnFilterChanged(object sender, EventArgs e)
@@ -332,7 +337,6 @@ namespace DW5S.App.UserControl
         }
         private async void GridView1_FocusedRowObjectChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowObjectChangedEventArgs e)
         {
-            gridHomePosRes.DataSource = new List<PosResViewModel>();
             mapControl1.DelFixedImg("Sat");
             mapControl1.DelFixedImg("Tx");
             tsk = (e.Row as TaskViewModel);
@@ -458,37 +462,51 @@ namespace DW5S.App.UserControl
                 try
                 {
                     TaskViewModel addItem;
-                    TaskEditor frm = new TaskEditor();
-                    if (frm.ShowDialog() != DialogResult.OK) return;
-                    addItem = frm.info;
-                    var addItemSignal = frm.selectedItem;
-                    if (addItem.PosType == EnumPosType.X1D1CX)
+                    EditForms.TaskTemplate taskfrm = new EditForms.TaskTemplate();
+                    if (taskfrm.ShowDialog() != DialogResult.OK)
                     {
-                        addItem.Adja2Sat = null;
+                        return;
                     }
-                    var unitOfWork = IocContainer.UnitOfWork;
-                    var repsTask = unitOfWork.Of<TaskInfo>();
-                    var taskInfo = await repsTask.AddOrUpdateAsync(addItem.To<TaskInfo>());
-                    await unitOfWork.SaveAsync();
-                    addItem.Id = taskInfo.Id;
-                    List<TaskSig> sigList = new List<TaskSig>();
-                    foreach (var item in addItemSignal)
+                    if (taskfrm.SelectedTemplate == 0)
                     {
-                        TaskSig taskSig = new TaskSig
+                        TaskEditor frm = new TaskEditor();
+                        if (frm.ShowDialog() != DialogResult.OK) return;
+                        addItem = frm.info;
+                        var addItemSignal = frm.selectedItem;
+                        if (addItem.PosType == EnumPosType.X1D1CX)
                         {
-                            TaskInfoID = taskInfo.Id,
-                            SigInfoID = item.Id,
-                            FreqUpHz = item.FreqUpHz,
-                            FreqDownHz = item.FreqDownHz,
-                        };
-                        sigList.Add(taskSig);
+                            addItem.Adja2Sat = null;
+                        }
+                        var unitOfWork = IocContainer.UnitOfWork;
+                        var repsTask = unitOfWork.Of<TaskInfo>();
+                        var taskInfo = await repsTask.AddOrUpdateAsync(addItem.To<TaskInfo>());
+                        await unitOfWork.SaveAsync();
+                        addItem.Id = taskInfo.Id;
+                        List<TaskSig> sigList = new List<TaskSig>();
+                        foreach (var item in addItemSignal)
+                        {
+                            TaskSig taskSig = new TaskSig
+                            {
+                                TaskInfoID = taskInfo.Id,
+                                SigInfoID = item.Id,
+                                FreqUpHz = item.FreqUpHz,
+                                FreqDownHz = item.FreqDownHz,
+                            };
+                            sigList.Add(taskSig);
+                        }
+                        var repsTaskSig = unitOfWork.Of<TaskSig>();
+                        await repsTaskSig.AddOrUpdateAsync(sigList);
+                        await unitOfWork.SaveAsync();
+                        list.Insert(0, addItem);
+                        gridView1.RefreshData();
+                        gridView1.FocusedRowHandle = 0;
+
                     }
-                    var repsTaskSig = unitOfWork.Of<TaskSig>();
-                    await repsTaskSig.AddOrUpdateAsync(sigList);
-                    await unitOfWork.SaveAsync();
-                    list.Insert(0, addItem);
-                    gridView1.RefreshData();
-                    gridView1.FocusedRowHandle = 0;
+                    else
+                    {
+
+                    }
+
                 }
                 catch (Exception ex)
                 {
@@ -573,10 +591,11 @@ namespace DW5S.App.UserControl
                     if (!DxHelper.MsgBoxHelper.ShowConfirm($"删除任务[{tsk.TaskName}]?"))
                         return;
                     var unitOfWork = IocContainer.UnitOfWork;
-                    var repsTask = unitOfWork.Of<TaskInfo>();
-                    await repsTask.DeleteAsync(p => p.Id == tsk.Id);
                     var repsTaskSig = unitOfWork.Of<TaskSig>();
                     await repsTaskSig.DeleteAsync(p => p.TaskInfoID == tsk.Id);
+
+                    var repsTask = unitOfWork.Of<TaskInfo>();
+                    await repsTask.DeleteAsync(p => p.Id == tsk.Id);
                     await unitOfWork.SaveAsync();
                     gridView1.DeleteSelectedRows();
 

+ 7 - 1
DW5S.Controller/ResultController.cs

@@ -5,6 +5,7 @@ using DW5S.WebApi;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.EntityFrameworkCore;
 using Serilog;
+using System.Linq;
 
 namespace DW5S.Controllers
 {
@@ -75,7 +76,12 @@ namespace DW5S.Controllers
                     if (!posList.Contains(item))
                         posList.Add(item);
                 }
-                var res = posList.Select(p => new TaskFreqResDto() { FreqUpHz = p }).OrderBy(o => o.FreqUpHz).ToList();
+                var res = posList.Select(p => new TaskFreqResDto() { FreqUpHz = p }).ToList();
+                var res2 = (await unitOfWork.Of<TaskSig>().FindAsync(p => p.TaskInfoID == dto.TaskInfoID))
+                    .Select(p => new TaskFreqResDto() { FreqUpHz = p.FreqUpHz });
+
+                res.AddRange(res2);
+                res= res.DistinctBy(p=>p.FreqUpHz).OrderBy(p => p.FreqUpHz).ToList();
                 return Success(res);
             }
             catch (Exception ex)

+ 1 - 1
DW5S.ViewModel/PosResViewModel.cs

@@ -21,7 +21,7 @@ namespace DW5S.ViewModel
         public double FreqUpDis => FrequpHz / 1e6;
 
         [Display(Name = "任务编号",AutoGenerateField =false)]
-        public int TargetInfoID { get; set; }
+        public int? TargetInfoID { get; set; }
 
         [Display(Name = "检测方式")]
         [ToolTip]