wyq 1 سال پیش
والد
کامیت
75cfb55b42

+ 12 - 0
DataSimulation.Forms/DataSimulation.Forms.csproj

@@ -66,6 +66,9 @@
     <Reference Include="Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
       <HintPath>..\packages\Serilog.3.1.1\lib\net471\Serilog.dll</HintPath>
     </Reference>
+    <Reference Include="SQLite.CodeFirst, Version=1.7.0.36, Culture=neutral, PublicKeyToken=eb96ba0a78d831a7, processorArchitecture=MSIL">
+      <HintPath>..\packages\SQLite.CodeFirst.1.7.0.36\lib\net45\SQLite.CodeFirst.dll</HintPath>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
       <HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
@@ -114,6 +117,12 @@
     <Compile Include="DxHelper\MsgBoxHelper.cs" />
     <Compile Include="DxHelper\SvgHelper.cs" />
     <Compile Include="DxHelper\WaitHelper.cs" />
+    <Compile Include="EditForms\SatEditor.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="EditForms\SatEditor.Designer.cs">
+      <DependentUpon>SatEditor.cs</DependentUpon>
+    </Compile>
     <Compile Include="ExtensionsDev\BaseEditExtension.cs" />
     <Compile Include="ExtensionsDev\ChooseFileExtension.cs" />
     <Compile Include="ExtensionsDev\DateEditExtension.cs" />
@@ -143,6 +152,9 @@
     <Compile Include="UserControl\CtrlSat.Designer.cs">
       <DependentUpon>CtrlSat.cs</DependentUpon>
     </Compile>
+    <EmbeddedResource Include="EditForms\SatEditor.resx">
+      <DependentUpon>SatEditor.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="MainForm.resx">
       <DependentUpon>MainForm.cs</DependentUpon>
     </EmbeddedResource>

+ 283 - 0
DataSimulation.Forms/EditForms/SatEditor.Designer.cs

@@ -0,0 +1,283 @@
+namespace DataSimulation.Forms.EditForms
+{
+    partial class SatEditor
+    {
+        /// <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()
+        {
+            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.txtSatLon = new DevExpress.XtraEditors.ButtonEdit();
+            this.txtSatName = new DevExpress.XtraEditors.TextEdit();
+            this.searchLookUpEdit1 = 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.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.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
+            this.layoutControl1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.txtSatLon.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtSatName.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit1.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit1View)).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.emptySpaceItem2)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // layoutControl1
+            // 
+            this.layoutControl1.Controls.Add(this.btnOk);
+            this.layoutControl1.Controls.Add(this.btnCancel);
+            this.layoutControl1.Controls.Add(this.txtSatLon);
+            this.layoutControl1.Controls.Add(this.txtSatName);
+            this.layoutControl1.Controls.Add(this.searchLookUpEdit1);
+            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, 257);
+            this.layoutControl1.TabIndex = 0;
+            this.layoutControl1.Text = "layoutControl1";
+            // 
+            // btnOk
+            // 
+            this.btnOk.Location = new System.Drawing.Point(131, 195);
+            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, 195);
+            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);
+            // 
+            // txtSatLon
+            // 
+            this.txtSatLon.Location = new System.Drawing.Point(22, 147);
+            this.txtSatLon.Name = "txtSatLon";
+            this.txtSatLon.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "°", -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.txtSatLon.Properties.NullValuePrompt = "非必需";
+            this.txtSatLon.Size = new System.Drawing.Size(214, 23);
+            this.txtSatLon.StyleController = this.layoutControl1;
+            this.txtSatLon.TabIndex = 6;
+            // 
+            // txtSatName
+            // 
+            this.txtSatName.Location = new System.Drawing.Point(22, 93);
+            this.txtSatName.Name = "txtSatName";
+            this.txtSatName.Properties.AutoHeight = false;
+            this.txtSatName.Size = new System.Drawing.Size(214, 23);
+            this.txtSatName.StyleController = this.layoutControl1;
+            this.txtSatName.TabIndex = 5;
+            // 
+            // searchLookUpEdit1
+            // 
+            this.searchLookUpEdit1.Location = new System.Drawing.Point(22, 39);
+            this.searchLookUpEdit1.Name = "searchLookUpEdit1";
+            this.searchLookUpEdit1.Properties.AutoHeight = false;
+            this.searchLookUpEdit1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            this.searchLookUpEdit1.Properties.PopupView = this.searchLookUpEdit1View;
+            this.searchLookUpEdit1.Size = new System.Drawing.Size(214, 23);
+            this.searchLookUpEdit1.StyleController = this.layoutControl1;
+            this.searchLookUpEdit1.TabIndex = 4;
+            // 
+            // 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.layoutControlItem1,
+            this.layoutControlItem2,
+            this.layoutControlItem3,
+            this.layoutControlItem4,
+            this.layoutControlItem5,
+            this.emptySpaceItem2});
+            this.Root.Name = "Root";
+            this.Root.Padding = new DevExpress.XtraLayout.Utils.Padding(20, 20, 20, 20);
+            this.Root.Size = new System.Drawing.Size(258, 257);
+            this.Root.TextVisible = false;
+            // 
+            // emptySpaceItem1
+            // 
+            this.emptySpaceItem1.AllowHotTrack = false;
+            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 199);
+            this.emptySpaceItem1.Name = "emptySpaceItem1";
+            this.emptySpaceItem1.Size = new System.Drawing.Size(218, 18);
+            this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
+            // 
+            // layoutControlItem1
+            // 
+            this.layoutControlItem1.Control = this.searchLookUpEdit1;
+            this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
+            this.layoutControlItem1.MaxSize = new System.Drawing.Size(0, 44);
+            this.layoutControlItem1.MinSize = new System.Drawing.Size(54, 44);
+            this.layoutControlItem1.Name = "layoutControlItem1";
+            this.layoutControlItem1.Size = new System.Drawing.Size(218, 44);
+            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.txtSatName;
+            this.layoutControlItem2.Location = new System.Drawing.Point(0, 44);
+            this.layoutControlItem2.MaxSize = new System.Drawing.Size(0, 54);
+            this.layoutControlItem2.MinSize = new System.Drawing.Size(54, 54);
+            this.layoutControlItem2.Name = "layoutControlItem2";
+            this.layoutControlItem2.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 12, 2);
+            this.layoutControlItem2.Size = new System.Drawing.Size(218, 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);
+            // 
+            // layoutControlItem3
+            // 
+            this.layoutControlItem3.Control = this.txtSatLon;
+            this.layoutControlItem3.Location = new System.Drawing.Point(0, 98);
+            this.layoutControlItem3.MaxSize = new System.Drawing.Size(0, 51);
+            this.layoutControlItem3.MinSize = new System.Drawing.Size(54, 51);
+            this.layoutControlItem3.Name = "layoutControlItem3";
+            this.layoutControlItem3.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 12, 2);
+            this.layoutControlItem3.Size = new System.Drawing.Size(218, 51);
+            this.layoutControlItem3.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
+            this.layoutControlItem3.Text = "轨道经度";
+            this.layoutControlItem3.TextLocation = DevExpress.Utils.Locations.Top;
+            this.layoutControlItem3.TextSize = new System.Drawing.Size(48, 14);
+            // 
+            // layoutControlItem4
+            // 
+            this.layoutControlItem4.Control = this.btnCancel;
+            this.layoutControlItem4.Location = new System.Drawing.Point(0, 173);
+            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, 173);
+            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;
+            // 
+            // emptySpaceItem2
+            // 
+            this.emptySpaceItem2.AllowHotTrack = false;
+            this.emptySpaceItem2.Location = new System.Drawing.Point(0, 149);
+            this.emptySpaceItem2.MaxSize = new System.Drawing.Size(0, 24);
+            this.emptySpaceItem2.MinSize = new System.Drawing.Size(104, 24);
+            this.emptySpaceItem2.Name = "emptySpaceItem2";
+            this.emptySpaceItem2.Size = new System.Drawing.Size(218, 24);
+            this.emptySpaceItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
+            this.emptySpaceItem2.TextSize = new System.Drawing.Size(0, 0);
+            // 
+            // SatEditor
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(258, 257);
+            this.Controls.Add(this.layoutControl1);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
+            this.Name = "SatEditor";
+            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.txtSatLon.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtSatName.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit1.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit1View)).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.emptySpaceItem2)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private DevExpress.XtraLayout.LayoutControl layoutControl1;
+        private DevExpress.XtraLayout.LayoutControlGroup Root;
+        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1;
+        private DevExpress.XtraEditors.SearchLookUpEdit searchLookUpEdit1;
+        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 txtSatLon;
+        private DevExpress.XtraEditors.TextEdit txtSatName;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5;
+        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem2;
+    }
+}

+ 70 - 0
DataSimulation.Forms/EditForms/SatEditor.cs

@@ -0,0 +1,70 @@
+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.Windows.Forms;
+using DataSimulation.Repostory;
+using DataSimulation.Repostory.EFContext;
+using DataSimulation.Repostory.Model;
+
+namespace DataSimulation.Forms.EditForms
+{
+    public partial class SatEditor : DevExpress.XtraEditors.XtraForm
+    {
+        public SatInfo info;
+        public SatEditor()
+        {
+            InitializeComponent();
+            this.layoutControl1.UseDefault();
+            this.Text = "添加卫星";
+            info = new SatInfo();
+            this.StartPosition = FormStartPosition.CenterParent;
+        }
+        public SatEditor(SatInfo info)
+            : this()
+        {
+            this.Text = "编辑卫星";
+            this.info = info;
+        }
+        private async void SatEditor_Load(object sender, EventArgs e)
+        {
+            var listXl = await XlCache.GetAllAsync();
+            this.searchLookUpEdit1.UseDefault().SetStringData(listXl.Select(p=>p.Sat)).UseDoubleClickToSelectAll();
+            if (this.Text == "编辑卫星" && info != null)
+            {
+                this.txtSatName.Text = info.SatName;
+                this.txtSatLon.Text = info.SatLon.ToString();
+            }
+        }
+
+        private void btnCancel_Click(object sender, EventArgs e)
+        {
+            this.DialogResult = DialogResult.Cancel;
+        }
+        private void btnOk_Click(object sender, EventArgs e)
+        {
+
+            try
+            {
+                var sat = searchLookUpEdit1.Text;
+                var idx = sat.LastIndexOf('(');
+                var satCodeStr = sat.Substring(idx + 1, sat.Length - idx - 2);
+                info.SatCode = Convert.ToInt32(satCodeStr);
+                info.SatName = txtSatName.Text.Trim();
+                if (!string.IsNullOrWhiteSpace(txtSatLon.Text))
+                    info.SatLon = Convert.ToDouble(txtSatLon.Text);
+                this.DialogResult = DialogResult.OK;
+            }
+            catch (Exception ex)
+            {
+                Serilog.Log.Error(ex, "编辑卫星信息出错");
+                DxHelper.MsgBoxHelper.ShowError("编辑卫星信息出错");
+            }
+        }
+    }
+}

+ 120 - 0
DataSimulation.Forms/EditForms/SatEditor.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>

+ 9 - 8
DataSimulation.Forms/MainForm.Designer.cs

@@ -35,13 +35,13 @@
             this.btnXl = new DevExpress.XtraBars.BarButtonItem();
             this.btnSat = new DevExpress.XtraBars.BarButtonItem();
             this.btnTx = new DevExpress.XtraBars.BarButtonItem();
+            this.btnRef = new DevExpress.XtraBars.BarButtonItem();
             this.ribbonPage1 = new DevExpress.XtraBars.Ribbon.RibbonPage();
             this.ribbonPageGroup1 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
             this.ribbonPageGroup2 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
             this.dockManager1 = new DevExpress.XtraBars.Docking.DockManager(this.components);
             this.documentManager1 = new DevExpress.XtraBars.Docking2010.DocumentManager(this.components);
             this.tabbedView1 = new DevExpress.XtraBars.Docking2010.Views.Tabbed.TabbedView(this.components);
-            this.btnRef = new DevExpress.XtraBars.BarButtonItem();
             ((System.ComponentModel.ISupportInitialize)(this.ribbon)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.dockManager1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.documentManager1)).BeginInit();
@@ -97,6 +97,7 @@
             this.btnSat.Id = 3;
             this.btnSat.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("btnSat.ImageOptions.SvgImage")));
             this.btnSat.Name = "btnSat";
+            this.btnSat.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btn_ItemClick);
             // 
             // btnTx
             // 
@@ -105,6 +106,13 @@
             this.btnTx.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("btnTx.ImageOptions.SvgImage")));
             this.btnTx.Name = "btnTx";
             // 
+            // btnRef
+            // 
+            this.btnRef.Caption = "参考站管理";
+            this.btnRef.Id = 5;
+            this.btnRef.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("btnRef.ImageOptions.SvgImage")));
+            this.btnRef.Name = "btnRef";
+            // 
             // ribbonPage1
             // 
             this.ribbonPage1.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] {
@@ -152,13 +160,6 @@
             this.documentManager1.ViewCollection.AddRange(new DevExpress.XtraBars.Docking2010.Views.BaseView[] {
             this.tabbedView1});
             // 
-            // btnRef
-            // 
-            this.btnRef.Caption = "参考站管理";
-            this.btnRef.Id = 5;
-            this.btnRef.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("btnRef.ImageOptions.SvgImage")));
-            this.btnRef.Name = "btnRef";
-            // 
             // MainForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);

+ 1 - 0
DataSimulation.Forms/MainForm.cs

@@ -23,6 +23,7 @@ namespace DataSimulation.Forms
             ribbon.UseDefault();
             tabbedView1.UseDefault();
             ctrlTypes.Add("任务管理", typeof(CtrlHome));
+            ctrlTypes.Add("卫星管理", typeof(CtrlSat));
             btn_ItemClick(null, null);
         }
         private void btn_ItemClick(object sender, ItemClickEventArgs e)

+ 6 - 3
DataSimulation.Forms/Properties/licenses.licx

@@ -1,7 +1,10 @@
+DevExpress.XtraCharts.Heatmap.HeatmapControl, DevExpress.XtraCharts.v23.2.UI, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
 DevExpress.XtraBars.Docking.DockManager, DevExpress.XtraBars.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.ButtonEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.SearchLookUpEdit, DevExpress.XtraGrid.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
 DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraCharts.Heatmap.HeatmapControl, DevExpress.XtraCharts.v23.2.UI, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraBars.Docking2010.DocumentManager, DevExpress.XtraBars.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
 DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
 DevExpress.XtraMap.MapControl, DevExpress.XtraMap.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraBars.Docking2010.DocumentManager, DevExpress.XtraBars.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

+ 24 - 23
DataSimulation.Forms/UserControl/CtrlSat.cs

@@ -10,6 +10,7 @@ using System.Drawing;
 using System.Linq;
 using System.Windows.Forms;
 using DataSimulation.Repostory.EFContext;
+using DataSimulation.Forms.EditForms;
 
 namespace DataSimulation.Forms.UserControl
 {
@@ -58,16 +59,16 @@ namespace DataSimulation.Forms.UserControl
         {
             try
             {
-                ////SatEditor frm = new SatEditor();
-                //if (frm.ShowDialog() != DialogResult.OK) return;
-                //var addItem = frm.info;
-                //using (SimulationContext db = new SimulationContext())
-                //{
-                //    db.SatInfos.Add(addItem);
-                //    await db.SaveChangesAsync();
-                //}
-                //list.Add(addItem);
-                //gridView1.RefreshData();
+                SatEditor frm = new SatEditor();
+                if (frm.ShowDialog() != DialogResult.OK) return;
+                var addItem = frm.info;
+                using (SimulationContext db = new SimulationContext())
+                {
+                    db.SatInfos.Add(addItem);
+                    await db.SaveChangesAsync();
+                }
+                list.Add(addItem);
+                gridView1.RefreshData();
             }
             catch (Exception ex)
             {
@@ -79,19 +80,19 @@ namespace DataSimulation.Forms.UserControl
         {
             try
             {
-                //var editItem = gridView1.GetFocusedRow() as SatInfo;
-                //SatEditor frm = new SatEditor(editItem);
-                //if (frm.ShowDialog() != DialogResult.OK) return;
-                //editItem = frm.info;
-                //using (SimulationContext db = new SimulationContext())
-                //{
-                //    var find = await db.SatInfos.Where(p => p.ID == editItem.ID).FirstOrDefaultAsync();
-                //    find.SatName = editItem.SatName;
-                //    find.SatCode = editItem.SatCode;
-                //    find.SatLon = editItem.SatLon;
-                //    await db.SaveChangesAsync();
-                //}
-                //gridView1.RefreshData();
+                var editItem = gridView1.GetFocusedRow() as SatInfo;
+                SatEditor frm = new SatEditor(editItem);
+                if (frm.ShowDialog() != DialogResult.OK) return;
+                editItem = frm.info;
+                using (SimulationContext db = new SimulationContext())
+                {
+                    var find = await db.SatInfos.Where(p => p.ID == editItem.ID).FirstOrDefaultAsync();
+                    find.SatName = editItem.SatName;
+                    find.SatCode = editItem.SatCode;
+                    find.SatLon = editItem.SatLon;
+                    await db.SaveChangesAsync();
+                }
+                gridView1.RefreshData();
             }
             catch (Exception ex)
             {

+ 1 - 0
DataSimulation.Forms/packages.config

@@ -2,6 +2,7 @@
 <packages>
   <package id="EntityFramework" version="6.4.4" targetFramework="net472" />
   <package id="Serilog" version="3.1.1" targetFramework="net472" />
+  <package id="SQLite.CodeFirst" version="1.7.0.36" targetFramework="net472" />
   <package id="Stub.System.Data.SQLite.Core.NetFramework" version="1.0.118.0" targetFramework="net472" />
   <package id="System.Buffers" version="4.5.1" targetFramework="net472" />
   <package id="System.ComponentModel.Annotations" version="5.0.0" targetFramework="net472" />

+ 2 - 2
DataSimulation.Repostory/DataSimulation.Repostory.csproj

@@ -8,8 +8,8 @@
     <ProjectGuid>{61D871DE-8837-49A9-B141-C03A690A53AF}</ProjectGuid>
     <OutputType>Library</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>DataSimulation.Dto</RootNamespace>
-    <AssemblyName>DataSimulation.Dto</AssemblyName>
+    <RootNamespace>DataSimulation.Repostory</RootNamespace>
+    <AssemblyName>DataSimulation.Repostory</AssemblyName>
     <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <Deterministic>true</Deterministic>

+ 0 - 3
DataSimulation.Repostory/EFContext/SimulationContext.cs

@@ -15,9 +15,6 @@ using System.Reflection;
 using System.Data.SQLite.EF6;
 using System.Data.SQLite;
 using System.Data.Entity.Core.Common;
-using System.Data.Entity.Core.EntityClient;
-using static System.Net.WebRequestMethods;
-using DataSimulation.Dto.Model;
 
 namespace DataSimulation.Repostory.EFContext
 {

+ 1 - 1
DataSimulation.Repostory/Model/AntInfo.cs

@@ -7,7 +7,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 
-namespace DataSimulation.Dto.Model
+namespace DataSimulation.Repostory.Model
 {
     /// <summary>
     /// 天线信息

+ 1 - 1
DataSimulation.Repostory/Model/RefInfo.cs

@@ -7,7 +7,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 
-namespace DataSimulation.Dto.Model
+namespace DataSimulation.Repostory.Model
 {
     [Table("RefInfo")]
     public class RefInfo : BaseModel<long>

+ 1 - 1
DataSimulation.Repostory/Model/SimulationInfo.cs

@@ -7,7 +7,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 
-namespace DataSimulation.Dto.Model
+namespace DataSimulation.Repostory.Model
 {
     /// <summary>
     /// 仿真航迹数据信息

+ 2 - 2
DataSimulation.Repostory/Properties/AssemblyInfo.cs

@@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
 // 有关程序集的一般信息由以下
 // 控制。更改这些特性值可修改
 // 与程序集关联的信息。
-[assembly: AssemblyTitle("DataSimulation.Dto")]
+[assembly: AssemblyTitle("DataSimulation.Repostory")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("DataSimulation.Dto")]
+[assembly: AssemblyProduct("DataSimulation.Repostory")]
 [assembly: AssemblyCopyright("Copyright ©  2024")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]