diff --git a/SCADA/Program/.vs/DataExchange/v15/.suo b/SCADA/Program/.vs/DataExchange/v15/.suo
new file mode 100644
index 0000000..7c2a6c4
Binary files /dev/null and b/SCADA/Program/.vs/DataExchange/v15/.suo differ
diff --git a/SCADA/Program/.vs/DataExchange/v15/sqlite3/storage.ide b/SCADA/Program/.vs/DataExchange/v15/sqlite3/storage.ide
new file mode 100644
index 0000000..d774922
Binary files /dev/null and b/SCADA/Program/.vs/DataExchange/v15/sqlite3/storage.ide differ
diff --git a/SCADA/Program/BatchCoreService/obj/x86/Debug/BatchCoreService.csproj.CoreCompileInputs.cache b/SCADA/Program/BatchCoreService/obj/x86/Debug/BatchCoreService.csproj.CoreCompileInputs.cache
new file mode 100644
index 0000000..0800e3d
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/obj/x86/Debug/BatchCoreService.csproj.CoreCompileInputs.cache
@@ -0,0 +1 @@
+f012c49e1080a2b9aceea8df438e021a773d45a7
diff --git a/SCADA/Program/BatchCoreService/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/SCADA/Program/BatchCoreService/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..4cd4b07
Binary files /dev/null and b/SCADA/Program/BatchCoreService/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/SCADA/Program/BatchCoreTest/obj/x86/Debug/BatchCoreTest.csproj.CoreCompileInputs.cache b/SCADA/Program/BatchCoreTest/obj/x86/Debug/BatchCoreTest.csproj.CoreCompileInputs.cache
new file mode 100644
index 0000000..8bd0556
--- /dev/null
+++ b/SCADA/Program/BatchCoreTest/obj/x86/Debug/BatchCoreTest.csproj.CoreCompileInputs.cache
@@ -0,0 +1 @@
+1a4002e6bb52fdef112cc7ef9a538fcd953d76e1
diff --git a/SCADA/Program/BatchCoreTest/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/SCADA/Program/BatchCoreTest/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..b440ff5
Binary files /dev/null and b/SCADA/Program/BatchCoreTest/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/SCADA/Program/ClientDriver/obj/Debug/ClientDriver.csproj.CoreCompileInputs.cache b/SCADA/Program/ClientDriver/obj/Debug/ClientDriver.csproj.CoreCompileInputs.cache
new file mode 100644
index 0000000..07bba0c
--- /dev/null
+++ b/SCADA/Program/ClientDriver/obj/Debug/ClientDriver.csproj.CoreCompileInputs.cache
@@ -0,0 +1 @@
+d870d9e27124943cac27963d743df86dde8bee4f
diff --git a/SCADA/Program/ClientDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/SCADA/Program/ClientDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..a91607d
Binary files /dev/null and b/SCADA/Program/ClientDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/SCADA/Program/CoreTest/obj/x86/Debug/AlarmSet.g.i.cs b/SCADA/Program/CoreTest/obj/x86/Debug/AlarmSet.g.i.cs
new file mode 100644
index 0000000..e8fb47f
--- /dev/null
+++ b/SCADA/Program/CoreTest/obj/x86/Debug/AlarmSet.g.i.cs
@@ -0,0 +1,199 @@
+#pragma checksum "..\..\..\AlarmSet.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "59BFA4F8D2CBCFAA5AAF46E345571EEF"
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
+//
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
+//
+//------------------------------------------------------------------------------
+
+using CoreTest;
+using Microsoft.Windows.Controls;
+using System;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Automation;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Forms.Integration;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Media.Effects;
+using System.Windows.Media.Imaging;
+using System.Windows.Media.Media3D;
+using System.Windows.Media.TextFormatting;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Shell;
+
+
+namespace CoreTest {
+
+
+ ///
+ /// AlarmSet
+ ///
+ public partial class AlarmSet : System.Windows.Window, System.Windows.Markup.IComponentConnector {
+
+
+ #line 20 "..\..\..\AlarmSet.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.TabControl tab1;
+
+ #line default
+ #line hidden
+
+
+ #line 22 "..\..\..\AlarmSet.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.DataGrid list0;
+
+ #line default
+ #line hidden
+
+
+ #line 45 "..\..\..\AlarmSet.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.ListView list2;
+
+ #line default
+ #line hidden
+
+
+ #line 65 "..\..\..\AlarmSet.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.ToolBar toolBar1;
+
+ #line default
+ #line hidden
+
+
+ #line 70 "..\..\..\AlarmSet.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal Microsoft.Windows.Controls.DateTimePicker dtstart;
+
+ #line default
+ #line hidden
+
+
+ #line 72 "..\..\..\AlarmSet.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal Microsoft.Windows.Controls.DateTimePicker dtend;
+
+ #line default
+ #line hidden
+
+
+ #line 75 "..\..\..\AlarmSet.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal Microsoft.Windows.Controls.ColorPicker colorpicker;
+
+ #line default
+ #line hidden
+
+
+ #line 77 "..\..\..\AlarmSet.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.ListView list1;
+
+ #line default
+ #line hidden
+
+
+ #line 94 "..\..\..\AlarmSet.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.ListBox list3;
+
+ #line default
+ #line hidden
+
+ private bool _contentLoaded;
+
+ ///
+ /// InitializeComponent
+ ///
+ [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent() {
+ if (_contentLoaded) {
+ return;
+ }
+ _contentLoaded = true;
+ System.Uri resourceLocater = new System.Uri("/CoreTest;component/alarmset.xaml", System.UriKind.Relative);
+
+ #line 1 "..\..\..\AlarmSet.xaml"
+ System.Windows.Application.LoadComponent(this, resourceLocater);
+
+ #line default
+ #line hidden
+ }
+
+ [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+ void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
+ switch (connectionId)
+ {
+ case 1:
+
+ #line 6 "..\..\..\AlarmSet.xaml"
+ ((CoreTest.AlarmSet)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);
+
+ #line default
+ #line hidden
+
+ #line 6 "..\..\..\AlarmSet.xaml"
+ ((CoreTest.AlarmSet)(target)).Closed += new System.EventHandler(this.Window_Closed);
+
+ #line default
+ #line hidden
+ return;
+ case 2:
+ this.tab1 = ((System.Windows.Controls.TabControl)(target));
+ return;
+ case 3:
+ this.list0 = ((System.Windows.Controls.DataGrid)(target));
+ return;
+ case 4:
+ this.list2 = ((System.Windows.Controls.ListView)(target));
+ return;
+ case 5:
+ this.toolBar1 = ((System.Windows.Controls.ToolBar)(target));
+ return;
+ case 6:
+ this.dtstart = ((Microsoft.Windows.Controls.DateTimePicker)(target));
+ return;
+ case 7:
+ this.dtend = ((Microsoft.Windows.Controls.DateTimePicker)(target));
+ return;
+ case 8:
+ this.colorpicker = ((Microsoft.Windows.Controls.ColorPicker)(target));
+
+ #line 75 "..\..\..\AlarmSet.xaml"
+ this.colorpicker.SelectedColorChanged += new System.Windows.RoutedPropertyChangedEventHandler(this.ColorPicker_SelectedColorChanged);
+
+ #line default
+ #line hidden
+ return;
+ case 9:
+ this.list1 = ((System.Windows.Controls.ListView)(target));
+ return;
+ case 10:
+ this.list3 = ((System.Windows.Controls.ListBox)(target));
+ return;
+ }
+ this._contentLoaded = true;
+ }
+ }
+}
+
diff --git a/SCADA/Program/CoreTest/obj/x86/Debug/App.g.i.cs b/SCADA/Program/CoreTest/obj/x86/Debug/App.g.i.cs
new file mode 100644
index 0000000..9e40340
--- /dev/null
+++ b/SCADA/Program/CoreTest/obj/x86/Debug/App.g.i.cs
@@ -0,0 +1,78 @@
+#pragma checksum "..\..\..\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "87C752EAB1D8111DD0461A1A34A553FD"
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
+//
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
+//
+//------------------------------------------------------------------------------
+
+using Microsoft.Windows.Controls;
+using System;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Automation;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Forms.Integration;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Media.Effects;
+using System.Windows.Media.Imaging;
+using System.Windows.Media.Media3D;
+using System.Windows.Media.TextFormatting;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Shell;
+
+
+namespace CoreTest {
+
+
+ ///
+ /// App
+ ///
+ public partial class App : System.Windows.Application {
+
+ private bool _contentLoaded;
+
+ ///
+ /// InitializeComponent
+ ///
+ [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent() {
+ if (_contentLoaded) {
+ return;
+ }
+ _contentLoaded = true;
+ System.Uri resourceLocater = new System.Uri("/CoreTest;component/app.xaml", System.UriKind.Relative);
+
+ #line 1 "..\..\..\App.xaml"
+ System.Windows.Application.LoadComponent(this, resourceLocater);
+
+ #line default
+ #line hidden
+ }
+
+ ///
+ /// Application Entry Point.
+ ///
+ [System.STAThreadAttribute()]
+ [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+ public static void Main() {
+ CoreTest.App app = new CoreTest.App();
+ app.InitializeComponent();
+ app.Run();
+ }
+ }
+}
+
diff --git a/SCADA/Program/CoreTest/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/SCADA/Program/CoreTest/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..8b524d3
Binary files /dev/null and b/SCADA/Program/CoreTest/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/SCADA/Program/CoreTest/obj/x86/Debug/Example.csproj.CoreCompileInputs.cache b/SCADA/Program/CoreTest/obj/x86/Debug/Example.csproj.CoreCompileInputs.cache
new file mode 100644
index 0000000..88ef1ec
--- /dev/null
+++ b/SCADA/Program/CoreTest/obj/x86/Debug/Example.csproj.CoreCompileInputs.cache
@@ -0,0 +1 @@
+43b7e478c21a4a5cb617d6e58056a0c2d8073403
diff --git a/SCADA/Program/CoreTest/obj/x86/Debug/GeneratedInternalTypeHelper.g.i.cs b/SCADA/Program/CoreTest/obj/x86/Debug/GeneratedInternalTypeHelper.g.i.cs
new file mode 100644
index 0000000..ffa4e1e
--- /dev/null
+++ b/SCADA/Program/CoreTest/obj/x86/Debug/GeneratedInternalTypeHelper.g.i.cs
@@ -0,0 +1,62 @@
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
+//
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
+//
+//------------------------------------------------------------------------------
+
+namespace XamlGeneratedNamespace {
+
+
+ ///
+ /// GeneratedInternalTypeHelper
+ ///
+ [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public sealed class GeneratedInternalTypeHelper : System.Windows.Markup.InternalTypeHelper {
+
+ ///
+ /// CreateInstance
+ ///
+ protected override object CreateInstance(System.Type type, System.Globalization.CultureInfo culture) {
+ return System.Activator.CreateInstance(type, ((System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)
+ | (System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.CreateInstance)), null, null, culture);
+ }
+
+ ///
+ /// GetPropertyValue
+ ///
+ protected override object GetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, System.Globalization.CultureInfo culture) {
+ return propertyInfo.GetValue(target, System.Reflection.BindingFlags.Default, null, null, culture);
+ }
+
+ ///
+ /// SetPropertyValue
+ ///
+ protected override void SetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, object value, System.Globalization.CultureInfo culture) {
+ propertyInfo.SetValue(target, value, System.Reflection.BindingFlags.Default, null, null, culture);
+ }
+
+ ///
+ /// CreateDelegate
+ ///
+ protected override System.Delegate CreateDelegate(System.Type delegateType, object target, string handler) {
+ return ((System.Delegate)(target.GetType().InvokeMember("_CreateDelegate", (System.Reflection.BindingFlags.InvokeMethod
+ | (System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)), null, target, new object[] {
+ delegateType,
+ handler}, null)));
+ }
+
+ ///
+ /// AddEventHandler
+ ///
+ protected override void AddEventHandler(System.Reflection.EventInfo eventInfo, object target, System.Delegate handler) {
+ eventInfo.AddEventHandler(target, handler);
+ }
+ }
+}
+
diff --git a/SCADA/Program/CoreTest/obj/x86/Debug/Login.g.i.cs b/SCADA/Program/CoreTest/obj/x86/Debug/Login.g.i.cs
new file mode 100644
index 0000000..7eb0f3a
--- /dev/null
+++ b/SCADA/Program/CoreTest/obj/x86/Debug/Login.g.i.cs
@@ -0,0 +1,205 @@
+#pragma checksum "..\..\..\Login.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "375A0423B4D66B38B66903C58FC0AA60"
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
+//
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
+//
+//------------------------------------------------------------------------------
+
+using CoreTest;
+using HMIControl;
+using System;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Automation;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Forms.Integration;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Media.Effects;
+using System.Windows.Media.Imaging;
+using System.Windows.Media.Media3D;
+using System.Windows.Media.TextFormatting;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Shell;
+
+
+namespace CoreTest {
+
+
+ ///
+ /// Login
+ ///
+ public partial class Login : System.Windows.Window, System.Windows.Markup.IComponentConnector {
+
+
+ #line 10 "..\..\..\Login.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.Button button1;
+
+ #line default
+ #line hidden
+
+
+ #line 11 "..\..\..\Login.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.Button button2;
+
+ #line default
+ #line hidden
+
+
+ #line 12 "..\..\..\Login.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.TextBlock textBlock2;
+
+ #line default
+ #line hidden
+
+
+ #line 13 "..\..\..\Login.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.TextBlock textBlock3;
+
+ #line default
+ #line hidden
+
+
+ #line 14 "..\..\..\Login.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.TextBox txtUser;
+
+ #line default
+ #line hidden
+
+
+ #line 15 "..\..\..\Login.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.TextBlock textBlock4;
+
+ #line default
+ #line hidden
+
+
+ #line 16 "..\..\..\Login.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.PasswordBox txtPassword;
+
+ #line default
+ #line hidden
+
+
+ #line 17 "..\..\..\Login.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.TextBlock txterr;
+
+ #line default
+ #line hidden
+
+
+ #line 18 "..\..\..\Login.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.Button button3;
+
+ #line default
+ #line hidden
+
+ private bool _contentLoaded;
+
+ ///
+ /// InitializeComponent
+ ///
+ [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent() {
+ if (_contentLoaded) {
+ return;
+ }
+ _contentLoaded = true;
+ System.Uri resourceLocater = new System.Uri("/CoreTest;component/login.xaml", System.UriKind.Relative);
+
+ #line 1 "..\..\..\Login.xaml"
+ System.Windows.Application.LoadComponent(this, resourceLocater);
+
+ #line default
+ #line hidden
+ }
+
+ [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+ void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
+ switch (connectionId)
+ {
+ case 1:
+
+ #line 4 "..\..\..\Login.xaml"
+ ((CoreTest.Login)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);
+
+ #line default
+ #line hidden
+ return;
+ case 2:
+ this.button1 = ((System.Windows.Controls.Button)(target));
+
+ #line 10 "..\..\..\Login.xaml"
+ this.button1.Click += new System.Windows.RoutedEventHandler(this.button1_Click);
+
+ #line default
+ #line hidden
+ return;
+ case 3:
+ this.button2 = ((System.Windows.Controls.Button)(target));
+
+ #line 11 "..\..\..\Login.xaml"
+ this.button2.Click += new System.Windows.RoutedEventHandler(this.button2_Click);
+
+ #line default
+ #line hidden
+ return;
+ case 4:
+ this.textBlock2 = ((System.Windows.Controls.TextBlock)(target));
+ return;
+ case 5:
+ this.textBlock3 = ((System.Windows.Controls.TextBlock)(target));
+ return;
+ case 6:
+ this.txtUser = ((System.Windows.Controls.TextBox)(target));
+ return;
+ case 7:
+ this.textBlock4 = ((System.Windows.Controls.TextBlock)(target));
+ return;
+ case 8:
+ this.txtPassword = ((System.Windows.Controls.PasswordBox)(target));
+ return;
+ case 9:
+ this.txterr = ((System.Windows.Controls.TextBlock)(target));
+ return;
+ case 10:
+ this.button3 = ((System.Windows.Controls.Button)(target));
+
+ #line 19 "..\..\..\Login.xaml"
+ this.button3.Click += new System.Windows.RoutedEventHandler(this.button3_Click);
+
+ #line default
+ #line hidden
+ return;
+ }
+ this._contentLoaded = true;
+ }
+ }
+}
+
diff --git a/SCADA/Program/CoreTest/obj/x86/Debug/RuntimeChart.g.i.cs b/SCADA/Program/CoreTest/obj/x86/Debug/RuntimeChart.g.i.cs
new file mode 100644
index 0000000..24aa8a3
--- /dev/null
+++ b/SCADA/Program/CoreTest/obj/x86/Debug/RuntimeChart.g.i.cs
@@ -0,0 +1,188 @@
+#pragma checksum "..\..\..\RuntimeChart.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "DC1BFB7524CCB66F5D58735A70216F0A"
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
+//
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
+//
+//------------------------------------------------------------------------------
+
+using CoreTest;
+using HMIControl;
+using Microsoft.Research.DynamicDataDisplay;
+using Microsoft.Research.DynamicDataDisplay.Charts;
+using Microsoft.Research.DynamicDataDisplay.Charts.Axes;
+using Microsoft.Research.DynamicDataDisplay.Charts.Axes.Numeric;
+using Microsoft.Research.DynamicDataDisplay.Charts.Isolines;
+using Microsoft.Research.DynamicDataDisplay.Charts.Markers;
+using Microsoft.Research.DynamicDataDisplay.Charts.Navigation;
+using Microsoft.Research.DynamicDataDisplay.Charts.Shapes;
+using Microsoft.Research.DynamicDataDisplay.Common.Palettes;
+using Microsoft.Research.DynamicDataDisplay.Converters;
+using Microsoft.Research.DynamicDataDisplay.DataSources;
+using Microsoft.Research.DynamicDataDisplay.MarkupExtensions;
+using Microsoft.Research.DynamicDataDisplay.Navigation;
+using Microsoft.Research.DynamicDataDisplay.PointMarkers;
+using Microsoft.Research.DynamicDataDisplay.ViewportRestrictions;
+using Microsoft.Windows.Controls;
+using System;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Automation;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Forms.Integration;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Media.Effects;
+using System.Windows.Media.Imaging;
+using System.Windows.Media.Media3D;
+using System.Windows.Media.TextFormatting;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Shell;
+
+
+namespace CoreTest {
+
+
+ ///
+ /// RuntimeChart
+ ///
+ public partial class RuntimeChart : System.Windows.Window, System.Windows.Markup.IComponentConnector {
+
+
+ #line 16 "..\..\..\RuntimeChart.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.ComboBox comb1;
+
+ #line default
+ #line hidden
+
+
+ #line 18 "..\..\..\RuntimeChart.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal Microsoft.Windows.Controls.ColorPicker colorpicker;
+
+ #line default
+ #line hidden
+
+
+ #line 20 "..\..\..\RuntimeChart.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal Microsoft.Research.DynamicDataDisplay.ChartPlotter chartPlotter1;
+
+ #line default
+ #line hidden
+
+
+ #line 22 "..\..\..\RuntimeChart.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal Microsoft.Research.DynamicDataDisplay.Charts.HorizontalDateTimeAxis hTimeSpanAxis;
+
+ #line default
+ #line hidden
+
+
+ #line 24 "..\..\..\RuntimeChart.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal Microsoft.Research.DynamicDataDisplay.Charts.HorizontalLine hilevel;
+
+ #line default
+ #line hidden
+
+
+ #line 25 "..\..\..\RuntimeChart.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal Microsoft.Research.DynamicDataDisplay.Charts.HorizontalLine lolevel;
+
+ #line default
+ #line hidden
+
+ private bool _contentLoaded;
+
+ ///
+ /// InitializeComponent
+ ///
+ [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent() {
+ if (_contentLoaded) {
+ return;
+ }
+ _contentLoaded = true;
+ System.Uri resourceLocater = new System.Uri("/CoreTest;component/runtimechart.xaml", System.UriKind.Relative);
+
+ #line 1 "..\..\..\RuntimeChart.xaml"
+ System.Windows.Application.LoadComponent(this, resourceLocater);
+
+ #line default
+ #line hidden
+ }
+
+ [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+ void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
+ switch (connectionId)
+ {
+ case 1:
+
+ #line 8 "..\..\..\RuntimeChart.xaml"
+ ((CoreTest.RuntimeChart)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);
+
+ #line default
+ #line hidden
+
+ #line 8 "..\..\..\RuntimeChart.xaml"
+ ((CoreTest.RuntimeChart)(target)).Closed += new System.EventHandler(this.Window_Closed);
+
+ #line default
+ #line hidden
+ return;
+ case 2:
+ this.comb1 = ((System.Windows.Controls.ComboBox)(target));
+
+ #line 16 "..\..\..\RuntimeChart.xaml"
+ this.comb1.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.comb1_SelectionChanged);
+
+ #line default
+ #line hidden
+ return;
+ case 3:
+ this.colorpicker = ((Microsoft.Windows.Controls.ColorPicker)(target));
+
+ #line 18 "..\..\..\RuntimeChart.xaml"
+ this.colorpicker.SelectedColorChanged += new System.Windows.RoutedPropertyChangedEventHandler(this.ColorPicker_SelectedColorChanged);
+
+ #line default
+ #line hidden
+ return;
+ case 4:
+ this.chartPlotter1 = ((Microsoft.Research.DynamicDataDisplay.ChartPlotter)(target));
+ return;
+ case 5:
+ this.hTimeSpanAxis = ((Microsoft.Research.DynamicDataDisplay.Charts.HorizontalDateTimeAxis)(target));
+ return;
+ case 6:
+ this.hilevel = ((Microsoft.Research.DynamicDataDisplay.Charts.HorizontalLine)(target));
+ return;
+ case 7:
+ this.lolevel = ((Microsoft.Research.DynamicDataDisplay.Charts.HorizontalLine)(target));
+ return;
+ }
+ this._contentLoaded = true;
+ }
+ }
+}
+
diff --git a/SCADA/Program/CoreTest/obj/x86/Debug/StartDevice.g.i.cs b/SCADA/Program/CoreTest/obj/x86/Debug/StartDevice.g.i.cs
new file mode 100644
index 0000000..9cda527
--- /dev/null
+++ b/SCADA/Program/CoreTest/obj/x86/Debug/StartDevice.g.i.cs
@@ -0,0 +1,151 @@
+#pragma checksum "..\..\..\StartDevice.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "14206CA5E5BB144386A3AAAB0A6BD5A5"
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
+//
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
+//
+//------------------------------------------------------------------------------
+
+using HMIControl;
+using System;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Automation;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Forms.Integration;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Media.Effects;
+using System.Windows.Media.Imaging;
+using System.Windows.Media.Media3D;
+using System.Windows.Media.TextFormatting;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Shell;
+
+
+namespace CoreTest {
+
+
+ ///
+ /// StartDevice
+ ///
+ public partial class StartDevice : System.Windows.Window, System.Windows.Markup.IComponentConnector {
+
+
+ #line 8 "..\..\..\StartDevice.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.Grid grd;
+
+ #line default
+ #line hidden
+
+
+ #line 20 "..\..\..\StartDevice.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.Border border1;
+
+ #line default
+ #line hidden
+
+
+ #line 21 "..\..\..\StartDevice.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.TextBlock devicename;
+
+ #line default
+ #line hidden
+
+
+ #line 22 "..\..\..\StartDevice.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.Button btnStop;
+
+ #line default
+ #line hidden
+
+
+ #line 23 "..\..\..\StartDevice.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.Button btnExit;
+
+ #line default
+ #line hidden
+
+
+ #line 24 "..\..\..\StartDevice.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.Button btnStart;
+
+ #line default
+ #line hidden
+
+ private bool _contentLoaded;
+
+ ///
+ /// InitializeComponent
+ ///
+ [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent() {
+ if (_contentLoaded) {
+ return;
+ }
+ _contentLoaded = true;
+ System.Uri resourceLocater = new System.Uri("/CoreTest;component/startdevice.xaml", System.UriKind.Relative);
+
+ #line 1 "..\..\..\StartDevice.xaml"
+ System.Windows.Application.LoadComponent(this, resourceLocater);
+
+ #line default
+ #line hidden
+ }
+
+ [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+ void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
+ switch (connectionId)
+ {
+ case 1:
+ this.grd = ((System.Windows.Controls.Grid)(target));
+ return;
+ case 2:
+ this.border1 = ((System.Windows.Controls.Border)(target));
+ return;
+ case 3:
+ this.devicename = ((System.Windows.Controls.TextBlock)(target));
+ return;
+ case 4:
+ this.btnStop = ((System.Windows.Controls.Button)(target));
+ return;
+ case 5:
+ this.btnExit = ((System.Windows.Controls.Button)(target));
+
+ #line 23 "..\..\..\StartDevice.xaml"
+ this.btnExit.Click += new System.Windows.RoutedEventHandler(this.btnExit_Click);
+
+ #line default
+ #line hidden
+ return;
+ case 6:
+ this.btnStart = ((System.Windows.Controls.Button)(target));
+ return;
+ }
+ this._contentLoaded = true;
+ }
+ }
+}
+
diff --git a/SCADA/Program/CoreTest/obj/x86/Debug/TagMonitor.g.i.cs b/SCADA/Program/CoreTest/obj/x86/Debug/TagMonitor.g.i.cs
new file mode 100644
index 0000000..933836e
--- /dev/null
+++ b/SCADA/Program/CoreTest/obj/x86/Debug/TagMonitor.g.i.cs
@@ -0,0 +1,136 @@
+#pragma checksum "..\..\..\TagMonitor.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "0A98A6F201A7031A640A21A10F8B84E7"
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
+//
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
+//
+//------------------------------------------------------------------------------
+
+using CoreTest;
+using Microsoft.Windows.Controls;
+using Microsoft.Windows.Controls.PropertyGrid;
+using System;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Automation;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Forms.Integration;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Media.Effects;
+using System.Windows.Media.Imaging;
+using System.Windows.Media.Media3D;
+using System.Windows.Media.TextFormatting;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Shell;
+
+
+namespace CoreTest {
+
+
+ ///
+ /// TagMonitor
+ ///
+ public partial class TagMonitor : System.Windows.Window, System.Windows.Markup.IComponentConnector {
+
+
+ #line 16 "..\..\..\TagMonitor.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.DataGrid list1;
+
+ #line default
+ #line hidden
+
+
+ #line 24 "..\..\..\TagMonitor.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal Microsoft.Windows.Controls.ChildWindow childWindow1;
+
+ #line default
+ #line hidden
+
+
+ #line 26 "..\..\..\TagMonitor.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.TextBox textBox1;
+
+ #line default
+ #line hidden
+
+ private bool _contentLoaded;
+
+ ///
+ /// InitializeComponent
+ ///
+ [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent() {
+ if (_contentLoaded) {
+ return;
+ }
+ _contentLoaded = true;
+ System.Uri resourceLocater = new System.Uri("/CoreTest;component/tagmonitor.xaml", System.UriKind.Relative);
+
+ #line 1 "..\..\..\TagMonitor.xaml"
+ System.Windows.Application.LoadComponent(this, resourceLocater);
+
+ #line default
+ #line hidden
+ }
+
+ [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+ void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
+ switch (connectionId)
+ {
+ case 1:
+
+ #line 7 "..\..\..\TagMonitor.xaml"
+ ((CoreTest.TagMonitor)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);
+
+ #line default
+ #line hidden
+
+ #line 7 "..\..\..\TagMonitor.xaml"
+ ((CoreTest.TagMonitor)(target)).Closed += new System.EventHandler(this.Window_Closed);
+
+ #line default
+ #line hidden
+ return;
+ case 2:
+ this.list1 = ((System.Windows.Controls.DataGrid)(target));
+ return;
+ case 3:
+ this.childWindow1 = ((Microsoft.Windows.Controls.ChildWindow)(target));
+ return;
+ case 4:
+ this.textBox1 = ((System.Windows.Controls.TextBox)(target));
+ return;
+ case 5:
+
+ #line 27 "..\..\..\TagMonitor.xaml"
+ ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click);
+
+ #line default
+ #line hidden
+ return;
+ }
+ this._contentLoaded = true;
+ }
+ }
+}
+
diff --git a/SCADA/Program/CoreTest/obj/x86/Debug/Trend.g.i.cs b/SCADA/Program/CoreTest/obj/x86/Debug/Trend.g.i.cs
new file mode 100644
index 0000000..cbda123
--- /dev/null
+++ b/SCADA/Program/CoreTest/obj/x86/Debug/Trend.g.i.cs
@@ -0,0 +1,264 @@
+#pragma checksum "..\..\..\Trend.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "1B342724173D1F60676E7E203DB0077B"
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
+//
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
+//
+//------------------------------------------------------------------------------
+
+using CoreTest;
+using Microsoft.Research.DynamicDataDisplay;
+using Microsoft.Research.DynamicDataDisplay.Charts;
+using Microsoft.Research.DynamicDataDisplay.Charts.Axes;
+using Microsoft.Research.DynamicDataDisplay.Charts.Axes.Numeric;
+using Microsoft.Research.DynamicDataDisplay.Charts.Isolines;
+using Microsoft.Research.DynamicDataDisplay.Charts.Markers;
+using Microsoft.Research.DynamicDataDisplay.Charts.Navigation;
+using Microsoft.Research.DynamicDataDisplay.Charts.Shapes;
+using Microsoft.Research.DynamicDataDisplay.Common.Palettes;
+using Microsoft.Research.DynamicDataDisplay.Converters;
+using Microsoft.Research.DynamicDataDisplay.DataSources;
+using Microsoft.Research.DynamicDataDisplay.MarkupExtensions;
+using Microsoft.Research.DynamicDataDisplay.Navigation;
+using Microsoft.Research.DynamicDataDisplay.PointMarkers;
+using Microsoft.Research.DynamicDataDisplay.ViewportRestrictions;
+using Microsoft.Windows.Controls;
+using System;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Automation;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Forms.Integration;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Media.Effects;
+using System.Windows.Media.Imaging;
+using System.Windows.Media.Media3D;
+using System.Windows.Media.TextFormatting;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Shell;
+
+
+namespace CoreTest {
+
+
+ ///
+ /// Trend
+ ///
+ public partial class Trend : System.Windows.Window, System.Windows.Markup.IComponentConnector {
+
+
+ #line 15 "..\..\..\Trend.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.ToolBar toolBar1;
+
+ #line default
+ #line hidden
+
+
+ #line 23 "..\..\..\Trend.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal Microsoft.Windows.Controls.DateTimePicker dtstart;
+
+ #line default
+ #line hidden
+
+
+ #line 25 "..\..\..\Trend.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal Microsoft.Windows.Controls.DateTimePicker dtend;
+
+ #line default
+ #line hidden
+
+
+ #line 27 "..\..\..\Trend.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.CheckBox PCheckBox;
+
+ #line default
+ #line hidden
+
+
+ #line 28 "..\..\..\Trend.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.Primitives.Popup popusBottom;
+
+ #line default
+ #line hidden
+
+
+ #line 34 "..\..\..\Trend.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal Microsoft.Windows.Controls.CheckListBox chklist;
+
+ #line default
+ #line hidden
+
+
+ #line 40 "..\..\..\Trend.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.ComboBox comodel;
+
+ #line default
+ #line hidden
+
+
+ #line 45 "..\..\..\Trend.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal System.Windows.Controls.CheckBox chkshow;
+
+ #line default
+ #line hidden
+
+
+ #line 46 "..\..\..\Trend.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal Microsoft.Windows.Controls.ColorPicker colorpicker;
+
+ #line default
+ #line hidden
+
+
+ #line 48 "..\..\..\Trend.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal Microsoft.Research.DynamicDataDisplay.ChartPlotter chartPlotter1;
+
+ #line default
+ #line hidden
+
+
+ #line 50 "..\..\..\Trend.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal Microsoft.Research.DynamicDataDisplay.Charts.HorizontalDateTimeAxis hTimeSpanAxis;
+
+ #line default
+ #line hidden
+
+
+ #line 52 "..\..\..\Trend.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal Microsoft.Research.DynamicDataDisplay.Charts.Navigation.CursorCoordinateGraph cursor;
+
+ #line default
+ #line hidden
+
+
+ #line 53 "..\..\..\Trend.xaml"
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+ internal Microsoft.Research.DynamicDataDisplay.Charts.Navigation.AxisCursorGraph axiscuror;
+
+ #line default
+ #line hidden
+
+ private bool _contentLoaded;
+
+ ///
+ /// InitializeComponent
+ ///
+ [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent() {
+ if (_contentLoaded) {
+ return;
+ }
+ _contentLoaded = true;
+ System.Uri resourceLocater = new System.Uri("/CoreTest;component/trend.xaml", System.UriKind.Relative);
+
+ #line 1 "..\..\..\Trend.xaml"
+ System.Windows.Application.LoadComponent(this, resourceLocater);
+
+ #line default
+ #line hidden
+ }
+
+ [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
+ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+ void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
+ switch (connectionId)
+ {
+ case 1:
+
+ #line 9 "..\..\..\Trend.xaml"
+ ((CoreTest.Trend)(target)).Closed += new System.EventHandler(this.Window_Closed);
+
+ #line default
+ #line hidden
+ return;
+ case 2:
+ this.toolBar1 = ((System.Windows.Controls.ToolBar)(target));
+ return;
+ case 3:
+ this.dtstart = ((Microsoft.Windows.Controls.DateTimePicker)(target));
+ return;
+ case 4:
+ this.dtend = ((Microsoft.Windows.Controls.DateTimePicker)(target));
+ return;
+ case 5:
+ this.PCheckBox = ((System.Windows.Controls.CheckBox)(target));
+ return;
+ case 6:
+ this.popusBottom = ((System.Windows.Controls.Primitives.Popup)(target));
+ return;
+ case 7:
+ this.chklist = ((Microsoft.Windows.Controls.CheckListBox)(target));
+ return;
+ case 8:
+ this.comodel = ((System.Windows.Controls.ComboBox)(target));
+
+ #line 40 "..\..\..\Trend.xaml"
+ this.comodel.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.comodel_SelectionChanged);
+
+ #line default
+ #line hidden
+ return;
+ case 9:
+ this.chkshow = ((System.Windows.Controls.CheckBox)(target));
+
+ #line 45 "..\..\..\Trend.xaml"
+ this.chkshow.Click += new System.Windows.RoutedEventHandler(this.chkshow_Click);
+
+ #line default
+ #line hidden
+ return;
+ case 10:
+ this.colorpicker = ((Microsoft.Windows.Controls.ColorPicker)(target));
+
+ #line 46 "..\..\..\Trend.xaml"
+ this.colorpicker.SelectedColorChanged += new System.Windows.RoutedPropertyChangedEventHandler(this.ColorPicker_SelectedColorChanged);
+
+ #line default
+ #line hidden
+ return;
+ case 11:
+ this.chartPlotter1 = ((Microsoft.Research.DynamicDataDisplay.ChartPlotter)(target));
+ return;
+ case 12:
+ this.hTimeSpanAxis = ((Microsoft.Research.DynamicDataDisplay.Charts.HorizontalDateTimeAxis)(target));
+ return;
+ case 13:
+ this.cursor = ((Microsoft.Research.DynamicDataDisplay.Charts.Navigation.CursorCoordinateGraph)(target));
+ return;
+ case 14:
+ this.axiscuror = ((Microsoft.Research.DynamicDataDisplay.Charts.Navigation.AxisCursorGraph)(target));
+ return;
+ }
+ this._contentLoaded = true;
+ }
+ }
+}
+
diff --git a/SCADA/Program/DataHelper/obj/x86/Debug/DataHelper.csproj.CoreCompileInputs.cache b/SCADA/Program/DataHelper/obj/x86/Debug/DataHelper.csproj.CoreCompileInputs.cache
new file mode 100644
index 0000000..285343a
--- /dev/null
+++ b/SCADA/Program/DataHelper/obj/x86/Debug/DataHelper.csproj.CoreCompileInputs.cache
@@ -0,0 +1 @@
+d4f11827d746f1a477cba419eeb5af48f36e2d3e
diff --git a/SCADA/Program/DataHelper/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/SCADA/Program/DataHelper/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..156dd75
Binary files /dev/null and b/SCADA/Program/DataHelper/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/SCADA/Program/DataService/obj/x86/Debug/DataService.csproj.CoreCompileInputs.cache b/SCADA/Program/DataService/obj/x86/Debug/DataService.csproj.CoreCompileInputs.cache
new file mode 100644
index 0000000..36fe6cf
--- /dev/null
+++ b/SCADA/Program/DataService/obj/x86/Debug/DataService.csproj.CoreCompileInputs.cache
@@ -0,0 +1 @@
+f31c354057912f4e6b416c13a1e1935d1348c0fa
diff --git a/SCADA/Program/DataService/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/SCADA/Program/DataService/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..b316634
Binary files /dev/null and b/SCADA/Program/DataService/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/SCADA/Program/FileDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/SCADA/Program/FileDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..64dcac9
Binary files /dev/null and b/SCADA/Program/FileDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/SCADA/Program/FileDriver/obj/Debug/FileDriver.csproj.CoreCompileInputs.cache b/SCADA/Program/FileDriver/obj/Debug/FileDriver.csproj.CoreCompileInputs.cache
new file mode 100644
index 0000000..56596f9
--- /dev/null
+++ b/SCADA/Program/FileDriver/obj/Debug/FileDriver.csproj.CoreCompileInputs.cache
@@ -0,0 +1 @@
+a519cf22ffbdb642c7cb47c798524b3a25f0d396
diff --git a/SCADA/Program/HMIControl/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/SCADA/Program/HMIControl/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..5608a78
Binary files /dev/null and b/SCADA/Program/HMIControl/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/SCADA/Program/HMIControl/obj/Debug/GeneratedInternalTypeHelper.g.i.cs b/SCADA/Program/HMIControl/obj/Debug/GeneratedInternalTypeHelper.g.i.cs
new file mode 100644
index 0000000..ffa4e1e
--- /dev/null
+++ b/SCADA/Program/HMIControl/obj/Debug/GeneratedInternalTypeHelper.g.i.cs
@@ -0,0 +1,62 @@
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
+//
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
+//
+//------------------------------------------------------------------------------
+
+namespace XamlGeneratedNamespace {
+
+
+ ///
+ /// GeneratedInternalTypeHelper
+ ///
+ [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public sealed class GeneratedInternalTypeHelper : System.Windows.Markup.InternalTypeHelper {
+
+ ///
+ /// CreateInstance
+ ///
+ protected override object CreateInstance(System.Type type, System.Globalization.CultureInfo culture) {
+ return System.Activator.CreateInstance(type, ((System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)
+ | (System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.CreateInstance)), null, null, culture);
+ }
+
+ ///
+ /// GetPropertyValue
+ ///
+ protected override object GetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, System.Globalization.CultureInfo culture) {
+ return propertyInfo.GetValue(target, System.Reflection.BindingFlags.Default, null, null, culture);
+ }
+
+ ///
+ /// SetPropertyValue
+ ///
+ protected override void SetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, object value, System.Globalization.CultureInfo culture) {
+ propertyInfo.SetValue(target, value, System.Reflection.BindingFlags.Default, null, null, culture);
+ }
+
+ ///
+ /// CreateDelegate
+ ///
+ protected override System.Delegate CreateDelegate(System.Type delegateType, object target, string handler) {
+ return ((System.Delegate)(target.GetType().InvokeMember("_CreateDelegate", (System.Reflection.BindingFlags.InvokeMethod
+ | (System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)), null, target, new object[] {
+ delegateType,
+ handler}, null)));
+ }
+
+ ///
+ /// AddEventHandler
+ ///
+ protected override void AddEventHandler(System.Reflection.EventInfo eventInfo, object target, System.Delegate handler) {
+ eventInfo.AddEventHandler(target, handler);
+ }
+ }
+}
+
diff --git a/SCADA/Program/HMIControl/obj/Debug/HMIControl.csproj.CoreCompileInputs.cache b/SCADA/Program/HMIControl/obj/Debug/HMIControl.csproj.CoreCompileInputs.cache
new file mode 100644
index 0000000..0eaa856
--- /dev/null
+++ b/SCADA/Program/HMIControl/obj/Debug/HMIControl.csproj.CoreCompileInputs.cache
@@ -0,0 +1 @@
+a7abf19bcdea243d852d493c6c08741b180f57c5
diff --git a/SCADA/Program/HMIControl/obj/Debug/HMIControl_MarkupCompile.i.cache b/SCADA/Program/HMIControl/obj/Debug/HMIControl_MarkupCompile.i.cache
new file mode 100644
index 0000000..75b2554
--- /dev/null
+++ b/SCADA/Program/HMIControl/obj/Debug/HMIControl_MarkupCompile.i.cache
@@ -0,0 +1,20 @@
+HMIControl
+
+
+library
+C#
+.cs
+C:\Users\admin\Desktop\SharpSCADA\SharpSCADA\SCADA\Program\HMIControl\obj\Debug\
+HMIControl
+none
+false
+DEBUG;TRACE
+
+1-731644535
+
+91-777039375
+111652719211
+Themes\Generic.xaml;
+
+True
+
diff --git a/SCADA/Program/HMIControl/obj/Debug/HMIControl_MarkupCompile.i.lref b/SCADA/Program/HMIControl/obj/Debug/HMIControl_MarkupCompile.i.lref
new file mode 100644
index 0000000..abd8efa
--- /dev/null
+++ b/SCADA/Program/HMIControl/obj/Debug/HMIControl_MarkupCompile.i.lref
@@ -0,0 +1,4 @@
+C:\Users\admin\Desktop\SharpSCADA\SharpSCADA\SCADA\Program\HMIControl\obj\Debug\GeneratedInternalTypeHelper.g.i.cs
+
+FC:\Users\admin\Desktop\SharpSCADA\SharpSCADA\SCADA\Program\HMIControl\Themes\Generic.xaml;;
+
diff --git a/SCADA/Program/LinkableControlDesignTime/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/SCADA/Program/LinkableControlDesignTime/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..5ad8c9b
Binary files /dev/null and b/SCADA/Program/LinkableControlDesignTime/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/SCADA/Program/LinkableControlDesignTime/obj/Debug/LinkableControlDesign.csproj.CoreCompileInputs.cache b/SCADA/Program/LinkableControlDesignTime/obj/Debug/LinkableControlDesign.csproj.CoreCompileInputs.cache
new file mode 100644
index 0000000..5eee24d
--- /dev/null
+++ b/SCADA/Program/LinkableControlDesignTime/obj/Debug/LinkableControlDesign.csproj.CoreCompileInputs.cache
@@ -0,0 +1 @@
+21e18031a23dc5a936f51f4ad279b96333746c2f
diff --git a/SCADA/Program/ModbusDriver/ModbusRTUDriver.cs b/SCADA/Program/ModbusDriver/ModbusRTUDriver.cs
index 54cb79e..836583c 100644
--- a/SCADA/Program/ModbusDriver/ModbusRTUDriver.cs
+++ b/SCADA/Program/ModbusDriver/ModbusRTUDriver.cs
@@ -10,24 +10,166 @@ using DataService;
namespace ModbusDriver
{
[Description("Modbus RTU协议")]
+ //ModbusRTUReader : IPLCDriver IPLCDriver : IDriver, IReaderWriter IDriver : IDisposable
public sealed class ModbusRTUReader : IPLCDriver
{
- short _id;
- public short ID
+ //自定义构造函数3
+ public ModbusRTUReader(IDataServer server, short id, string name, string remote = null, int timeOut = 10000, string port = "COM1", string baudRate = "9600")
{
- get
+ _id = id;
+ _name = name;
+ _server = server;
+ _port = port;
+ _serialPort = new SerialPort(port);
+ _timeOut = timeOut;
+ _serialPort.ReadTimeout = _timeOut;
+ _serialPort.WriteTimeout = _timeOut;
+ _serialPort.BaudRate = int.Parse(baudRate);
+ _serialPort.DataBits = 8;
+ _serialPort.Parity = Parity.Even;
+ _serialPort.StopBits = StopBits.One;
+ }
+ private SerialPort _serialPort;
+
+
+ /*
+ Sbyte:代表有符号的8位整数,数值范围从-128 ~ 127
+ Byte:代表无符号的8位整数,数值范围从0~255
+ Short:代表有符号的16位整数,范围从-32768 ~ 32767
+ ushort:代表有符号的16位整数,范围从0 到 65,535
+ Int:代表有符号的32位整数,范围从-2147483648 ~ 2147483648
+ uint:代表无符号的32位整数,范围从0 ~ 4294967295
+ Long:代表有符号的64位整数,范围从-9223372036854775808 ~ 9223372036854775808
+ Ulong:代表无符号的64位整数,范围从0 ~ 18446744073709551615。
+ */
+ private byte[] CreateReadHeader(int startAddress, ushort length, byte function)
+ {
+ byte[] data = new byte[8];
+ data[0] = (byte)_id; // Slave id high byte 从站地址
+ data[1] = function; // Message size
+ byte[] _adr = BitConverter.GetBytes((short)startAddress);//以字节数组的形式返回指定的 16 位无符号整数值。
+ data[2] = _adr[0]; // Start address high byte 起始地址的高八位
+ data[3] = _adr[1]; // Start address low byte 起始地址的低八位
+ byte[] _length = BitConverter.GetBytes((short)length);
+ data[4] = _length[0]; // Number of data to read high byte 寄存器数量的高八位
+ data[5] = _length[1]; // Number of data to read low byte 寄存器数量的低八位
+ byte[] arr = Utility.CalculateCrc(data, 6);
+ data[6] = arr[0]; //CRC校验的低八位
+ data[7] = arr[1]; //CRC校验的高八位
+ return data;
+ }
+ #region 写单个线圈或单个离散输出 功能码:0x05
+ public byte[] WriteSingleCoils(int startAddress, bool OnOff)
+ {
+ byte[] data = new byte[8];
+ data[0] = (byte)_id; // Slave id high byte
+ data[1] = Modbus.fctWriteSingleCoil; // Function code
+ byte[] _adr = BitConverter.GetBytes((short)startAddress);
+ data[2] = _adr[0]; // Start address
+ data[3] = _adr[1]; // Start address
+ if (OnOff)
{
- return _id;
+ data[4] = 0xFF;
+ data[5] = 0x00;
+ }
+ else
+ {
+ data[4] = 0x00;
+ data[5] = 0x00;
}
+ byte[] arr = Utility.CalculateCrc(data, 6);
+ data[6] = arr[0];
+ data[7] = arr[1];
+ return data;
}
+ #endregion
- private SerialPort _serialPort;
+ #region 写多个线圈 功能码:0x0F 15
+ public byte[] WriteMultipleCoils(int startAddress, ushort numBits, byte[] values)
+ {
+ int len = values.Length;
+ byte[] data = new byte[len + 9];
+ data[0] = (byte)_id; // Slave id high byte 从站地址高八位
+ data[1] = Modbus.fctWriteMultipleCoils; // Function code 功能码
+ byte[] _adr = BitConverter.GetBytes((short)startAddress);
+ data[2] = _adr[0]; // Start address 开始地址高八位
+ data[3] = _adr[1]; // Start address 开始地址低八位
+ byte[] _length = BitConverter.GetBytes((short)numBits);
+ data[4] = _length[0]; // Number of data to read 寄存器数量高八位
+ data[5] = _length[1]; // Number of data to read 寄存器数量低八位
+
+
+ data[6] = (byte)len; //字节数量
+ Array.Copy(values, 0, data, 7, len); //在data中加入变更数据
+ byte[] arr = Utility.CalculateCrc(data, len + 7);
+ data[len + 7] = arr[0]; //CRC校验的低八位
+ data[len + 8] = arr[1]; //CRC校验的高八位
+ return data;
+ }
+ #endregion
+
+ #region 写单个保持寄存器 功能码:0x06
+ public byte[] WriteSingleRegister(int startAddress, byte[] values)
+ {
+ byte[] data = new byte[8];
+ data[0] = (byte)_id; // Slave id high byte 从站地址高八位
+ data[1] = Modbus.fctWriteSingleRegister; // Function code 功能码
+ byte[] _adr = BitConverter.GetBytes((short)startAddress);
+ data[2] = _adr[0]; // Start address 开始地址高八位
+ data[3] = _adr[1]; // Start address 开始地址高八位
+ data[4] = values[0]; //变更数据的高位
+ data[5] = values[1]; //变更数据的低位
+ byte[] arr = Utility.CalculateCrc(data, 6);
+ data[6] = arr[0]; //CRC校验码低八位
+ data[7] = arr[1]; //CRC校验码高八位
+ return data;
+ }
+ #endregion
+
+ #region 写多个保持寄存器 功能码:0x10 16
+ public byte[] WriteMultipleRegister(int startAddress, byte[] values)
+ {
+ int len = values.Length;
+ if (len % 2 > 0) len++;
+ byte[] data = new byte[len + 9];
+ data[0] = (byte)_id; // Slave id high byte 从站地址
+ data[1] = Modbus.fctWriteMultipleRegister; // Function code 功能码
+ byte[] _adr = BitConverter.GetBytes((short)startAddress);
+ data[2] = _adr[0]; // Start address 开始地址高八位
+ data[3] = _adr[1]; // Start address 开始地址低八位
+ byte[] _length = BitConverter.GetBytes((short)(len >> 1));
+ data[4] = _length[0]; // Number of data to read 寄存器数量高八位
+ data[5] = _length[1]; // Number of data to read 寄存器数量低八位
+ data[6] = (byte)len; //字节数
+ Array.Copy(values, 0, data, 7, len); //把变更数据加入data中
+ byte[] arr = Utility.CalculateCrc(data, len + 7);
+ data[len + 7] = arr[0]; //crc校验的低八位
+ data[len + 8] = arr[1]; //CRC校验的高八位
+ return data;
+ }
+ #endregion
+
+
+
+ #region :IPLCDriver
public int PDU
{
- get { return 0x100; }
+ // get { return 0x100; } //0x100十进制值为256
+
+
+ /* 更新人:yjz
+ 更新日期:20171125
+ 更新原因: 在串行通信中RS232 / RS485 modbus协议规定如下:
+ ADU=地址域+功能码+数据+差错校验 其中 ADU 256字节,地址域1字节,功能码1字节,数据为252字节 , 差错检验2字节,
+ PDU=功能码+数据
+ 所以PDU应为: 253字节
+ */
+ get { return 0xFD; } //0xFD 十进制为253
+
+
}
- public DeviceAddress GetDeviceAddress(string address)
+ public DeviceAddress GetDeviceAddress(string address)//PLC地址一般为5位 如40001,也有可能为40001.1 首位代表地址类型
{
DeviceAddress dv = DeviceAddress.Empty;
if (string.IsNullOrEmpty(address))
@@ -36,7 +178,7 @@ namespace ModbusDriver
{
case '0':
{
- dv.Area = Modbus.fctReadCoil;
+ dv.Area = Modbus.fctReadCoil;//功能码:01 读线圈或离散量输出状态 00001 - 09999:数字量输出( 线圈)
int st;
int.TryParse(address, out st);
dv.Bit = (byte)(st % 16);
@@ -46,7 +188,7 @@ namespace ModbusDriver
break;
case '1':
{
- dv.Area = Modbus.fctReadDiscreteInputs;
+ dv.Area = Modbus.fctReadDiscreteInputs;//功能码:02 读离散量输入 10001 - 19999:数字量输入(触点)
int st;
int.TryParse(address.Substring(1), out st);
dv.Bit = (byte)(st % 16);
@@ -54,10 +196,11 @@ namespace ModbusDriver
dv.Start = st;
}
break;
+
case '4':
{
int index = address.IndexOf('.');
- dv.Area = Modbus.fctReadHoldingRegister;
+ dv.Area = Modbus.fctReadHoldingRegister;//功能码:03 读取保持寄存器 40001 - 49999:数据保持寄存器
if (index > 0)
{
dv.Start = int.Parse(address.Substring(1, index - 1));
@@ -65,13 +208,13 @@ namespace ModbusDriver
}
else
dv.Start = int.Parse(address.Substring(1));
- dv.Start--;
+ dv.Start--; //PLC的寄存器地址比modbus协议的通讯地址大1 如:40002 对应寻 址地址 0x0001
}
break;
case '3':
{
int index = address.IndexOf('.');
- dv.Area = Modbus.fctReadInputRegister;
+ dv.Area = Modbus.fctReadInputRegister;//功能码:04读输入寄存器 30001 - 39999:输入数据寄存器(通常为模拟量输入)
if (index > 0)
{
dv.Start = int.Parse(address.Substring(1, index - 1));
@@ -79,7 +222,7 @@ namespace ModbusDriver
}
else
dv.Start = int.Parse(address.Substring(1));
- dv.Start--;
+ dv.Start--; //PLC的寄存器地址比modbus协议的通讯地址大1 如:40002 对应寻 址地址 0x0001
}
break;
}
@@ -90,7 +233,18 @@ namespace ModbusDriver
{
return string.Empty;
}
+ #endregion
+ #region :IDriver
+ //从站地址
+ short _id;
+ public short ID
+ {
+ get
+ {
+ return _id;
+ }
+ }
string _name;
public string Name
{
@@ -106,7 +260,6 @@ namespace ModbusDriver
get { return _port; }
set { _port = value; }
}
-
public bool IsClosed
{
get
@@ -133,23 +286,6 @@ namespace ModbusDriver
{
get { return _server; }
}
-
- public ModbusRTUReader(IDataServer server, short id, string name, string remote = null, int timeOut = 10000, string port = "COM1", string baudRate = "9600")
- {
- _id = id;
- _name = name;
- _server = server;
- _port = port;
- _serialPort = new SerialPort(port);
- _timeOut = timeOut;
- _serialPort.ReadTimeout = _timeOut;
- _serialPort.WriteTimeout = _timeOut;
- _serialPort.BaudRate = int.Parse(baudRate);
- _serialPort.DataBits = 8;
- _serialPort.Parity = Parity.Even;
- _serialPort.StopBits = StopBits.One;
- }
-
public bool Connect()
{
try
@@ -179,6 +315,10 @@ namespace ModbusDriver
grp.IsActive = false;
return _grps.Remove(grp);
}
+ public event ShutdownRequestEventHandler OnClose;
+ #endregion
+
+ #region : IDisposable
public void Dispose()
{
@@ -189,96 +329,9 @@ namespace ModbusDriver
_grps.Clear();
_serialPort.Close();
}
+ #endregion
- private byte[] CreateReadHeader(int startAddress, ushort length, byte function)
- {
- byte[] data = new byte[8];
- data[0] = (byte)_id; // Slave id high byte
- data[1] = function; // Message size
- byte[] _adr = BitConverter.GetBytes((short)startAddress);
- data[2] = _adr[0]; // Start address
- data[3] = _adr[1]; // Start address
- byte[] _length = BitConverter.GetBytes((short)length);
- data[4] = _length[0]; // Number of data to read
- data[5] = _length[1]; // Number of data to read
- byte[] arr = Utility.CalculateCrc(data, 6);
- data[6] = arr[0];
- data[7] = arr[1];
- return data;
- }
-
- public byte[] WriteSingleCoils(int startAddress, bool OnOff)
- {
- byte[] data = new byte[8];
- data[0] = (byte)_id; // Slave id high byte
- data[1] = Modbus.fctWriteSingleCoil; // Function code
- byte[] _adr = BitConverter.GetBytes((short)startAddress);
- data[2] = _adr[0]; // Start address
- data[3] = _adr[1]; // Start address
- if (OnOff) data[4] = 0xFF;
- byte[] arr = Utility.CalculateCrc(data, 6);
- data[6] = arr[0];
- data[7] = arr[1];
- return data;
- }
-
- public byte[] WriteMultipleCoils(int startAddress, ushort numBits, byte[] values)
- {
- int len = values.Length;
- byte[] data = new byte[len + 9];
- data[0] = (byte)_id; // Slave id high byte
- data[1] = Modbus.fctWriteMultipleCoils; // Function code
- byte[] _adr = BitConverter.GetBytes((short)startAddress);
- data[2] = _adr[0]; // Start address
- data[3] = _adr[1]; // Start address
- byte[] _length = BitConverter.GetBytes((short)numBits);
- data[4] = _length[0]; // Number of data to read
- data[5] = _length[1]; // Number of data to read
- data[6] = (byte)len;
- Array.Copy(values, 0, data, 7, len);
- byte[] arr = Utility.CalculateCrc(data, len + 7);
- data[len + 7] = arr[0];
- data[len + 8] = arr[1];
- return data;
- }
-
- public byte[] WriteSingleRegister(int startAddress, byte[] values)
- {
- byte[] data = new byte[8];
- data[0] = (byte)_id; // Slave id high byte
- data[1] = Modbus.fctWriteSingleRegister; // Function code
- byte[] _adr = BitConverter.GetBytes((short)startAddress);
- data[2] = _adr[0]; // Start address
- data[3] = _adr[1]; // Start address
- data[4] = values[0];
- data[5] = values[1];
- byte[] arr = Utility.CalculateCrc(data, 6);
- data[6] = arr[0];
- data[7] = arr[1];
- return data;
- }
-
- public byte[] WriteMultipleRegister(int startAddress, byte[] values)
- {
- int len = values.Length;
- if (len % 2 > 0) len++;
- byte[] data = new byte[len + 9];
- data[0] = (byte)_id; // Slave id high byte
- data[1] = Modbus.fctWriteMultipleRegister; // Function code
- byte[] _adr = BitConverter.GetBytes((short)startAddress);
- data[2] = _adr[0]; // Start address
- data[3] = _adr[1]; // Start address
- byte[] _length = BitConverter.GetBytes((short)(len >> 1));
- data[4] = _length[0]; // Number of data to read
- data[5] = _length[1]; // Number of data to read
- data[6] = (byte)len;
- Array.Copy(values, 0, data, 7, len);
- byte[] arr = Utility.CalculateCrc(data, len + 7);
- data[len + 7] = arr[0];
- data[len + 8] = arr[1];
- return data;
- }
-
+ #region :IReaderWriter
public byte[] ReadBytes(DeviceAddress address, ushort size)
{
int area = address.Area;
@@ -354,6 +407,7 @@ namespace ModbusDriver
return this.ReadValueEx(address);
}
+
public int WriteBytes(DeviceAddress address, byte[] bit)
{
var data = WriteMultipleRegister(address.Start, bit);
@@ -421,7 +475,12 @@ namespace ModbusDriver
return this.WriteValueEx(address, value);
}
- public event ShutdownRequestEventHandler OnClose;
+ #endregion
+
+
+
+
+
}
public sealed class ModbusRtuGroup : PLCGroup
diff --git a/SCADA/Program/ModbusDriver/ModbusTCPDriver.cs b/SCADA/Program/ModbusDriver/ModbusTCPDriver.cs
index 9f9a234..08fc88e 100644
--- a/SCADA/Program/ModbusDriver/ModbusTCPDriver.cs
+++ b/SCADA/Program/ModbusDriver/ModbusTCPDriver.cs
@@ -10,8 +10,94 @@ using DataService;
namespace ModbusDriver
{
[Description("Modbus TCP协议")]
- public sealed class ModbusTCPReader : IPLCDriver, IMultiReadWrite
+ public sealed class ModbusTCPReader : IPLCDriver, IMultiReadWrite //IPLCDriver : IDriver, IReaderWriter IDriver : IDisposable
{
+
+
+ #region
+ public int PDU
+ {
+ // get { return 252; }
+ //get { return 256; }
+ /* 更新人:yjz
+ 更新日期:20171125
+ 更新原因: 在 modbus——TCP中协议规定如下:
+ ADU=MBAP+功能码+数据 其中 ADU 256字节,MBAP 7字节,功能码1字节,数据为248字节
+ PDU=功能码+数据
+ 所以PDU应为: 249字节
+ */
+ get { return 249; } //0xF9 十进制为249
+
+ }
+
+ public DeviceAddress GetDeviceAddress(string address)
+ {
+ DeviceAddress dv = DeviceAddress.Empty;
+ if (string.IsNullOrEmpty(address))
+ return dv;
+ dv.Area = _slaveId;
+ switch (address[0])
+ {
+ case '0':
+ {
+ dv.DBNumber = Modbus.fctReadCoil;
+ int st;
+ int.TryParse(address, out st);
+ //dv.Start = (st / 16) * 16;//???????????????????
+ dv.Bit = (byte)(st % 16);
+ st /= 16;
+ dv.Start = st;
+ }
+ break;
+ case '1':
+ {
+ dv.DBNumber = Modbus.fctReadDiscreteInputs;
+ int st;
+ int.TryParse(address.Substring(1), out st);
+ //dv.Start = (st / 16) * 16;//???????????????????
+ dv.Bit = (byte)(st % 16);
+ st /= 16;
+ dv.Start = st;
+ }
+ break;
+ case '4':
+ {
+ int index = address.IndexOf('.');
+ dv.DBNumber = Modbus.fctReadHoldingRegister;
+ if (index > 0)
+ {
+ dv.Start = int.Parse(address.Substring(1, index - 1));
+ dv.Bit = byte.Parse(address.Substring(index + 1));
+ }
+ else
+ dv.Start = int.Parse(address.Substring(1));
+ dv.Start--;
+ }
+ break;
+ case '3':
+ {
+ int index = address.IndexOf('.');
+ dv.DBNumber = Modbus.fctReadInputRegister;
+ if (index > 0)
+ {
+ dv.Start = int.Parse(address.Substring(1, index - 1));
+ dv.Bit = byte.Parse(address.Substring(index + 1));
+ }
+ else
+ dv.Start = int.Parse(address.Substring(1));
+ dv.Start--;
+ }
+ break;
+ }
+ return dv;
+ }
+
+ public string GetAddress(DeviceAddress address)
+ {
+ return string.Empty;
+ }
+
+ #endregion
private int _timeout;
private Socket tcpSynCl;
@@ -239,78 +325,6 @@ namespace ModbusDriver
return WriteSyncData(data);
}
- public int PDU
- {
- get { return 252; }
- //get { return 256; }
- }
-
- public DeviceAddress GetDeviceAddress(string address)
- {
- DeviceAddress dv = DeviceAddress.Empty;
- if (string.IsNullOrEmpty(address))
- return dv;
- dv.Area = _slaveId;
- switch (address[0])
- {
- case '0':
- {
- dv.DBNumber = Modbus.fctReadCoil;
- int st;
- int.TryParse(address, out st);
- //dv.Start = (st / 16) * 16;//???????????????????
- dv.Bit = (byte)(st % 16);
- st /= 16;
- dv.Start = st;
- }
- break;
- case '1':
- {
- dv.DBNumber = Modbus.fctReadDiscreteInputs;
- int st;
- int.TryParse(address.Substring(1), out st);
- //dv.Start = (st / 16) * 16;//???????????????????
- dv.Bit = (byte)(st % 16);
- st /= 16;
- dv.Start = st;
- }
- break;
- case '4':
- {
- int index = address.IndexOf('.');
- dv.DBNumber = Modbus.fctReadHoldingRegister;
- if (index > 0)
- {
- dv.Start = int.Parse(address.Substring(1, index - 1));
- dv.Bit = byte.Parse(address.Substring(index + 1));
- }
- else
- dv.Start = int.Parse(address.Substring(1));
- dv.Start--;
- }
- break;
- case '3':
- {
- int index = address.IndexOf('.');
- dv.DBNumber = Modbus.fctReadInputRegister;
- if (index > 0)
- {
- dv.Start = int.Parse(address.Substring(1, index - 1));
- dv.Bit = byte.Parse(address.Substring(index + 1));
- }
- else
- dv.Start = int.Parse(address.Substring(1));
- dv.Start--;
- }
- break;
- }
- return dv;
- }
-
- public string GetAddress(DeviceAddress address)
- {
- return string.Empty;
- }
public IGroup AddGroup(string name, short id, int updateRate, float deadBand = 0f, bool active = false)
diff --git a/SCADA/Program/ModbusDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/SCADA/Program/ModbusDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..6f3aa8b
Binary files /dev/null and b/SCADA/Program/ModbusDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/SCADA/Program/ModbusDriver/obj/Debug/ModbusDriver.csproj.CoreCompileInputs.cache b/SCADA/Program/ModbusDriver/obj/Debug/ModbusDriver.csproj.CoreCompileInputs.cache
new file mode 100644
index 0000000..63527c2
--- /dev/null
+++ b/SCADA/Program/ModbusDriver/obj/Debug/ModbusDriver.csproj.CoreCompileInputs.cache
@@ -0,0 +1 @@
+9be013b3f62515e5c2177e72f2c384551dd4fd36
diff --git a/SCADA/Program/OPCDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/SCADA/Program/OPCDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..d586613
Binary files /dev/null and b/SCADA/Program/OPCDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/SCADA/Program/OPCDriver/obj/Debug/OPCDriver.csproj.CoreCompileInputs.cache b/SCADA/Program/OPCDriver/obj/Debug/OPCDriver.csproj.CoreCompileInputs.cache
new file mode 100644
index 0000000..c20775b
--- /dev/null
+++ b/SCADA/Program/OPCDriver/obj/Debug/OPCDriver.csproj.CoreCompileInputs.cache
@@ -0,0 +1 @@
+7427020da1b61bef59389709317457491637d5fe
diff --git a/SCADA/Program/OPCLib/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/SCADA/Program/OPCLib/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..9656dcb
Binary files /dev/null and b/SCADA/Program/OPCLib/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/SCADA/Program/OPCLib/obj/x86/Debug/OPCLib.csproj.CoreCompileInputs.cache b/SCADA/Program/OPCLib/obj/x86/Debug/OPCLib.csproj.CoreCompileInputs.cache
new file mode 100644
index 0000000..d029272
--- /dev/null
+++ b/SCADA/Program/OPCLib/obj/x86/Debug/OPCLib.csproj.CoreCompileInputs.cache
@@ -0,0 +1 @@
+94984fbddb2109c3812b6de0f400dec9879e3f86
diff --git a/SCADA/Program/SiemensPLCDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/SCADA/Program/SiemensPLCDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..90544fd
Binary files /dev/null and b/SCADA/Program/SiemensPLCDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/SCADA/Program/SiemensPLCDriver/obj/Debug/SiemensPLCDriver.csproj.CoreCompileInputs.cache b/SCADA/Program/SiemensPLCDriver/obj/Debug/SiemensPLCDriver.csproj.CoreCompileInputs.cache
new file mode 100644
index 0000000..c2767d6
--- /dev/null
+++ b/SCADA/Program/SiemensPLCDriver/obj/Debug/SiemensPLCDriver.csproj.CoreCompileInputs.cache
@@ -0,0 +1 @@
+7141aba8c101ad8c89a0e61359a75be157e7e549
diff --git a/SCADA/Program/TagConfig/TagConfig/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/SCADA/Program/TagConfig/TagConfig/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..d665355
Binary files /dev/null and b/SCADA/Program/TagConfig/TagConfig/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/SCADA/Program/TagConfig/TagConfig/obj/x86/Debug/TagConfig.csproj.CoreCompileInputs.cache b/SCADA/Program/TagConfig/TagConfig/obj/x86/Debug/TagConfig.csproj.CoreCompileInputs.cache
new file mode 100644
index 0000000..3f03244
--- /dev/null
+++ b/SCADA/Program/TagConfig/TagConfig/obj/x86/Debug/TagConfig.csproj.CoreCompileInputs.cache
@@ -0,0 +1 @@
+7efbd9325b6e0d4fb1a955c4ea1ae176b1bfa5d0