gongqiuhong 1 year ago
parent
commit
72f3da408c

+ 8 - 0
DataSimulation.Forms/App.config

@@ -44,4 +44,12 @@
       <add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
     <remove invariant="System.Data.SQLite" /><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /></DbProviderFactories>
   </system.data>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
 </configuration>

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

@@ -67,6 +67,15 @@
     <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="Serilog.Sinks.Async, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
+      <HintPath>..\packages\Serilog.Sinks.Async.1.5.0\lib\net461\Serilog.Sinks.Async.dll</HintPath>
+    </Reference>
+    <Reference Include="Serilog.Sinks.Console, Version=5.0.1.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
+      <HintPath>..\packages\Serilog.Sinks.Console.5.0.1\lib\net471\Serilog.Sinks.Console.dll</HintPath>
+    </Reference>
+    <Reference Include="Serilog.Sinks.File, Version=5.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
+      <HintPath>..\packages\Serilog.Sinks.File.5.0.0\lib\net45\Serilog.Sinks.File.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>
@@ -120,6 +129,7 @@
   <ItemGroup>
     <Compile Include="Basic\ColorHelper.cs" />
     <Compile Include="Basic\DebounceDispatcher.cs" />
+    <Compile Include="DxHelper\EnumExtension.cs" />
     <Compile Include="DxHelper\MD5Helper.cs" />
     <Compile Include="DxHelper\MsgBoxHelper.cs" />
     <Compile Include="DxHelper\SvgHelper.cs" />
@@ -136,6 +146,12 @@
     <Compile Include="EditForms\SatEditor.Designer.cs">
       <DependentUpon>SatEditor.cs</DependentUpon>
     </Compile>
+    <Compile Include="EditForms\TaskEditor.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="EditForms\TaskEditor.Designer.cs">
+      <DependentUpon>TaskEditor.cs</DependentUpon>
+    </Compile>
     <Compile Include="ExtensionsDev\BaseEditExtension.cs" />
     <Compile Include="ExtensionsDev\ChooseFileExtension.cs" />
     <Compile Include="ExtensionsDev\DateEditExtension.cs" />
@@ -145,6 +161,7 @@
     <Compile Include="ExtensionsDev\RibbonExtension.cs" />
     <Compile Include="ExtensionsDev\SearchLookUpEditExtension.cs" />
     <Compile Include="ExtensionsDev\TabbedViewExtension.cs" />
+    <Compile Include="Localizer\ChsLocalizer.cs" />
     <Compile Include="MainForm.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -183,6 +200,9 @@
     <EmbeddedResource Include="EditForms\SatEditor.resx">
       <DependentUpon>SatEditor.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="EditForms\TaskEditor.resx">
+      <DependentUpon>TaskEditor.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="MainForm.resx">
       <DependentUpon>MainForm.cs</DependentUpon>
     </EmbeddedResource>

+ 38 - 0
DataSimulation.Forms/DxHelper/EnumExtension.cs

@@ -0,0 +1,38 @@
+using DevExpress.XtraEditors;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DxHelper
+{
+    /// <summary>
+    /// 枚举扩展
+    /// </summary>
+    public static class EnumExtension
+    {
+        /// <summary>
+        /// 获取枚举描述
+        /// </summary>
+        /// <param name="enumType">枚举类型</param>
+        /// <returns></returns>
+        public static string GetEnumDisplayName(this Enum enumType)
+        {
+            try
+            {
+                Type type = enumType.GetType();
+                var field = type.GetField(Enum.GetName(type, enumType));
+                string displayName = field.GetCustomAttribute<DisplayAttribute>().Name;
+                return displayName;
+            }
+            catch
+            {
+                return string.Empty;
+            }
+           
+        }
+    }
+}

+ 515 - 0
DataSimulation.Forms/EditForms/TaskEditor.Designer.cs

@@ -0,0 +1,515 @@
+namespace DataSimulation.Forms.EditForms
+{
+    partial class TaskEditor
+    {
+        /// <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 editorButtonImageOptions3 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject9 = new DevExpress.Utils.SerializableAppearanceObject();
+            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 editorButtonImageOptions2 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject5 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject6 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject7 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject8 = new DevExpress.Utils.SerializableAppearanceObject();
+            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.Root = new DevExpress.XtraLayout.LayoutControlGroup();
+            this.txtTaskName = new DevExpress.XtraEditors.TextEdit();
+            this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
+            this.radioSimulationType = new DevExpress.XtraEditors.RadioGroup();
+            this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.txtMainSat = new DevExpress.XtraEditors.SearchLookUpEdit();
+            this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.searchLookUpEdit1View = new DevExpress.XtraGrid.Views.Grid.GridView();
+            this.txtAdjaSat1 = new DevExpress.XtraEditors.SearchLookUpEdit();
+            this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.searchLookUpEdit2View = new DevExpress.XtraGrid.Views.Grid.GridView();
+            this.txtAdjaSat2 = new DevExpress.XtraEditors.SearchLookUpEdit();
+            this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.searchLookUpEdit3View = new DevExpress.XtraGrid.Views.Grid.GridView();
+            this.txtTx = new DevExpress.XtraEditors.ImageComboBoxEdit();
+            this.layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.txtRefStation = new DevExpress.XtraEditors.ImageComboBoxEdit();
+            this.layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.txtFreqUp = new DevExpress.XtraEditors.ButtonEdit();
+            this.layoutControlItem8 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.txtBand = new DevExpress.XtraEditors.ButtonEdit();
+            this.layoutControlItem9 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.txtSpeed = new DevExpress.XtraEditors.ButtonEdit();
+            this.layoutControlItem10 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.btnSaveOther = new DevExpress.XtraEditors.SimpleButton();
+            this.layoutControlItem11 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.btnSave = new DevExpress.XtraEditors.SimpleButton();
+            this.layoutControlItem12 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem();
+            this.dxErrorProvider = new DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider(this.components);
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
+            this.layoutControl1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtTaskName.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.radioSimulationType.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtMainSat.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit1View)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtAdjaSat1.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit2View)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtAdjaSat2.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit3View)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtTx.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtRefStation.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtFreqUp.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtBand.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtSpeed.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem11)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem12)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dxErrorProvider)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // layoutControl1
+            // 
+            this.layoutControl1.Controls.Add(this.btnSave);
+            this.layoutControl1.Controls.Add(this.btnSaveOther);
+            this.layoutControl1.Controls.Add(this.txtSpeed);
+            this.layoutControl1.Controls.Add(this.txtBand);
+            this.layoutControl1.Controls.Add(this.txtFreqUp);
+            this.layoutControl1.Controls.Add(this.txtRefStation);
+            this.layoutControl1.Controls.Add(this.txtTx);
+            this.layoutControl1.Controls.Add(this.txtAdjaSat2);
+            this.layoutControl1.Controls.Add(this.txtAdjaSat1);
+            this.layoutControl1.Controls.Add(this.txtMainSat);
+            this.layoutControl1.Controls.Add(this.radioSimulationType);
+            this.layoutControl1.Controls.Add(this.txtTaskName);
+            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(403, 450);
+            this.layoutControl1.TabIndex = 0;
+            this.layoutControl1.Text = "layoutControl1";
+            // 
+            // Root
+            // 
+            this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
+            this.Root.GroupBordersVisible = false;
+            this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
+            this.layoutControlItem1,
+            this.emptySpaceItem1,
+            this.layoutControlItem2,
+            this.layoutControlItem3,
+            this.layoutControlItem4,
+            this.layoutControlItem5,
+            this.layoutControlItem6,
+            this.layoutControlItem8,
+            this.layoutControlItem9,
+            this.layoutControlItem10,
+            this.layoutControlItem7,
+            this.layoutControlItem11,
+            this.layoutControlItem12,
+            this.emptySpaceItem2});
+            this.Root.Name = "Root";
+            this.Root.Size = new System.Drawing.Size(403, 450);
+            this.Root.TextVisible = false;
+            // 
+            // txtTaskName
+            // 
+            this.txtTaskName.Location = new System.Drawing.Point(12, 29);
+            this.txtTaskName.Name = "txtTaskName";
+            this.txtTaskName.Size = new System.Drawing.Size(379, 20);
+            this.txtTaskName.StyleController = this.layoutControl1;
+            this.txtTaskName.TabIndex = 4;
+            // 
+            // layoutControlItem1
+            // 
+            this.layoutControlItem1.Control = this.txtTaskName;
+            this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
+            this.layoutControlItem1.Name = "layoutControlItem1";
+            this.layoutControlItem1.Size = new System.Drawing.Size(383, 41);
+            this.layoutControlItem1.Text = "任务名称";
+            this.layoutControlItem1.TextLocation = DevExpress.Utils.Locations.Top;
+            this.layoutControlItem1.TextSize = new System.Drawing.Size(48, 14);
+            // 
+            // emptySpaceItem1
+            // 
+            this.emptySpaceItem1.AllowHotTrack = false;
+            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 338);
+            this.emptySpaceItem1.Name = "emptySpaceItem1";
+            this.emptySpaceItem1.Size = new System.Drawing.Size(383, 92);
+            this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
+            // 
+            // radioSimulationType
+            // 
+            this.radioSimulationType.Location = new System.Drawing.Point(12, 70);
+            this.radioSimulationType.Name = "radioSimulationType";
+            this.radioSimulationType.Size = new System.Drawing.Size(379, 42);
+            this.radioSimulationType.StyleController = this.layoutControl1;
+            this.radioSimulationType.TabIndex = 5;
+            // 
+            // layoutControlItem2
+            // 
+            this.layoutControlItem2.Control = this.radioSimulationType;
+            this.layoutControlItem2.Location = new System.Drawing.Point(0, 41);
+            this.layoutControlItem2.MinSize = new System.Drawing.Size(54, 60);
+            this.layoutControlItem2.Name = "layoutControlItem2";
+            this.layoutControlItem2.Size = new System.Drawing.Size(383, 63);
+            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);
+            // 
+            // txtMainSat
+            // 
+            this.txtMainSat.Location = new System.Drawing.Point(12, 133);
+            this.txtMainSat.Name = "txtMainSat";
+            this.txtMainSat.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            this.txtMainSat.Properties.PopupView = this.searchLookUpEdit1View;
+            this.txtMainSat.Size = new System.Drawing.Size(379, 20);
+            this.txtMainSat.StyleController = this.layoutControl1;
+            this.txtMainSat.TabIndex = 6;
+            // 
+            // layoutControlItem3
+            // 
+            this.layoutControlItem3.Control = this.txtMainSat;
+            this.layoutControlItem3.Location = new System.Drawing.Point(0, 104);
+            this.layoutControlItem3.Name = "layoutControlItem3";
+            this.layoutControlItem3.Size = new System.Drawing.Size(383, 41);
+            this.layoutControlItem3.Text = "主星";
+            this.layoutControlItem3.TextLocation = DevExpress.Utils.Locations.Top;
+            this.layoutControlItem3.TextSize = new System.Drawing.Size(48, 14);
+            // 
+            // searchLookUpEdit1View
+            // 
+            this.searchLookUpEdit1View.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
+            this.searchLookUpEdit1View.Name = "searchLookUpEdit1View";
+            this.searchLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false;
+            this.searchLookUpEdit1View.OptionsView.ShowGroupPanel = false;
+            // 
+            // txtAdjaSat1
+            // 
+            this.txtAdjaSat1.Location = new System.Drawing.Point(12, 174);
+            this.txtAdjaSat1.Name = "txtAdjaSat1";
+            this.txtAdjaSat1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            this.txtAdjaSat1.Properties.PopupView = this.searchLookUpEdit2View;
+            this.txtAdjaSat1.Size = new System.Drawing.Size(379, 20);
+            this.txtAdjaSat1.StyleController = this.layoutControl1;
+            this.txtAdjaSat1.TabIndex = 7;
+            // 
+            // layoutControlItem4
+            // 
+            this.layoutControlItem4.Control = this.txtAdjaSat1;
+            this.layoutControlItem4.Location = new System.Drawing.Point(0, 145);
+            this.layoutControlItem4.Name = "layoutControlItem4";
+            this.layoutControlItem4.Size = new System.Drawing.Size(383, 41);
+            this.layoutControlItem4.Text = "邻星1";
+            this.layoutControlItem4.TextLocation = DevExpress.Utils.Locations.Top;
+            this.layoutControlItem4.TextSize = new System.Drawing.Size(48, 14);
+            // 
+            // searchLookUpEdit2View
+            // 
+            this.searchLookUpEdit2View.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
+            this.searchLookUpEdit2View.Name = "searchLookUpEdit2View";
+            this.searchLookUpEdit2View.OptionsSelection.EnableAppearanceFocusedCell = false;
+            this.searchLookUpEdit2View.OptionsView.ShowGroupPanel = false;
+            // 
+            // txtAdjaSat2
+            // 
+            this.txtAdjaSat2.Location = new System.Drawing.Point(12, 215);
+            this.txtAdjaSat2.Name = "txtAdjaSat2";
+            this.txtAdjaSat2.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            this.txtAdjaSat2.Properties.PopupView = this.searchLookUpEdit3View;
+            this.txtAdjaSat2.Size = new System.Drawing.Size(379, 20);
+            this.txtAdjaSat2.StyleController = this.layoutControl1;
+            this.txtAdjaSat2.TabIndex = 8;
+            // 
+            // layoutControlItem5
+            // 
+            this.layoutControlItem5.Control = this.txtAdjaSat2;
+            this.layoutControlItem5.Location = new System.Drawing.Point(0, 186);
+            this.layoutControlItem5.Name = "layoutControlItem5";
+            this.layoutControlItem5.Size = new System.Drawing.Size(383, 41);
+            this.layoutControlItem5.Text = "邻星2";
+            this.layoutControlItem5.TextLocation = DevExpress.Utils.Locations.Top;
+            this.layoutControlItem5.TextSize = new System.Drawing.Size(48, 14);
+            // 
+            // searchLookUpEdit3View
+            // 
+            this.searchLookUpEdit3View.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
+            this.searchLookUpEdit3View.Name = "searchLookUpEdit3View";
+            this.searchLookUpEdit3View.OptionsSelection.EnableAppearanceFocusedCell = false;
+            this.searchLookUpEdit3View.OptionsView.ShowGroupPanel = false;
+            // 
+            // txtTx
+            // 
+            this.txtTx.Location = new System.Drawing.Point(12, 256);
+            this.txtTx.Name = "txtTx";
+            this.txtTx.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            this.txtTx.Size = new System.Drawing.Size(187, 20);
+            this.txtTx.StyleController = this.layoutControl1;
+            this.txtTx.TabIndex = 9;
+            // 
+            // layoutControlItem6
+            // 
+            this.layoutControlItem6.Control = this.txtTx;
+            this.layoutControlItem6.Location = new System.Drawing.Point(0, 227);
+            this.layoutControlItem6.Name = "layoutControlItem6";
+            this.layoutControlItem6.Size = new System.Drawing.Size(191, 41);
+            this.layoutControlItem6.Text = "天线";
+            this.layoutControlItem6.TextLocation = DevExpress.Utils.Locations.Top;
+            this.layoutControlItem6.TextSize = new System.Drawing.Size(48, 14);
+            // 
+            // txtRefStation
+            // 
+            this.txtRefStation.Location = new System.Drawing.Point(203, 256);
+            this.txtRefStation.Name = "txtRefStation";
+            this.txtRefStation.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            this.txtRefStation.Size = new System.Drawing.Size(188, 20);
+            this.txtRefStation.StyleController = this.layoutControl1;
+            this.txtRefStation.TabIndex = 10;
+            // 
+            // layoutControlItem7
+            // 
+            this.layoutControlItem7.Control = this.txtRefStation;
+            this.layoutControlItem7.Location = new System.Drawing.Point(191, 227);
+            this.layoutControlItem7.Name = "layoutControlItem7";
+            this.layoutControlItem7.Size = new System.Drawing.Size(192, 41);
+            this.layoutControlItem7.Text = "参考站";
+            this.layoutControlItem7.TextLocation = DevExpress.Utils.Locations.Top;
+            this.layoutControlItem7.TextSize = new System.Drawing.Size(48, 14);
+            // 
+            // txtFreqUp
+            // 
+            this.txtFreqUp.Location = new System.Drawing.Point(12, 297);
+            this.txtFreqUp.Name = "txtFreqUp";
+            this.txtFreqUp.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "Hz", -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(124, 23);
+            this.txtFreqUp.StyleController = this.layoutControl1;
+            this.txtFreqUp.TabIndex = 11;
+            // 
+            // layoutControlItem8
+            // 
+            this.layoutControlItem8.Control = this.txtFreqUp;
+            this.layoutControlItem8.Location = new System.Drawing.Point(0, 268);
+            this.layoutControlItem8.Name = "layoutControlItem8";
+            this.layoutControlItem8.Size = new System.Drawing.Size(128, 44);
+            this.layoutControlItem8.Text = "上行频点";
+            this.layoutControlItem8.TextLocation = DevExpress.Utils.Locations.Top;
+            this.layoutControlItem8.TextSize = new System.Drawing.Size(48, 14);
+            // 
+            // txtBand
+            // 
+            this.txtBand.Location = new System.Drawing.Point(140, 297);
+            this.txtBand.Name = "txtBand";
+            this.txtBand.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "Hz", -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.txtBand.Size = new System.Drawing.Size(123, 23);
+            this.txtBand.StyleController = this.layoutControl1;
+            this.txtBand.TabIndex = 12;
+            // 
+            // layoutControlItem9
+            // 
+            this.layoutControlItem9.Control = this.txtBand;
+            this.layoutControlItem9.Location = new System.Drawing.Point(128, 268);
+            this.layoutControlItem9.Name = "layoutControlItem9";
+            this.layoutControlItem9.Size = new System.Drawing.Size(127, 44);
+            this.layoutControlItem9.Text = "信号带宽";
+            this.layoutControlItem9.TextLocation = DevExpress.Utils.Locations.Top;
+            this.layoutControlItem9.TextSize = new System.Drawing.Size(48, 14);
+            // 
+            // txtSpeed
+            // 
+            this.txtSpeed.Location = new System.Drawing.Point(267, 297);
+            this.txtSpeed.Name = "txtSpeed";
+            this.txtSpeed.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "m/s", -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.txtSpeed.Size = new System.Drawing.Size(124, 23);
+            this.txtSpeed.StyleController = this.layoutControl1;
+            this.txtSpeed.TabIndex = 13;
+            // 
+            // layoutControlItem10
+            // 
+            this.layoutControlItem10.Control = this.txtSpeed;
+            this.layoutControlItem10.Location = new System.Drawing.Point(255, 268);
+            this.layoutControlItem10.Name = "layoutControlItem10";
+            this.layoutControlItem10.Size = new System.Drawing.Size(128, 44);
+            this.layoutControlItem10.Text = "速度";
+            this.layoutControlItem10.TextLocation = DevExpress.Utils.Locations.Top;
+            this.layoutControlItem10.TextSize = new System.Drawing.Size(48, 14);
+            // 
+            // btnSaveOther
+            // 
+            this.btnSaveOther.Location = new System.Drawing.Point(289, 324);
+            this.btnSaveOther.Name = "btnSaveOther";
+            this.btnSaveOther.Size = new System.Drawing.Size(47, 22);
+            this.btnSaveOther.StyleController = this.layoutControl1;
+            this.btnSaveOther.TabIndex = 14;
+            this.btnSaveOther.Text = "另存";
+            // 
+            // layoutControlItem11
+            // 
+            this.layoutControlItem11.Control = this.btnSaveOther;
+            this.layoutControlItem11.Location = new System.Drawing.Point(277, 312);
+            this.layoutControlItem11.Name = "layoutControlItem11";
+            this.layoutControlItem11.Size = new System.Drawing.Size(51, 26);
+            this.layoutControlItem11.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem11.TextVisible = false;
+            // 
+            // btnSave
+            // 
+            this.btnSave.Location = new System.Drawing.Point(340, 324);
+            this.btnSave.Name = "btnSave";
+            this.btnSave.Size = new System.Drawing.Size(51, 22);
+            this.btnSave.StyleController = this.layoutControl1;
+            this.btnSave.TabIndex = 15;
+            this.btnSave.Text = "保存";
+            // 
+            // layoutControlItem12
+            // 
+            this.layoutControlItem12.Control = this.btnSave;
+            this.layoutControlItem12.Location = new System.Drawing.Point(328, 312);
+            this.layoutControlItem12.Name = "layoutControlItem12";
+            this.layoutControlItem12.Size = new System.Drawing.Size(55, 26);
+            this.layoutControlItem12.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem12.TextVisible = false;
+            // 
+            // emptySpaceItem2
+            // 
+            this.emptySpaceItem2.AllowHotTrack = false;
+            this.emptySpaceItem2.Location = new System.Drawing.Point(0, 312);
+            this.emptySpaceItem2.Name = "emptySpaceItem2";
+            this.emptySpaceItem2.Size = new System.Drawing.Size(277, 26);
+            this.emptySpaceItem2.TextSize = new System.Drawing.Size(0, 0);
+            // 
+            // dxErrorProvider
+            // 
+            this.dxErrorProvider.ContainerControl = this;
+            // 
+            // TaskEditor
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(403, 450);
+            this.Controls.Add(this.layoutControl1);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
+            this.Name = "TaskEditor";
+            this.Text = "TaskEditor";
+            this.Load += new System.EventHandler(this.TaskEditor_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
+            this.layoutControl1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtTaskName.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.radioSimulationType.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtMainSat.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit1View)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtAdjaSat1.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit2View)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtAdjaSat2.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit3View)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtTx.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtRefStation.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtFreqUp.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtBand.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtSpeed.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem11)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem12)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dxErrorProvider)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private DevExpress.XtraLayout.LayoutControl layoutControl1;
+        private DevExpress.XtraLayout.LayoutControlGroup Root;
+        private DevExpress.XtraEditors.TextEdit txtTaskName;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
+        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1;
+        private DevExpress.XtraEditors.RadioGroup radioSimulationType;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
+        private DevExpress.XtraEditors.SearchLookUpEdit txtMainSat;
+        private DevExpress.XtraGrid.Views.Grid.GridView searchLookUpEdit1View;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3;
+        private DevExpress.XtraEditors.SearchLookUpEdit txtAdjaSat2;
+        private DevExpress.XtraGrid.Views.Grid.GridView searchLookUpEdit3View;
+        private DevExpress.XtraEditors.SearchLookUpEdit txtAdjaSat1;
+        private DevExpress.XtraGrid.Views.Grid.GridView searchLookUpEdit2View;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5;
+        private DevExpress.XtraEditors.ButtonEdit txtSpeed;
+        private DevExpress.XtraEditors.ButtonEdit txtBand;
+        private DevExpress.XtraEditors.ButtonEdit txtFreqUp;
+        private DevExpress.XtraEditors.ImageComboBoxEdit txtRefStation;
+        private DevExpress.XtraEditors.ImageComboBoxEdit txtTx;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem6;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem8;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem9;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem10;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem7;
+        private DevExpress.XtraEditors.SimpleButton btnSave;
+        private DevExpress.XtraEditors.SimpleButton btnSaveOther;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem11;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem12;
+        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem2;
+        private DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider dxErrorProvider;
+    }
+}

+ 78 - 0
DataSimulation.Forms/EditForms/TaskEditor.cs

@@ -0,0 +1,78 @@
+using DataSimulation.Repostory.EFContext;
+using DataSimulation.Repostory.Model;
+using DevExpress.Utils.About;
+using DevExpress.XtraEditors.Controls;
+using DxHelper;
+using ExtensionsDev;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Data.Entity;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace DataSimulation.Forms.EditForms
+{
+    public partial class TaskEditor : DevExpress.XtraEditors.XtraForm
+    {
+        public TaskInfo info;
+        public TaskEditor()
+        {
+            InitializeComponent();
+            this.layoutControl1.UseDefault();
+            this.Text = "添加任务";
+            info = new TaskInfo();
+            this.StartPosition = FormStartPosition.CenterParent;
+            //加载DW类型
+            List<RadioGroupItem> radioGroups = new List<RadioGroupItem>();
+            var values = Enum.GetValues(typeof(EnumSimulationType));
+            foreach (var item in values)
+            {
+                radioGroups.Add(new RadioGroupItem(Convert.ToInt32(item), ((EnumSimulationType)item).GetEnumDisplayName()));
+            }
+            this.radioSimulationType.Properties.Items.AddRange(radioGroups.ToArray());
+        }
+
+        public TaskEditor(TaskInfo info)
+          : this()
+        {
+            this.Text = "编辑任务";
+            this.info = info;
+        }
+
+        private async void TaskEditor_Load(object sender, EventArgs e)
+        {
+            using (SimulationContext db = new SimulationContext())
+            {
+                var sats = await db.SatInfos.ToListAsync();
+                this.txtMainSat.UseDefault().SetData(sats, nameof(SatInfo.Sat)).UseDoubleClickToSelectAll();
+                this.txtAdjaSat1.UseDefault().SetData(sats, nameof(SatInfo.Sat)).UseDoubleClickToSelectAll();
+                this.txtAdjaSat2.UseDefault().SetData(sats, nameof(SatInfo.Sat)).UseDoubleClickToSelectAll();
+            }
+            if (this.Text == "编辑任务" && info != null)
+            {
+                using (SimulationContext db = new SimulationContext())
+                {
+                    var satMain = await db.SatInfos.Where(w => w.SatCode == info.MainSat).FirstOrDefaultAsync();
+                    var satAdja1 = await db.SatInfos.Where(w => w.SatCode == info.Adja1Sat).FirstOrDefaultAsync();
+                    var satAdja2 = await db.SatInfos.Where(w => w.SatCode == info.Adja2Sat).FirstOrDefaultAsync();
+
+                    this.txtTaskName.Text = info.TaskName;
+                    this.radioSimulationType.SelectedIndex = (int)info.SimulationType;
+                    this.txtMainSat.EditValue = satMain;
+                    this.txtAdjaSat1.EditValue = satAdja1;
+                    this.txtAdjaSat2.EditValue = satAdja2;
+                    this.txtTx.EditValue = info.AntID;
+                    this.txtRefStation.EditValue = info.RefID;
+                    this.txtFreqUp.EditValue = info.Freq * (decimal)1e-6;
+                    this.txtBand.EditValue = info.Band * (decimal)1e-6;
+                    this.txtSpeed.EditValue = info.Speed;
+                }
+            }
+        }
+    }
+}

+ 123 - 0
DataSimulation.Forms/EditForms/TaskEditor.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>

+ 336 - 0
DataSimulation.Forms/Localizer/ChsLocalizer.cs

@@ -0,0 +1,336 @@
+using DevExpress.XtraBars.Docking2010;
+using DevExpress.XtraBars.Localization;
+using DevExpress.XtraEditors;
+using DevExpress.XtraEditors.Controls;
+using DevExpress.XtraGrid.Localization;
+using DevExpress.XtraLayout.Localization;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DataSimulation.Forms
+{
+    static class ChsLocalizer
+    {
+        /// <summary>
+        /// UI控件本地化
+        /// </summary>
+        public static void UseChs()
+        {
+            //GridControl
+            GridLocalizer.Active = new ChsGridLocalizer();
+
+            //Bar
+            BarLocalizer.Active = new ChsBarLocalizer();
+
+            //DocumentManager
+            DocumentManagerLocalizer.Active = new ChsDocumentManagerLocalizer();
+
+            //LayoutControl
+            LayoutLocalizer.Active = new ChsLayoutLocalizer();
+
+            //Control
+            Localizer.Active = new ChsControlLocalizer();
+        }
+
+    }
+    class ChsControlLocalizer : Localizer
+    {
+        public override string GetLocalizedString(StringId id)
+        {
+            switch (id)
+            {
+                case StringId.TextEditMenuUndo:
+                    return "撤销";
+                case StringId.TextEditMenuCut:
+                    return "剪切";
+                case StringId.TextEditMenuCopy:
+                    return "复制";
+                case StringId.TextEditMenuPaste:
+                    return "粘贴";
+                case StringId.TextEditMenuDelete:
+                    return "删除";
+                case StringId.TextEditMenuSelectAll:
+                    return "全选";
+                case StringId.XtraMessageBoxYesButtonText:
+                    return "是";
+                case StringId.XtraMessageBoxNoButtonText:
+                    return "否";
+                case StringId.XtraMessageBoxOkButtonText:
+                    return "确定";
+                case StringId.XtraMessageBoxCancelButtonText:
+                    return "取消";
+                case StringId.XtraMessageBoxRetryButtonText:
+                    return "重试";
+                case StringId.NavigatorTextStringFormat:
+                    return "Record {0} of {1}";
+                case StringId.SearchControlNullValuePrompt:
+                    return "输入搜索文本...";
+                case StringId.TabHeaderButtonClose:
+                    return "关闭选项卡";
+            }
+            var res = base.GetLocalizedString(id);
+            return res;
+        }
+    }
+
+    class ChsGridLocalizer : GridLocalizer
+    {
+        public override string GetLocalizedString(GridStringId id)
+        {
+            switch (id)
+            {
+                case GridStringId.MenuColumnSortAscending:
+                    return "升序排列";
+                case GridStringId.MenuColumnSortDescending:
+                    return "降序排列";
+                case GridStringId.MenuColumnUnGroup:
+                    return "取消分组";
+                case GridStringId.MenuColumnGroup:
+                    return "分组";
+                case GridStringId.MenuGroupPanelShow:
+                    return "显示分组面板";
+                case GridStringId.MenuGroupPanelHide:
+                    return "隐藏分组面板";
+                case GridStringId.MenuColumnRemoveColumn:
+                    return "移除列";
+                case GridStringId.MenuColumnColumnCustomization:
+                    return "列选择";
+                case GridStringId.MenuColumnBestFit:
+                    return "最佳匹配";
+                case GridStringId.MenuColumnBestFitAllColumns:
+                    return "最佳匹配(所有列)";
+                case GridStringId.MenuColumnFilterEditor:
+                    return "自定义筛选";
+                case GridStringId.MenuColumnFindFilterShow:
+                    return "显示搜索面板";
+                case GridStringId.MenuColumnFindFilterHide:
+                    return "隐藏搜索面板";
+                case GridStringId.MenuColumnAutoFilterRowShow:
+                    return "显示自动过滤";
+                case GridStringId.MenuColumnAutoFilterRowHide:
+                    return "隐藏自动过滤";
+                case GridStringId.FindNullPrompt:
+                    return "输入搜索文本...";
+                case GridStringId.FindControlFindButton:
+                    return "搜索";
+                case GridStringId.FindControlClearButton:
+                    return "清除";
+                case GridStringId.FindControlNextButton:
+                    return "下一项";
+                case GridStringId.FindControlPrevButton:
+                    return "上一项";
+                case GridStringId.CustomizationCaption:
+                    return "自定义";
+                case GridStringId.CustomizationFormColumnHint:
+                    return "拖拽列到此处以自定义布局";
+                case GridStringId.GridGroupPanelText:
+                    return "拖拽列到此处以分组";
+                case GridStringId.MenuColumnShowColumn:
+                    return "显示此列";
+                case GridStringId.MenuColumnClearSorting:
+                    return "清除排序";
+                case GridStringId.MenuColumnClearAllSorting:
+                    return "清除所有排序";
+                case GridStringId.FilterPanelCustomizeButton:
+                    return "自定义";
+                case GridStringId.FilterBuilderOkButton:
+                    return "确定";
+                case GridStringId.FilterBuilderCancelButton:
+                    return "取消";
+                case GridStringId.FilterBuilderApplyButton:
+                    return "应用";
+                case GridStringId.MenuGroupPanelFullExpand:
+                    return "全部展开";
+                case GridStringId.MenuGroupPanelFullCollapse:
+                    return "全部折叠";
+                case GridStringId.MenuGroupPanelClearGrouping:
+                    return "清除分组";
+                case GridStringId.FilterBuilderCaption:
+                    return "筛选条件";
+                case GridStringId.MenuColumnClearFilter:
+                    return "取消过滤";
+            }
+            var res = base.GetLocalizedString(id);
+            return res;
+        }
+    }
+
+    class ChsBarLocalizer : BarLocalizer
+    {
+        public override string GetLocalizedString(BarString id)
+        {
+            switch (id)
+            {
+                case BarString.CloseButton:
+                    return "关闭";
+                case BarString.RibbonToolbarAdd:
+                    return "添加快速访问工具栏";
+                case BarString.RibbonToolbarRemove:
+                    return "移除快速访问工具栏";
+                case BarString.RibbonToolbarMinimizeRibbon:
+                    return "最小化功能区";
+                case BarString.CollapseRibbonSuperTipHeader:
+                    return "最小化任务栏(Ctrl+F1)";
+                case BarString.CollapseRibbonSuperTipText:
+                    return "在任务栏中只显示标签名";
+                case BarString.CustomizeToolbarText:
+                    return "自定义工具栏";
+                case BarString.ExpandRibbonSuperTipHeader:
+                    return "展开任务栏(Ctrl+F1)";
+                case BarString.ExpandRibbonSuperTipText:
+                    return "始终展开任务栏";
+                case BarString.RestoreButton:
+                    return "还原";
+                case BarString.MinimizeButton:
+                    return "最小化";
+                case BarString.CustomizeButton:
+                    return "自定义";
+                case BarString.ToolbarNameCaption:
+                    return "工具栏";
+            }
+            var res = base.GetLocalizedString(id);
+            return res;
+        }
+    }
+
+    class ChsDocumentManagerLocalizer : DevExpress.XtraBars.Docking2010.DocumentManagerLocalizer
+    {
+        public override string GetLocalizedString(DocumentManagerStringId id)
+        {
+            switch (id)
+            {
+                case DocumentManagerStringId.CommandCloseAll:
+                    return "关闭所有文档";
+                case DocumentManagerStringId.CommandOpenedWindowsDialog:
+                    return "窗体...";
+                case DocumentManagerStringId.ActivateDocumentButtonText:
+                    return "激活";
+                case DocumentManagerStringId.CloseDocumentButtonText:
+                    return "关闭窗体";
+                case DocumentManagerStringId.CloseAllDocumentsButtonText:
+                    return "关闭所有";
+                case DocumentManagerStringId.OpenedWindowsDialogNameColumnCaption:
+                    return "名称";
+                case DocumentManagerStringId.OpenedWindowsDialogPathColumnCaption:
+                    return "路径";
+                case DocumentManagerStringId.OpenedWindowsDialogCaption:
+                    return "窗口";
+                case DocumentManagerStringId.CloseAllDocumentsWarningMessage:
+                    return "确定关闭所有文档";
+                case DocumentManagerStringId.CloseDocumentWarningMessage:
+                    return "确定关闭文档[{0}]?";
+            }
+            var res = base.GetLocalizedString(id);
+            return res;
+        }
+    }
+    class ChsLayoutLocalizer : LayoutLocalizer
+    {
+        public override string GetLocalizedString(LayoutStringId id)
+        {
+            switch (id)
+            {
+                case LayoutStringId.AddItem:
+                    return "添加项";
+                case LayoutStringId.ShowCustomizationFormMenuText:
+                    return "定制面板";
+                case LayoutStringId.UndoHintCaption:
+                    return "撤销(Ctrl+Z)";
+                case LayoutStringId.RedoHintCaption:
+                    return "重复(Ctrl+Y)";
+                case LayoutStringId.SaveHintCaption:
+                    return "保存(Ctrl+S)";
+                case LayoutStringId.LoadHintCaption:
+                    return "加载(Ctrl+O)";
+                case LayoutStringId.UndoButtonHintText:
+                    return "撤销上次操作";
+                case LayoutStringId.RedoButtonHintText:
+                    return "重复上次操作";
+                case LayoutStringId.SaveButtonHintText:
+                    return "将布局信息保存在xml文件中";
+                case LayoutStringId.LoadButtonHintText:
+                    return "从xml文件中加载布局信息";
+                case LayoutStringId.CustomizationFormTitle:
+                    return "自定义";
+                case LayoutStringId.ControlGroupDefaultText:
+                    return "分组";
+                case LayoutStringId.TreeViewPageTitle:
+                    return "树状视图";
+                case LayoutStringId.HiddenItemsPageTitle:
+                    return "隐藏条目";
+                case LayoutStringId.EmptySpaceItemDefaultText:
+                    return "空白区域项目";
+                case LayoutStringId.HiddenItemsNodeText:
+                    return "隐藏数据项";
+                case LayoutStringId.SimpleLabelItemDefaultText:
+                    return "标签";
+                case LayoutStringId.SimpleSeparatorItemDefaultText:
+                    return "分隔符";
+                case LayoutStringId.SplitterItemDefaultText:
+                    return "拆分器";
+                case LayoutStringId.HideCustomizationFormMenuText:
+                    return "隐藏布局面板";
+                case LayoutStringId.BestFitMenuText:
+                    return "最佳匹配";
+                case LayoutStringId.LockMenuGroup:
+                    return "强制限定大小";
+                case LayoutStringId.ResetConstraintsToDefaultsMenuItem:
+                    return "重置";
+                case LayoutStringId.FreeSizingMenuItem:
+                    return "允许改变大小";
+                case LayoutStringId.LockSizeMenuItem:
+                    return "锁定大小";
+                case LayoutStringId.LockWidthMenuItem:
+                    return "锁定宽度";
+                case LayoutStringId.LockHeightMenuItem:
+                    return "锁定高度";
+                case LayoutStringId.RenameMenuText:
+                    return "重命名";
+                case LayoutStringId.ShowTextMenuItem:
+                    return "显示文本";
+                case LayoutStringId.HideTextMenuItem:
+                    return "隐藏文本";
+                case LayoutStringId.TextPositionMenuText:
+                    return "文本位置";
+                case LayoutStringId.TextPositionTopMenuText:
+                    return "上方";
+                case LayoutStringId.TextPositionBottomMenuText:
+                    return "下方";
+                case LayoutStringId.TextPositionLeftMenuText:
+                    return "左边";
+                case LayoutStringId.TextPositionRightMenuText:
+                    return "右边";
+                case LayoutStringId.HideItemMenutext:
+                    return "隐藏条目";
+                case LayoutStringId.GroupItemsMenuText:
+                    return "分组";
+                case LayoutStringId.CreateTabbedGroupMenuText:
+                    return "创建群组标签页";
+                case LayoutStringId.CreateEmptySpaceItem:
+                    return "创建空白区域项";
+                case LayoutStringId.UnGroupItemsMenuText:
+                    return "取消分组";
+                case LayoutStringId.ConvertToText:
+                    return "转换为";
+                case LayoutStringId.FlowLayoutText:
+                    return "流式布局";
+                case LayoutStringId.RegularLayoutText:
+                    return "常规布局";
+                case LayoutStringId.TableLayoutText:
+                    return "表格布局";
+                case LayoutStringId.GroupStyleMenuText:
+                    return "分组样式";
+                case LayoutStringId.UnGroupTabbedGroupMenuText:
+                    return "解除分组标签页";
+                case LayoutStringId.AddTabMenuText:
+                    return "添加标签页";
+            }
+            var res = base.GetLocalizedString(id);
+            return res;
+        }
+    }
+
+}

+ 90 - 7
DataSimulation.Forms/Program.cs

@@ -1,10 +1,15 @@
 using DevExpress.LookAndFeel;
 using DevExpress.Skins;
 using DevExpress.UserSkins;
+using DevExpress.XtraEditors;
+using Serilog;
 using System;
 using System.Collections.Generic;
+using System.Configuration;
+using System.Diagnostics;
 using System.Linq;
 using System.Reflection;
+using System.Security.Principal;
 using System.Windows.Forms;
 
 namespace DataSimulation.Forms
@@ -30,15 +35,93 @@ namespace DataSimulation.Forms
                 Serilog.Log.Error(e.Exception, "出现未处理的线程异常");
             };
         }
-            /// <summary>
-            /// The main entry point for the application.
-            /// </summary>
-            [STAThread]
+        static bool IsRunningAsAdmin()
+        {
+            bool result;
+            try
+            {
+                WindowsIdentity identity = WindowsIdentity.GetCurrent();
+                WindowsPrincipal principal = new WindowsPrincipal(identity);
+                result = principal.IsInRole(WindowsBuiltInRole.Administrator);
+            }
+            catch
+            {
+                result = false;
+            }
+            return result;
+        }
+        static void RestartAsAdmin()
+        {
+            var startInfo = new ProcessStartInfo();
+            startInfo.FileName = Application.ExecutablePath;
+            startInfo.Verb = "runas"; // 以管理员身份运行
+            try
+            {
+                Process.Start(startInfo);
+            }
+            catch (System.ComponentModel.Win32Exception)
+            {
+                // 用户取消了管理员权限提示,或者其他错误
+                // 可以在此处处理错误情况
+            }
+
+            Application.Exit();
+        }
+        /// <summary>
+        /// The main entry point for the application.
+        /// </summary>
+        [STAThread]
         static void Main()
         {
-            Application.EnableVisualStyles();
-            Application.SetCompatibleTextRenderingDefault(false);
-            Application.Run(new MainForm());
+            string outputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}  {Exception}";
+            Serilog.Log.Logger = new Serilog.LoggerConfiguration()
+                .WriteTo.Console(outputTemplate: outputTemplate)
+                .WriteTo.Logger(p => p.Filter.ByIncludingOnly(e => e.Level == Serilog.Events.LogEventLevel.Information)
+                    .WriteTo.File("Logs\\Info\\.log", rollingInterval: Serilog.RollingInterval.Day))
+                .WriteTo.Logger(p => p.Filter.ByIncludingOnly(e => e.Level == Serilog.Events.LogEventLevel.Warning)
+                    .WriteTo.File("Logs\\Warning\\.log", rollingInterval: Serilog.RollingInterval.Day))
+                .WriteTo.Logger(p => p.Filter.ByIncludingOnly(e => e.Level == Serilog.Events.LogEventLevel.Error)
+                    .WriteTo.File("Logs\\Error\\.log", rollingInterval: Serilog.RollingInterval.Day, outputTemplate: outputTemplate))
+                .CreateLogger();
+            //WindowsFormsSettings.AllowDpiScale = true;
+            //WindowsFormsSettings.AllowHoverAnimation = DevExpress.Utils.DefaultBoolean.True;
+            //WindowsFormsSettings.AllowDefaultSvgImages = DevExpress.Utils.DefaultBoolean.True;
+            //WindowsFormsSettings.AllowRoundedWindowCorners = DevExpress.Utils.DefaultBoolean.True;
+            //WindowsFormsSettings.AnimationMode = AnimationMode.EnableAll;
+            //WindowsFormsSettings.BackgroundSkinningMode = BackgroundSkinningMode.AllColors;
+            //WindowsFormsSettings.DefaultAllowHtmlDraw = true;
+            //WindowsFormsSettings.DefaultLookAndFeel.SetSkinStyle(SkinStyle.WXICompact);
+            //WindowsFormsSettings.DefaultFont = new System.Drawing.Font("微软雅黑", 10f);
+            //WindowsFormsSettings.SetPerMonitorDpiAware();
+
+            if (Debugger.IsAttached)
+            {
+                //DevExpress23.2以上版本查看未本地化的资源
+                //DevExpress.Utils.Localization.XtraLocalizer.EnableTraceSource();
+            }
+            if (IsRunningAsAdmin())
+            {
+                string screenTitle = ConfigurationManager.AppSettings["SystemName"];
+                string screenCompany = ConfigurationManager.AppSettings["Company"];
+                DxHelper.WaitHelper.SetSplashTips("Tips.txt");
+                ChsLocalizer.UseChs();
+
+
+                DxHelper.WaitHelper.ShowSplashScreen(screenTitle, screenCompany);
+                DxHelper.WaitHelper.UpdateSplashMessage("正在加载程序资源文件...");
+                MainForm mainForm = new MainForm() { Text = screenTitle };
+                DxHelper.WaitHelper.UpdateSplashMessage("正在初始化...");
+                System.Windows.Forms.Application.Run(mainForm);
+            }
+            else
+            {
+                RestartAsAdmin();
+             }
+
+            //ChsLocalizer.UseChs();
+            //Application.EnableVisualStyles();
+            //Application.SetCompatibleTextRenderingDefault(false);
+            //Application.Run(new MainForm());
         }
     }
 }

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

@@ -1,11 +1,12 @@
-DevExpress.XtraCharts.Heatmap.HeatmapControl, DevExpress.XtraCharts.v23.2.UI, 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.XtraBars.Docking.DockManager, DevExpress.XtraBars.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.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.XtraBars.Docking.DockManager, DevExpress.XtraBars.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
 DevExpress.XtraBars.BarManager, DevExpress.XtraBars.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.XtraEditors.SearchLookUpEdit, DevExpress.XtraGrid.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.ImageComboBoxEdit, DevExpress.XtraEditors.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.XtraEditors.TextEdit, DevExpress.XtraEditors.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.XtraMap.MapControl, DevExpress.XtraMap.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

+ 17 - 55
DataSimulation.Forms/UserControl/CtrlHome.Designer.cs

@@ -48,9 +48,6 @@
             this.barDockControlBottom = new DevExpress.XtraBars.BarDockControl();
             this.barDockControlLeft = new DevExpress.XtraBars.BarDockControl();
             this.barDockControlRight = new DevExpress.XtraBars.BarDockControl();
-            this.bar1 = new DevExpress.XtraBars.Bar();
-            this.bar2 = new DevExpress.XtraBars.Bar();
-            this.bar3 = new DevExpress.XtraBars.Bar();
             this.popupMenu = new DevExpress.XtraBars.PopupMenu(this.components);
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
             this.layoutControl1.SuspendLayout();
@@ -72,10 +69,10 @@
             this.layoutControl1.Controls.Add(this.mapControl);
             this.layoutControl1.Controls.Add(this.gridControl);
             this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.layoutControl1.Location = new System.Drawing.Point(0, 41);
+            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(1170, 585);
+            this.layoutControl1.Size = new System.Drawing.Size(1170, 646);
             this.layoutControl1.TabIndex = 0;
             this.layoutControl1.Text = "layoutControl1";
             // 
@@ -83,7 +80,7 @@
             // 
             this.mapControl.Location = new System.Drawing.Point(301, 12);
             this.mapControl.Name = "mapControl";
-            this.mapControl.Size = new System.Drawing.Size(857, 561);
+            this.mapControl.Size = new System.Drawing.Size(857, 622);
             this.mapControl.TabIndex = 5;
             // 
             // gridControl
@@ -91,7 +88,7 @@
             this.gridControl.Location = new System.Drawing.Point(15, 38);
             this.gridControl.MainView = this.gridView;
             this.gridControl.Name = "gridControl";
-            this.gridControl.Size = new System.Drawing.Size(269, 532);
+            this.gridControl.Size = new System.Drawing.Size(269, 593);
             this.gridControl.TabIndex = 4;
             this.gridControl.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
             this.gridView});
@@ -110,7 +107,7 @@
             this.layoutControlGroup,
             this.splitterItem1});
             this.Root.Name = "Root";
-            this.Root.Size = new System.Drawing.Size(1170, 585);
+            this.Root.Size = new System.Drawing.Size(1170, 646);
             this.Root.TextVisible = false;
             // 
             // layoutControlItem2
@@ -118,7 +115,7 @@
             this.layoutControlItem2.Control = this.mapControl;
             this.layoutControlItem2.Location = new System.Drawing.Point(289, 0);
             this.layoutControlItem2.Name = "layoutControlItem2";
-            this.layoutControlItem2.Size = new System.Drawing.Size(861, 565);
+            this.layoutControlItem2.Size = new System.Drawing.Size(861, 626);
             this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
             this.layoutControlItem2.TextVisible = false;
             // 
@@ -140,15 +137,16 @@
             this.layoutControlGroup.Location = new System.Drawing.Point(0, 0);
             this.layoutControlGroup.Name = "layoutControlGroup";
             this.layoutControlGroup.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
-            this.layoutControlGroup.Size = new System.Drawing.Size(279, 565);
+            this.layoutControlGroup.Size = new System.Drawing.Size(279, 626);
             this.layoutControlGroup.Text = "任务管理";
+            this.layoutControlGroup.CustomButtonClick += new DevExpress.XtraBars.Docking2010.BaseButtonEventHandler(this.layoutControlGroup_CustomButtonClick);
             // 
             // layoutControlItem1
             // 
             this.layoutControlItem1.Control = this.gridControl;
             this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
             this.layoutControlItem1.Name = "layoutControlItem1";
-            this.layoutControlItem1.Size = new System.Drawing.Size(273, 536);
+            this.layoutControlItem1.Size = new System.Drawing.Size(273, 597);
             this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
             this.layoutControlItem1.TextVisible = false;
             // 
@@ -157,21 +155,15 @@
             this.splitterItem1.AllowHotTrack = true;
             this.splitterItem1.Location = new System.Drawing.Point(279, 0);
             this.splitterItem1.Name = "splitterItem1";
-            this.splitterItem1.Size = new System.Drawing.Size(10, 565);
+            this.splitterItem1.Size = new System.Drawing.Size(10, 626);
             // 
             // barManager
             // 
-            this.barManager.Bars.AddRange(new DevExpress.XtraBars.Bar[] {
-            this.bar1,
-            this.bar2,
-            this.bar3});
             this.barManager.DockControls.Add(this.barDockControlTop);
             this.barManager.DockControls.Add(this.barDockControlBottom);
             this.barManager.DockControls.Add(this.barDockControlLeft);
             this.barManager.DockControls.Add(this.barDockControlRight);
             this.barManager.Form = this;
-            this.barManager.MainMenu = this.bar2;
-            this.barManager.StatusBar = this.bar3;
             // 
             // barDockControlTop
             // 
@@ -179,58 +171,31 @@
             this.barDockControlTop.Dock = System.Windows.Forms.DockStyle.Top;
             this.barDockControlTop.Location = new System.Drawing.Point(0, 0);
             this.barDockControlTop.Manager = this.barManager;
-            this.barDockControlTop.Size = new System.Drawing.Size(1170, 41);
+            this.barDockControlTop.Size = new System.Drawing.Size(1170, 0);
             // 
             // barDockControlBottom
             // 
             this.barDockControlBottom.CausesValidation = false;
             this.barDockControlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
-            this.barDockControlBottom.Location = new System.Drawing.Point(0, 626);
+            this.barDockControlBottom.Location = new System.Drawing.Point(0, 646);
             this.barDockControlBottom.Manager = this.barManager;
-            this.barDockControlBottom.Size = new System.Drawing.Size(1170, 20);
+            this.barDockControlBottom.Size = new System.Drawing.Size(1170, 0);
             // 
             // barDockControlLeft
             // 
             this.barDockControlLeft.CausesValidation = false;
             this.barDockControlLeft.Dock = System.Windows.Forms.DockStyle.Left;
-            this.barDockControlLeft.Location = new System.Drawing.Point(0, 41);
+            this.barDockControlLeft.Location = new System.Drawing.Point(0, 0);
             this.barDockControlLeft.Manager = this.barManager;
-            this.barDockControlLeft.Size = new System.Drawing.Size(0, 585);
+            this.barDockControlLeft.Size = new System.Drawing.Size(0, 646);
             // 
             // barDockControlRight
             // 
             this.barDockControlRight.CausesValidation = false;
             this.barDockControlRight.Dock = System.Windows.Forms.DockStyle.Right;
-            this.barDockControlRight.Location = new System.Drawing.Point(1170, 41);
+            this.barDockControlRight.Location = new System.Drawing.Point(1170, 0);
             this.barDockControlRight.Manager = this.barManager;
-            this.barDockControlRight.Size = new System.Drawing.Size(0, 585);
-            // 
-            // bar1
-            // 
-            this.bar1.BarName = "Tools";
-            this.bar1.DockCol = 0;
-            this.bar1.DockStyle = DevExpress.XtraBars.BarDockStyle.Top;
-            this.bar1.Text = "Tools";
-            // 
-            // bar2
-            // 
-            this.bar2.BarName = "Main menu";
-            this.bar2.DockCol = 0;
-            this.bar2.DockStyle = DevExpress.XtraBars.BarDockStyle.Top;
-            this.bar2.OptionsBar.MultiLine = true;
-            this.bar2.OptionsBar.UseWholeRow = true;
-            this.bar2.Text = "Main menu";
-            // 
-            // bar3
-            // 
-            this.bar3.BarName = "Status bar";
-            this.bar3.CanDockStyle = DevExpress.XtraBars.BarCanDockStyle.Bottom;
-            this.bar3.DockCol = 0;
-            this.bar3.DockStyle = DevExpress.XtraBars.BarDockStyle.Bottom;
-            this.bar3.OptionsBar.AllowQuickCustomization = false;
-            this.bar3.OptionsBar.DrawDragBorder = false;
-            this.bar3.OptionsBar.UseWholeRow = true;
-            this.bar3.Text = "Status bar";
+            this.barDockControlRight.Size = new System.Drawing.Size(0, 646);
             // 
             // popupMenu
             // 
@@ -280,9 +245,6 @@
         private DevExpress.XtraLayout.SplitterItem splitterItem1;
         private DevExpress.Utils.SvgImageCollection svgImageCollection1;
         private DevExpress.XtraBars.BarManager barManager;
-        private DevExpress.XtraBars.Bar bar1;
-        private DevExpress.XtraBars.Bar bar2;
-        private DevExpress.XtraBars.Bar bar3;
         private DevExpress.XtraBars.BarDockControl barDockControlTop;
         private DevExpress.XtraBars.BarDockControl barDockControlBottom;
         private DevExpress.XtraBars.BarDockControl barDockControlLeft;

+ 81 - 15
DataSimulation.Forms/UserControl/CtrlHome.cs

@@ -1,13 +1,18 @@
-using DataSimulation.Repostory.EFContext;
+using DataSimulation.Forms.EditForms;
+using DataSimulation.Repostory;
+using DataSimulation.Repostory.EFContext;
 using DataSimulation.Repostory.Model;
 using DevExpress.Utils;
+using DevExpress.XtraEditors.ButtonsPanelControl;
 using DxHelper;
+using ExtensionsDev;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
 using System.Data.Entity;
 using System.Drawing;
+using System.IO;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -17,17 +22,21 @@ namespace DataSimulation.Forms.UserControl
 {
     public partial class CtrlHome : DevExpress.XtraEditors.XtraUserControl
     {
+        List<TaskInfo> taskList = new List<TaskInfo>();
         public CtrlHome()
         {
             InitializeComponent();
-             gridControl.Init<TaskInfo>().UseFilter();
-            mapControl.UseDefalutOptions()
+            gridControl.Init<TaskInfo>().UseFilter();
+            layoutControl1.UseDefault();
+            mapControl
+                .UseDefalutOptions()
           .UseClearAll()
           .UseDistanceLine()
           .UseMarkDot()
           .UseExportImg()
           .UseExportXlsx()
           .UseExportCsv()
+            .SetMapLayerType(null)
           .UseDrawRect(rect =>
           {
               (double startLon, double startLat, double centerLon, double centerLat, double endLon, double endLat, double lonRange, double latRange) = rect;
@@ -38,22 +47,32 @@ namespace DataSimulation.Forms.UserControl
         {
             try
             {
-                List<TaskInfo> list = new List<TaskInfo>();
-                using (SimulationContext db = new SimulationContext())
+
+                var yearDirs = Directory.EnumerateDirectories(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DbPart")).OrderByDescending(p => Convert.ToInt32(new DirectoryInfo(p).Name));//年目录,倒叙排列
+                foreach (var yearDir in yearDirs)
                 {
-                    var taskList = db.TaskInfos.OrderByDescending(p => p.UpdateTime).ToList();
-                    list.AddRange(taskList);
-                    var runningList = await db.TaskInfos.Where(p => p.TaskState == EnumTaskState.Running).ToListAsync();
-                    foreach (var item in runningList)
+                    //每一天的db文件,倒序排列
+                    var dayFiles = Directory.EnumerateFiles(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, yearDir), "*.db").OrderByDescending(p => Convert.ToInt32(new DirectoryInfo(p).Name.Substring(0, 4)));
+                    foreach (var dayFile in dayFiles)
                     {
-                        item.TaskState = EnumTaskState.Stopped;
+                        using (SimulationPartContext db = SimulationPartContext.GetContext(dayFile))
+                        {
+                            taskList.AddRange(await db.TaskInfos.ToListAsync());
+                            var runningList = await db.TaskInfos.Where(p => p.TaskState == EnumTaskState.Running).ToListAsync();
+                            foreach (var item in runningList)
+                            {
+                                item.TaskState = EnumTaskState.Stopped;
+                            }
+                            await db.SaveChangesAsync();
+                        }
                     }
-                    await db.SaveChangesAsync();
-                    gridControl.DataSource=list;
-                    gridView.Columns[nameof(TaskInfo.TaskName)].AppearanceCell.TextOptions.HAlignment = HorzAlignment.Near;
-                    this.svgImageCollection1.Add("Stopped", SvgHelper.CreateCycle("#1E8B58"));
-                    this.svgImageCollection1.Add("Running", SvgHelper.CreateCycle("#2E8B57"));
                 }
+
+
+                gridControl.DataSource = taskList;
+                gridView.Columns[nameof(TaskInfo.TaskName)].AppearanceCell.TextOptions.HAlignment = HorzAlignment.Near;
+                this.svgImageCollection1.Add("Stopped", SvgHelper.CreateCycle("#1E8B58"));
+                this.svgImageCollection1.Add("Running", SvgHelper.CreateCycle("#2E8B57"));
             }
             catch (Exception)
             {
@@ -61,5 +80,52 @@ namespace DataSimulation.Forms.UserControl
                 throw;
             }
         }
+
+        private async void layoutControlGroup_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e)
+        {
+            var txt = (e.Button as GroupBoxButton).Caption;
+            if (txt == "新建任务")
+            {
+                try
+                {
+                    TaskEditor frm = new TaskEditor();
+                    if (frm.ShowDialog() != DialogResult.OK) return;
+                    var addItem = frm.info;
+                    var taskList = await TaskCache.GetAllAsync();
+                    //if (await taskList.ToList().(p => p.TaskName == addItem.TaskName))
+                    //{
+                    //    DxHelper.MsgBoxHelper.ShowWarning("任务名称重复");
+                    //    return;
+                    //}
+                    //using (SimulationContext db = new RHDWContext())
+                    //{
+                    //    if (await db.TaskInfos.AnyAsync(p => p.TaskName == addItem.TaskName))
+                    //    {
+                    //        DxHelper.MsgBoxHelper.ShowWarning("任务名称重复");
+                    //        return;
+                    //    }
+                    //    if (addItem.PosType == EnumPosType.X1D1CX)
+                    //    {
+                    //        addItem.Adja1Sat = null;
+                    //        addItem.Adja2Sat = null;
+                    //    }
+                    //    else if (addItem.PosType == EnumPosType.X2D1 || addItem.PosType == EnumPosType.X2Dfo || addItem.PosType == EnumPosType.RH)
+                    //    {
+                    //        addItem.Adja2Sat = null;
+                    //    }
+                    //    db.TaskInfos.Add(addItem);
+                    //    await db.SaveChangesAsync();
+                    //}
+                    //list.Insert(0, addItem);
+                    //gridView1.RefreshData();
+                    //gridView1.FocusedRowHandle = 0;
+                }
+                catch (Exception ex)
+                {
+                    Serilog.Log.Error(ex, "保存任务异常");
+                    DxHelper.MsgBoxHelper.ShowError("保存任务异常");
+                }
+            }
+        }
     }
 }

+ 3 - 0
DataSimulation.Forms/packages.config

@@ -2,6 +2,9 @@
 <packages>
   <package id="EntityFramework" version="6.4.4" targetFramework="net472" />
   <package id="Serilog" version="3.1.1" targetFramework="net472" />
+  <package id="Serilog.Sinks.Async" version="1.5.0" targetFramework="net472" />
+  <package id="Serilog.Sinks.Console" version="5.0.1" targetFramework="net472" />
+  <package id="Serilog.Sinks.File" version="5.0.0" 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" />

+ 1 - 0
DataSimulation.Repostory/DataSimulation.Repostory.csproj

@@ -95,6 +95,7 @@
     <Compile Include="Model\XlInfo.cs" />
     <Compile Include="PosData.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="TaskCache.cs" />
     <Compile Include="XlCache.cs" />
   </ItemGroup>
   <ItemGroup>

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

@@ -43,7 +43,6 @@ namespace DataSimulation.Repostory.EFContext
             base.OnModelCreating(modelBuilder);
         }
 
-        public DbSet<TaskInfo> TaskInfos { set; get; }
         public DbSet<SatInfo> SatInfos { get; set; }
 
         public DbSet<AntInfo> AntInfos { get; set; }

+ 50 - 0
DataSimulation.Repostory/TaskCache.cs

@@ -0,0 +1,50 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using DataSimulation.Repostory.EFContext;
+using DataSimulation.Repostory.Model;
+
+namespace DataSimulation.Repostory
+{
+    public static class TaskCache
+    {
+        /// <summary>
+        /// 获取数据库所有任务
+        /// </summary>
+        /// <returns></returns>
+        public static async Task<List<TaskInfo>> GetAllAsync()
+        {
+            try
+            {
+                List<TaskInfo> list = new List<TaskInfo>();
+                var dir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DbPart");
+                if (!Directory.Exists(dir)) return list;
+                var yearDirs = Directory.EnumerateDirectories(dir).OrderByDescending(p => Convert.ToInt32(new DirectoryInfo(p).Name));//年目录,倒叙排列
+                foreach (var yearDir in yearDirs)
+                {
+                    //每一天的db文件,倒序排列
+                    var dayFiles = Directory.EnumerateFiles(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, yearDir), "*.db").OrderByDescending(p => Convert.ToInt32(new DirectoryInfo(p).Name.Substring(0, 4)));
+                    foreach (var dayFile in dayFiles)
+                    {
+                        using (SimulationPartContext db = SimulationPartContext.GetContext(dayFile))
+                        {
+                            list.AddRange(await db.TaskInfos.ToListAsync());
+                        }
+                    }
+                }
+                return list;
+            }
+            catch (Exception ex)
+            {
+                Serilog.Log.Error(ex, "加载任务信息异常");
+                return null;
+            }
+        }
+
+
+    }
+}