Browse Source

Merge pull request #9 from yangjingzhao123/master

modbusRTU  增加了对程序理解的注释
pull/17/head
Gavin 9 years ago
committed by GitHub
parent
commit
6110c61d16
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. BIN
      SCADA/Program/.vs/DataExchange/v15/.suo
  2. BIN
      SCADA/Program/.vs/DataExchange/v15/sqlite3/storage.ide
  3. 1
      SCADA/Program/BatchCoreService/obj/x86/Debug/BatchCoreService.csproj.CoreCompileInputs.cache
  4. BIN
      SCADA/Program/BatchCoreService/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  5. 1
      SCADA/Program/BatchCoreTest/obj/x86/Debug/BatchCoreTest.csproj.CoreCompileInputs.cache
  6. BIN
      SCADA/Program/BatchCoreTest/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  7. 1
      SCADA/Program/ClientDriver/obj/Debug/ClientDriver.csproj.CoreCompileInputs.cache
  8. BIN
      SCADA/Program/ClientDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  9. 199
      SCADA/Program/CoreTest/obj/x86/Debug/AlarmSet.g.i.cs
  10. 78
      SCADA/Program/CoreTest/obj/x86/Debug/App.g.i.cs
  11. BIN
      SCADA/Program/CoreTest/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  12. 1
      SCADA/Program/CoreTest/obj/x86/Debug/Example.csproj.CoreCompileInputs.cache
  13. 62
      SCADA/Program/CoreTest/obj/x86/Debug/GeneratedInternalTypeHelper.g.i.cs
  14. 205
      SCADA/Program/CoreTest/obj/x86/Debug/Login.g.i.cs
  15. 188
      SCADA/Program/CoreTest/obj/x86/Debug/RuntimeChart.g.i.cs
  16. 151
      SCADA/Program/CoreTest/obj/x86/Debug/StartDevice.g.i.cs
  17. 136
      SCADA/Program/CoreTest/obj/x86/Debug/TagMonitor.g.i.cs
  18. 264
      SCADA/Program/CoreTest/obj/x86/Debug/Trend.g.i.cs
  19. 1
      SCADA/Program/DataHelper/obj/x86/Debug/DataHelper.csproj.CoreCompileInputs.cache
  20. BIN
      SCADA/Program/DataHelper/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  21. 1
      SCADA/Program/DataService/obj/x86/Debug/DataService.csproj.CoreCompileInputs.cache
  22. BIN
      SCADA/Program/DataService/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  23. BIN
      SCADA/Program/FileDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  24. 1
      SCADA/Program/FileDriver/obj/Debug/FileDriver.csproj.CoreCompileInputs.cache
  25. BIN
      SCADA/Program/HMIControl/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  26. 62
      SCADA/Program/HMIControl/obj/Debug/GeneratedInternalTypeHelper.g.i.cs
  27. 1
      SCADA/Program/HMIControl/obj/Debug/HMIControl.csproj.CoreCompileInputs.cache
  28. 20
      SCADA/Program/HMIControl/obj/Debug/HMIControl_MarkupCompile.i.cache
  29. 4
      SCADA/Program/HMIControl/obj/Debug/HMIControl_MarkupCompile.i.lref
  30. BIN
      SCADA/Program/LinkableControlDesignTime/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  31. 1
      SCADA/Program/LinkableControlDesignTime/obj/Debug/LinkableControlDesign.csproj.CoreCompileInputs.cache
  32. 301
      SCADA/Program/ModbusDriver/ModbusRTUDriver.cs
  33. 160
      SCADA/Program/ModbusDriver/ModbusTCPDriver.cs
  34. BIN
      SCADA/Program/ModbusDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  35. 1
      SCADA/Program/ModbusDriver/obj/Debug/ModbusDriver.csproj.CoreCompileInputs.cache
  36. BIN
      SCADA/Program/OPCDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  37. 1
      SCADA/Program/OPCDriver/obj/Debug/OPCDriver.csproj.CoreCompileInputs.cache
  38. BIN
      SCADA/Program/OPCLib/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  39. 1
      SCADA/Program/OPCLib/obj/x86/Debug/OPCLib.csproj.CoreCompileInputs.cache
  40. BIN
      SCADA/Program/SiemensPLCDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  41. 1
      SCADA/Program/SiemensPLCDriver/obj/Debug/SiemensPLCDriver.csproj.CoreCompileInputs.cache
  42. BIN
      SCADA/Program/TagConfig/TagConfig/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  43. 1
      SCADA/Program/TagConfig/TagConfig/obj/x86/Debug/TagConfig.csproj.CoreCompileInputs.cache

BIN
SCADA/Program/.vs/DataExchange/v15/.suo

Binary file not shown.

BIN
SCADA/Program/.vs/DataExchange/v15/sqlite3/storage.ide

Binary file not shown.

1
SCADA/Program/BatchCoreService/obj/x86/Debug/BatchCoreService.csproj.CoreCompileInputs.cache

@ -0,0 +1 @@
f012c49e1080a2b9aceea8df438e021a773d45a7

BIN
SCADA/Program/BatchCoreService/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache

Binary file not shown.

1
SCADA/Program/BatchCoreTest/obj/x86/Debug/BatchCoreTest.csproj.CoreCompileInputs.cache

@ -0,0 +1 @@
1a4002e6bb52fdef112cc7ef9a538fcd953d76e1

BIN
SCADA/Program/BatchCoreTest/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache

Binary file not shown.

1
SCADA/Program/ClientDriver/obj/Debug/ClientDriver.csproj.CoreCompileInputs.cache

@ -0,0 +1 @@
d870d9e27124943cac27963d743df86dde8bee4f

BIN
SCADA/Program/ClientDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache

Binary file not shown.

199
SCADA/Program/CoreTest/obj/x86/Debug/AlarmSet.g.i.cs

@ -0,0 +1,199 @@
#pragma checksum "..\..\..\AlarmSet.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "59BFA4F8D2CBCFAA5AAF46E345571EEF"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
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 {
/// <summary>
/// AlarmSet
/// </summary>
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;
/// <summary>
/// InitializeComponent
/// </summary>
[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<System.Windows.Media.Color>(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;
}
}
}

78
SCADA/Program/CoreTest/obj/x86/Debug/App.g.i.cs

@ -0,0 +1,78 @@
#pragma checksum "..\..\..\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "87C752EAB1D8111DD0461A1A34A553FD"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
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 {
/// <summary>
/// App
/// </summary>
public partial class App : System.Windows.Application {
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[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
}
/// <summary>
/// Application Entry Point.
/// </summary>
[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();
}
}
}

BIN
SCADA/Program/CoreTest/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache

Binary file not shown.

1
SCADA/Program/CoreTest/obj/x86/Debug/Example.csproj.CoreCompileInputs.cache

@ -0,0 +1 @@
43b7e478c21a4a5cb617d6e58056a0c2d8073403

62
SCADA/Program/CoreTest/obj/x86/Debug/GeneratedInternalTypeHelper.g.i.cs

@ -0,0 +1,62 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace XamlGeneratedNamespace {
/// <summary>
/// GeneratedInternalTypeHelper
/// </summary>
[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 {
/// <summary>
/// CreateInstance
/// </summary>
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);
}
/// <summary>
/// GetPropertyValue
/// </summary>
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);
}
/// <summary>
/// SetPropertyValue
/// </summary>
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);
}
/// <summary>
/// CreateDelegate
/// </summary>
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)));
}
/// <summary>
/// AddEventHandler
/// </summary>
protected override void AddEventHandler(System.Reflection.EventInfo eventInfo, object target, System.Delegate handler) {
eventInfo.AddEventHandler(target, handler);
}
}
}

205
SCADA/Program/CoreTest/obj/x86/Debug/Login.g.i.cs

@ -0,0 +1,205 @@
#pragma checksum "..\..\..\Login.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "375A0423B4D66B38B66903C58FC0AA60"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
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 {
/// <summary>
/// Login
/// </summary>
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;
/// <summary>
/// InitializeComponent
/// </summary>
[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;
}
}
}

188
SCADA/Program/CoreTest/obj/x86/Debug/RuntimeChart.g.i.cs

@ -0,0 +1,188 @@
#pragma checksum "..\..\..\RuntimeChart.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "DC1BFB7524CCB66F5D58735A70216F0A"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
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 {
/// <summary>
/// RuntimeChart
/// </summary>
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;
/// <summary>
/// InitializeComponent
/// </summary>
[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<System.Windows.Media.Color>(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;
}
}
}

151
SCADA/Program/CoreTest/obj/x86/Debug/StartDevice.g.i.cs

@ -0,0 +1,151 @@
#pragma checksum "..\..\..\StartDevice.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "14206CA5E5BB144386A3AAAB0A6BD5A5"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
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 {
/// <summary>
/// StartDevice
/// </summary>
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;
/// <summary>
/// InitializeComponent
/// </summary>
[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;
}
}
}

136
SCADA/Program/CoreTest/obj/x86/Debug/TagMonitor.g.i.cs

@ -0,0 +1,136 @@
#pragma checksum "..\..\..\TagMonitor.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "0A98A6F201A7031A640A21A10F8B84E7"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
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 {
/// <summary>
/// TagMonitor
/// </summary>
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;
/// <summary>
/// InitializeComponent
/// </summary>
[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;
}
}
}

264
SCADA/Program/CoreTest/obj/x86/Debug/Trend.g.i.cs

@ -0,0 +1,264 @@
#pragma checksum "..\..\..\Trend.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "1B342724173D1F60676E7E203DB0077B"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
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 {
/// <summary>
/// Trend
/// </summary>
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;
/// <summary>
/// InitializeComponent
/// </summary>
[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<System.Windows.Media.Color>(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;
}
}
}

1
SCADA/Program/DataHelper/obj/x86/Debug/DataHelper.csproj.CoreCompileInputs.cache

@ -0,0 +1 @@
d4f11827d746f1a477cba419eeb5af48f36e2d3e

BIN
SCADA/Program/DataHelper/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache

Binary file not shown.

1
SCADA/Program/DataService/obj/x86/Debug/DataService.csproj.CoreCompileInputs.cache

@ -0,0 +1 @@
f31c354057912f4e6b416c13a1e1935d1348c0fa

BIN
SCADA/Program/DataService/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache

Binary file not shown.

BIN
SCADA/Program/FileDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache

Binary file not shown.

1
SCADA/Program/FileDriver/obj/Debug/FileDriver.csproj.CoreCompileInputs.cache

@ -0,0 +1 @@
a519cf22ffbdb642c7cb47c798524b3a25f0d396

BIN
SCADA/Program/HMIControl/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache

Binary file not shown.

62
SCADA/Program/HMIControl/obj/Debug/GeneratedInternalTypeHelper.g.i.cs

@ -0,0 +1,62 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace XamlGeneratedNamespace {
/// <summary>
/// GeneratedInternalTypeHelper
/// </summary>
[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 {
/// <summary>
/// CreateInstance
/// </summary>
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);
}
/// <summary>
/// GetPropertyValue
/// </summary>
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);
}
/// <summary>
/// SetPropertyValue
/// </summary>
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);
}
/// <summary>
/// CreateDelegate
/// </summary>
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)));
}
/// <summary>
/// AddEventHandler
/// </summary>
protected override void AddEventHandler(System.Reflection.EventInfo eventInfo, object target, System.Delegate handler) {
eventInfo.AddEventHandler(target, handler);
}
}
}

1
SCADA/Program/HMIControl/obj/Debug/HMIControl.csproj.CoreCompileInputs.cache

@ -0,0 +1 @@
a7abf19bcdea243d852d493c6c08741b180f57c5

20
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

4
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;;

BIN
SCADA/Program/LinkableControlDesignTime/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache

Binary file not shown.

1
SCADA/Program/LinkableControlDesignTime/obj/Debug/LinkableControlDesign.csproj.CoreCompileInputs.cache

@ -0,0 +1 @@
21e18031a23dc5a936f51f4ad279b96333746c2f

301
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:80255
   Short:16-32768 32767
   ushort:160 65,535
Int:32-2147483648 2147483648
   uint:320 4294967295
   Long:64-9223372036854775808 9223372036854775808
   Ulong:640 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 25611252 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

160
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
modbusTCP中协议规定如下
ADU=MBAP++ ADU 256MBAP 71248
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)

BIN
SCADA/Program/ModbusDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache

Binary file not shown.

1
SCADA/Program/ModbusDriver/obj/Debug/ModbusDriver.csproj.CoreCompileInputs.cache

@ -0,0 +1 @@
9be013b3f62515e5c2177e72f2c384551dd4fd36

BIN
SCADA/Program/OPCDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache

Binary file not shown.

1
SCADA/Program/OPCDriver/obj/Debug/OPCDriver.csproj.CoreCompileInputs.cache

@ -0,0 +1 @@
7427020da1b61bef59389709317457491637d5fe

BIN
SCADA/Program/OPCLib/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache

Binary file not shown.

1
SCADA/Program/OPCLib/obj/x86/Debug/OPCLib.csproj.CoreCompileInputs.cache

@ -0,0 +1 @@
94984fbddb2109c3812b6de0f400dec9879e3f86

BIN
SCADA/Program/SiemensPLCDriver/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache

Binary file not shown.

1
SCADA/Program/SiemensPLCDriver/obj/Debug/SiemensPLCDriver.csproj.CoreCompileInputs.cache

@ -0,0 +1 @@
7141aba8c101ad8c89a0e61359a75be157e7e549

BIN
SCADA/Program/TagConfig/TagConfig/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache

Binary file not shown.

1
SCADA/Program/TagConfig/TagConfig/obj/x86/Debug/TagConfig.csproj.CoreCompileInputs.cache

@ -0,0 +1 @@
7efbd9325b6e0d4fb1a955c4ea1ae176b1bfa5d0
Loading…
Cancel
Save