gongqiuhong 1 year ago
parent
commit
9fc84ebd9f

+ 36 - 36
XdCxRhDW.App/EditForms/TaskEditor.Designer.cs

@@ -103,13 +103,13 @@
             this.layoutControl1.Name = "layoutControl1";
             this.layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new System.Drawing.Rectangle(784, 215, 650, 400);
             this.layoutControl1.Root = this.Root;
-            this.layoutControl1.Size = new System.Drawing.Size(495, 301);
+            this.layoutControl1.Size = new System.Drawing.Size(502, 301);
             this.layoutControl1.TabIndex = 0;
             this.layoutControl1.Text = "layoutControl1";
             // 
             // btnFreq
             // 
-            this.btnFreq.Location = new System.Drawing.Point(277, 260);
+            this.btnFreq.Location = new System.Drawing.Point(284, 260);
             this.btnFreq.Name = "btnFreq";
             this.btnFreq.Size = new System.Drawing.Size(96, 23);
             this.btnFreq.StyleController = this.layoutControl1;
@@ -119,7 +119,7 @@
             // 
             // btnSave
             // 
-            this.btnSave.Location = new System.Drawing.Point(387, 260);
+            this.btnSave.Location = new System.Drawing.Point(394, 260);
             this.btnSave.Name = "btnSave";
             this.btnSave.Size = new System.Drawing.Size(96, 23);
             this.btnSave.StyleController = this.layoutControl1;
@@ -132,7 +132,7 @@
             this.txtTaskName.Location = new System.Drawing.Point(12, 39);
             this.txtTaskName.Name = "txtTaskName";
             this.txtTaskName.Properties.AutoHeight = false;
-            this.txtTaskName.Size = new System.Drawing.Size(311, 20);
+            this.txtTaskName.Size = new System.Drawing.Size(246, 20);
             this.txtTaskName.StyleController = this.layoutControl1;
             this.txtTaskName.TabIndex = 4;
             // 
@@ -144,7 +144,7 @@
             this.txtPosType.Properties.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(244)))), ((int)(((byte)(244)))), ((int)(((byte)(244)))));
             this.txtPosType.Properties.Appearance.Options.UseBackColor = true;
             this.txtPosType.Properties.Columns = 3;
-            this.txtPosType.Size = new System.Drawing.Size(471, 79);
+            this.txtPosType.Size = new System.Drawing.Size(478, 79);
             this.txtPosType.StyleController = this.layoutControl1;
             this.txtPosType.TabIndex = 5;
             this.txtPosType.EditValueChanged += new System.EventHandler(this.txtPosType_EditValueChanged);
@@ -158,7 +158,7 @@
             this.txtMainSat.Properties.NullText = "";
             this.txtMainSat.Properties.PopupSizeable = false;
             this.txtMainSat.Properties.PopupView = this.searchLookUpEdit1View;
-            this.txtMainSat.Size = new System.Drawing.Size(154, 20);
+            this.txtMainSat.Size = new System.Drawing.Size(156, 20);
             this.txtMainSat.StyleController = this.layoutControl1;
             this.txtMainSat.TabIndex = 7;
             // 
@@ -171,14 +171,14 @@
             // 
             // txtAdja1Sat
             // 
-            this.txtAdja1Sat.Location = new System.Drawing.Point(170, 185);
+            this.txtAdja1Sat.Location = new System.Drawing.Point(172, 185);
             this.txtAdja1Sat.Name = "txtAdja1Sat";
             this.txtAdja1Sat.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
             this.txtAdja1Sat.Properties.NullText = "";
             this.txtAdja1Sat.Properties.PopupSizeable = false;
             this.txtAdja1Sat.Properties.PopupView = this.gridView1;
-            this.txtAdja1Sat.Size = new System.Drawing.Size(154, 20);
+            this.txtAdja1Sat.Size = new System.Drawing.Size(157, 20);
             this.txtAdja1Sat.StyleController = this.layoutControl1;
             this.txtAdja1Sat.TabIndex = 8;
             // 
@@ -191,14 +191,14 @@
             // 
             // txtAdja2Sat
             // 
-            this.txtAdja2Sat.Location = new System.Drawing.Point(328, 185);
+            this.txtAdja2Sat.Location = new System.Drawing.Point(333, 185);
             this.txtAdja2Sat.Name = "txtAdja2Sat";
             this.txtAdja2Sat.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
             this.txtAdja2Sat.Properties.NullText = "";
             this.txtAdja2Sat.Properties.PopupSizeable = false;
             this.txtAdja2Sat.Properties.PopupView = this.gridView2;
-            this.txtAdja2Sat.Size = new System.Drawing.Size(155, 20);
+            this.txtAdja2Sat.Size = new System.Drawing.Size(157, 20);
             this.txtAdja2Sat.StyleController = this.layoutControl1;
             this.txtAdja2Sat.TabIndex = 9;
             // 
@@ -212,13 +212,14 @@
             // txtTaskType
             // 
             this.txtTaskType.EditValue = 0;
-            this.txtTaskType.Location = new System.Drawing.Point(327, 37);
+            this.txtTaskType.Location = new System.Drawing.Point(262, 37);
             this.txtTaskType.Name = "txtTaskType";
             this.txtTaskType.Properties.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(244)))), ((int)(((byte)(244)))), ((int)(((byte)(244)))));
             this.txtTaskType.Properties.Appearance.Options.UseBackColor = true;
             this.txtTaskType.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
-            this.txtTaskType.Properties.Columns = 2;
-            this.txtTaskType.Size = new System.Drawing.Size(156, 27);
+            this.txtTaskType.Properties.ColumnIndent = 3;
+            this.txtTaskType.Properties.Columns = 3;
+            this.txtTaskType.Size = new System.Drawing.Size(228, 27);
             this.txtTaskType.StyleController = this.layoutControl1;
             this.txtTaskType.TabIndex = 5;
             this.txtTaskType.SelectedIndexChanged += new System.EventHandler(this.txtTaskType_SelectedIndexChanged);
@@ -228,17 +229,17 @@
             this.txtCapDir.Location = new System.Drawing.Point(12, 226);
             this.txtCapDir.Name = "txtCapDir";
             this.txtCapDir.Properties.AutoHeight = false;
-            this.txtCapDir.Size = new System.Drawing.Size(233, 20);
+            this.txtCapDir.Size = new System.Drawing.Size(237, 20);
             this.txtCapDir.StyleController = this.layoutControl1;
             this.txtCapDir.TabIndex = 4;
             // 
             // txtCapDirFormat
             // 
             this.txtCapDirFormat.EditValue = "yyyy_MM_dd_HH";
-            this.txtCapDirFormat.Location = new System.Drawing.Point(249, 226);
+            this.txtCapDirFormat.Location = new System.Drawing.Point(253, 226);
             this.txtCapDirFormat.Name = "txtCapDirFormat";
             this.txtCapDirFormat.Properties.AutoHeight = false;
-            this.txtCapDirFormat.Size = new System.Drawing.Size(234, 20);
+            this.txtCapDirFormat.Size = new System.Drawing.Size(237, 20);
             this.txtCapDirFormat.StyleController = this.layoutControl1;
             this.txtCapDirFormat.TabIndex = 13;
             this.txtCapDirFormat.ToolTip = "没有子目录则不填";
@@ -259,7 +260,7 @@
             this.layoutControlGroup1,
             this.layoutControlItem7});
             this.Root.Name = "Root";
-            this.Root.Size = new System.Drawing.Size(495, 301);
+            this.Root.Size = new System.Drawing.Size(502, 301);
             this.Root.TextVisible = false;
             // 
             // emptySpaceItem1
@@ -267,7 +268,7 @@
             this.emptySpaceItem1.AllowHotTrack = false;
             this.emptySpaceItem1.Location = new System.Drawing.Point(0, 238);
             this.emptySpaceItem1.Name = "emptySpaceItem1";
-            this.emptySpaceItem1.Size = new System.Drawing.Size(265, 43);
+            this.emptySpaceItem1.Size = new System.Drawing.Size(272, 43);
             this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
             // 
             // layoutControlItem2
@@ -277,7 +278,7 @@
             this.layoutControlItem2.MaxSize = new System.Drawing.Size(0, 100);
             this.layoutControlItem2.MinSize = new System.Drawing.Size(54, 100);
             this.layoutControlItem2.Name = "layoutControlItem2";
-            this.layoutControlItem2.Size = new System.Drawing.Size(475, 100);
+            this.layoutControlItem2.Size = new System.Drawing.Size(482, 100);
             this.layoutControlItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItem2.Text = "定位模式";
             this.layoutControlItem2.TextLocation = DevExpress.Utils.Locations.Top;
@@ -286,7 +287,7 @@
             // layoutControlItem3
             // 
             this.layoutControlItem3.Control = this.btnSave;
-            this.layoutControlItem3.Location = new System.Drawing.Point(375, 238);
+            this.layoutControlItem3.Location = new System.Drawing.Point(382, 238);
             this.layoutControlItem3.MaxSize = new System.Drawing.Size(100, 37);
             this.layoutControlItem3.MinSize = new System.Drawing.Size(100, 37);
             this.layoutControlItem3.Name = "layoutControlItem3";
@@ -301,7 +302,7 @@
             this.layoutControlItem4.Control = this.txtMainSat;
             this.layoutControlItem4.Location = new System.Drawing.Point(0, 156);
             this.layoutControlItem4.Name = "layoutControlItem4";
-            this.layoutControlItem4.Size = new System.Drawing.Size(158, 41);
+            this.layoutControlItem4.Size = new System.Drawing.Size(160, 41);
             this.layoutControlItem4.Text = "主星";
             this.layoutControlItem4.TextLocation = DevExpress.Utils.Locations.Top;
             this.layoutControlItem4.TextSize = new System.Drawing.Size(84, 14);
@@ -315,7 +316,7 @@
             this.itemCapDir.MaxSize = new System.Drawing.Size(0, 41);
             this.itemCapDir.MinSize = new System.Drawing.Size(118, 41);
             this.itemCapDir.Name = "itemCapDir";
-            this.itemCapDir.Size = new System.Drawing.Size(237, 41);
+            this.itemCapDir.Size = new System.Drawing.Size(241, 41);
             this.itemCapDir.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.itemCapDir.Text = "采集文件目录";
             this.itemCapDir.TextLocation = DevExpress.Utils.Locations.Top;
@@ -324,11 +325,11 @@
             // itemCapDirFormat
             // 
             this.itemCapDirFormat.Control = this.txtCapDirFormat;
-            this.itemCapDirFormat.Location = new System.Drawing.Point(237, 197);
+            this.itemCapDirFormat.Location = new System.Drawing.Point(241, 197);
             this.itemCapDirFormat.MaxSize = new System.Drawing.Size(0, 41);
             this.itemCapDirFormat.MinSize = new System.Drawing.Size(88, 41);
             this.itemCapDirFormat.Name = "itemCapDirFormat";
-            this.itemCapDirFormat.Size = new System.Drawing.Size(238, 41);
+            this.itemCapDirFormat.Size = new System.Drawing.Size(241, 41);
             this.itemCapDirFormat.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.itemCapDirFormat.Text = "子目录日期格式";
             this.itemCapDirFormat.TextLocation = DevExpress.Utils.Locations.Top;
@@ -337,9 +338,9 @@
             // layoutControlItemAdja1
             // 
             this.layoutControlItemAdja1.Control = this.txtAdja1Sat;
-            this.layoutControlItemAdja1.Location = new System.Drawing.Point(158, 156);
+            this.layoutControlItemAdja1.Location = new System.Drawing.Point(160, 156);
             this.layoutControlItemAdja1.Name = "layoutControlItemAdja1";
-            this.layoutControlItemAdja1.Size = new System.Drawing.Size(158, 41);
+            this.layoutControlItemAdja1.Size = new System.Drawing.Size(161, 41);
             this.layoutControlItemAdja1.Text = "邻星1";
             this.layoutControlItemAdja1.TextLocation = DevExpress.Utils.Locations.Top;
             this.layoutControlItemAdja1.TextSize = new System.Drawing.Size(84, 14);
@@ -348,9 +349,9 @@
             // layoutControlItemAdja2
             // 
             this.layoutControlItemAdja2.Control = this.txtAdja2Sat;
-            this.layoutControlItemAdja2.Location = new System.Drawing.Point(316, 156);
+            this.layoutControlItemAdja2.Location = new System.Drawing.Point(321, 156);
             this.layoutControlItemAdja2.Name = "layoutControlItemAdja2";
-            this.layoutControlItemAdja2.Size = new System.Drawing.Size(159, 41);
+            this.layoutControlItemAdja2.Size = new System.Drawing.Size(161, 41);
             this.layoutControlItemAdja2.Text = "邻星2";
             this.layoutControlItemAdja2.TextLocation = DevExpress.Utils.Locations.Top;
             this.layoutControlItemAdja2.TextSize = new System.Drawing.Size(84, 14);
@@ -364,7 +365,7 @@
             this.layoutControlItem5});
             this.layoutControlGroup1.Location = new System.Drawing.Point(0, 0);
             this.layoutControlGroup1.Name = "layoutControlGroup1";
-            this.layoutControlGroup1.Size = new System.Drawing.Size(475, 56);
+            this.layoutControlGroup1.Size = new System.Drawing.Size(482, 56);
             // 
             // layoutControlItem1
             // 
@@ -374,7 +375,7 @@
             this.layoutControlItem1.MinSize = new System.Drawing.Size(118, 56);
             this.layoutControlItem1.Name = "layoutControlItem1";
             this.layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 12, 7);
-            this.layoutControlItem1.Size = new System.Drawing.Size(315, 56);
+            this.layoutControlItem1.Size = new System.Drawing.Size(250, 56);
             this.layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItem1.Text = "任务名称";
             this.layoutControlItem1.TextLocation = DevExpress.Utils.Locations.Top;
@@ -385,12 +386,11 @@
             this.layoutControlItem5.Control = this.txtTaskType;
             this.layoutControlItem5.ControlAlignment = System.Drawing.ContentAlignment.TopLeft;
             this.layoutControlItem5.CustomizationFormText = "定位模式";
-            this.layoutControlItem5.Location = new System.Drawing.Point(315, 0);
-            this.layoutControlItem5.MaxSize = new System.Drawing.Size(160, 56);
-            this.layoutControlItem5.MinSize = new System.Drawing.Size(160, 56);
+            this.layoutControlItem5.Location = new System.Drawing.Point(250, 0);
+            this.layoutControlItem5.MinSize = new System.Drawing.Size(88, 37);
             this.layoutControlItem5.Name = "layoutControlItem5";
             this.layoutControlItem5.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 10, 2);
-            this.layoutControlItem5.Size = new System.Drawing.Size(160, 56);
+            this.layoutControlItem5.Size = new System.Drawing.Size(232, 56);
             this.layoutControlItem5.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItem5.Text = " ";
             this.layoutControlItem5.TextLocation = DevExpress.Utils.Locations.Top;
@@ -399,7 +399,7 @@
             // layoutControlItem7
             // 
             this.layoutControlItem7.Control = this.btnFreq;
-            this.layoutControlItem7.Location = new System.Drawing.Point(265, 238);
+            this.layoutControlItem7.Location = new System.Drawing.Point(272, 238);
             this.layoutControlItem7.MaxSize = new System.Drawing.Size(110, 37);
             this.layoutControlItem7.MinSize = new System.Drawing.Size(110, 37);
             this.layoutControlItem7.Name = "layoutControlItem7";
@@ -417,7 +417,7 @@
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(495, 301);
+            this.ClientSize = new System.Drawing.Size(502, 301);
             this.Controls.Add(this.layoutControl1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
             this.Name = "TaskEditor";

+ 18 - 11
XdCxRhDW.App/EditForms/TaskEditor.cs

@@ -32,7 +32,7 @@ namespace XdCxRhDW.App.EditForms
     public partial class TaskEditor : DevExpress.XtraEditors.XtraForm
     {
         public TaskInfo info;
-        public List<SigInfo> selectedItem=new List<SigInfo>();
+        public List<SigInfo> selectedItem = new List<SigInfo>();
         public TaskEditor()
         {
             InitializeComponent();
@@ -55,7 +55,7 @@ namespace XdCxRhDW.App.EditForms
             this.txtTaskType_SelectedIndexChanged(this, EventArgs.Empty);
         }
 
-        public TaskEditor(TaskInfo info,List<SigInfo> taskSigList)
+        public TaskEditor(TaskInfo info, List<SigInfo> taskSigList)
            : this()
         {
             this.Text = $"编辑任务[{info.TaskName}]";
@@ -103,7 +103,12 @@ namespace XdCxRhDW.App.EditForms
                     dxErrorProvider.SetError(txtTaskName, "请填写任务名");
                     return;
                 }
-               
+                if (!selectedItem.Any())
+                {
+                    DxHelper.MsgBoxHelper.ShowError("请选择信号");
+                    return;
+                }
+
                 if (this.Text == "添加任务")
                 {
                     using (RHDWContext db = new RHDWContext())
@@ -146,7 +151,7 @@ namespace XdCxRhDW.App.EditForms
                         dxErrorProvider.SetError(txtAdja1Sat, "请选择邻星");
                         return;
                     }
-                    if(txtMainSat.EditValue== txtAdja1Sat.EditValue)
+                    if (txtMainSat.EditValue == txtAdja1Sat.EditValue)
                     {
                         dxErrorProvider.SetError(txtAdja1Sat, "邻星不能和主星一致");
                         return;
@@ -186,7 +191,7 @@ namespace XdCxRhDW.App.EditForms
                     }
 
                 }
-                if (txtTaskType.SelectedIndex != 0)
+                if ((EnumTaskType)txtTaskType.EditValue == EnumTaskType.History)//是历史任务
                 {
                     if (string.IsNullOrWhiteSpace(txtCapDir.Text))
                     {
@@ -266,19 +271,21 @@ namespace XdCxRhDW.App.EditForms
 
         private void txtTaskType_SelectedIndexChanged(object sender, EventArgs e)
         {
-            if (txtTaskType.SelectedIndex == 0)
+            if ((EnumTaskType)txtTaskType.EditValue != EnumTaskType.History)
             {
-               
                 itemCapDir.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                 itemCapDirFormat.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
-                this.Height -= 55;
+                if (this.Height >= 438)
+                    this.Height -= 55;
             }
             else
             {
                 itemCapDir.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                 itemCapDirFormat.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                 //txtSignalType.Properties.Items.Remove(normal);//不要移除了
-                this.Height += 55;
+                var a = this.Height;
+                if (this.Height < 438)
+                    this.Height += 55;
             }
             this.layoutControl1.BestFit();
         }
@@ -286,7 +293,7 @@ namespace XdCxRhDW.App.EditForms
 
         private void btnFreq_Click(object sender, EventArgs e)
         {
-            
+
             if (this.Text.StartsWith("添加任务"))
             {
                 TaskEditorSignal frm = new TaskEditorSignal();
@@ -302,6 +309,6 @@ namespace XdCxRhDW.App.EditForms
                 selectedItem.Clear();
                 selectedItem = frm.listSigInfoSelected;
             }
-            }
+        }
     }
 }

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

@@ -235,7 +235,7 @@ namespace XdCxRhDW.App.UserControl
             {
                 this.txtFrequpMHz.Properties.Items.Clear();
                 this.txtFrequpMHz.Properties.Items.Add(new ImageComboBoxItem("全部", null));
-                var sigs = await db.SigInfos.ToListAsync();
+                var sigs = await db.TaskSigs.Where(w => w.TaskInfoID == tsk.ID).ToListAsync();
                 foreach (var item in sigs)
                 {
                     this.txtFrequpMHz.Properties.Items.Add(new ImageComboBoxItem((item.FreqUp / 1e6).ToString("f3"), item.FreqUp));

+ 4 - 1
XdCxRhDW.Entity/EntityEnum.cs

@@ -25,7 +25,10 @@ namespace XdCxRhDW.Entity
         Real,
 
         [Display(Name = "历史任务")]
-        History
+        History,
+
+        [Display(Name = "组合任务")]
+        Assembly
     }
     /// <summary>
     /// 任务定位类型