Pārlūkot izejas kodu

Merge branch 'master' of http://139.155.15.221:3000/zoulei/XdCxRhDW

wyq 1 gadu atpakaļ
vecāks
revīzija
dc5df0a44f

+ 250 - 0
XdCxRhDW.App/EditForms/SigDelayEditor.Designer.cs

@@ -0,0 +1,250 @@
+namespace XdCxRhDW.App.EditForms
+{
+    partial class SigDelayEditor
+    {
+        /// <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.components = new System.ComponentModel.Container();
+            DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions1 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject1 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject2 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject3 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject4 = new DevExpress.Utils.SerializableAppearanceObject();
+            this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
+            this.btnOk = new DevExpress.XtraEditors.SimpleButton();
+            this.btnCancel = new DevExpress.XtraEditors.SimpleButton();
+            this.txtDelay = new DevExpress.XtraEditors.ButtonEdit();
+            this.txtSat = new DevExpress.XtraEditors.SearchLookUpEdit();
+            this.searchLookUpEdit1View = new DevExpress.XtraGrid.Views.Grid.GridView();
+            this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
+            this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
+            this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.dxErrorProvider = new DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider(this.components);
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
+            this.layoutControl1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.txtDelay.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtSat.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit1View)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dxErrorProvider)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // layoutControl1
+            // 
+            this.layoutControl1.Controls.Add(this.btnOk);
+            this.layoutControl1.Controls.Add(this.btnCancel);
+            this.layoutControl1.Controls.Add(this.txtDelay);
+            this.layoutControl1.Controls.Add(this.txtSat);
+            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(317, 205);
+            this.layoutControl1.TabIndex = 0;
+            this.layoutControl1.Text = "layoutControl1";
+            // 
+            // btnOk
+            // 
+            this.btnOk.Location = new System.Drawing.Point(160, 130);
+            this.btnOk.Name = "btnOk";
+            this.btnOk.Size = new System.Drawing.Size(135, 22);
+            this.btnOk.StyleController = this.layoutControl1;
+            this.btnOk.TabIndex = 10;
+            this.btnOk.Text = "确定";
+            this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
+            // 
+            // btnCancel
+            // 
+            this.btnCancel.Location = new System.Drawing.Point(22, 130);
+            this.btnCancel.Name = "btnCancel";
+            this.btnCancel.Size = new System.Drawing.Size(134, 22);
+            this.btnCancel.StyleController = this.layoutControl1;
+            this.btnCancel.TabIndex = 9;
+            this.btnCancel.Text = "取消";
+            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
+            // 
+            // txtDelay
+            // 
+            this.txtDelay.Location = new System.Drawing.Point(22, 103);
+            this.txtDelay.Name = "txtDelay";
+            this.txtDelay.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.True;
+            this.txtDelay.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "us", -1, false, true, false, editorButtonImageOptions1, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject1, serializableAppearanceObject2, serializableAppearanceObject3, serializableAppearanceObject4, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            this.txtDelay.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
+            this.txtDelay.Properties.MaskSettings.Set("mask", "f3");
+            this.txtDelay.Size = new System.Drawing.Size(273, 23);
+            this.txtDelay.StyleController = this.layoutControl1;
+            this.txtDelay.TabIndex = 2;
+            // 
+            // txtSat
+            // 
+            this.txtSat.Location = new System.Drawing.Point(22, 49);
+            this.txtSat.MinimumSize = new System.Drawing.Size(0, 23);
+            this.txtSat.Name = "txtSat";
+            this.txtSat.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            this.txtSat.Properties.NullText = "";
+            this.txtSat.Properties.PopupView = this.searchLookUpEdit1View;
+            this.txtSat.Size = new System.Drawing.Size(273, 23);
+            this.txtSat.StyleController = this.layoutControl1;
+            this.txtSat.TabIndex = 0;
+            // 
+            // searchLookUpEdit1View
+            // 
+            this.searchLookUpEdit1View.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
+            this.searchLookUpEdit1View.Name = "searchLookUpEdit1View";
+            this.searchLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false;
+            this.searchLookUpEdit1View.OptionsView.ShowGroupPanel = false;
+            // 
+            // Root
+            // 
+            this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
+            this.Root.GroupBordersVisible = false;
+            this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
+            this.emptySpaceItem1,
+            this.layoutControlItem2,
+            this.layoutControlItem4,
+            this.layoutControlItem5,
+            this.layoutControlItem6});
+            this.Root.Name = "Root";
+            this.Root.Padding = new DevExpress.XtraLayout.Utils.Padding(20, 20, 20, 20);
+            this.Root.Size = new System.Drawing.Size(317, 205);
+            this.Root.TextVisible = false;
+            // 
+            // emptySpaceItem1
+            // 
+            this.emptySpaceItem1.AllowHotTrack = false;
+            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 134);
+            this.emptySpaceItem1.MinSize = new System.Drawing.Size(104, 24);
+            this.emptySpaceItem1.Name = "emptySpaceItem1";
+            this.emptySpaceItem1.Size = new System.Drawing.Size(277, 31);
+            this.emptySpaceItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
+            this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
+            // 
+            // layoutControlItem2
+            // 
+            this.layoutControlItem2.Control = this.txtSat;
+            this.layoutControlItem2.Location = new System.Drawing.Point(0, 0);
+            this.layoutControlItem2.MinSize = new System.Drawing.Size(50, 25);
+            this.layoutControlItem2.Name = "layoutControlItem2";
+            this.layoutControlItem2.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 12, 2);
+            this.layoutControlItem2.Size = new System.Drawing.Size(277, 54);
+            this.layoutControlItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
+            this.layoutControlItem2.Text = "卫星";
+            this.layoutControlItem2.TextLocation = DevExpress.Utils.Locations.Top;
+            this.layoutControlItem2.TextSize = new System.Drawing.Size(48, 14);
+            // 
+            // layoutControlItem4
+            // 
+            this.layoutControlItem4.Control = this.btnCancel;
+            this.layoutControlItem4.Location = new System.Drawing.Point(0, 108);
+            this.layoutControlItem4.Name = "layoutControlItem4";
+            this.layoutControlItem4.Size = new System.Drawing.Size(138, 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(138, 108);
+            this.layoutControlItem5.Name = "layoutControlItem5";
+            this.layoutControlItem5.Size = new System.Drawing.Size(139, 26);
+            this.layoutControlItem5.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem5.TextVisible = false;
+            // 
+            // layoutControlItem6
+            // 
+            this.layoutControlItem6.Control = this.txtDelay;
+            this.layoutControlItem6.ControlAlignment = System.Drawing.ContentAlignment.TopLeft;
+            this.layoutControlItem6.CustomizationFormText = "轨道经度";
+            this.layoutControlItem6.Location = new System.Drawing.Point(0, 54);
+            this.layoutControlItem6.MinSize = new System.Drawing.Size(64, 54);
+            this.layoutControlItem6.Name = "layoutControlItem6";
+            this.layoutControlItem6.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 12, 2);
+            this.layoutControlItem6.Size = new System.Drawing.Size(277, 54);
+            this.layoutControlItem6.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
+            this.layoutControlItem6.Text = "转发延迟";
+            this.layoutControlItem6.TextLocation = DevExpress.Utils.Locations.Top;
+            this.layoutControlItem6.TextSize = new System.Drawing.Size(48, 14);
+            // 
+            // dxErrorProvider
+            // 
+            this.dxErrorProvider.ContainerControl = this;
+            // 
+            // SigDelayEditor
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(317, 205);
+            this.Controls.Add(this.layoutControl1);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
+            this.Name = "SigDelayEditor";
+            this.Text = "TaskEditor";
+            this.Load += new System.EventHandler(this.SatEditor_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
+            this.layoutControl1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.txtDelay.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtSat.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit1View)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dxErrorProvider)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private DevExpress.XtraLayout.LayoutControl layoutControl1;
+        private DevExpress.XtraLayout.LayoutControlGroup Root;
+        private DevExpress.XtraEditors.SimpleButton btnOk;
+        private DevExpress.XtraEditors.SimpleButton btnCancel;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5;
+        private DevExpress.XtraEditors.ButtonEdit txtDelay;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem6;
+        private DevExpress.XtraGrid.GridControl gridControl1;
+        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1;
+        private DevExpress.XtraEditors.SearchLookUpEdit txtSat;
+        private DevExpress.XtraGrid.Views.Grid.GridView searchLookUpEdit1View;
+        private DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider dxErrorProvider;
+    }
+}

+ 100 - 0
XdCxRhDW.App/EditForms/SigDelayEditor.cs

@@ -0,0 +1,100 @@
+using DevExpress.Data.Browsing;
+using DevExpress.Utils.Gesture;
+using DevExpress.XtraEditors;
+using DevExpress.XtraTreeList;
+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.Runtime.Remoting.Metadata.W3cXsd2001;
+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 SigDelayEditor : DevExpress.XtraEditors.XtraForm
+    {
+        public SigDelay info;
+        public int sigId;
+        public SigDelayEditor(int sigId)
+        {
+            InitializeComponent();
+            this.layoutControl1.UseDefault();
+            this.Text = "添加转发延迟";
+            info = new SigDelay();
+            this.StartPosition = FormStartPosition.CenterParent;
+            this.sigId = sigId;
+        }
+        public SigDelayEditor(SigDelay info, int sigId)
+            : this(sigId)
+        {
+            this.Text = "编辑转发延迟";
+            this.info = info;
+            this.sigId = sigId;
+        }
+        private async void SatEditor_Load(object sender, EventArgs e)
+        {
+            using (RHDWContext db = new RHDWContext())
+            {
+                var sats = await db.SatInfos.ToListAsync();
+                this.txtSat.UseDefault().SetData(sats, nameof(SatInfo.Sat)).UseDoubleClickToSelectAll();
+                if (this.Text == "编辑转发延迟" && info != null)
+                {
+                    this.txtSat.EditValue = sats.FirstOrDefault(f=>f.SatCode== info.SatInfoSatCode);
+                    this.txtDelay.EditValue = info.Delay;
+                }
+            }
+        }
+
+        private void btnCancel_Click(object sender, EventArgs e)
+        {
+            this.DialogResult = DialogResult.Cancel;
+        }
+        private async void btnOk_Click(object sender, EventArgs e)
+        {
+            try
+            {
+                if (txtSat.EditValue == null)
+                {
+                    dxErrorProvider.SetError(txtSat, "请选择卫星");
+                    return;
+                }
+                if (txtDelay.EditValue == null)
+                {
+                    dxErrorProvider.SetError(txtDelay, "请输入转发延迟");
+                    return;
+                }
+                var satInfo = (SatInfo)txtSat.EditValue;
+                using (RHDWContext db = new RHDWContext())
+                {
+                    var list = await db.SigDelays.Where(w => w.SigInfoId == sigId).ToListAsync();
+                    if (list.Where(w => w.ID != info.ID).Any(a => a.SatInfoSatCode == satInfo.SatCode))
+                    {
+                        DxHelper.MsgBoxHelper.ShowInfo("已添加该卫星");
+                        return;
+                    }
+                }
+                info.SigInfoId = sigId;
+                info.SatInfoSatCode = satInfo.SatCode;
+                info.Sat = $"[{satInfo.SatLon}°]{satInfo.SatName}({satInfo.SatCode})"; 
+                info.Delay = Convert.ToDouble(txtDelay.EditValue);
+              
+               
+                this.DialogResult = DialogResult.OK;
+            }
+            catch (Exception ex)
+            {
+                Serilog.Log.Error(ex, "编辑转发延迟出错");
+                DxHelper.MsgBoxHelper.ShowError("编辑转发延迟出错");
+            }
+        }
+    }
+}

+ 123 - 0
XdCxRhDW.App/EditForms/SigDelayEditor.resx

@@ -0,0 +1,123 @@
+<?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>
+  <metadata name="dxErrorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+</root>

+ 52 - 233
XdCxRhDW.App/EditForms/SigEditor.Designer.cs

@@ -28,6 +28,7 @@
         /// </summary>
         private void InitializeComponent()
         {
+            this.components = new System.ComponentModel.Container();
             DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions1 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject1 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject2 = new DevExpress.Utils.SerializableAppearanceObject();
@@ -43,77 +44,45 @@
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject10 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject11 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject12 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions5 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject17 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject18 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject19 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject20 = new DevExpress.Utils.SerializableAppearanceObject();
             this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
+            this.txtSigType = new DevExpress.XtraEditors.CheckedComboBoxEdit();
             this.btnOk = new DevExpress.XtraEditors.SimpleButton();
             this.btnCancel = new DevExpress.XtraEditors.SimpleButton();
             this.txtSnr = new DevExpress.XtraEditors.ButtonEdit();
-            this.txtSat = new DevExpress.XtraEditors.SearchLookUpEdit();
-            this.searchLookUpEdit1View = new DevExpress.XtraGrid.Views.Grid.GridView();
             this.txtFreqDown = new DevExpress.XtraEditors.ButtonEdit();
+            this.txtFreqUp = new DevExpress.XtraEditors.ButtonEdit();
             this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
             this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
-            this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem();
-            this.txtFreqUp = new DevExpress.XtraEditors.ButtonEdit();
-            this.txtSigType = new DevExpress.XtraEditors.CheckedComboBoxEdit();
             this.layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem();
-            this.gridSigDelay = new DevExpress.XtraGrid.GridControl();
-            this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
-            this.layoutControlItem8 = new DevExpress.XtraLayout.LayoutControlItem();
-            this.txtDelay = new DevExpress.XtraEditors.ButtonEdit();
-            this.layoutControlItem9 = new DevExpress.XtraLayout.LayoutControlItem();
-            this.btnAddDelay = new DevExpress.XtraEditors.SimpleButton();
-            this.layoutControlItem10 = new DevExpress.XtraLayout.LayoutControlItem();
-            this.layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup();
-            this.btnDel = new DevExpress.XtraEditors.SimpleButton();
-            this.layoutControlItem11 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.dxErrorProvider = new DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider(this.components);
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
             this.layoutControl1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.txtSigType.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.txtSnr.Properties)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtSat.Properties)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit1View)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.txtFreqDown.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtFreqUp.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtFreqUp.Properties)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtSigType.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.gridSigDelay)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtDelay.Properties)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem11)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dxErrorProvider)).BeginInit();
             this.SuspendLayout();
             // 
             // layoutControl1
             // 
-            this.layoutControl1.Controls.Add(this.btnDel);
-            this.layoutControl1.Controls.Add(this.btnAddDelay);
-            this.layoutControl1.Controls.Add(this.txtDelay);
-            this.layoutControl1.Controls.Add(this.gridSigDelay);
             this.layoutControl1.Controls.Add(this.txtSigType);
             this.layoutControl1.Controls.Add(this.btnOk);
             this.layoutControl1.Controls.Add(this.btnCancel);
             this.layoutControl1.Controls.Add(this.txtSnr);
-            this.layoutControl1.Controls.Add(this.txtSat);
             this.layoutControl1.Controls.Add(this.txtFreqDown);
             this.layoutControl1.Controls.Add(this.txtFreqUp);
             this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -121,13 +90,23 @@
             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(317, 537);
+            this.layoutControl1.Size = new System.Drawing.Size(317, 292);
             this.layoutControl1.TabIndex = 0;
             this.layoutControl1.Text = "layoutControl1";
             // 
+            // txtSigType
+            // 
+            this.txtSigType.Location = new System.Drawing.Point(22, 157);
+            this.txtSigType.Name = "txtSigType";
+            this.txtSigType.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            this.txtSigType.Size = new System.Drawing.Size(273, 20);
+            this.txtSigType.StyleController = this.layoutControl1;
+            this.txtSigType.TabIndex = 3;
+            // 
             // btnOk
             // 
-            this.btnOk.Location = new System.Drawing.Point(160, 474);
+            this.btnOk.Location = new System.Drawing.Point(160, 235);
             this.btnOk.Name = "btnOk";
             this.btnOk.Size = new System.Drawing.Size(135, 22);
             this.btnOk.StyleController = this.layoutControl1;
@@ -137,7 +116,7 @@
             // 
             // btnCancel
             // 
-            this.btnCancel.Location = new System.Drawing.Point(22, 474);
+            this.btnCancel.Location = new System.Drawing.Point(22, 235);
             this.btnCancel.Name = "btnCancel";
             this.btnCancel.Size = new System.Drawing.Size(134, 22);
             this.btnCancel.StyleController = this.layoutControl1;
@@ -152,28 +131,12 @@
             this.txtSnr.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.True;
             this.txtSnr.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "dB", -1, false, true, false, editorButtonImageOptions1, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject1, serializableAppearanceObject2, serializableAppearanceObject3, serializableAppearanceObject4, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            this.txtSnr.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
+            this.txtSnr.Properties.MaskSettings.Set("mask", "f3");
             this.txtSnr.Size = new System.Drawing.Size(273, 23);
             this.txtSnr.StyleController = this.layoutControl1;
             this.txtSnr.TabIndex = 4;
             // 
-            // txtSat
-            // 
-            this.txtSat.Location = new System.Drawing.Point(27, 288);
-            this.txtSat.Name = "txtSat";
-            this.txtSat.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
-            this.txtSat.Properties.PopupView = this.searchLookUpEdit1View;
-            this.txtSat.Size = new System.Drawing.Size(263, 20);
-            this.txtSat.StyleController = this.layoutControl1;
-            this.txtSat.TabIndex = 5;
-            // 
-            // searchLookUpEdit1View
-            // 
-            this.searchLookUpEdit1View.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
-            this.searchLookUpEdit1View.Name = "searchLookUpEdit1View";
-            this.searchLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false;
-            this.searchLookUpEdit1View.OptionsView.ShowGroupPanel = false;
-            // 
             // txtFreqDown
             // 
             this.txtFreqDown.Location = new System.Drawing.Point(22, 103);
@@ -181,10 +144,25 @@
             this.txtFreqDown.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.True;
             this.txtFreqDown.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "MHz", -1, false, true, false, editorButtonImageOptions2, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject5, serializableAppearanceObject6, serializableAppearanceObject7, serializableAppearanceObject8, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            this.txtFreqDown.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
+            this.txtFreqDown.Properties.MaskSettings.Set("mask", "f3");
             this.txtFreqDown.Size = new System.Drawing.Size(273, 23);
             this.txtFreqDown.StyleController = this.layoutControl1;
             this.txtFreqDown.TabIndex = 2;
             // 
+            // txtFreqUp
+            // 
+            this.txtFreqUp.Location = new System.Drawing.Point(22, 49);
+            this.txtFreqUp.MinimumSize = new System.Drawing.Size(0, 23);
+            this.txtFreqUp.Name = "txtFreqUp";
+            this.txtFreqUp.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "MHz", -1, false, true, false, editorButtonImageOptions3, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject9, serializableAppearanceObject10, serializableAppearanceObject11, serializableAppearanceObject12, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            this.txtFreqUp.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
+            this.txtFreqUp.Properties.MaskSettings.Set("mask", "f3");
+            this.txtFreqUp.Size = new System.Drawing.Size(273, 23);
+            this.txtFreqUp.StyleController = this.layoutControl1;
+            this.txtFreqUp.TabIndex = 0;
+            // 
             // Root
             // 
             this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
@@ -196,34 +174,20 @@
             this.layoutControlItem4,
             this.layoutControlItem5,
             this.layoutControlItem6,
-            this.layoutControlItem7,
-            this.layoutControlGroup1});
+            this.layoutControlItem7});
             this.Root.Name = "Root";
             this.Root.Padding = new DevExpress.XtraLayout.Utils.Padding(20, 20, 20, 20);
-            this.Root.Size = new System.Drawing.Size(317, 537);
+            this.Root.Size = new System.Drawing.Size(317, 292);
             this.Root.TextVisible = false;
             // 
             // emptySpaceItem1
             // 
             this.emptySpaceItem1.AllowHotTrack = false;
-            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 478);
+            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 239);
             this.emptySpaceItem1.Name = "emptySpaceItem1";
-            this.emptySpaceItem1.Size = new System.Drawing.Size(277, 19);
+            this.emptySpaceItem1.Size = new System.Drawing.Size(277, 13);
             this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
             // 
-            // layoutControlItem1
-            // 
-            this.layoutControlItem1.Control = this.txtSat;
-            this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
-            this.layoutControlItem1.MaxSize = new System.Drawing.Size(0, 54);
-            this.layoutControlItem1.MinSize = new System.Drawing.Size(54, 43);
-            this.layoutControlItem1.Name = "layoutControlItem1";
-            this.layoutControlItem1.Size = new System.Drawing.Size(267, 43);
-            this.layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
-            this.layoutControlItem1.Text = "卫星";
-            this.layoutControlItem1.TextLocation = DevExpress.Utils.Locations.Top;
-            this.layoutControlItem1.TextSize = new System.Drawing.Size(48, 14);
-            // 
             // layoutControlItem2
             // 
             this.layoutControlItem2.Control = this.txtFreqUp;
@@ -253,7 +217,7 @@
             // layoutControlItem4
             // 
             this.layoutControlItem4.Control = this.btnCancel;
-            this.layoutControlItem4.Location = new System.Drawing.Point(0, 452);
+            this.layoutControlItem4.Location = new System.Drawing.Point(0, 213);
             this.layoutControlItem4.Name = "layoutControlItem4";
             this.layoutControlItem4.Size = new System.Drawing.Size(138, 26);
             this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0);
@@ -262,7 +226,7 @@
             // layoutControlItem5
             // 
             this.layoutControlItem5.Control = this.btnOk;
-            this.layoutControlItem5.Location = new System.Drawing.Point(138, 452);
+            this.layoutControlItem5.Location = new System.Drawing.Point(138, 213);
             this.layoutControlItem5.Name = "layoutControlItem5";
             this.layoutControlItem5.Size = new System.Drawing.Size(139, 26);
             this.layoutControlItem5.TextSize = new System.Drawing.Size(0, 0);
@@ -283,27 +247,6 @@
             this.layoutControlItem6.TextLocation = DevExpress.Utils.Locations.Top;
             this.layoutControlItem6.TextSize = new System.Drawing.Size(48, 14);
             // 
-            // txtFreqUp
-            // 
-            this.txtFreqUp.Location = new System.Drawing.Point(22, 49);
-            this.txtFreqUp.MinimumSize = new System.Drawing.Size(0, 23);
-            this.txtFreqUp.Name = "txtFreqUp";
-            this.txtFreqUp.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "MHz", -1, false, true, false, editorButtonImageOptions3, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject9, serializableAppearanceObject10, serializableAppearanceObject11, serializableAppearanceObject12, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
-            this.txtFreqUp.Size = new System.Drawing.Size(273, 23);
-            this.txtFreqUp.StyleController = this.layoutControl1;
-            this.txtFreqUp.TabIndex = 0;
-            // 
-            // txtSigType
-            // 
-            this.txtSigType.Location = new System.Drawing.Point(22, 157);
-            this.txtSigType.Name = "txtSigType";
-            this.txtSigType.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
-            this.txtSigType.Size = new System.Drawing.Size(273, 20);
-            this.txtSigType.StyleController = this.layoutControl1;
-            this.txtSigType.TabIndex = 3;
-            // 
             // layoutControlItem7
             // 
             this.layoutControlItem7.Control = this.txtSigType;
@@ -317,118 +260,15 @@
             this.layoutControlItem7.TextLocation = DevExpress.Utils.Locations.Top;
             this.layoutControlItem7.TextSize = new System.Drawing.Size(48, 14);
             // 
-            // gridSigDelay
-            // 
-            this.gridSigDelay.Location = new System.Drawing.Point(27, 359);
-            this.gridSigDelay.MainView = this.gridView1;
-            this.gridSigDelay.Name = "gridSigDelay";
-            this.gridSigDelay.Size = new System.Drawing.Size(263, 106);
-            this.gridSigDelay.TabIndex = 8;
-            this.gridSigDelay.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
-            this.gridView1});
-            // 
-            // gridView1
-            // 
-            this.gridView1.GridControl = this.gridSigDelay;
-            this.gridView1.Name = "gridView1";
-            // 
-            // layoutControlItem8
-            // 
-            this.layoutControlItem8.Control = this.gridSigDelay;
-            this.layoutControlItem8.Location = new System.Drawing.Point(0, 88);
-            this.layoutControlItem8.Name = "layoutControlItem8";
-            this.layoutControlItem8.Size = new System.Drawing.Size(267, 110);
-            this.layoutControlItem8.TextSize = new System.Drawing.Size(0, 0);
-            this.layoutControlItem8.TextVisible = false;
-            // 
-            // txtDelay
-            // 
-            this.txtDelay.Location = new System.Drawing.Point(27, 331);
-            this.txtDelay.Name = "txtDelay";
-            this.txtDelay.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "us", -1, false, true, false, editorButtonImageOptions5, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject17, serializableAppearanceObject18, serializableAppearanceObject19, serializableAppearanceObject20, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
-            this.txtDelay.Size = new System.Drawing.Size(186, 23);
-            this.txtDelay.StyleController = this.layoutControl1;
-            this.txtDelay.TabIndex = 6;
-            // 
-            // layoutControlItem9
-            // 
-            this.layoutControlItem9.Control = this.txtDelay;
-            this.layoutControlItem9.Location = new System.Drawing.Point(0, 43);
-            this.layoutControlItem9.MinSize = new System.Drawing.Size(109, 41);
-            this.layoutControlItem9.Name = "layoutControlItem9";
-            this.layoutControlItem9.Size = new System.Drawing.Size(190, 45);
-            this.layoutControlItem9.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
-            this.layoutControlItem9.Text = "转发延迟";
-            this.layoutControlItem9.TextLocation = DevExpress.Utils.Locations.Top;
-            this.layoutControlItem9.TextSize = new System.Drawing.Size(48, 14);
-            // 
-            // btnAddDelay
-            // 
-            this.btnAddDelay.Location = new System.Drawing.Point(217, 332);
-            this.btnAddDelay.MinimumSize = new System.Drawing.Size(0, 23);
-            this.btnAddDelay.Name = "btnAddDelay";
-            this.btnAddDelay.Size = new System.Drawing.Size(35, 23);
-            this.btnAddDelay.StyleController = this.layoutControl1;
-            this.btnAddDelay.TabIndex = 7;
-            this.btnAddDelay.Text = "添加";
-            this.btnAddDelay.Click += new System.EventHandler(this.btnAddDelay_Click);
-            // 
-            // layoutControlItem10
-            // 
-            this.layoutControlItem10.Control = this.btnAddDelay;
-            this.layoutControlItem10.Location = new System.Drawing.Point(190, 43);
-            this.layoutControlItem10.Name = "layoutControlItem10";
-            this.layoutControlItem10.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 20, 2);
-            this.layoutControlItem10.Size = new System.Drawing.Size(39, 45);
-            this.layoutControlItem10.Text = "  ";
-            this.layoutControlItem10.TextLocation = DevExpress.Utils.Locations.Top;
-            this.layoutControlItem10.TextSize = new System.Drawing.Size(0, 0);
-            this.layoutControlItem10.TextVisible = false;
-            // 
-            // layoutControlGroup1
-            // 
-            this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
-            this.layoutControlItem8,
-            this.layoutControlItem9,
-            this.layoutControlItem10,
-            this.layoutControlItem1,
-            this.layoutControlItem11});
-            this.layoutControlGroup1.Location = new System.Drawing.Point(0, 213);
-            this.layoutControlGroup1.Name = "layoutControlGroup1";
-            this.layoutControlGroup1.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 2, 2);
-            this.layoutControlGroup1.Size = new System.Drawing.Size(277, 239);
-            this.layoutControlGroup1.Spacing = new DevExpress.XtraLayout.Utils.Padding(2, 2, 12, 2);
-            this.layoutControlGroup1.Text = "卫星转发延迟";
-            // 
-            // btnDel
-            // 
-            this.btnDel.Location = new System.Drawing.Point(256, 332);
-            this.btnDel.MinimumSize = new System.Drawing.Size(0, 23);
-            this.btnDel.Name = "btnDel";
-            this.btnDel.Size = new System.Drawing.Size(34, 23);
-            this.btnDel.StyleController = this.layoutControl1;
-            this.btnDel.TabIndex = 11;
-            this.btnDel.Text = "删除";
-            this.btnDel.Click += new System.EventHandler(this.btnDel_Click);
-            // 
-            // layoutControlItem11
-            // 
-            this.layoutControlItem11.Control = this.btnDel;
-            this.layoutControlItem11.Location = new System.Drawing.Point(229, 43);
-            this.layoutControlItem11.MinSize = new System.Drawing.Size(35, 45);
-            this.layoutControlItem11.Name = "layoutControlItem11";
-            this.layoutControlItem11.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 20, 2);
-            this.layoutControlItem11.Size = new System.Drawing.Size(38, 45);
-            this.layoutControlItem11.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
-            this.layoutControlItem11.TextSize = new System.Drawing.Size(0, 0);
-            this.layoutControlItem11.TextVisible = false;
+            // dxErrorProvider
+            // 
+            this.dxErrorProvider.ContainerControl = this;
             // 
             // SigEditor
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(317, 537);
+            this.ClientSize = new System.Drawing.Size(317, 292);
             this.Controls.Add(this.layoutControl1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
             this.Name = "SigEditor";
@@ -436,29 +276,19 @@
             this.Load += new System.EventHandler(this.SatEditor_Load);
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
             this.layoutControl1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.txtSigType.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.txtSnr.Properties)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtSat.Properties)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit1View)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.txtFreqDown.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtFreqUp.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtFreqUp.Properties)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtSigType.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.gridSigDelay)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtDelay.Properties)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem11)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dxErrorProvider)).EndInit();
             this.ResumeLayout(false);
 
         }
@@ -468,9 +298,6 @@
         private DevExpress.XtraLayout.LayoutControl layoutControl1;
         private DevExpress.XtraLayout.LayoutControlGroup Root;
         private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1;
-        private DevExpress.XtraEditors.SearchLookUpEdit txtSat;
-        private DevExpress.XtraGrid.Views.Grid.GridView searchLookUpEdit1View;
-        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
         private DevExpress.XtraEditors.SimpleButton btnOk;
         private DevExpress.XtraEditors.SimpleButton btnCancel;
         private DevExpress.XtraEditors.ButtonEdit txtSnr;
@@ -483,15 +310,7 @@
         private DevExpress.XtraEditors.ButtonEdit txtFreqUp;
         private DevExpress.XtraEditors.CheckedComboBoxEdit txtSigType;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem7;
-        private DevExpress.XtraGrid.GridControl gridSigDelay;
-        private DevExpress.XtraGrid.Views.Grid.GridView gridView1;
-        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem8;
-        private DevExpress.XtraEditors.SimpleButton btnAddDelay;
-        private DevExpress.XtraEditors.ButtonEdit txtDelay;
-        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem9;
-        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem10;
-        private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup1;
-        private DevExpress.XtraEditors.SimpleButton btnDel;
-        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem11;
+        private DevExpress.XtraGrid.GridControl gridControl1;
+        private DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider dxErrorProvider;
     }
 }

+ 52 - 58
XdCxRhDW.App/EditForms/SigEditor.cs

@@ -20,7 +20,6 @@ namespace XdCxRhDW.App.EditForms
     public partial class SigEditor : DevExpress.XtraEditors.XtraForm
     {
         public SigInfo info;
-        readonly List<SigDelay> list = new List<SigDelay>();
         public SigEditor()
         {
             InitializeComponent();
@@ -35,41 +34,31 @@ namespace XdCxRhDW.App.EditForms
             this.Text = "编辑信号";
             this.info = info;
         }
-        private async void SatEditor_Load(object sender, EventArgs e)
+        private void SatEditor_Load(object sender, EventArgs e)
         {
-            using (RHDWContext db = new RHDWContext())
-            {
-                var sats = await db.SatInfos.ToListAsync();
-                this.txtSat.UseDefault().SetData(sats, nameof(SatInfo.Sat)).UseDoubleClickToSelectAll();
-            }
+           
             txtSigType.Properties.Items.Clear();
             txtSigType.Properties.Items.AddEnum<EnumSigCheckType>();
-            gridSigDelay.UseDefault(list).UseMultiSelect();
             if (this.Text == "编辑信号" && info != null)
             {
                 this.txtFreqUp.EditValue = info.FreqUp;
                 this.txtFreqDown.EditValue = info.FreqDown;
                 this.txtSnr.EditValue = info.Snr;
-                List<EnumSigCheckType> deWay = new List<EnumSigCheckType>();
-                if (info.SigType.HasFlag(EnumSigCheckType.DAMA))
-                {
-                    deWay.Add(EnumSigCheckType.DAMA);
-                }
-                if (info.SigType.HasFlag(EnumSigCheckType.IBS))
-                {
-                    deWay.Add(EnumSigCheckType.IBS);
-                }
-                if (info.SigType.HasFlag(EnumSigCheckType.Ky5758))
-                {
-                    deWay.Add(EnumSigCheckType.Ky5758);
-                }
-                this.txtSigType.EditValue = string.Join(",", deWay);
-
-                using (RHDWContext db = new RHDWContext())
-                {
-                    var items = await db.SigDelays.Where(p => p.SignalID==info.ID).ToListAsync();
-                    list.AddRange(items);
-                }
+                //List<EnumSigCheckType> deWay = new List<EnumSigCheckType>();
+                //if (info.SigType.HasFlag(EnumSigCheckType.DAMA))
+                //{
+                //    deWay.Add(EnumSigCheckType.DAMA);
+                //}
+                //if (info.SigType.HasFlag(EnumSigCheckType.IBS))
+                //{
+                //    deWay.Add(EnumSigCheckType.IBS);
+                //}
+                //if (info.SigType.HasFlag(EnumSigCheckType.Ky5758))
+                //{
+                //    deWay.Add(EnumSigCheckType.Ky5758);
+                //}
+                //this.txtSigType.EditValue = string.Join(",", deWay);
+                this.txtSigType.EditValue = info.SigType.ToString();
             }
         }
 
@@ -79,13 +68,45 @@ namespace XdCxRhDW.App.EditForms
         }
         private void btnOk_Click(object sender, EventArgs e)
         {
-
             try
             {
-               
-                info.FreqUp =Convert.ToDouble( txtFreqUp.EditValue);
+                if (txtFreqUp.EditValue == null)
+                {
+                    dxErrorProvider.SetError(txtFreqUp, "请输入上行频点");
+                    return;
+                }
+                if (txtFreqDown.EditValue == null)
+                {
+                    dxErrorProvider.SetError(txtFreqDown, "请输入下行频点");
+                    return;
+                }
+                if (string.IsNullOrEmpty(txtSigType.EditValue.ToString()))
+                {
+                    dxErrorProvider.SetError(txtSigType, "请选择信号类型");
+                    return;
+                }
+                if (txtSnr.EditValue == null)
+                {
+                    dxErrorProvider.SetError(txtSnr, "请输入门限");
+                    return;
+                }
+                info.FreqUp = Convert.ToDouble(txtFreqUp.EditValue);
                 info.FreqDown = Convert.ToDouble(txtFreqDown.EditValue);
                 info.Snr = Convert.ToDouble(txtSnr.EditValue);
+                var res = txtSigType.EditValue.ToString().Split(new string[] { "," }, System.StringSplitOptions.RemoveEmptyEntries).ToList();
+                if (res.Count() == 2)
+                {
+                    info.SigType = (EnumSigCheckType)Enum.Parse(typeof(EnumSigCheckType), res[0]) | (EnumSigCheckType)Enum.Parse(typeof(EnumSigCheckType), res[1]);
+                }
+                else if (res.Count() == 3)
+                {
+                    info.SigType = (EnumSigCheckType)Enum.Parse(typeof(EnumSigCheckType), res[0]) | (EnumSigCheckType)Enum.Parse(typeof(EnumSigCheckType), res[1]) | (EnumSigCheckType)Enum.Parse(typeof(EnumSigCheckType), res[2]);
+                }
+                else
+                {
+                    info.SigType = (EnumSigCheckType)Enum.Parse(typeof(EnumSigCheckType), res[0]);
+                }
+
                 this.DialogResult = DialogResult.OK;
             }
             catch (Exception ex)
@@ -94,32 +115,5 @@ namespace XdCxRhDW.App.EditForms
                 DxHelper.MsgBoxHelper.ShowError("编辑信号信息出错");
             }
         }
-
-        private void btnAddDelay_Click(object sender, EventArgs e)
-        {
-            SigDelay sigDelay = new SigDelay();
-            sigDelay.SatID = ((SatInfo)txtSat.EditValue).SatCode;
-            sigDelay.Delay = Convert.ToDouble(txtDelay.EditValue.ToString());
-            if (list.Any(a => a.SatID == sigDelay.SatID))
-            {
-                DxHelper.MsgBoxHelper.ShowInfo("已添加该卫星");
-                return;
-            }
-            list.Add(sigDelay);
-            gridView1.RefreshData();
-        }
-
-        private void btnDel_Click(object sender, EventArgs e)
-        {
-            var idsGrid = gridView1.GetSelectedRows();
-            List<SigDelay> selectedRes = new List<SigDelay>();
-            foreach (var row in idsGrid)
-            {
-                selectedRes.Add(gridView1.GetRow(row) as SigDelay);
-            }
-            var seltedIds = selectedRes.Select(s => s.SatID);
-            list.RemoveAll(r => seltedIds.Contains(r.SatID));
-            gridView1.RefreshData();
-        }
     }
 }

+ 3 - 0
XdCxRhDW.App/EditForms/SigEditor.resx

@@ -117,4 +117,7 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <metadata name="dxErrorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
 </root>

+ 108 - 14
XdCxRhDW.App/UserControl/CtrlSignal.Designer.cs

@@ -29,37 +29,124 @@
         private void InitializeComponent()
         {
             this.gridSignal = new DevExpress.XtraGrid.GridControl();
-            this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
+            this.gridViewSignal = new DevExpress.XtraGrid.Views.Grid.GridView();
+            this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
+            this.gridSigDelay = new DevExpress.XtraGrid.GridControl();
+            this.gridViewSigDelay = new DevExpress.XtraGrid.Views.Grid.GridView();
+            this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
+            this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.splitterItem1 = new DevExpress.XtraLayout.SplitterItem();
             ((System.ComponentModel.ISupportInitialize)(this.gridSignal)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.gridViewSignal)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
+            this.layoutControl1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.gridSigDelay)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.gridViewSigDelay)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.splitterItem1)).BeginInit();
             this.SuspendLayout();
             // 
             // gridSignal
             // 
-            this.gridSignal.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.gridSignal.Location = new System.Drawing.Point(0, 0);
-            this.gridSignal.MainView = this.gridView1;
+            this.gridSignal.Location = new System.Drawing.Point(12, 12);
+            this.gridSignal.MainView = this.gridViewSignal;
             this.gridSignal.Name = "gridSignal";
-            this.gridSignal.Size = new System.Drawing.Size(643, 437);
+            this.gridSignal.Size = new System.Drawing.Size(440, 469);
             this.gridSignal.TabIndex = 0;
             this.gridSignal.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
-            this.gridView1});
+            this.gridViewSignal});
             // 
-            // gridView1
+            // gridViewSignal
             // 
-            this.gridView1.GridControl = this.gridSignal;
-            this.gridView1.Name = "gridView1";
+            this.gridViewSignal.GridControl = this.gridSignal;
+            this.gridViewSignal.Name = "gridViewSignal";
+            this.gridViewSignal.FocusedRowChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventHandler(this.gridViewSignal_FocusedRowChanged);
+            // 
+            // layoutControl1
+            // 
+            this.layoutControl1.Controls.Add(this.gridSignal);
+            this.layoutControl1.Controls.Add(this.gridSigDelay);
+            this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.layoutControl1.Location = new System.Drawing.Point(0, 0);
+            this.layoutControl1.Name = "layoutControl1";
+            this.layoutControl1.Root = this.Root;
+            this.layoutControl1.Size = new System.Drawing.Size(815, 493);
+            this.layoutControl1.TabIndex = 1;
+            this.layoutControl1.Text = "layoutControl1";
+            // 
+            // gridSigDelay
+            // 
+            this.gridSigDelay.Location = new System.Drawing.Point(466, 12);
+            this.gridSigDelay.MainView = this.gridViewSigDelay;
+            this.gridSigDelay.Name = "gridSigDelay";
+            this.gridSigDelay.Size = new System.Drawing.Size(337, 469);
+            this.gridSigDelay.TabIndex = 8;
+            this.gridSigDelay.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
+            this.gridViewSigDelay});
+            // 
+            // gridViewSigDelay
+            // 
+            this.gridViewSigDelay.GridControl = this.gridSigDelay;
+            this.gridViewSigDelay.Name = "gridViewSigDelay";
+            // 
+            // Root
+            // 
+            this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
+            this.Root.GroupBordersVisible = false;
+            this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
+            this.layoutControlItem1,
+            this.layoutControlItem2,
+            this.splitterItem1});
+            this.Root.Name = "Root";
+            this.Root.Size = new System.Drawing.Size(815, 493);
+            this.Root.TextVisible = false;
+            // 
+            // layoutControlItem1
+            // 
+            this.layoutControlItem1.Control = this.gridSignal;
+            this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
+            this.layoutControlItem1.Name = "layoutControlItem1";
+            this.layoutControlItem1.Size = new System.Drawing.Size(444, 473);
+            this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem1.TextVisible = false;
+            // 
+            // layoutControlItem2
+            // 
+            this.layoutControlItem2.Control = this.gridSigDelay;
+            this.layoutControlItem2.Location = new System.Drawing.Point(454, 0);
+            this.layoutControlItem2.Name = "layoutControlItem2";
+            this.layoutControlItem2.Size = new System.Drawing.Size(341, 473);
+            this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem2.TextVisible = false;
+            // 
+            // splitterItem1
+            // 
+            this.splitterItem1.AllowHotTrack = true;
+            this.splitterItem1.Location = new System.Drawing.Point(444, 0);
+            this.splitterItem1.Name = "splitterItem1";
+            this.splitterItem1.Size = new System.Drawing.Size(10, 473);
             // 
             // CtrlSignal
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.Controls.Add(this.gridSignal);
+            this.Controls.Add(this.layoutControl1);
             this.Name = "CtrlSignal";
-            this.Size = new System.Drawing.Size(643, 437);
+            this.Size = new System.Drawing.Size(815, 493);
             this.Load += new System.EventHandler(this.CtrlSignal_Load);
             ((System.ComponentModel.ISupportInitialize)(this.gridSignal)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.gridViewSignal)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
+            this.layoutControl1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.gridSigDelay)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.gridViewSigDelay)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.splitterItem1)).EndInit();
             this.ResumeLayout(false);
 
         }
@@ -67,6 +154,13 @@
         #endregion
 
         private DevExpress.XtraGrid.GridControl gridSignal;
-        private DevExpress.XtraGrid.Views.Grid.GridView gridView1;
+        private DevExpress.XtraGrid.Views.Grid.GridView gridViewSignal;
+        private DevExpress.XtraLayout.LayoutControl layoutControl1;
+        private DevExpress.XtraLayout.LayoutControlGroup Root;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
+        private DevExpress.XtraGrid.GridControl gridSigDelay;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
+        private DevExpress.XtraGrid.Views.Grid.GridView gridViewSigDelay;
+        private DevExpress.XtraLayout.SplitterItem splitterItem1;
     }
 }

+ 158 - 11
XdCxRhDW.App/UserControl/CtrlSignal.cs

@@ -1,4 +1,5 @@
-using System;
+using DevExpress.Utils.About;
+using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
@@ -17,7 +18,8 @@ namespace XdCxRhDW.App.UserControl
 {
     public partial class CtrlSignal : DevExpress.XtraEditors.XtraUserControl
     {
-        readonly List<SigInfo> list = new List<SigInfo>();
+        readonly List<SigInfo> listSigInfo = new List<SigInfo>();
+        readonly List<SigDelay> listSigDelay = new List<SigDelay>();
         public CtrlSignal()
         {
             InitializeComponent();
@@ -27,14 +29,22 @@ namespace XdCxRhDW.App.UserControl
         {
             try
             {
-                gridSignal.UseDefault(list).UseMultiSelect().UseRowNumber()
-                    .UseAddAsync(Add);
-                    //.UseEditAsync<SatInfo>(Edit)
-                    //.UseDeleteAsync<SatInfo>(Delete);
+                gridSignal.UseDefault(listSigInfo).UseMultiSelect().UseRowNumber()
+                    .UseAddAsync(AddSigInfo)
+                    .UseEditAsync<SigInfo>(EditSigInfo)
+                    .UseDeleteAsync<SigInfo>(DeleteSigInfo);
+                gridSigDelay.UseDefault(listSigDelay).UseMultiSelect().UseRowNumber()
+                   .UseAddAsync(AddSigDelay)
+                   .UseEditAsync<SigDelay>(EditSigDelay)
+                   .UseDeleteAsync<SigDelay>(DeleteSigDelay);
+
                 using (var db = new RHDWContext())
                 {
                     var items = await db.SigInfos.ToListAsync();
-                    list.AddRange(items);
+                    listSigInfo.AddRange(items);
+                    //var delayItems = await db.SigDelays.ToListAsync();
+                    //var delayRes = delayItems.Where(w => w.SigInfoID == items.FirstOrDefault().ID);
+                    //listSigDelay.AddRange(delayRes);
                 }
             }
             catch (Exception ex)
@@ -43,7 +53,7 @@ namespace XdCxRhDW.App.UserControl
                 DxHelper.MsgBoxHelper.ShowError("查询信号信息异常");
             }
         }
-        private async Task<SigInfo> Add()
+        private async Task<SigInfo> AddSigInfo()
         {
             try
             {
@@ -52,17 +62,154 @@ namespace XdCxRhDW.App.UserControl
                 var addItem = frm.info;
                 using (RHDWContext db = new RHDWContext())
                 {
-                    db.SigInfos.Add(addItem);
+                    var sig = db.SigInfos.Add(addItem);
+                    await db.SaveChangesAsync();
+                }
+                return addItem;
+            }
+            catch (Exception ex)
+            {
+                Serilog.Log.Error(ex, "添加信号信息异常");
+                DxHelper.MsgBoxHelper.ShowError("添加信号信息异常");
+                return null;
+            }
+        }
+        private async Task<SigInfo> EditSigInfo(SigInfo editItem)
+        {
+            try
+            {
+                SigEditor frm = new SigEditor(editItem);
+                if (frm.ShowDialog() != DialogResult.OK) return null;
+                editItem = frm.info;
+                using (RHDWContext db = new RHDWContext())
+                {
+                    var find = await db.SigInfos.Where(p => p.ID == editItem.ID).FirstOrDefaultAsync();
+                    find.FreqUp = editItem.FreqUp;
+                    find.FreqDown = editItem.FreqDown;
+                    find.SigType = editItem.SigType;
+                    find.Snr = editItem.Snr;
+                    await db.SaveChangesAsync();
+                }
+                return editItem;
+            }
+            catch (Exception ex)
+            {
+                Serilog.Log.Error(ex, "保存信号信息异常");
+                DxHelper.MsgBoxHelper.ShowError("保存信号信息异常");
+                return null;
+            }
+        }
+        private async Task<bool> DeleteSigInfo(List<SigInfo> list)
+        {
+            try
+            {
+                var ids = list.Select(p => p.ID);
+                using (RHDWContext db = new RHDWContext())
+                {
+                    var delItems = await db.SigInfos.Where(p => ids.Contains(p.ID)).ToListAsync();
+                    db.SigInfos.RemoveRange(delItems);
+                    await db.SaveChangesAsync();
+                }
+                return true;
+            }
+            catch (Exception ex)
+            {
+                Serilog.Log.Error(ex, "删除信号信息异常");
+                DxHelper.MsgBoxHelper.ShowError("删除信号信息异常");
+                return false;
+            }
+        }
+        private async Task<SigDelay> AddSigDelay()
+        {
+            try
+            {
+                var sigInfoId = gridViewSignal.GetFocusedRow() as SigInfo;
+                if (sigInfoId == null) return null;
+                SigDelayEditor frm = new SigDelayEditor(sigInfoId.ID);
+                if (frm.ShowDialog() != DialogResult.OK) return null;
+                var addItem = frm.info;
+                using (RHDWContext db = new RHDWContext())
+                {
+                    addItem.SigInfoId = sigInfoId.ID;
+                    var sig = db.SigDelays.Add(addItem);
                     await db.SaveChangesAsync();
                 }
                 return addItem;
             }
             catch (Exception ex)
             {
-                Serilog.Log.Error(ex, "添加卫星信息异常");
-                DxHelper.MsgBoxHelper.ShowError("添加卫星信息异常");
+                Serilog.Log.Error(ex, "添加转发延迟异常");
+                DxHelper.MsgBoxHelper.ShowError("添加转发延迟异常");
+                return null;
+            }
+        }
+        private async Task<SigDelay> EditSigDelay(SigDelay editItem)
+        {
+            try
+            {
+                var sigInfoId = gridViewSignal.GetFocusedRow() as SigInfo;
+                if (sigInfoId == null) return null;
+                SigDelayEditor frm = new SigDelayEditor(editItem, sigInfoId.ID);
+                if (frm.ShowDialog() != DialogResult.OK) return null;
+                editItem = frm.info;
+                using (RHDWContext db = new RHDWContext())
+                {
+                    var find = await db.SigDelays.Where(p => p.ID == editItem.ID).FirstOrDefaultAsync();
+                    find.SigInfoId = editItem.SigInfoId;
+                    find.SatInfoSatCode = editItem.SatInfoSatCode;
+                    find.Delay = editItem.Delay;
+                    await db.SaveChangesAsync();
+                }
+                return editItem;
+            }
+            catch (Exception ex)
+            {
+                Serilog.Log.Error(ex, "保存转发延迟异常");
+                DxHelper.MsgBoxHelper.ShowError("保存转发延迟异常");
                 return null;
             }
         }
+        private async Task<bool> DeleteSigDelay(List<SigDelay> list)
+        {
+            try
+            {
+                var ids = list.Select(p => p.ID);
+                using (RHDWContext db = new RHDWContext())
+                {
+                    var delItems = await db.SigDelays.Where(p => ids.Contains(p.ID)).ToListAsync();
+                    db.SigDelays.RemoveRange(delItems);
+                    await db.SaveChangesAsync();
+                }
+                return true;
+            }
+            catch (Exception ex)
+            {
+                Serilog.Log.Error(ex, "删除转发延迟异常");
+                DxHelper.MsgBoxHelper.ShowError("删除转发延迟异常");
+                return false;
+            }
+        }
+
+        private async void gridViewSignal_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
+        {
+            var sigInfoId = gridViewSignal.GetFocusedRow() as SigInfo;
+            if (sigInfoId == null) return;
+            listSigDelay.Clear();
+            using (var db = new RHDWContext())
+            {
+                var delayItems = await db.SigDelays.ToListAsync();
+                var delayItemsRes = delayItems.Where(w => w.SigInfoId == sigInfoId.ID);
+                var sats = await db.SatInfos.ToListAsync();
+                foreach (var delayItem in delayItemsRes)
+                {
+                    SigDelay sigDelay = delayItem as SigDelay;
+                    var satInfo = sats.FirstOrDefault(f => f.SatCode == sigDelay.SatInfoSatCode);
+                    sigDelay.Sat = $"[{satInfo.SatLon}°]{satInfo.SatName}({satInfo.SatCode})";
+                    listSigDelay.Add(sigDelay);
+                }
+                // listSigDelay.AddRange(delayItems);
+                gridViewSigDelay.RefreshData();
+            }
+        }
     }
 }

+ 15 - 3
XdCxRhDW.App/XdCxRhDW.App.csproj

@@ -82,9 +82,9 @@
     <Reference Include="DevExpress.XtraLayout.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
     <Reference Include="DevExpress.XtraMap.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
     <Reference Include="DevExpress.XtraPrinting.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
-    <Reference Include="DevExpress.XtraScheduler.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
-    <Reference Include="DevExpress.XtraScheduler.v23.2.Core, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
-    <Reference Include="DevExpress.XtraScheduler.v23.2.Core.Desktop, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
+ <Reference Include="DevExpress.XtraScheduler.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+ <Reference Include="DevExpress.XtraScheduler.v23.2.Core, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
+ <Reference Include="DevExpress.XtraScheduler.v23.2.Core.Desktop, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
     <Reference Include="DevExpress.XtraTreeList.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
     <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
       <HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
@@ -194,6 +194,12 @@
     <Compile Include="EditForms\PosTimeEditor.Designer.cs">
       <DependentUpon>PosTimeEditor.cs</DependentUpon>
     </Compile>
+    <Compile Include="EditForms\SigDelayEditor.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="EditForms\SigDelayEditor.Designer.cs">
+      <DependentUpon>SigDelayEditor.cs</DependentUpon>
+    </Compile>
     <Compile Include="EditForms\SigEditor.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -446,6 +452,12 @@
     <EmbeddedResource Include="CorTools\XlCalculateForm.resx">
       <DependentUpon>XlCalculateForm.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="EditForms\SigDelayEditor.resx">
+      <DependentUpon>SigDelayEditor.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="EditForms\SigEditor.resx">
+      <DependentUpon>SigEditor.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="EditForms\TaskHistoryTimeEditor.resx">
       <DependentUpon>TaskHistoryTimeEditor.cs</DependentUpon>
     </EmbeddedResource>

+ 18 - 5
XdCxRhDW.Entity/SigDelay.cs

@@ -1,8 +1,10 @@
-using System;
+using Newtonsoft.Json;
+using System;
 using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
 using System.ComponentModel.DataAnnotations.Schema;
 using System.Linq;
+using System.Runtime.Remoting.Metadata.W3cXsd2001;
 using System.Text;
 using System.Threading.Tasks;
 
@@ -12,13 +14,24 @@ namespace XdCxRhDW.Entity
     public class SigDelay : BaseEntity
     {
        
-        [Display(Name = "信号ID", AutoGenerateField = false)]
-        public int SignalID { get; set; }
+        [Display(Name = "信号编号")]
+        public int SigInfoId { get; set; }
+
+        [Display(AutoGenerateField = false)]
+        public virtual SigInfo SigInfo { get; set; }
+
+        [Display(Name = "卫星编号")]
+        public int SatInfoSatCode { get; set; }
 
         [Display(Name = "卫星")]
-        public int SatID { get; set; }
+        public string Sat { get; set; }
+
+        [Display(AutoGenerateField = false)]
+        public virtual SatInfo SatInfo { get; set; }
 
         [Display(Name = "转发延迟(us)")]
-        public double Delay { get; set; }       
+        public double Delay { get; set; }
+
+       
     }
 }

+ 1 - 2
XdCxRhDW.Entity/SigInfo.cs

@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
 using System.ComponentModel.DataAnnotations.Schema;
 using System.Linq;
+using System.Runtime.Remoting.Metadata.W3cXsd2001;
 using System.Text;
 using System.Threading.Tasks;
 
@@ -22,7 +23,5 @@ namespace XdCxRhDW.Entity
 
         [Display(Name = "门限(dB)")]
         public double Snr { get; set; }
-
-       
     }
 }