gongqiuhong 1 year ago
parent
commit
00d5947c72

+ 35 - 19
XdCxRhDW.App/EditForms/TaskEditor.cs

@@ -4,6 +4,7 @@ using DevExpress.XtraBars.Customization;
 using DevExpress.XtraEditors;
 using DevExpress.XtraEditors.Controls;
 using DevExpress.XtraEditors.DXErrorProvider;
+using DevExpress.XtraPrinting.Native;
 using DPP_YH_Core.Extensions;
 using DxHelper;
 using ExtensionsDev;
@@ -30,7 +31,6 @@ namespace XdCxRhDW.App.EditForms
     public partial class TaskEditor : DevExpress.XtraEditors.XtraForm
     {
         public TaskInfo info;
-        public List<EnumDetectionWay> taskDetectionWayList;
         public TaskEditor()
         {
             InitializeComponent();
@@ -54,12 +54,11 @@ namespace XdCxRhDW.App.EditForms
         }
 
 
-        public TaskEditor(TaskInfo info,List<EnumDetectionWay> taskDetectionWayList)
+        public TaskEditor(TaskInfo info)
            : this()
         {
             this.Text = "编辑任务";
             this.info = info;
-            this.taskDetectionWayList = taskDetectionWayList;
         }
 
         private async void TaskEditor_Load(object sender, EventArgs e)
@@ -83,7 +82,20 @@ namespace XdCxRhDW.App.EditForms
                     this.txtPosType.SelectedIndex = (int)info.PosType;
                     this.txtTaskType.SelectedIndex = (int)info.TaskType;
                     this.txtSignalType.EditValue = info.SigType;
-                    this.txtDetectionWay.EditValue = string.Join(",", taskDetectionWayList);
+                    List<EnumDetectionWay> deWay = new List<EnumDetectionWay>();
+                    if (info.DetectionWay.Value.HasFlag(EnumDetectionWay.DAMA))
+                    {
+                        deWay.Add( EnumDetectionWay.DAMA);
+                    }
+                    if (info.DetectionWay.Value.HasFlag(EnumDetectionWay.IBS))
+                    {
+                        deWay.Add(EnumDetectionWay.IBS);
+                    }
+                    if (info.DetectionWay.Value.HasFlag(EnumDetectionWay.EnergyDetection))
+                    {
+                        deWay.Add(EnumDetectionWay.EnergyDetection);
+                    }
+                    this.txtDetectionWay.EditValue =string.Join(",", deWay);
                     this.txtDetectionWay.RefreshEditValue();
                     this.txtMainSat.EditValue = satMain;
                     this.txtAdja1Sat.EditValue = satAdja1;
@@ -236,17 +248,25 @@ namespace XdCxRhDW.App.EditForms
                 info.SigType = (EnumSigType)txtSignalType.EditValue;
                 if (info.SigType == EnumSigType.SX)
                 {
-                    taskDetectionWayList = new List<EnumDetectionWay>();
-                    var res = txtDetectionWay.EditValue.ToString().Split(new string[] { ","}, System.StringSplitOptions.RemoveEmptyEntries).ToList();
-                    foreach (var s in res)
+                    var res = txtDetectionWay.EditValue.ToString().Split(new string[] { "," }, System.StringSplitOptions.RemoveEmptyEntries).ToList();
+                    if (res.Count() == 2)
+                    {
+                        info.DetectionWay = (EnumDetectionWay)Enum.Parse(typeof(EnumDetectionWay), res[0])| (EnumDetectionWay)Enum.Parse(typeof(EnumDetectionWay), res[1]);
+                    }
+                   else if (res.Count() == 3)
+                    {
+                        info.DetectionWay = (EnumDetectionWay)Enum.Parse(typeof(EnumDetectionWay), res[0])| (EnumDetectionWay)Enum.Parse(typeof(EnumDetectionWay), res[1])| (EnumDetectionWay)Enum.Parse(typeof(EnumDetectionWay), res[2]);
+                    }
+                    else
                     {
-                        taskDetectionWayList.Add((EnumDetectionWay)Enum.Parse(typeof(EnumDetectionWay), s));
+                        info.DetectionWay = (EnumDetectionWay)Enum.Parse(typeof(EnumDetectionWay), res[0]);
                     }
                 }
                 else
                 {
-                    taskDetectionWayList = null;
+                    info.DetectionWay = EnumDetectionWay.EnergyDetection;
                 }
+                //string strResult = info.DetectionWay.ToString() + " " + ((int)info.DetectionWay);
                 info.TaskType = (EnumTaskType)txtTaskType.SelectedIndex;
                 if (info.TaskType == EnumTaskType.Real)
                 {
@@ -343,10 +363,15 @@ namespace XdCxRhDW.App.EditForms
 
         private void txtSignalType_SelectedIndexChanged(object sender, EventArgs e)
         {
-            if (txtSignalType.SelectedIndex == 0) return;//请选择项不处理
+            if (txtSignalType.SelectedIndex == 0)
+            {
+                itemDetectionWay.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
+                return;
+            }
             var selectedEnum = (EnumSigType)Enum.Parse(typeof(EnumSigType), txtSignalType.EditValue.ToString());
             if (selectedEnum == EnumSigType.SX)
             {
+                txtDetectionWay.Properties.Items.Clear();
                 txtDetectionWay.Properties.Items.AddEnum<EnumDetectionWay>();
                 itemDetectionWay.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
             }
@@ -354,14 +379,5 @@ namespace XdCxRhDW.App.EditForms
                 itemDetectionWay.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
             }
         }
-
-        private void txtDetectionWay_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
-        {
-            if (e.Value == null) return;
-            if (e.Value.ToString() == EnumDetectionWay.ISignal.ToString())
-            {
-                e.DisplayText = $"{(long)e.Value / 1e6}MHz";
-            }
-        }
     }
 }

+ 218 - 0
XdCxRhDW.App/EditForms/TaskHistoryTimeEditor.Designer.cs

@@ -0,0 +1,218 @@
+namespace XdCxRhDW.App.EditForms
+{
+    partial class TaskHistoryTimeEditor
+    {
+        /// <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()
+        {
+            this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
+            this.btnOk = new DevExpress.XtraEditors.SimpleButton();
+            this.btnCancel = new DevExpress.XtraEditors.SimpleButton();
+            this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
+            this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
+            this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.txtStartTime = new DevExpress.XtraEditors.DateEdit();
+            this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.txtEndTime = new DevExpress.XtraEditors.DateEdit();
+            this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
+            this.layoutControl1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtStartTime.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtStartTime.Properties.CalendarTimeProperties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtEndTime.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtEndTime.Properties.CalendarTimeProperties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // layoutControl1
+            // 
+            this.layoutControl1.Controls.Add(this.btnOk);
+            this.layoutControl1.Controls.Add(this.btnCancel);
+            this.layoutControl1.Controls.Add(this.txtStartTime);
+            this.layoutControl1.Controls.Add(this.txtEndTime);
+            this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.layoutControl1.Location = new System.Drawing.Point(0, 0);
+            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.TabIndex = 0;
+            this.layoutControl1.Text = "layoutControl1";
+            // 
+            // btnOk
+            // 
+            this.btnOk.Location = new System.Drawing.Point(131, 104);
+            this.btnOk.Name = "btnOk";
+            this.btnOk.Size = new System.Drawing.Size(105, 22);
+            this.btnOk.StyleController = this.layoutControl1;
+            this.btnOk.TabIndex = 8;
+            this.btnOk.Text = "确定";
+            this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
+            // 
+            // btnCancel
+            // 
+            this.btnCancel.Location = new System.Drawing.Point(22, 104);
+            this.btnCancel.Name = "btnCancel";
+            this.btnCancel.Size = new System.Drawing.Size(105, 22);
+            this.btnCancel.StyleController = this.layoutControl1;
+            this.btnCancel.TabIndex = 7;
+            this.btnCancel.Text = "取消";
+            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
+            // 
+            // Root
+            // 
+            this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
+            this.Root.GroupBordersVisible = false;
+            this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
+            this.emptySpaceItem1,
+            this.layoutControlItem4,
+            this.layoutControlItem5,
+            this.layoutControlItem2,
+            this.layoutControlItem1});
+            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.TextVisible = false;
+            // 
+            // emptySpaceItem1
+            // 
+            this.emptySpaceItem1.AllowHotTrack = false;
+            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 108);
+            this.emptySpaceItem1.Name = "emptySpaceItem1";
+            this.emptySpaceItem1.Size = new System.Drawing.Size(218, 12);
+            this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
+            // 
+            // layoutControlItem4
+            // 
+            this.layoutControlItem4.Control = this.btnCancel;
+            this.layoutControlItem4.Location = new System.Drawing.Point(0, 82);
+            this.layoutControlItem4.Name = "layoutControlItem4";
+            this.layoutControlItem4.Size = new System.Drawing.Size(109, 26);
+            this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem4.TextVisible = false;
+            // 
+            // layoutControlItem5
+            // 
+            this.layoutControlItem5.Control = this.btnOk;
+            this.layoutControlItem5.Location = new System.Drawing.Point(109, 82);
+            this.layoutControlItem5.Name = "layoutControlItem5";
+            this.layoutControlItem5.Size = new System.Drawing.Size(109, 26);
+            this.layoutControlItem5.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem5.TextVisible = false;
+            // 
+            // txtStartTime
+            // 
+            this.txtStartTime.EditValue = null;
+            this.txtStartTime.Location = new System.Drawing.Point(22, 39);
+            this.txtStartTime.Name = "txtStartTime";
+            this.txtStartTime.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            this.txtStartTime.Properties.CalendarTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            this.txtStartTime.Size = new System.Drawing.Size(214, 20);
+            this.txtStartTime.StyleController = this.layoutControl1;
+            this.txtStartTime.TabIndex = 9;
+            // 
+            // layoutControlItem2
+            // 
+            this.layoutControlItem2.Control = this.txtStartTime;
+            this.layoutControlItem2.Location = new System.Drawing.Point(0, 0);
+            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);
+            // 
+            // txtEndTime
+            // 
+            this.txtEndTime.EditValue = null;
+            this.txtEndTime.Location = new System.Drawing.Point(22, 80);
+            this.txtEndTime.Name = "txtEndTime";
+            this.txtEndTime.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            this.txtEndTime.Properties.CalendarTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            this.txtEndTime.Size = new System.Drawing.Size(214, 20);
+            this.txtEndTime.StyleController = this.layoutControl1;
+            this.txtEndTime.TabIndex = 10;
+            // 
+            // layoutControlItem1
+            // 
+            this.layoutControlItem1.Control = this.txtEndTime;
+            this.layoutControlItem1.Location = new System.Drawing.Point(0, 41);
+            this.layoutControlItem1.Name = "layoutControlItem1";
+            this.layoutControlItem1.Size = new System.Drawing.Size(218, 41);
+            this.layoutControlItem1.Text = "结束";
+            this.layoutControlItem1.TextLocation = DevExpress.Utils.Locations.Top;
+            this.layoutControlItem1.TextSize = new System.Drawing.Size(48, 14);
+            // 
+            // TaskHistoryTimeEditor
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(258, 160);
+            this.Controls.Add(this.layoutControl1);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
+            this.Name = "TaskHistoryTimeEditor";
+            this.Text = "历史任务时间段选择";
+            this.Load += new System.EventHandler(this.SatEditor_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
+            this.layoutControl1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtStartTime.Properties.CalendarTimeProperties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtStartTime.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtEndTime.Properties.CalendarTimeProperties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtEndTime.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private DevExpress.XtraLayout.LayoutControl layoutControl1;
+        private DevExpress.XtraLayout.LayoutControlGroup Root;
+        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1;
+        private DevExpress.XtraEditors.SimpleButton btnOk;
+        private DevExpress.XtraEditors.SimpleButton btnCancel;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5;
+        private DevExpress.XtraEditors.DateEdit txtStartTime;
+        private DevExpress.XtraEditors.DateEdit txtEndTime;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
+    }
+}

+ 47 - 0
XdCxRhDW.App/EditForms/TaskHistoryTimeEditor.cs

@@ -0,0 +1,47 @@
+using DevExpress.XtraEditors;
+using ExtensionsDev;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Data.Entity;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Documents;
+using System.Windows.Forms;
+using XdCxRhDW.Entity;
+using XdCxRhDW.Repostory;
+
+namespace XdCxRhDW.App.EditForms
+{
+    public partial class TaskHistoryTimeEditor : DevExpress.XtraEditors.XtraForm
+    {
+       public DateTime start = DateTime.MinValue;
+        public DateTime end = DateTime.MinValue;
+        public TaskHistoryTimeEditor()
+        {
+            InitializeComponent();
+            this.layoutControl1.UseDefault();
+            this.txtStartTime.UseDefault();
+            this.txtEndTime.UseDefault();
+            this.StartPosition = FormStartPosition.CenterParent;
+        }
+        private  void SatEditor_Load(object sender, EventArgs e)
+        {
+           txtStartTime.DateTime= DateTime.Now;
+        }
+
+        private void btnCancel_Click(object sender, EventArgs e)
+        {
+            this.DialogResult = DialogResult.Cancel;
+        }
+        private void btnOk_Click(object sender, EventArgs e)
+        {
+            start = txtStartTime.DateTime;
+            end = txtEndTime.DateTime;
+            this.DialogResult = DialogResult.OK;
+        }
+    }
+}

+ 120 - 0
XdCxRhDW.App/EditForms/TaskHistoryTimeEditor.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>

+ 11 - 36
XdCxRhDW.App/UserControl/CtrlHome.cs

@@ -726,7 +726,6 @@ namespace XdCxRhDW.App.UserControl
                     TaskEditor frm = new TaskEditor();
                     if (frm.ShowDialog() != DialogResult.OK) return;
                     var addItem = frm.info;
-                    var taskDetectionWayList = frm.taskDetectionWayList;
                     using (RHDWContext db = new RHDWContext())
                     {
                         if (addItem.PosType == EnumPosType.X1D1CX)
@@ -739,19 +738,7 @@ namespace XdCxRhDW.App.UserControl
                             addItem.Adja2Sat = null;
                         }
                         var taskInfo = db.TaskInfos.Add(addItem);
-                        await db.SaveChangesAsync();
-                        if (taskDetectionWayList != null)
-                        {
-                            List<TaskDetectionWay> resList = new List<TaskDetectionWay>();
-                            foreach (var item in taskDetectionWayList)
-                            {
-                                TaskDetectionWay res = new TaskDetectionWay();
-                                res.TaskId = taskInfo.ID;
-                                res.DetectionWay = item;
-                                resList.Add(res);
-                            }
-                            db.TaskDetectionWays.AddRange(resList);
-                        }
+                        
                         await db.SaveChangesAsync();
                     }
                     list.Insert(0, addItem);
@@ -771,12 +758,9 @@ namespace XdCxRhDW.App.UserControl
                     using (RHDWContext db = new RHDWContext())
                     {
                         var editItem = gridView1.GetFocusedRow() as TaskInfo;
-                        var taskDetectionWay = db.TaskDetectionWays.Where(w => w.TaskId == editItem.ID);
-                        var detectionWay = taskDetectionWay.Select(s=>s.DetectionWay).ToList();
-                        TaskEditor frm = new TaskEditor(editItem, detectionWay);
+                        TaskEditor frm = new TaskEditor(editItem);
                         if (frm.ShowDialog() != DialogResult.OK) return;
                         editItem = frm.info;
-                        detectionWay = frm.taskDetectionWayList;
                         if (await db.TaskInfos.AnyAsync(p => p.ID != editItem.ID && p.TaskName == editItem.TaskName))
                         {
                             DxHelper.MsgBoxHelper.ShowWarning("任务名称重复");
@@ -786,23 +770,7 @@ namespace XdCxRhDW.App.UserControl
                         find.TaskName = editItem.TaskName;
                         find.PosType = editItem.PosType;
                         find.SigType = editItem.SigType;
-                        if (taskDetectionWay != null)
-                            db.TaskDetectionWays.RemoveRange(taskDetectionWay);
-                        if (find.SigType == EnumSigType.SX )
-                        {
-                            if (detectionWay != null)
-                            {
-                                List<TaskDetectionWay> resList = new List<TaskDetectionWay>();
-                                foreach (var item in detectionWay)
-                                {
-                                    TaskDetectionWay res = new TaskDetectionWay();
-                                    res.TaskId = editItem.ID;
-                                    res.DetectionWay = item;
-                                    resList.Add(res);
-                                }
-                                db.TaskDetectionWays.AddRange(resList);
-                            }
-                        }
+                        find.DetectionWay = editItem.DetectionWay;
                         find.UpdateTime = DateTime.Now;
                         find.Freq = editItem.Freq;
                         find.MainSat = editItem.MainSat;
@@ -874,13 +842,20 @@ namespace XdCxRhDW.App.UserControl
                             DxHelper.MsgBoxHelper.ShowWarning($"请打开执行历史任务的服务");
                             return;
                         }
+                        TaskHistoryTimeEditor frm = new TaskHistoryTimeEditor();
+                        if (frm.ShowDialog() != DialogResult.OK) return;
+                        var startTime = frm.start;
+                        var endTime = frm.end;
                         HistoryTaskProcessingDto dto = new HistoryTaskProcessingDto();
                         dto.ID = tsk.ID;
+                        dto.StartTime=startTime;
+                        dto.EndTime = endTime;
                         dto.TaskName = tsk.TaskName;
                         dto.PosType = (EnumPosTypeDto)(int)tsk.PosType;
                         dto.SigType = (EnumSigTypeDto)(int)tsk.SigType;
+                        
                         dto.CapDir = tsk.CapDir;
-                        dto.DateDirFormat = "yyMMdd HH";
+                        dto.DateDirFormat = tsk.CapDirFormat;
                         var strs = tsk.HistoryFrequpMHz.Split(',');
                         var freqs = strs.Select(f => ((long)(Convert.ToDouble(f) * 1e6)));
                         dto.FreqsHz = freqs.ToList();

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

@@ -169,6 +169,12 @@
     <Compile Include="DxHelper\PopupHelper.cs" />
     <Compile Include="DxHelper\SvgHelper.cs" />
     <Compile Include="DxHelper\WaitHelper.cs" />
+    <Compile Include="EditForms\TaskHistoryTimeEditor.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="EditForms\TaskHistoryTimeEditor.Designer.cs">
+      <DependentUpon>TaskHistoryTimeEditor.cs</DependentUpon>
+    </Compile>
     <Compile Include="EditForms\EditorTar.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -382,6 +388,9 @@
     <EmbeddedResource Include="CorTools\XlCalculateForm.resx">
       <DependentUpon>XlCalculateForm.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="EditForms\TaskHistoryTimeEditor.resx">
+      <DependentUpon>TaskHistoryTimeEditor.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="EditForms\EditorTar.resx">
       <DependentUpon>EditorTar.cs</DependentUpon>
     </EmbeddedResource>

+ 0 - 1
XdCxRhDW.Entity/03.XdCxRhDW.Entity.csproj

@@ -55,7 +55,6 @@
     <Compile Include="SysSetings.cs" />
     <Compile Include="TargetInfo.cs" />
     <Compile Include="TaskInfo.cs" />
-    <Compile Include="TaskDetectionWay.cs" />
     <Compile Include="TxInfo.cs" />
     <Compile Include="XlInfo.cs" />
   </ItemGroup>

+ 8 - 7
XdCxRhDW.Entity/ModelEnum.cs

@@ -158,22 +158,23 @@ namespace XdCxRhDW.Entity
         SX,
     }
 
+    [Flags]
     public enum EnumDetectionWay
     {
         /// <summary>
-        /// D信号(脱密)
+        /// DAMA
         /// </summary>
-        [Display(Name = "D信号(脱密)")]
-        DSignal,
+        [Display(Name = "DAMA")]
+        DAMA=1,
         /// <summary>
-        /// I信号(脱密
+        /// IBS
         /// </summary>
-        [Display(Name = "I信号(脱密)")]
-        ISignal,
+        [Display(Name = "IBS")]
+        IBS=2,
         /// <summary>
         /// 能量检测
         /// </summary>
         [Display(Name = "能量检测")]
-        EnergyDetection,
+        EnergyDetection=4,
     }
 }

+ 0 - 21
XdCxRhDW.Entity/TaskDetectionWay.cs

@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace XdCxRhDW.Entity
-{
-    [Table("TaskDetectionWay")]
-    public class TaskDetectionWay : BaseEntity
-    {
-        public long TaskId { get; set; }
-
-        /// <summary>
-        /// 检测方式
-        /// </summary>
-        public EnumDetectionWay DetectionWay { get; set; }
-    }
-}

+ 7 - 1
XdCxRhDW.Entity/TaskInfo.cs

@@ -44,7 +44,13 @@ namespace XdCxRhDW.Entity
         [Display(Name = "上行频点")]
         public long Freq { get; set; }
 
-  
+
+
+        /// <summary>
+        /// 检测方式
+        /// </summary>
+        [Display(AutoGenerateField = false)]
+        public EnumDetectionWay? DetectionWay { get; set; }
 
         /// <summary>
         /// 历史任务采集文件的目录

+ 0 - 2
XdCxRhDW.Repostory/EFContext/RHDWContext.cs

@@ -48,8 +48,6 @@ namespace XdCxRhDW.Repostory
 
         public DbSet<TaskInfo> TaskInfos { set; get; }
 
-        public DbSet<TaskDetectionWay> TaskDetectionWays { set; get; }
-
         public DbSet<TxInfo> TxInfos { get; set; }
 
         public DbSet<SatInfo> SatInfos { get; set; }