diff --git a/.gitignore b/.gitignore
index 61cc579..5424663 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,4 +6,6 @@ ehthumbs.db
Desktop.ini
!*.exe
!*.dll
-!*.bak
\ No newline at end of file
+!*.bak
+/.vs
+/SCADA/Program/packages/Newtonsoft.Json.11.0.2
diff --git a/SCADA/Program/.vs/DataExchange/v15/.suo b/SCADA/Program/.vs/DataExchange/v15/.suo
index f095429..cd17afb 100644
Binary files a/SCADA/Program/.vs/DataExchange/v15/.suo and b/SCADA/Program/.vs/DataExchange/v15/.suo differ
diff --git a/SCADA/Program/.vs/DataExchange/v15/Server/sqlite3/storage.ide b/SCADA/Program/.vs/DataExchange/v15/Server/sqlite3/storage.ide
index f81afa1..fae741c 100644
Binary files a/SCADA/Program/.vs/DataExchange/v15/Server/sqlite3/storage.ide and b/SCADA/Program/.vs/DataExchange/v15/Server/sqlite3/storage.ide differ
diff --git a/SCADA/Program/.vs/DataExchange/v15/Server/sqlite3/storage.ide-shm b/SCADA/Program/.vs/DataExchange/v15/Server/sqlite3/storage.ide-shm
new file mode 100644
index 0000000..8d4930e
Binary files /dev/null and b/SCADA/Program/.vs/DataExchange/v15/Server/sqlite3/storage.ide-shm differ
diff --git a/SCADA/Program/.vs/DataExchange/v15/Server/sqlite3/storage.ide-wal b/SCADA/Program/.vs/DataExchange/v15/Server/sqlite3/storage.ide-wal
new file mode 100644
index 0000000..0f3e506
Binary files /dev/null and b/SCADA/Program/.vs/DataExchange/v15/Server/sqlite3/storage.ide-wal differ
diff --git a/SCADA/Program/ABPLCReader/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/SCADA/Program/ABPLCReader/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..a785665
Binary files /dev/null and b/SCADA/Program/ABPLCReader/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/SCADA/Program/BatchCoreService/ProjectInstaller.Designer.cs b/SCADA/Program/BatchCoreService/ProjectInstaller.Designer.cs
index eb821b3..6fee665 100644
--- a/SCADA/Program/BatchCoreService/ProjectInstaller.Designer.cs
+++ b/SCADA/Program/BatchCoreService/ProjectInstaller.Designer.cs
@@ -42,7 +42,7 @@
this.serviceInstaller1.Description = "数据服务";
this.serviceInstaller1.ServiceName = "BatchCoreService";
this.serviceInstaller1.ServicesDependedOn = new string[] {
- "MSSQL$SQLEXPRESS"};
+ "HaoSQL2008"};
this.serviceInstaller1.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
//
// ProjectInstaller
diff --git a/SCADA/Program/BatchCoreService/ProjectInstaller.resx b/SCADA/Program/BatchCoreService/ProjectInstaller.resx
index 235f1b0..ee77145 100644
--- a/SCADA/Program/BatchCoreService/ProjectInstaller.resx
+++ b/SCADA/Program/BatchCoreService/ProjectInstaller.resx
@@ -118,7 +118,7 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- 17, 56
+ 17, 55
196, 17
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..2915dd6
Binary files /dev/null and b/SCADA/Program/BatchCoreService/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
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..528b2bb
Binary files /dev/null and b/SCADA/Program/BatchCoreTest/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/SCADA/Program/ClientDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/SCADA/Program/ClientDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..5407aeb
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..2209bad
--- /dev/null
+++ b/SCADA/Program/CoreTest/obj/x86/Debug/AlarmSet.g.i.cs
@@ -0,0 +1,199 @@
+#pragma checksum "..\..\..\AlarmSet.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "11D7D1142659883006DE8D16FF16C98ECF5D96E5"
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本: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..80117e2
--- /dev/null
+++ b/SCADA/Program/CoreTest/obj/x86/Debug/App.g.i.cs
@@ -0,0 +1,78 @@
+#pragma checksum "..\..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "E1F43B7F6CA36743FBDCC124511923BCB538201D"
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本: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..720843c
Binary files /dev/null and b/SCADA/Program/CoreTest/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
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..5574ef9
--- /dev/null
+++ b/SCADA/Program/CoreTest/obj/x86/Debug/Login.g.i.cs
@@ -0,0 +1,205 @@
+#pragma checksum "..\..\..\Login.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "AE28E95762DCC3C98413991AB3FD0D23F37D3CE3"
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本: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..188fd75
--- /dev/null
+++ b/SCADA/Program/CoreTest/obj/x86/Debug/RuntimeChart.g.i.cs
@@ -0,0 +1,188 @@
+#pragma checksum "..\..\..\RuntimeChart.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "8AE27EC0F869EF1ADB433A4756BFD002B4305BD3"
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本: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..54202c4
--- /dev/null
+++ b/SCADA/Program/CoreTest/obj/x86/Debug/StartDevice.g.i.cs
@@ -0,0 +1,151 @@
+#pragma checksum "..\..\..\StartDevice.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "0EEE22AD3B597E0CB717D8885FB4F7D7B3D7EBF9"
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本: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..babb05a
--- /dev/null
+++ b/SCADA/Program/CoreTest/obj/x86/Debug/TagMonitor.g.i.cs
@@ -0,0 +1,136 @@
+#pragma checksum "..\..\..\TagMonitor.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "28C5AB6899D56BC8ADA97D3865FFFC890B9A3DDD"
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本: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..fc5eae5
--- /dev/null
+++ b/SCADA/Program/CoreTest/obj/x86/Debug/Trend.g.i.cs
@@ -0,0 +1,264 @@
+#pragma checksum "..\..\..\Trend.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "A699E208959857EF7ABA7FAB7613F3E3383D42FE"
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本: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/DDEDriver/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/SCADA/Program/DDEDriver/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..d771f05
Binary files /dev/null and b/SCADA/Program/DDEDriver/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/SCADA/Program/DataExchange.sln b/SCADA/Program/DataExchange.sln
index 48ca860..27a960b 100644
--- a/SCADA/Program/DataExchange.sln
+++ b/SCADA/Program/DataExchange.sln
@@ -39,6 +39,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ABPLCDriver", "ABPLCReader\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DDEDriver", "DDEDriver\DDEDriver.csproj", "{14938033-7870-477D-925C-A447933A44E7}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MelsecDriver", "MelsecDriver\MelsecDriver.csproj", "{AE7D9641-3F7D-4282-B752-2FA14619CFBF}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HslCommunication_Net45", "..\..\..\HslCommunication\HslCommunication_Net45\HslCommunication_Net45.csproj", "{7F8029DA-1B94-4B1D-B91F-5B21DBF2F3A2}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -359,6 +363,46 @@ Global
{14938033-7870-477D-925C-A447933A44E7}.Release|x64.ActiveCfg = Release|x86
{14938033-7870-477D-925C-A447933A44E7}.Release|x86.ActiveCfg = Release|x86
{14938033-7870-477D-925C-A447933A44E7}.Release|x86.Build.0 = Release|x86
+ {AE7D9641-3F7D-4282-B752-2FA14619CFBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {AE7D9641-3F7D-4282-B752-2FA14619CFBF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {AE7D9641-3F7D-4282-B752-2FA14619CFBF}.Debug|Itanium.ActiveCfg = Debug|Any CPU
+ {AE7D9641-3F7D-4282-B752-2FA14619CFBF}.Debug|Itanium.Build.0 = Debug|Any CPU
+ {AE7D9641-3F7D-4282-B752-2FA14619CFBF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {AE7D9641-3F7D-4282-B752-2FA14619CFBF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {AE7D9641-3F7D-4282-B752-2FA14619CFBF}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {AE7D9641-3F7D-4282-B752-2FA14619CFBF}.Debug|x64.Build.0 = Debug|Any CPU
+ {AE7D9641-3F7D-4282-B752-2FA14619CFBF}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {AE7D9641-3F7D-4282-B752-2FA14619CFBF}.Debug|x86.Build.0 = Debug|Any CPU
+ {AE7D9641-3F7D-4282-B752-2FA14619CFBF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {AE7D9641-3F7D-4282-B752-2FA14619CFBF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {AE7D9641-3F7D-4282-B752-2FA14619CFBF}.Release|Itanium.ActiveCfg = Release|Any CPU
+ {AE7D9641-3F7D-4282-B752-2FA14619CFBF}.Release|Itanium.Build.0 = Release|Any CPU
+ {AE7D9641-3F7D-4282-B752-2FA14619CFBF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {AE7D9641-3F7D-4282-B752-2FA14619CFBF}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {AE7D9641-3F7D-4282-B752-2FA14619CFBF}.Release|x64.ActiveCfg = Release|Any CPU
+ {AE7D9641-3F7D-4282-B752-2FA14619CFBF}.Release|x64.Build.0 = Release|Any CPU
+ {AE7D9641-3F7D-4282-B752-2FA14619CFBF}.Release|x86.ActiveCfg = Release|Any CPU
+ {AE7D9641-3F7D-4282-B752-2FA14619CFBF}.Release|x86.Build.0 = Release|Any CPU
+ {7F8029DA-1B94-4B1D-B91F-5B21DBF2F3A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7F8029DA-1B94-4B1D-B91F-5B21DBF2F3A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7F8029DA-1B94-4B1D-B91F-5B21DBF2F3A2}.Debug|Itanium.ActiveCfg = Debug|Any CPU
+ {7F8029DA-1B94-4B1D-B91F-5B21DBF2F3A2}.Debug|Itanium.Build.0 = Debug|Any CPU
+ {7F8029DA-1B94-4B1D-B91F-5B21DBF2F3A2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {7F8029DA-1B94-4B1D-B91F-5B21DBF2F3A2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {7F8029DA-1B94-4B1D-B91F-5B21DBF2F3A2}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {7F8029DA-1B94-4B1D-B91F-5B21DBF2F3A2}.Debug|x64.Build.0 = Debug|Any CPU
+ {7F8029DA-1B94-4B1D-B91F-5B21DBF2F3A2}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {7F8029DA-1B94-4B1D-B91F-5B21DBF2F3A2}.Debug|x86.Build.0 = Debug|Any CPU
+ {7F8029DA-1B94-4B1D-B91F-5B21DBF2F3A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7F8029DA-1B94-4B1D-B91F-5B21DBF2F3A2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7F8029DA-1B94-4B1D-B91F-5B21DBF2F3A2}.Release|Itanium.ActiveCfg = Release|Any CPU
+ {7F8029DA-1B94-4B1D-B91F-5B21DBF2F3A2}.Release|Itanium.Build.0 = Release|Any CPU
+ {7F8029DA-1B94-4B1D-B91F-5B21DBF2F3A2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {7F8029DA-1B94-4B1D-B91F-5B21DBF2F3A2}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {7F8029DA-1B94-4B1D-B91F-5B21DBF2F3A2}.Release|x64.ActiveCfg = Release|Any CPU
+ {7F8029DA-1B94-4B1D-B91F-5B21DBF2F3A2}.Release|x64.Build.0 = Release|Any CPU
+ {7F8029DA-1B94-4B1D-B91F-5B21DBF2F3A2}.Release|x86.ActiveCfg = Release|Any CPU
+ {7F8029DA-1B94-4B1D-B91F-5B21DBF2F3A2}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/SCADA/Program/DataHelper/MssqlFactory.cs b/SCADA/Program/DataHelper/MssqlFactory.cs
index 45d5c1d..6541c70 100644
--- a/SCADA/Program/DataHelper/MssqlFactory.cs
+++ b/SCADA/Program/DataHelper/MssqlFactory.cs
@@ -12,6 +12,11 @@ namespace DatabaseLib
DataHelper.AddErrorLog(new Exception(message));
}
+ public void CallException(Exception e)
+ {
+ DataHelper.AddErrorLog(e);
+ }
+
public bool ConnectionTest()
{
//创建连接对象
@@ -30,7 +35,7 @@ namespace DatabaseLib
}
catch (Exception e)
{
- CallException(e.Message);
+ CallException(e);
}
}
//mySqlConnection is a SqlConnection object
@@ -77,7 +82,7 @@ namespace DatabaseLib
}
catch (Exception e)
{
- CallException(SQL + " " + e.Message);
+ CallException(new Exception(SQL + " " + e.Message, e));
}
}
return ds;
@@ -104,7 +109,7 @@ namespace DatabaseLib
}
catch (Exception e)
{
- CallException(SQL + " " + e.Message);
+ CallException(new Exception(SQL + " " + e.Message, e));
}
}
return ds;
@@ -135,7 +140,7 @@ namespace DatabaseLib
}
catch (Exception e)
{
- CallException(SQLs + " " + e.Message);
+ CallException(new Exception(SQLs + " " + e.Message, e));
}
}
return ds;
@@ -162,7 +167,7 @@ namespace DatabaseLib
}
catch (Exception e)
{
- CallException(SQL + " " + e.Message);
+ CallException(new Exception(SQL + " " + e.Message, e));
}
}
return dt;
@@ -198,7 +203,7 @@ namespace DatabaseLib
{
if (sqlT != null)
sqlT.Rollback();
- CallException(SQL + " " + e.Message);
+ CallException(new Exception(SQL + " " + e.Message, e));
return -1;
}
return res;
@@ -235,7 +240,7 @@ namespace DatabaseLib
{
if (sqlT != null)
sqlT.Rollback();
- CallException(SQLs + " " + e.Message);
+ CallException(new Exception(SQLs + " " + e.Message, e));
res = -1;
}
return res;
@@ -278,7 +283,7 @@ namespace DatabaseLib
{
if (sqlT != null)
sqlT.Rollback();
- CallException(SQLs + " " + e.Message);
+ CallException(new Exception(SQLs + " " + e.Message, e));
res = -1;
}
return res;
@@ -308,7 +313,7 @@ namespace DatabaseLib
}
catch (Exception e)
{
- CallException(SQL + " " + e.Message);
+ CallException(new Exception(SQL + " " + e.Message, e));
}
}
@@ -345,7 +350,7 @@ namespace DatabaseLib
}
catch (Exception e)
{
- CallException(sSQL + " " + e.Message);
+ CallException(new Exception(sSQL + " " + e.Message, e));
return null;
}
}
@@ -379,7 +384,7 @@ namespace DatabaseLib
{
if (sqlT != null)
sqlT.Rollback();
- CallException(sSQL + " " + e.Message);
+ CallException(new Exception(sSQL + " " + e.Message, e));
return null;
}
}
@@ -423,7 +428,7 @@ namespace DatabaseLib
}
catch (Exception e)
{
- CallException(ProName + " " + e.Message);
+ CallException(new Exception(ProName + " " + e.Message, e));
return -1;
}
}
@@ -450,7 +455,7 @@ namespace DatabaseLib
}
catch (Exception e)
{
- CallException(ProName + " " + e.Message);
+ CallException(new Exception(ProName + " " + e.Message, e));
return false;
}
}
@@ -489,7 +494,7 @@ namespace DatabaseLib
}
catch (Exception e)
{
- CallException(ProName + " " + e.Message);
+ CallException(new Exception(ProName + " " + e.Message, e));
return null;
}
}
@@ -518,7 +523,7 @@ namespace DatabaseLib
catch (Exception e)
{
- CallException(ProName + " " + e.Message);
+ CallException(new Exception(ProName + " " + e.Message, e));
return null;
}
}
@@ -555,7 +560,7 @@ namespace DatabaseLib
}
catch (Exception e)
{
- CallException(ProName + " " + e.Message);
+ CallException(new Exception(ProName + " " + e.Message, e));
return null;
}
}
@@ -586,7 +591,7 @@ namespace DatabaseLib
}
catch (Exception e)
{
- CallException(ProName + " " + e.Message);
+ CallException(new Exception(ProName + " " + e.Message, e));
return null;
}
}
@@ -624,7 +629,7 @@ namespace DatabaseLib
}
catch (Exception e)
{
- CallException(ProName + " " + e.Message);
+ CallException(new Exception(ProName + " " + e.Message, e));
return null;
}
}
@@ -662,7 +667,7 @@ namespace DatabaseLib
}
catch (Exception e)
{
- CallException(ProName + " " + e.Message);
+ CallException(new Exception(ProName + " " + e.Message, e));
return null;
}
}
@@ -701,7 +706,44 @@ namespace DatabaseLib
if (sqlT != null)
sqlT.Rollback();
m_Conn.Close();
- CallException(e.Message);
+ CallException(e);
+ return false;
+ }
+ }
+ }
+
+ public bool BulkCopy(DataTable reader, string tableName, string command = null, SqlBulkCopyOptions options = SqlBulkCopyOptions.Default)
+ {
+ using (SqlConnection m_Conn = new SqlConnection(DataHelper.ConnectString))
+ {
+ SqlTransaction sqlT = null;
+ try
+ {
+ if (m_Conn.State == ConnectionState.Closed)
+ m_Conn.Open();
+ sqlT = m_Conn.BeginTransaction();
+ if (!string.IsNullOrEmpty(command))
+ {
+ SqlCommand cmd = new SqlCommand(command, m_Conn);
+ cmd.Transaction = sqlT;
+ cmd.ExecuteNonQuery();
+ }
+ SqlBulkCopy copy = new SqlBulkCopy(m_Conn, options, sqlT);
+ copy.DestinationTableName = tableName;
+ copy.BulkCopyTimeout = 100000;
+ //copy.BatchSize = _capacity;
+ copy.WriteToServer(reader);//如果写入失败,考虑不能无限增加线程数
+ //Clear();
+ sqlT.Commit();
+ m_Conn.Close();
+ return true;
+ }
+ catch (Exception e)
+ {
+ if (sqlT != null)
+ sqlT.Rollback();
+ m_Conn.Close();
+ CallException(e);
return false;
}
}
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..498ea33
Binary files /dev/null and b/SCADA/Program/DataHelper/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/SCADA/Program/DataService/CacheReader.cs b/SCADA/Program/DataService/CacheReader.cs
index 84e8834..f2b035c 100644
--- a/SCADA/Program/DataService/CacheReader.cs
+++ b/SCADA/Program/DataService/CacheReader.cs
@@ -139,8 +139,8 @@ namespace DataService
public int WriteString(DeviceAddress address, string str)
{
byte[] b = Encoding.ASCII.GetBytes(str);
- int index = address.CacheIndex;
- Array.Copy(_cache, index, b, 0, b.Length);
+ int index = address.CacheIndex * 2;
+ Buffer.BlockCopy(b, 0, _cache, index, b.Length);
return 0;
}
@@ -301,8 +301,8 @@ namespace DataService
public int WriteString(DeviceAddress address, string str)
{
byte[] b = Encoding.ASCII.GetBytes(str);
- int index = address.CacheIndex;
- Array.Copy(_cache, index, b, 0, b.Length);
+ int index = address.CacheIndex * 2;
+ Buffer.BlockCopy(b, 0, _cache, index, b.Length);
return 0;
}
@@ -495,8 +495,8 @@ namespace DataService
public int WriteString(DeviceAddress address, string str)
{
byte[] b = Encoding.ASCII.GetBytes(str);
- int index = address.CacheIndex;
- Buffer.BlockCopy(_cache, index, b, 0, b.Length);
+ int index = address.CacheIndex * 2;
+ Buffer.BlockCopy(b, 0, _cache, index, b.Length);
return 0;
}
@@ -582,7 +582,7 @@ namespace DataService
}
else
{
- result = (IPAddress.HostToNetworkOrder(_cache[startIndex]) << 16) | ((ushort)IPAddress.HostToNetworkOrder(_cache[startIndex + 1]));
+ result = (_cache[startIndex + 1] << 16) | ((ushort)_cache[startIndex]);
}
return new ItemData(result, 0, QUALITIES.QUALITY_GOOD);
}
@@ -694,8 +694,8 @@ namespace DataService
public int WriteString(DeviceAddress address, string str)
{
byte[] b = Encoding.ASCII.GetBytes(str);
- int index = address.CacheIndex;
- Buffer.BlockCopy(_cache, index, b, 0, b.Length);
+ int index = address.CacheIndex * 2;
+ Buffer.BlockCopy(b, 0, _cache, index, b.Length);
return 0;
}
@@ -863,8 +863,8 @@ namespace DataService
public int WriteString(DeviceAddress address, string str)
{
byte[] b = Encoding.ASCII.GetBytes(str);
- int index = address.CacheIndex;
- Buffer.BlockCopy(_cache, index, b, 0, b.Length);
+ int index = address.CacheIndex * 2;
+ Buffer.BlockCopy(b, 0, _cache, index, b.Length);
return 0;
}
@@ -1029,8 +1029,8 @@ namespace DataService
public int WriteString(DeviceAddress address, string str)
{
byte[] b = Encoding.ASCII.GetBytes(str);
- int index = address.CacheIndex;
- Buffer.BlockCopy(_cache, index, b, 0, b.Length);
+ int index = address.CacheIndex * 2;
+ Buffer.BlockCopy(b, 0, _cache, index, b.Length);
return 0;
}
diff --git a/SCADA/Program/DataService/Enums.cs b/SCADA/Program/DataService/Enums.cs
index b1accd5..64ecd0f 100644
--- a/SCADA/Program/DataService/Enums.cs
+++ b/SCADA/Program/DataService/Enums.cs
@@ -20,7 +20,7 @@ namespace DataService
INT = 7,
FLOAT = 8,
SYS = 9,
- STR = 11
+ STR = 10
}
[Flags]
diff --git a/SCADA/Program/DataService/ExtensionMethods.cs b/SCADA/Program/DataService/ExtensionMethods.cs
index 7c18827..67ff7e1 100644
--- a/SCADA/Program/DataService/ExtensionMethods.cs
+++ b/SCADA/Program/DataService/ExtensionMethods.cs
@@ -317,7 +317,7 @@ namespace DataService
int endIndex = 0;
while (endIndex < addrArr.Length)
{
- if (start.Area != addrArr[endIndex].Area || start.DBNumber != addrArr[endIndex].DBNumber || endIndex - startIndex >= limit)
+ if (start.Area != addrArr[endIndex].Area || start.DBNumber != addrArr[endIndex].DBNumber || endIndex - startIndex >= limit || endIndex == addrArr.Length - 1)
{
for (int i = startIndex; i < endIndex; i++)
{
diff --git a/SCADA/Program/DataService/PLCGroup.cs b/SCADA/Program/DataService/PLCGroup.cs
index 6d3c26a..89a1b41 100644
--- a/SCADA/Program/DataService/PLCGroup.cs
+++ b/SCADA/Program/DataService/PLCGroup.cs
@@ -191,7 +191,7 @@ namespace DataService
}
}
_items.TrimExcess();
- _items.Sort();
+ _items.Sort((x, y) => x.Address.CompareTo(y.Address));
UpdatePDUArea();
return true;
}
@@ -210,7 +210,7 @@ namespace DataService
}
}
_items.TrimExcess();
- _items.Sort();
+ _items.Sort((x, y) => x.Address.CompareTo(y.Address));
UpdatePDUArea();
return true;
}
@@ -284,7 +284,7 @@ namespace DataService
}
else
{
- var size= _start.DataSize <= bitCount ? 1 : _start.DataSize / bitCount;
+ var size = _start.DataSize <= bitCount ? 1 : _start.DataSize / bitCount;
_rangeList.Add(new PDUArea(_start, size, 0, 1));
_cacheReader.Size = size;//改变Cache的Size属性值将创建Cache的内存区域
}
@@ -303,9 +303,22 @@ namespace DataService
}
object sync = new object();
+
+ public void Flush()
+ {
+ lock (sync)
+ {
+ _changedList.Clear();
+ Poll();
+ if (_changedList.Count > 0)
+ Update();
+ }
+ }
+
protected void timer_Timer(object sender, EventArgs e)
{
- if (_isActive)
+ //Modified Kevin
+ if (_isActive && !_plcReader.IsClosed)
{
lock (sync)
{
@@ -838,7 +851,7 @@ namespace DataService
int offset = 0;
foreach (PDUArea area in _rangeList)
{
- byte[] rcvBytes = _plcReader.ReadBytes(area.Start, (ushort)area.Len);//从PLC读取数据
+ byte[] rcvBytes = _plcReader.ReadBytes(area.Start, (ushort)area.Len);//从PLC读取数据
if (rcvBytes == null || rcvBytes.Length == 0)
{
offset += (area.Len + 1) / 2;
@@ -848,66 +861,84 @@ namespace DataService
else
{
int len = rcvBytes.Length / 2;
- fixed (byte* p1 = rcvBytes)
+ //判断长度必须
+ if (len == area.Len)
{
- short* prcv = (short*)p1;
- int index = area.StartIndex;//index指向_items中的Tag元数据
- int count = index + area.Count;
- while (index < count)
+ fixed (byte* p1 = rcvBytes)
{
- DeviceAddress addr = _items[index].Address;
- int iShort = addr.CacheIndex;
- int iShort1 = iShort - offset;
- if (addr.VarType == DataType.BOOL)
+ short* prcv = (short*)p1;
+ int index = area.StartIndex; //index指向_items中的Tag元数据
+ int count = index + area.Count;
+ while (index < count)
{
- if (addr.ByteOrder.HasFlag(ByteOrder.Network)) prcv[iShort1] = IPAddress.HostToNetworkOrder(prcv[iShort1]);
- int tmp = prcv[iShort1] ^ cache[iShort];
- DeviceAddress next = addr;
- if (tmp != 0)
+ DeviceAddress addr = _items[index].Address;
+ int iShort = addr.CacheIndex;
+ int iShort1 = iShort - offset;
+ if (addr.VarType == DataType.BOOL)
{
- while (addr.Start == next.Start)
+ if (addr.ByteOrder.HasFlag(ByteOrder.Network))
+ prcv[iShort1] = IPAddress.HostToNetworkOrder(prcv[iShort1]);
+ int tmp = prcv[iShort1] ^ cache[iShort];
+ DeviceAddress next = addr;
+ if (tmp != 0)
{
- if ((tmp & (1 << next.Bit)) > 0) _changedList.Add(index);
- if (++index < count)
+ while (addr.Start == next.Start)
+ {
+ if ((tmp & (1 << next.Bit)) > 0) _changedList.Add(index);
+ if (++index < count)
+ next = _items[index].Address;
+ else
+ break;
+ }
+ }
+ else
+ {
+ while (addr.Start == next.Start && ++index < count)
+ {
next = _items[index].Address;
- else
- break;
+ }
}
}
else
{
- while (addr.Start == next.Start && ++index < count)
+ if (addr.DataSize <= 2)
{
- next = _items[index].Address;
+ if (prcv[iShort1] != cache[iShort]) _changedList.Add(index);
}
- }
- }
- else
- {
- if (addr.DataSize <= 2)
- {
- if (prcv[iShort1] != cache[iShort]) _changedList.Add(index);
- }
- else
- {
- int size = addr.DataSize / 2;
- for (int i = 0; i < size; i++)
+ else
{
- if (prcv[iShort1 + i] != cache[iShort + i])
+ int size = addr.DataSize / 2;
+ for (int i = 0; i < size; i++)
{
- _changedList.Add(index);
- break;
+ if (prcv[iShort1 + i] != cache[iShort + i])
+ {
+ _changedList.Add(index);
+ break;
+ }
}
}
+
+ index++;
}
- index++;
}
+
+ short[] prcvShorts = new short[len];
+ for (int i = 0; i < len; i++)
+ {
+ prcvShorts[i] = prcv[i];
+ }
+
+ //改成Array.Copy 由于线程安全的问题
+ Array.Copy(prcvShorts, 0, cache, offset, len);
+ /*
+ for (int j = 0; j < len; j++)
+ {
+ cache[j + offset] = prcv[j];
+ }//将PLC读取的数据写入到CacheReader中
+ */
}
- for (int j = 0; j < len; j++)
- {
- cache[j + offset] = prcv[j];
- }//将PLC读取的数据写入到CacheReader中
}
+
offset += len;
}
}
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..3e5f37d
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..b39707e
Binary files /dev/null and b/SCADA/Program/FileDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/SCADA/Program/HMIControl/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/SCADA/Program/HMIControl/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..b0aa29a
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_MarkupCompile.i.cache b/SCADA/Program/HMIControl/obj/Debug/HMIControl_MarkupCompile.i.cache
new file mode 100644
index 0000000..0640182
--- /dev/null
+++ b/SCADA/Program/HMIControl/obj/Debug/HMIControl_MarkupCompile.i.cache
@@ -0,0 +1,20 @@
+HMIControl
+
+
+library
+C#
+.cs
+D:\$MyWorkspace\GitHub\SharpSCADA\SCADA\Program\HMIControl\obj\Debug\
+HMIControl
+none
+false
+DEBUG;TRACE
+
+1-731644535
+
+911110599564
+11-823603823
+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..0941972
--- /dev/null
+++ b/SCADA/Program/HMIControl/obj/Debug/HMIControl_MarkupCompile.i.lref
@@ -0,0 +1,4 @@
+D:\$MyWorkspace\GitHub\SharpSCADA\SCADA\Program\HMIControl\obj\Debug\GeneratedInternalTypeHelper.g.i.cs
+
+FD:\$MyWorkspace\GitHub\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..133f8df
Binary files /dev/null and b/SCADA/Program/LinkableControlDesignTime/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/SCADA/Program/MelsecDriver/FxSerialReader.cs b/SCADA/Program/MelsecDriver/FxSerialReader.cs
new file mode 100644
index 0000000..2daf132
--- /dev/null
+++ b/SCADA/Program/MelsecDriver/FxSerialReader.cs
@@ -0,0 +1,1405 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.IO.Ports;
+using System.Linq;
+using System.Net;
+using System.Text;
+using System.Timers;
+using DataService;
+using HslCommunication.Profinet.Melsec;
+
+namespace MelsecDriver
+{
+ [Description("三菱Fx系列串口")]
+ //ModbusRTUReader : IPLCDriver IPLCDriver : IDriver, IReaderWriter IDriver : IDisposable
+ public sealed class FxSerialReader : IPLCDriver
+ {
+ #region : IDisposable
+
+ public void Dispose()
+ {
+ foreach (IGroup grp in _grps)
+ {
+ grp.Dispose();
+ }
+
+ _grps.Clear();
+ _fxSerial.Close();
+ }
+
+ #endregion
+
+ //从站地址
+ short _id;
+
+ public short ID
+ {
+ get { return _id; }
+ }
+
+ string _name;
+
+ public string Name
+ {
+ get { return _name; }
+ }
+
+ private string _serverName = "unknown";
+
+ public string ServerName
+ {
+ get { return _serverName; }
+ set { _serverName = value; }
+ }
+
+ public bool IsClosed
+ {
+ get { return _fxSerial == null || _fxSerial.IsOpen == false; }
+ }
+
+ IDataServer _server;
+
+ public IDataServer Parent
+ {
+ get { return _server; }
+ }
+
+
+ private string _port = "COM1";
+
+ [Category("串口设置"), Description("串口号")]
+ public string PortName
+ {
+ get { return _port; }
+ set { _port = value; }
+ }
+
+ private int _timeOut = 3000;
+
+ [Category("串口设置"), Description("通迅超时时间")]
+ public int TimeOut
+ {
+ get { return _timeOut; }
+ set { _timeOut = value; }
+ }
+
+ private int _baudRate = 9600;
+
+ [Category("串口设置"), Description("波特率")]
+ public int BaudRate
+ {
+ get { return _baudRate; }
+ set { _baudRate = value; }
+ }
+
+ private int _dataBits = 8;
+
+ [Category("串口设置"), Description("数据位")]
+ public int DataBits
+ {
+ get { return _dataBits; }
+ set { _dataBits = value; }
+ }
+
+ private StopBits _stopBits = StopBits.One;
+
+ [Category("串口设置"), Description("停止位")]
+ public StopBits StopBits
+ {
+ get { return _stopBits; }
+ set { _stopBits = value; }
+ }
+
+ private Parity _parity = Parity.None;
+
+ [Category("串口设置"), Description("奇偶校验")]
+ public Parity Parity
+ {
+ get { return _parity; }
+ set { _parity = value; }
+ }
+
+ private MelsecFxSerial _fxSerial;
+
+ public bool Connect()
+ {
+ _fxSerial = new MelsecFxSerial();
+ try
+ {
+ _fxSerial.SerialPortInni(sp =>
+ {
+ sp.PortName = _port;
+ sp.BaudRate = _baudRate;
+ sp.DataBits = _dataBits;
+ sp.StopBits = _stopBits;
+ sp.Parity = _parity;
+ });
+ _fxSerial.Open();
+
+ return true;
+ }
+ catch (Exception ex)
+ {
+ if (OnError != null)
+ OnError(this, new IOErrorEventArgs(ex.Message));
+ return false;
+ }
+ }
+
+ List _grps = new List();
+
+ public event IOErrorEventHandler OnError;
+
+ public IEnumerable Groups
+ {
+ get { return _grps; }
+ }
+
+ public IGroup AddGroup(string name, short id, int updateRate, float deadBand = 0, bool active = false)
+ {
+ FxShortGroup grp = new FxShortGroup(id, name, updateRate, active, this);
+ _grps.Add(grp);
+ return grp;
+ }
+
+ public bool RemoveGroup(IGroup grp)
+ {
+ grp.IsActive = false;
+ return _grps.Remove(grp);
+ }
+
+ //自定义构造函数3
+ public FxSerialReader(IDataServer server, short id, string name)
+ {
+ _id = id;
+ _name = name;
+ _server = server;
+ }
+
+ object _async = new object();
+
+
+ public byte[] ReadBytes(DeviceAddress address, ushort size)
+ {
+ string addr;
+ addr = GetAddress(address);
+ try
+ {
+ lock (_async)
+ {
+ if (address.DBNumber < 3)
+ {
+ var read = _fxSerial.ReadBool(addr, (ushort) (size * 16));
+ if (read.IsSuccess)
+ {
+ byte[] retBytes = new byte[size * 2];
+ Buffer.BlockCopy(read.Content,0,retBytes,0,size * 2);
+ return retBytes;
+ }
+ else
+ {
+ if (OnError != null)
+ OnError(this, new IOErrorEventArgs(read.Message));
+ return null;
+ }
+ }
+ else
+ {
+ var read = _fxSerial.Read(addr, size);
+ if (read.IsSuccess)
+ {
+ return read.Content;
+ }
+ else
+ {
+ if (OnError != null)
+ OnError(this, new IOErrorEventArgs(read.Message));
+ return null;
+ }
+ }
+
+ }
+ }
+ catch (Exception e)
+ {
+ if (OnError != null)
+ OnError(this, new IOErrorEventArgs(e.Message));
+ return null;
+ }
+ }
+
+ public ItemData ReadUInt32(DeviceAddress address)
+ {
+ byte[] bit = ReadBytes(address, 2);
+ return bit == null ? new ItemData(0, 0, QUALITIES.QUALITY_BAD) :
+ new ItemData(BitConverter.ToUInt32(bit, 0), 0, QUALITIES.QUALITY_GOOD);
+ }
+
+ public ItemData ReadInt32(DeviceAddress address)
+ {
+ byte[] bit = ReadBytes(address, 2);
+ return bit == null ? new ItemData(0, 0, QUALITIES.QUALITY_BAD) :
+ new ItemData(BitConverter.ToInt32(bit, 0), 0, QUALITIES.QUALITY_GOOD);
+ }
+
+ public ItemData ReadUInt16(DeviceAddress address)
+ {
+ byte[] bit = ReadBytes(address, 1);
+ return bit == null ? new ItemData(0, 0, QUALITIES.QUALITY_BAD) :
+ new ItemData(BitConverter.ToUInt16(bit, 0), 0, QUALITIES.QUALITY_GOOD);
+ }
+
+ public ItemData ReadInt16(DeviceAddress address)
+ {
+ byte[] bit = ReadBytes(address, 1);
+ return bit == null ? new ItemData(0, 0, QUALITIES.QUALITY_BAD) :
+ new ItemData(BitConverter.ToInt16(bit, 0), 0, QUALITIES.QUALITY_GOOD);
+ }
+
+ public ItemData ReadByte(DeviceAddress address)
+ {
+ byte[] bit = ReadBytes(address, 1);
+ return bit == null ? new ItemData(0, 0, QUALITIES.QUALITY_BAD) :
+ new ItemData(bit[0], 0, QUALITIES.QUALITY_GOOD);
+ }
+
+ public ItemData ReadString(DeviceAddress address, ushort size)
+ {
+ byte[] bit = ReadBytes(address, size);
+ return bit == null ? new ItemData(string.Empty, 0, QUALITIES.QUALITY_BAD) :
+ new ItemData(Encoding.ASCII.GetString(bit), 0, QUALITIES.QUALITY_GOOD);
+ }
+
+ public ItemData ReadFloat(DeviceAddress address)
+ {
+ byte[] bit = ReadBytes(address, 2);
+ return bit == null ? new ItemData(0f, 0, QUALITIES.QUALITY_BAD) :
+ new ItemData(BitConverter.ToSingle(bit, 0), 0, QUALITIES.QUALITY_GOOD);
+ }
+
+ public ItemData ReadBit(DeviceAddress address)
+ {
+ byte[] bit = ReadBytes(address, 1);
+ return bit == null ? new ItemData(false, 0, QUALITIES.QUALITY_BAD) :
+ new ItemData((bit[0] & (1 << (address.Bit))) > 0, 0, QUALITIES.QUALITY_GOOD);
+ }
+
+ public ItemData