diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ee03241
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+# Windows image file caches
+Thumbs.db
+ehthumbs.db
+
+# Folder config file
+Desktop.ini
+!*.exe
+!*.dll
\ No newline at end of file
diff --git a/Document/设计流程.doc b/Document/设计流程.doc
new file mode 100644
index 0000000..1607fcb
Binary files /dev/null and b/Document/设计流程.doc differ
diff --git a/Document/部署流程.doc b/Document/部署流程.doc
new file mode 100644
index 0000000..2ef73c4
Binary files /dev/null and b/Document/部署流程.doc differ
diff --git a/SCADA/DataConfig/client.xml b/SCADA/DataConfig/client.xml
new file mode 100644
index 0000000..6118c38
--- /dev/null
+++ b/SCADA/DataConfig/client.xml
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/SCADA/DataConfig/host.cfg b/SCADA/DataConfig/host.cfg
new file mode 100644
index 0000000..9147332
--- /dev/null
+++ b/SCADA/DataConfig/host.cfg
@@ -0,0 +1,4 @@
+lochost
+Data Source=.\SQLEXPRESS;Initial Catalog=SCADA;Integrated Security=True
+D:\HDA
+
diff --git a/SCADA/DataConfig/server.xml b/SCADA/DataConfig/server.xml
new file mode 100644
index 0000000..13f2e86
--- /dev/null
+++ b/SCADA/DataConfig/server.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SCADA/Database/Receiving1.csv b/SCADA/Database/Receiving1.csv
new file mode 100644
index 0000000..7b2cfa8
--- /dev/null
+++ b/SCADA/Database/Receiving1.csv
@@ -0,0 +1,123 @@
+Tag Name,Address,Data Type,Respect Data Type,Client Access,Scan Rate,Scaling,Raw Low,Raw High,Scaled Low,Scaled High,Scaled Data Type,Clamp Low,Clamp High,Eng Units,Description,Negate Value
+"Receiving1_AlmAck","K0008.10",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Conveyor3_Alarm","K0006.14",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Conveyor3_Running","K0006.10",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Conveyor4_Alarm","K0001.04",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Conveyor4_Running","K0001.03",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Conveyor5_Alarm","K0008.00",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Conveyor5_Running","K0007.10",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Conveyor6_Alarm","K0008.08",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Conveyor6_Running","K0005.14",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Conveyor7_Alarm","K0006.13",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Conveyor7_Running","K0006.12",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Conveyor8_Running","K0001.12",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Conveyor9_Alarm","K0001.08",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Conveyor9_Running","K0001.08",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_DF01SQH_Alarm","K0002.06",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_DF01SQL_Alarm","K0003.02",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_DF02SQH_Alarm","K0002.05",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_DF02SQL_Alarm","K0003.03",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_DF03SQH_Alarm","K0002.04",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_DF03SQL_Alarm","K0003.04",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_DF04SQH_Alarm","K0002.03",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_DF04SQL_Alarm","K0003.05",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_DF05SQH_Alarm","K0002.02",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_DF05SQL_Alarm","K0003.06",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_DF06SQL_Alarm","K0002.02",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_F01SQH_Alarm","K0007.09",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_F02SQH_Alarm","K0007.08",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_F03SQH_Alarm","K0007.07",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_F04SQH_Alarm","K0007.06",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_F05SQH_Alarm","K0007.05",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_F06SQH_Alarm","K0007.03",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Fan1_Alarm","K0008.07",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Fan1_Running","K0008.06",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Fan2_Running","K0008.07",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Fan3_Running","K0001.13",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_FourWays_Left","K0006.08",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_FourWays_MID","K0006.09",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_FourWays_Right","K0006.15",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate1_Ols","K0000.01",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate10_Alarm","K0003.11",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate10_Cls","K0004.07",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate10_Ols","K0004.00",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate11_Alarm","K0005.04",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate11_Cls","K0001.00",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate11_Ols","K0005.03",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate12_Alarm","K0005.02",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate12_Cls","K0001.01",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate12_Ols","K0005.02",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate13_Alarm","K0005.01",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate13_Cls","K0001.02",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate13_Ols","K0005.00",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate14_Alarm","K0005.07",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate14_Cls","K0000.15",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate14_Ols","K0005.05",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate15_Alarm","K0005.06",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate15_Cls","K0000.14",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate15_Ols","K0005.08",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate16_Ols","K0000.11",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate17_Ols","K0000.10",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate18_Ols","K0000.09",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate19_Ols","K0000.08",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate20_Ols","K0000.07",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate21_Ols","K0000.01",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate3_Alarm","K0005.12",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate3_Cls","K0000.12",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate3_Ols","K0005.11",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate4_Alarm","K0005.10",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate4_Cls","K0000.13",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate4_Ols","K0005.09",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate5_Alarm","K0003.07",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate5_Cls","K0004.01",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate5_Ols","K0000.06",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate6_Alarm","K0003.08",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate6_Cls","K0004.02",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate6_Ols","K0000.05",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate7_Alarm","K0003.09",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate7_Cls","K0004.04",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate7_Ols","K0000.04",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate8_Alarm","K0003.09",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate8_Cls","K0004.05",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate8_Ols","K0000.03",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate9_Alarm","K0003.10",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate9_Cls","K0004.06",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate9_Ols","K0000.02",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate9_Ols4","K0000.02",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate9_Ols5","K0000.02",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate9_Ols6","K0000.02",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate9_Ols7","K0000.02",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate9_Ols8","K0000.02",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate9_Ols9","K0000.02",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_leg1alm","K0010.00",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_LegMotor1_Overload","R0004",Float,1,R/W,100,,,,,,,,,,"",
+"Receiving1_LegMotor1_Running","K0006.01",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_LegMotor2_Overload","R0006",Float,1,R/W,100,,,,,,,,,,"",
+"Receiving1_LegMotor2_Running","K0005.15",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Legmotor2Speed_Speed","R0007",Float,1,R/W,100,,,,,,,,,,"",
+"Receiving1_LegMotor3_Overload","R0011",Float,1,R/W,100,,,,,,,,,,"",
+"Receiving1_LegMotor3_Running","K0006.00",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Legmotor3Curr_Digi","R0009",Float,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Legmotor3Speed_Speed","R0012",Float,1,R/W,100,,,,,,,,,,"",
+"Receiving1_LegMotor4_Overload","R0001",Float,1,R/W,100,,,,,,,,,,"",
+"Receiving1_LegMotor4_Running","K0001.06",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Legmotor4Curr_Digi","R0000",Float,1,R/W,100,,,,,,,,,,"",
+"Receiving1_LocalRemote","K0008.09",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_MagicRoll1_Alarm","K0007.02",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_MagicRoll1_Running","K0006.11",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_MagicRoll2_Alarm","K0007.01",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_MagicRoll2_Running","K0006.06",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_MagicRoll3_Alarm","K0007.00",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_MagicRoll3_Running","K0006.04",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_MagicRoll4_Alarm","K0001.09",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_MagicRoll4_Running","K0001.09",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Sifter1_Running","K0006.07",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Sifter2_Running","K0006.05",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Sifter3_Alarm","K0001.10",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Sifter3_Running","K0001.10",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_ThreeWays1_Left","K0001.07",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_ThreeWays1_Right","K0001.05",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_ThreeWays2_Left","K0006.03",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_ThreeWays2_Right","K0006.02",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving2_LegCUR102_Digi","R0005",Float,1,R/W,100,,,,,,,,,,"",
+"Receiving2_LegCUR106_Digi","R0003",Float,1,R/W,100,,,,,,,,,,"",
diff --git a/SCADA/Database/Receving2.csv b/SCADA/Database/Receving2.csv
new file mode 100644
index 0000000..645e647
--- /dev/null
+++ b/SCADA/Database/Receving2.csv
@@ -0,0 +1,36 @@
+Tag Name,Address,Data Type,Respect Data Type,Client Access,Scan Rate,Scaling,Raw Low,Raw High,Scaled Low,Scaled High,Scaled Data Type,Clamp Low,Clamp High,Eng Units,Description,Negate Value
+"Receiving1_Conveyor1_Alarm","K0002.11",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Conveyor1_Running","K0002.10",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Conveyor2_Alarm","K0002.09",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Conveyor2_Running","K0002.04",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate1_Alarm","K0001.14",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate1_Cls","K0001.13",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate1_Ols","K0001.11",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate2_Alarm","K0001.08",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate2_Cls","K0001.09",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving1_Gate2_Ols","K0001.10",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving2_Airport1_Alarm","K0002.08",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving2_Airport1_Running","K0001.05",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving2_Airport2_Alarm","K0001.00",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving2_Airport2_Running","K0001.01",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving2_AlmAck","K0002.02",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving2_Converyor1_Running","K0001.15",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving2_Converyor2_Alarm","K0002.12",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving2_Converyor2_Running","K0002.13",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving2_Fan1_Alarm","K0001.02",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving2_Fan1_Running","K0001.03",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving2_Gate1_Alarm","K0001.04",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving2_Gate1_Cls","K0001.06",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving2_Gate1_Ols","K0001.07",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving2_Gate2_Ols","K0002.05",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving2_LegMotor1_Overload","R0002",Float,1,R/W,100,,,,,,,,,,"",
+"Receiving2_Legmotor1Speed_Speed","R0003",Float,1,R/W,100,,,,,,,,,,"",
+"Receiving2_LegMotor2_Overload","R0000",Float,1,R/W,100,,,,,,,,,,"",
+"Receiving2_LegMotor2_Running","K0002.01",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving2_Legmotor2Speed_Speed","R0001",Float,1,R/W,100,,,,,,,,,,"",
+"Receiving2_LocalRemote","K0002.03",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving2_MagicRoll1_Alarm","K0002.14",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving2_MagicRoll1_Running","K0002.00",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving2_Sifter1_Alarm","K0002.15",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving2_Sifter1_Running","K0002.07",Boolean,1,R/W,100,,,,,,,,,,"",
+"Receiving2_Sifter1_Running8","K0002.07",Boolean,1,R/W,100,,,,,,,,,,"",
diff --git a/SCADA/Database/script.sql b/SCADA/Database/script.sql
new file mode 100644
index 0000000..610bf3f
Binary files /dev/null and b/SCADA/Database/script.sql differ
diff --git a/SCADA/Database/test.opf b/SCADA/Database/test.opf
new file mode 100644
index 0000000..246d88e
Binary files /dev/null and b/SCADA/Database/test.opf differ
diff --git a/SCADA/Example/BatchCommon.dll b/SCADA/Example/BatchCommon.dll
new file mode 100644
index 0000000..6a3ca6d
Binary files /dev/null and b/SCADA/Example/BatchCommon.dll differ
diff --git a/SCADA/Example/BatchCoreTest.exe b/SCADA/Example/BatchCoreTest.exe
new file mode 100644
index 0000000..3cae248
Binary files /dev/null and b/SCADA/Example/BatchCoreTest.exe differ
diff --git a/SCADA/Example/BatchCoreTest.exe.config b/SCADA/Example/BatchCoreTest.exe.config
new file mode 100644
index 0000000..88a4443
--- /dev/null
+++ b/SCADA/Example/BatchCoreTest.exe.config
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Example/ClientDriver.dll b/SCADA/Example/ClientDriver.dll
new file mode 100644
index 0000000..06d7814
Binary files /dev/null and b/SCADA/Example/ClientDriver.dll differ
diff --git a/SCADA/Example/CoreTest.exe b/SCADA/Example/CoreTest.exe
new file mode 100644
index 0000000..c8d662a
Binary files /dev/null and b/SCADA/Example/CoreTest.exe differ
diff --git a/SCADA/Example/DataHelper.dll b/SCADA/Example/DataHelper.dll
new file mode 100644
index 0000000..8d81d74
Binary files /dev/null and b/SCADA/Example/DataHelper.dll differ
diff --git a/SCADA/Example/DataService.dll b/SCADA/Example/DataService.dll
new file mode 100644
index 0000000..0623367
Binary files /dev/null and b/SCADA/Example/DataService.dll differ
diff --git a/SCADA/Example/DynamicDataDisplay.dll b/SCADA/Example/DynamicDataDisplay.dll
new file mode 100644
index 0000000..cb1a034
Binary files /dev/null and b/SCADA/Example/DynamicDataDisplay.dll differ
diff --git a/SCADA/Example/HMIControl.dll b/SCADA/Example/HMIControl.dll
new file mode 100644
index 0000000..c1f964c
Binary files /dev/null and b/SCADA/Example/HMIControl.dll differ
diff --git a/SCADA/Example/Microsoft.Expression.Controls.dll b/SCADA/Example/Microsoft.Expression.Controls.dll
new file mode 100644
index 0000000..48e2331
Binary files /dev/null and b/SCADA/Example/Microsoft.Expression.Controls.dll differ
diff --git a/SCADA/Example/Microsoft.Expression.Controls.xml b/SCADA/Example/Microsoft.Expression.Controls.xml
new file mode 100644
index 0000000..aaaf85b
--- /dev/null
+++ b/SCADA/Example/Microsoft.Expression.Controls.xml
@@ -0,0 +1,557 @@
+
+
+
+ Microsoft.Expression.Controls
+
+
+
+
+ Called before the polylines are looped over.
+
+
+
+
+ Computes the value used when LayoutPath.Capacity is set to Auto.
+
+
+
+
+ Checks whether or not the polylines should continue being looped over.
+
+
+
+
+ Called before a new polyline is marched.
+
+
+
+
+ Called when a polyline is completed.
+
+ The remaining arclength in the polyline.
+
+
+
+ Called when a step is successfully completed.
+
+ The actual step distance.
+ This may be different than Step if another polyline has been wrapped to.
+
+
+
+ Distributes the children of a path panel along a given layout path.
+
+ The path panel.
+ The index of the path in pathPanel.LayoutPaths.
+ The index of the first child to be laid out on this path.
+ The index of the next child to be distributed. If childIndex is returned, this function has done nothing.
+
+
+
+ The index of the next child to be arranged.
+
+
+
+
+ The distance in arc length that will be used for layout.
+
+
+
+
+ The distance in arc length to walk along the current polyline.
+
+
+
+
+ The total number of elements to be arranged on the LayoutPath.
+
+
+
+
+ Distributes the children of a path panel along a layout path.
+ Even distribution means that there is equal arclength between the centers of all
+ the elements on the path.
+
+
+
+
+ Specifies which path layout properties have changed.
+
+
+
+
+ Provides data for the event.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The data for the event.
+
+
+
+ Gets the properties changed in a event.
+
+
+
+
+ Encapsulates the data needed to update a .
+
+
+
+
+ Gets or sets the index of the path on which an element is arranged.
+
+
+
+
+ Gets or sets the index of an element in a collection of elements.
+
+
+
+
+ Gets or sets the index of an element on a path.
+
+
+
+
+ Gets or sets the offset of an element proportional to the total length of a collection of paths.
+
+
+
+
+ Gets or sets the offset of an element proportional to the length of a path.
+
+
+
+
+ Gets or sets the angle perpendicular to the path at an element's location.
+
+
+
+
+ Gets or sets the angle perpendicular to the path at an element's location if the element is oriented to the path.
+
+
+
+
+ Gets or sets whether or not an element is arranged on a path.
+
+
+
+
+ Represents an element that is arranged by a .
+
+
+ Implementing this interface enables to set these properties when the element is arranged.
+ This interface is not intended for general implementation.
+
+
+
+
+ Updates the properties based on the given and raises the event.
+
+ The data needed to update the .
+
+
+
+ Occurs when one or more of the properties change.
+
+
+ This event is raised whenever the item’s position along the path is updated. This can occur due to changes in the properties on the or changes to .
+
+
+
+
+ Gets the index of the path on which the item is arranged.
+
+
+
+
+ Gets the index of the item in a collection of items.
+
+
+
+
+ Gets the index of the item on the path on which it is arranged.
+
+
+
+
+ Gets the offset of the item proportional to the total length of a collection of paths.
+
+
+
+
+ Gets the offset of the item proportional to the length of the path on which it is arranged.
+
+
+
+
+ Gets the angle perpendicular to the path at the item's location.
+
+
+
+
+ Gets the angle perpendicular to the path at the items's location if the item is oriented to the path.
+
+
+
+
+ Gets or sets whether or not the item is arranged on the path.
+
+
+
+
+ Converts a representing whether or not an element is arranged to a value used to scale the element.
+
+
+
+
+ Throws a exception in all cases.
+
+ The target data being passed to the source.
+ The of data expected by the source object.
+ An optional parameter to be used in the converter logic.
+ The culture of the conversion.
+ The value to be passed to the source object.
+
+
+
+ Converts the specified to a .
+
+ The source data being passed to the target.
+ The of data expected by the target dependency property.
+ An optional parameter to be used in the converter logic.
+ The culture of the conversion.
+ If the is true, 1 is returned. Else, 0 is returned.
+
+
+
+ Specifies the distribution of a .
+
+
+
+
+ Specifies the orientation of elements on a .
+
+
+
+
+ Specifies the method for altering the on an open path.
+
+
+
+
+ Describes a path along which elements are arranged.
+
+
+
+
+ Ideally, we want to cache the Bezier curves before flattening, because transform will affect flattening.
+ That requires us to cache curves that we don't support very well yet. Instead, we cache the flatten points
+ in distribution strategy and transform them on demand.
+
+
+
+
+ Gets or sets the element that defines the path.
+
+
+
+
+ Gets or sets whether items are laid out evenly or with a fixed padding.
+
+
+
+
+ Gets or sets the maximum number of items displayed on the .
+
+
+
+
+ Gets or sets the distance in pixels along the arc length of the between two items.
+
+
+
+
+ Gets or sets the orientation of the items.
+
+
+ This property is supported on , but not .
+
+
+
+
+ Gets or sets the distance from the start of the to place the first item.
+
+
+
+
+ Gets or sets the percentage of the that participates in layout.
+
+
+
+
+ Gets or set the method to alter on an open path.
+
+
+
+
+ Gets the computed Capacity.
+
+
+
+
+ Gets whether or not the is valid in the context.
+ A is not valid if it is a descendant of the in which it is used.
+
+
+
+
+ Distributes the children of a layout path based on the size of the children and a given padding between the children.
+ The distance in arclength between children is determined by the padding plus the sum of the radii of the children's bounding boxes.
+
+
+
+
+ Contains a list of items that are laid out along one or more paths.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Creates the element used to display a specified item.
+
+ A corresponding to a specified item.
+
+
+
+ Determines if the specified item is (or is eligible to be) its own item container.
+
+ true if the item is its own item container; otherwise, false.
+ The specified item.
+
+
+
+ Positions child elements.
+
+ The size that this object should use to arrange its child elements.
+ The actual size used.
+
+
+
+ Gets or sets a collection of objects that define the path(s) used for layout.
+
+
+
+
+ Gets or sets the index to use within the list of items.
+
+
+
+
+ Gets or sets whether the item index wraps to the beginning of the collection when StartItemIndex is greater than 0.
+
+
+
+
+ Represents an item in a .
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ For a description of this member, see .
+
+
+
+
+ For a description of this member, see .
+
+
+
+
+ For a description of this member, see .
+
+
+
+
+ For a description of this member, see .
+
+
+
+
+ For a description of this member, see .
+
+
+
+
+ For a description of this member, see .
+
+
+
+
+ For a description of this member, see .
+
+
+
+
+ For a description of this member, see .
+
+
+
+
+ For a description of this member, see .
+
+
+
+
+ For a description of this member, see .
+
+
+
+
+ Arranges child elements along one or more path.
+
+
+ can be used as an alternative to when selection is not necessary.
+ The property is not supported on .
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Measures the size required for child elements.
+
+ The available size that this element can give to child elements.
+ The size that this element determines it needs during layout, based on its calculations of child element sizes.
+
+
+
+ Positions child elements.
+
+ The size that this object should use to arrange its child elements.
+ The actual size used.
+
+
+
+ Arranges the child at the given index at a particular location on a LayoutPath.
+
+ An index from the range 0 to PathPanel.Count.
+ The index of the layout path on which to arrange the child.
+ The polyline in the layout path.
+ The location on the polyline.
+ The index of the child on the LayoutPath.
+
+
+
+ Calculates the radius of the bounding circle for the child at the given index.
+
+ An index from the range 0 to PathPanel.Count.
+
+
+
+ Gets or sets a collection of objects that define the path(s) used for layout.
+
+
+
+
+ Gets or sets the index to use within the list of items.
+
+
+
+
+ Gets or sets whether the item index wraps to the beginning of the collection when is greater than 0.
+
+
+
+
+ The subset of LayoutPaths that are attached and not collapsed.
+
+
+
+
+ Count is the number of Children that the PathPanel will lay out.
+ If StartItemIndex > 0 and WrapItems is false, then this can be less than PathPanel.Children.Count
+
+
+
+
+ Gets the panel that contains the containers of an ItemsControl.
+
+ The ItemsControl.
+
+ The panel that contains the containers of an ItemsControl, or null
+ if the panel could not be found.
+
+
+ is null.
+
+
+
+
+ Traverses a tree by accepting an initial value and a function that
+ retrieves the child nodes of a node.
+
+ The type of the stream.
+ The initial node.
+ A function that retrieves the child
+ nodes of a node.
+ A predicate that evaluates a node
+ and returns a value indicating whether that node and it's children
+ should be traversed.
+ A stream of nodes.
+
+
+
+ Get the visual tree children of an element.
+
+ The element.
+ The visual tree children of an element.
+
+ is null.
+
+
+
+
+ Get the visual tree children of an element and the element itself.
+
+ The element.
+
+ The visual tree children of an element and the element itself.
+
+
+
+
+ Retrieves all the logical children of a framework element using a
+ breadth-first search. For performance reasons this method manually
+ manages the stack instead of using recursion.
+
+ The parent framework element.
+ The logical children of the framework element.
+
+
+
+ Retrieves all the logical descendents of a framework element using a
+ breadth-first search. For performance reasons this method manually
+ manages the stack instead of using recursion.
+
+ The parent framework element.
+ The logical children of the framework element.
+
+
+
diff --git a/SCADA/Example/Microsoft.Expression.Drawing.dll b/SCADA/Example/Microsoft.Expression.Drawing.dll
new file mode 100644
index 0000000..d2a5f7b
Binary files /dev/null and b/SCADA/Example/Microsoft.Expression.Drawing.dll differ
diff --git a/SCADA/Example/Microsoft.Expression.Drawing.xml b/SCADA/Example/Microsoft.Expression.Drawing.xml
new file mode 100644
index 0000000..f396802
--- /dev/null
+++ b/SCADA/Example/Microsoft.Expression.Drawing.xml
@@ -0,0 +1,1770 @@
+
+
+
+ Microsoft.Expression.Drawing
+
+
+
+
+ Renders a callout shape supporting several shapes combined with a callout arrow.
+
+
+
+
+ Provides a base class of a composite shape that derives from and implements .
+
+
+ implements interface,
+ and supports rendering a geometry similar to , but the geometry can be rendered outside the layout boundary.
+
+ A typical implementation has a customized default template in generic.xaml which template-binds most shape properties to a .
+ It should also extend the property to customize the appearance of the .
+
+ This class also supports showing content together with the shape.
+
+
+
+
+ Provides an interface to describe the parameters of a Shape.
+
+
+ This interface is the data for communication between Shape and GeometrySource.
+ Typically, a concrete implementation of IShape will implement this interface and pass it into
+ GeometrySource.UpdateGeometry(), which will then consume the shape as a read-only data provider.
+
+
+
+
+ Provides the necessary interface to define a Shape.
+ Both primitive and composite shapes need to match this interface, although they might derive from different types of FrameworkElement.
+
+
+
+
+ Invalidates the geometry for a . After the invalidation, the will recompute the geometry, which will occur asynchronously.
+
+
+
+ Gets or sets the that specifies how to paint the interior of the shape.
+ A that describes how the shape's interior is painted. The default is null.
+
+
+ Gets or sets the that specifies how the outline is painted.
+ A that specifies how the outline is painted.
+
+
+ Gets or sets the width of the stroke outline.
+ The width of the outline, in pixels.
+
+
+ Gets or sets a enumeration value that describes how the shape fills its allocated space.
+ One of the enumeration values. The default value at runtime depends on the type of .
+
+
+
+ Gets the rendered geometry presented by the rendering engine.
+
+
+
+
+ Gets the margin between logical bounds and actual geometry bounds.
+ This can be either positive (as in ) or negative (as in ).
+
+
+
+
+ Occurs when RenderedGeometry is changed.
+
+
+
+
+ Extends how the shape is drawn with creating geometry source.
+
+
+
+
+ Invalidates the geometry for a . After the invalidation, the will recompute the geometry, which will occur asynchronously.
+
+
+
+ Provides the behavior for the Arrange portion of a Silverlight layout pass. Classes can override this method to define their own Arrange pass behavior.
+ The actual size used once the element is arranged in layout.
+ The final area within the parent that this object should use to arrange itself and its children.
+ will recompute the Geometry when it's invalidated and update the RenderedGeometry and GeometryMargin.
+
+
+
+ Transforms a string content into with center alignment and multiple line support.
+
+
+ Use template-binding to instead of to enable this method.
+
+
+
+
+ Gets or sets the that specifies how to paint the interior of the shape.
+
+ A that describes how the shape's interior is painted.
+
+
+ Gets or sets the that specifies how the outline is painted.
+ A that specifies how the outline is painted.
+
+
+ Gets or sets the width of the stroke outline.
+ The width of the outline, in pixels.
+
+
+ Gets or sets a enumeration value that describes how the shape fills its allocated space.
+ One of the enumeration values.
+
+
+ Gets or sets a enumeration value that describes the at the start of a .
+ A value of the enumeration that specifies the shape at the start of a .
+
+
+ Gets or sets a enumeration value that describes the at the end of a line.
+ One of the enumeration values for .
+
+
+ Gets or sets a enumeration value that specifies the type of join that is used at the vertices of a .
+ A value of the enumeration that specifies the join appearance.
+
+
+ Gets or sets a limit on the ratio of the miter length to half the of a element.
+ The limit on the ratio of the miter length to the of a element. This value is always a positive number that is greater than or equal to 1.
+
+
+ Gets or sets a collection of values that indicate the pattern of dashes and gaps that is used to outline shapes.
+ A collection of values that specify the pattern of dashes and gaps.
+
+
+ Gets or sets a enumeration value that specifies how the ends of a dash are drawn.
+ One of the enumeration values for . The default is .
+
+
+ Gets or sets a that specifies the distance within the dash pattern where a dash begins.
+ A that represents the distance within the dash pattern where a dash begins. The default value is 0.
+
+
+
+ Gets the rendered geometry presented by the rendering engine.
+
+
+
+
+ Gets the margin between the logical bounds and the actual geometry bounds.
+ This can be either positive (as in ) or negative (as in ).
+
+
+
+
+ Gets or sets the internal content that converts a string into a center-aligned, multiple-line TextBlock.
+
+
+
+
+ Occurs when RenderedGeometry is changed.
+
+
+
+
+ Gets or sets the position of the callout relative to the top and left corner.
+
+
+
+
+ Gets or sets the callout style.
+
+
+
+
+ Provides a base class of a composite shape that derives from and implements .
+
+
+ implements interface,
+ and supports rendering a geometry similar to , but the geometry can be rendered outside the layout boundary.
+
+ A typical implementation has a customized default template in generic.xaml which template-binds most shape properties to a .
+ It should also extend the property to customize the appearance of the .
+
+
+
+
+ Extends how the shape is drawn with creating geometry source.
+
+
+
+
+ Invalidates the geometry for a . After the invalidation, the will recompute the geometry, which will occur asynchronously.
+
+
+
+ Provides the behavior for the Arrange portion of a Silverlight layout pass. Classes can override this method to define their own Arrange pass behavior.
+ The actual size used once the element is arranged in layout.
+ The final area within the parent that this object should use to arrange itself and its children.
+ will recompute the Geometry when it's invalidated and update the RenderedGeometry and GeometryMargin.
+
+
+
+ Gets or sets the that specifies how to paint the interior of the shape.
+
+ A that describes how the shape's interior is painted.
+
+
+ Gets or sets the that specifies how the outline is painted.
+ A that specifies how the outline is painted.
+
+
+ Gets or sets the width of the stroke outline.
+ The width of the outline, in pixels.
+
+
+ Gets or sets a enumeration value that describes how the shape fills its allocated space.
+ One of the enumeration values.
+
+
+ Gets or sets a enumeration value that describes the at the start of a .
+ A value of the enumeration that specifies the shape at the start of a .
+
+
+ Gets or sets a enumeration value that describes the at the end of a line.
+ One of the enumeration values for .
+
+
+ Gets or sets a enumeration value that specifies the type of join that is used at the vertices of a .
+ A value of the enumeration that specifies the join appearance.
+
+
+ Gets or sets a limit on the ratio of the miter length to half the of a element.
+ The limit on the ratio of the miter length to the of a element. This value is always a positive number that is greater than or equal to 1.
+
+
+ Gets or sets a collection of values that indicate the pattern of dashes and gaps that is used to outline shapes.
+ A collection of values that specify the pattern of dashes and gaps.
+
+
+ Gets or sets a enumeration value that specifies how the ends of a dash are drawn.
+ One of the enumeration values for . The default is .
+
+
+ Gets or sets a that specifies the distance within the dash pattern where a dash begins.
+ A that represents the distance within the dash pattern where a dash begins. The default value is 0.
+
+
+
+ Gets the rendered geometry presented by the rendering engine.
+
+
+
+
+ Gets the margin between the logical bounds and the actual geometry bounds.
+ This can be either positive (as in ) or negative (as in ).
+
+
+
+
+ Occurs when RenderedGeometry is changed.
+
+
+
+
+ Renders a bent line segment with optional arrow heads on both ends.
+
+
+
+ Provides the behavior for the Measure pass of Silverlight layout. Classes can override this method to define their own Measure pass behavior.
+ The size that this object determines it requires during layout, based on its calculations of child object allotted sizes, or possibly on other considerations such as fixed container size.
+ The available size that this object can give to child objects. Infinity () can be specified as a value to indicate that the object will size to whatever content is available.
+
+ A default can render at anysize.
+ The will stretch to the layout boundary and render to the outside if necessary.
+
+
+
+
+ Gets or sets the amount of bend for the arrow.
+
+ The bend amount between 0 and 1.
+
+
+
+ Gets or sets how the arrow head is rendered at the start of the line.
+
+
+
+
+ Gets or sets how the arrow head is rendered at the end of the line.
+
+
+
+
+ Gets or sets from which corner to start drawing the arrow.
+
+
+
+
+ Gets or sets the length of the arrow in pixels.
+
+
+
+
+ Provides an items control that displays one selected item, and allows panning between items using touch gestures.
+
+
+
+
+ The constructor for PanningItems.
+
+
+
+
+ Called when the PanningItems template is applied.
+
+
+
+
+ Gets or sets the orientation of items in the control.
+
+
+
+
+ Gets or sets the flick tolerance. This can be a value between 0 and 1.
+ It represents the percentage of the size of the PanningItems needed to be covered by the flick gesture to trigger an items change.
+
+
+
+
+ Gets or sets the item before the selected item.
+
+
+
+
+ Gets or sets the item after the selected item.
+
+
+
+
+ Gets or sets whether the contents of the items control will loop, so that the first item will follow the last item.
+
+
+
+
+ Gets or sets the value of the slider controlling the panning motion.
+
+
+
+
+ Helper class to work with PathGeometry.
+
+
+
+
+ Converts a string in the path mini-language into a PathGeometry.
+
+ A string in the path mini-language.
+
+
+
+ Converts the given geometry into a single PathGeometry.
+
+
+
+
+ Updates the given geometry as PathGeometry with a polyline matching a given point list.
+
+
+
+
+ Parses abbreviated geometry sytax.
+
+
+
+
+ Helper class to convert an ArcSegment to BezierSegment(s).
+
+
+ Helper class to work with PathSegment and all variations.
+
+
+ Strategy classes to handle different types of PathSegment.
+
+
+
+
+ Converts an arc segment into Bezier format.
+ Returns BezierSegment, PolyBezierSegment, LineSegment, or null.
+ When returning null, the arc degenerates into the start point.
+
+
+
+
+ Avoid calling the three-parameter constructor, since it always sets a local value for IsStroked.
+
+
+
+
+
+
+ Updates the SegmentCollection with a given polyline matching a given point list.
+ Tries to keep changes minimum and returns false if nothing has been changed.
+
+
+
+
+ Updates the collection[index] segment with a poly-Bezier segment matching a given point list.
+ A given point list must contain 3*N points for N Bezier segments.
+
+
+
+
+ Tests if a given path segment is empty.
+
+
+
+
+ Gets the point count in a given path segment.
+
+
+
+
+ Gets the last point of a given path segment.
+
+
+
+
+ Gets the point of a given index in a given segment.
+ If input is (-1), returns the last point.
+
+
+
+
+ Flattens a given segment and adds resulting points into a given point list.
+
+ The segment to be flatten.
+ The resulting points list.
+ The start point of the segment.
+ The error tolerance. Must be positive. Can be zero. Fallback to default tolerance.
+
+
+
+ ArcToBezier, computes the Bezier approximation of an arc.
+
+
+ This utility computes the Bezier approximation for an elliptical arc as
+ it is defined in the SVG arc spec. The ellipse from which the arc is
+ carved is axis-aligned in its own coordinates, and defined there by its
+ x and y radii. The rotation angle defines how the ellipse's axes are
+ rotated relative to the x axis. The start and end points define one of 4
+ possible arcs; the sweep and large-arc flags determine which one of
+ these arcs will be chosen.
+
+ Returning cPieces = 0 indicates a line instead of an arc
+ cPieces = -1 indicates that the arc degenerates to a point
+
+
+
+
+ Gets the number of Bezier arcs, and sine/cosine of each.
+
+
+ This is a private utility used by ArcToBezier. Breaks the arc into
+ pieces so that no piece will span more than 90 degrees. The input
+ points are on the unit circle.
+
+
+
+
+ GetBezierDistance returns the distance as a fraction of the radius.
+
+
+ Get the distance from a circular arc's end points to the control points
+ of the Bezier arc that approximates it, as a fraction of the arc's
+ radius.
+
+ Since the result is relative to the arc's radius, it depends strictly on
+ the arc's angle. The arc is assumed to be of 90 degrees or less, so the
+ angle is determined by the cosine of that angle, which is derived from
+ rDot = the dot product of two radius vectors. We need the Bezier curve
+ that agrees with the arc's points and tangents at the ends and midpoint.
+ Here we compute the distance from the curve's endpoints to its control
+ points.
+
+ Since we are looking for the relative distance, we can work on the unit
+ circle. Place the center of the circle at the origin, and put the X axis
+ as the bisector between the 2 vectors. Let a be the angle between the
+ vectors. Then the X coordinates of the 1st and last points are cos(a/2).
+ Let x be the X coordinate of the 2nd and 3rd points. At t=1/2 we have a
+ point at (1,0). But the terms of the polynomial there are all equal:
+
+ (1-t)^3 = t*(1-t)^2 = t^2*(1-t) = t^3 = 1/8,
+
+ so from the Bezier formula there we have:
+
+ 1 = (1/8) * (cos(a/2) + 3x + 3x + cos(a/2)),
+
+ hence
+
+ x = (4 - cos(a/2)) / 3
+
+ The X difference between that and the 1st point is:
+
+ DX = x - cos(a/2) = 4(1 - cos(a/2)) / 3.
+
+ But DX = distance / sin(a/2), hence the distance is
+
+ dist = (4/3)*(1 - cos(a/2)) / sin(a/2).
+
+ Rather than the angle a, we are given rDot = R^2 * cos(a), so we
+ multiply top and bottom by R:
+
+ dist = (4/3)*(R - Rcos(a/2)) / Rsin(a/2)
+
+ and use some trig:
+ ________________
+ cos(a/2) = \/(1 + cos(a)) / 2
+ ______________________
+ R*cos(a/2) = \/(R^2 + R^2 cos(a)) / 2
+ ________________
+ = \/(R^2 + rDot) / 2
+
+ Let A = (R^2 + rDot)/2.
+ ____________________
+ R*sin(a/2) = \/R^2 - R^2 cos^2(a/2)
+ _______
+ = \/R^2 - A
+
+ so:
+ _
+ 4 R - \/A
+ dist = - * ------------
+ 3 _______
+ \/R^2 - A
+
+ History:
+ 5/29/2001 MichKa
+ Created it.
+
+
+
+
+ Returns false if the radius is too small compared to the chord length (returns true on NaNs)
+ radius is modified to the value that is accepted.
+
+
+
+
+ A utility class to flatten Bezier curves.
+
+
+
+
+ Flattens a Bezier cubic curve and adds the resulting polyline to the third parameter.
+
+ The four Bezier cubic control points.
+ The maximum distance between two corresponding points on the true curve
+ and on the flattened polyline. Must be strictly positive.
+ Where to add the flattened polyline.
+ True to skip the first control point when adding the flattened polyline.
+ Where to add the value of the Bezier curve parameter associated with
+ each of the polyline vertices.
+ If is empty, the first control point
+ and its associated parameter are always added.
+
+
+
+ Flattens a Bezier quadratic curve and adds the resulting polyline to the third parameter.
+ Uses degree elevation for Bezier curves to reuse the code for the cubic case.
+
+ The three Bezier quadratic control points.
+ The maximum distance between two corresponding points on the true curve
+ and on the flattened polyline. Must be strictly positive.
+ Where to add the flattened polyline.
+ Whether to skip the first control point when adding the flattened polyline.
+ Where to add the value of the Bezier curve parameter associated with
+ each of the polyline vertices.
+ If is empty, the first control point and
+ its associated parameter are always added.
+
+
+
+ Extension methods that support non-geometry types.
+
+
+
+
+ Allows the application of an action delegate (often a very simple lambda) against an entire sequence.
+
+
+
+
+ Allows the application of an action delegate (often a very simple lambda) against an entire sequence.
+
+
+
+
+ Allows the application of an action delegate (often a very simple lambda) against an entire sequence with the index of each item.
+
+
+
+
+ Ensures the count of a list to a given count. Creates with a given factory or removes items when necessary.
+ If Input IList is a List, AddRange or RemoveRange is used when there's no factory.
+
+
+
+
+ Ensures the count of a list is at least the given count. Creates with a given factory.
+
+
+
+
+ Add a range of items to the end of a collection.
+ If a collection is a list, List.AddRange is used.
+
+
+
+
+ Gets the last item of a given list.
+
+
+
+
+ Removes the last item from the given list.
+
+
+
+
+ Makes a copy of obj and all it's public properties, including all collection properties.
+
+
+
+
+ Sets the value if different. Avoids setting a local value if possible.
+ Returns true when the value has been changed.
+
+
+
+
+ Clears the dependency property when it is locally set on the given dependency object.
+ Returns false if the dependeny property is not locally set.
+
+
+
+
+ Finds all visual descendants of a given type and condition using breadth-first search.
+
+
+
+
+ Gets all visual children in IEnumerable.
+
+
+
+
+ Unifies the interface of PropertyMetadata in WPF and Silverlight.
+ Provides the necessary notification about render, arrange, or measure.
+
+
+
+
+ This private Ctor should only be used by AttachCallback.
+
+
+
+
+ Chain InternalCallback() to attach the instance of DrawingPropertyMetadata on property callback.
+ In Silverlight, the property metadata is thrown away after setting. Use callback to remember it.
+
+
+
+
+ Before chaining the original callback, trigger DrawingPropertyChangedEvent.
+
+
+
+
+ Extension methods for geometry-related data structures (Point/Vector/Size/Rect).
+
+
+
+
+ Resizes the rectangle to a relative size while keeping the center invariant.
+
+
+
+
+ Gets the difference vector between two points.
+
+
+
+
+ Memberwise plus for Point.
+
+
+
+
+ Memberwise minus for Point.
+
+
+
+
+ Converts a string of mini-languages to a .
+
+ See: Path Markup Syntax(http://msdn.microsoft.com/en-us/library/cc189041(VS.95).aspx)
+ The string of path mini-languages for describing geometric paths.
+ A converted from the the path mini-languages.
+
+
+
+ Flattens a and adds result points to a given .
+
+ The input .
+ The point list to which result points will append.
+ A positive number specifying the maximum allowed error from the result points to the input path figure. A Value of zero allows the algorithm to pick the tolerance automatically.
+
+
+
+ Gets the normalized arc in a (0,0)(1,1) box.
+ Zero degrees is mapped to [0.5, 0] (up), and clockwise.
+
+
+
+
+ Gets the absolute arc point in a given bound with a given relative radius.
+
+
+
+
+ Gets the angle on an arc relative to a (0,0)(1,1) box.
+ Zero degrees is mapped to [0.5, 0] (up), and clockwise.
+
+
+
+
+ Gets the angle on an arc from a given absolute point relative to a bound.
+
+
+
+
+ Computes the transform that moves "Rect from" to "Rect to".
+
+
+
+
+ Computes the transform from the coordinate space of one UIElement to another.
+
+ The source element.
+ The destination element.
+ The transform between the UIElements, or null if it cannot be computed.
+
+
+
+ Maps a relative point to an absolute point using the mapping from a given bound to a (0,0)(1,1) box.
+
+
+
+
+ Maps an absolute point to a relative point using the mapping from a (0,0)(1,1) box to a given bound.
+
+
+
+
+ Computes the bound after stretching within a given logical bound.
+ If stretch to uniform, use given aspectRatio.
+ If aspectRatio is empty, it's equivalent to Fill.
+ If stretch is None, it's equivalent to Fill or Uniform.
+
+
+
+
+ Returns the mid point of two points.
+
+ The first point.
+ The second point.
+ The mid point between and .
+
+
+
+ Returns the dot product of two vectors.
+
+ The first vector.
+ The second vector.
+ The dot product of and .
+
+
+
+ Returns the dot product of two points.
+
+
+
+
+ Returns the distance between two points.
+
+ The first point.
+ The second point.
+ The distance between and .
+
+
+
+ Returns the square of the distance between two points.
+
+ The first point.
+ The second point.
+ The square of the distance between and .
+
+
+
+ Determinant of the cross product. Equivalent to directional area.
+
+
+
+
+ Computes the normal direction vector of given line segments.
+
+
+
+
+ Computes the perpendicular vector, 90-degrees, counter-clockwise.
+ Vector to the right perpendicular results in a vector to up.
+
+
+
+
+ Returns whether the two geometries are identical.
+
+
+
+
+ Ensures the value is an instance of result type (T). If not, replace with a new instance of type (T).
+
+
+
+
+ Ensures the list[index] is an instance of result type (T). If not, replace with a new instance of type (T).
+
+
+
+
+ Helper class that provides static properties and methods related to floating point arithmetic.
+
+
+
+
+ The minimum distance to consider that two values are same.
+ Note: internal floating point in MIL/SL is float, not double.
+
+
+
+
+ The value of the angle of a full circle.
+
+
+
+
+ The inner radius for a pentagram polygon shape, at precision of three digits in percentage.
+ (1 - Sin36 * Sin72 / Sin54) / (Cos36) ^ 2, which is 0.47210998990512996761913067272407
+
+
+
+
+ Determines whether a System.Double value is small enough to be considered
+ equivalent to zero.
+
+
+ True if value is smaller than DoubleTolerance;
+ otherwise, False.
+
+
+
+ Returns the value that's within the given range.
+ A given min/max that is null equals no limit.
+
+
+
+
+ Computes the Euclidean norm of the vector (x, y).
+
+ The first component.
+ The second component.
+ The Euclidean norm of the vector (x, y).
+
+
+
+ Computes a real number from the mantissa and exponent.
+
+
+
+ The value of x * 2^exp if successful.
+
+
+
+ Tests a double.
+
+ The double to test.
+ True if x is not a NaN and is not equal to plus or minus infinity;
+ otherwise, False.
+
+
+
+ Helper class to work with PathFigure.
+
+
+
+
+ Flattens the given figure and adds result points to the given point list.
+
+ The error tolerance. Must be positive. Can be zero. Fallback to default tolerance.
+
+
+
+ Iterates all segments inside a given figure, and returns the correct start point for each segment.
+
+
+
+
+ Synchronizes the figure to the given list of points as a single polyline segment.
+ Tries to keep the change to a minimum and returns false if nothing has been changed.
+
+
+
+
+ Synchronizes the given figure to be a closed ellipse with two arc segments.
+
+
+
+
+ A Tuple data structure for PathSegment and the corresponding StartPoint.
+
+
+
+
+ Represents a polyline with a list of connecting points.
+ A closed polygon is represented by repeating the first point at the end.
+ The differences, normals, angles, and lengths are computed on demand.
+
+
+
+
+ Constructs a polyline with two or more points.
+
+
+
+
+ The forward difference vector of polyline.
+ Points[i] + Differences[i] = Points[i+1]
+
+
+
+ Compute the normal vector of given location (lerp(index, index+1, fraction).
+ If the location is within range of cornerRadius, interpolate the normal direction.
+
+ The range of normal smoothless. If zero, no smoothness and return the exact normal on index.
+
+
+
+ The polyline is closed when the first and last points are repeated.
+
+
+
+
+ The count of points in this polyline.
+
+
+
+
+ The total arc length of this polyline.
+
+
+
+
+ The point array of this polyline.
+
+
+
+
+ The length between line segments, Points[i] to Points[i+1].
+
+
+
+
+ The list of normal vectors for each segment.
+ Normals[i] is the normal of segment p[i] to p[i + 1].
+ Normals[N-1] == Normals[N-2].
+
+
+
+
+ The list of Cos(angle) between two line segments on point p[i].
+ Note: The value is cos(angle) = Dot(u, v). Not in degrees.
+
+
+
+
+ The list of accumulated length from points[i] to points[0].
+
+
+
+
+ The data structure to communicate with the PathMarch algorithm.
+
+
+
+
+ Gets the interpolated position of this MarchLocation on a given point list.
+
+
+
+
+ Get the interpolated normal direction of this MarchLocation on a given normal vector list.
+
+
+
+
+ Gets the arc length of this MarchLocation to the start of the entire polyline.
+
+
+
+
+ The reason why this location is sampled.
+
+
+
+
+ The index of the point on a polyline point list.
+
+
+
+
+ Ratio: [0, 1], which is always before / (before + after).
+
+
+
+
+ Arc length before a stop point. Non-negative and less than Length[index].
+
+
+
+
+ Arc length after the stop point. Non-negative and less than Length[index].
+
+
+
+
+ Remaining length within a step to hit next stop. Positive to go forward. Negative to go backward.
+
+
+
+
+ Helper class to work with list of points
+
+
+
+
+ March the given polyline with a given interval and output each stop through callback.
+
+ The polyline points to march on.
+ The arc length to march before stopping at the first point.
+ The max angle between edges to be considered a corner vertex.
+ Callback when marching algorithm stop at a point. The callback returns the arc length for next stop.
+ If the asked length is negative, march backwards. If callback returns NaN, finish marching.
+
+
+
+ Reorders the given list of polylines so that the polyline with a given arc length in the list is the first.
+ Polylines that preceded this line are concatenated to the end of the list, with the first polyline at the very end.
+
+ A list of polylines.
+ The arc length in the entire list of polylines at which to find the start line.
+ The arc length into that line is returned in this variable.
+ The reordered and wrapped list.
+
+
+
+ A random generator that supports uniform and Gaussian distributions.
+
+
+
+
+ Generates a pair of independent, standard, normally distributed random numbers,
+ zero expectation, unit variance, using polar form of the Box-Muller transformation.
+
+
+
+
+ Private constructor. Force to use factory methods.
+
+
+
+
+ Creates a line segment
+
+
+
+
+ Creates a cubic bezier segment from quatratic curve (3 control points)
+
+
+
+
+ Creates a cubic bezier segment with 4 control points.
+
+
+
+
+ Control points of path segment. Length is variant.
+ Line segment has 2 points, Cubic bezier has 4 points.
+
+
+
+
+ Compares two transforms for an exact match. Transforms with the same value but different structure (e.g. Translate(0,0) and Rotate(0) are not considered equivalent).
+
+ The first transform.
+ The second transform.
+
+
+
+
+ Specifies the unit of thickness.
+
+
+
+
+ Unit in pixels.
+
+
+
+
+ Unit in percentage relative to the bounding box.
+
+
+
+
+ Provides the base class of a source of geometry.
+ Generates and caches the geometry based on the input parameters and the layout bounds.
+
+
+ A typical implementation will extend the UpdateCachedGeometry() to update this.cachedGeometry.
+ This base class will then handle the invalidation, pipeline to the geometry effects, and then cache relative to the layout bounds.
+ An implementation should try to reuse the cached geometry as much as possible to avoid reconstruction in the rendering thread.
+ An implementation can extend the ComputeLogicalBounds to handle Stretch differently.
+
+ The type of geometry source parameter on which the base class is working on.
+
+
+
+ Provides an interface to describe the source of a geometry.
+
+
+ This interface is designed to expose the geometry source in a non-generic way.
+ Typical implementation should subclass GeometrySource instead of implementing this interface directly.
+
+
+
+
+ Notifies that the geometry has been invalidated because of external changes.
+
+
+ Geometry is typically invalidated when parameters are changed.
+ If any geometry has been invalidated externally, the geometry will be recomputed even if the layout bounds change.
+
+
+
+
+ Update the geometry using the given parameters and the layout bounds.
+ Returns false if nothing has been updated.
+
+
+
+
+ Gets or sets the resulting geometry after the latest UpdateGeometry().
+
+
+
+
+ Gets the bounding box where the geometry should stretch to.
+ The actual geometry might be smaller or larger than this.
+ should already take stroke thickness and stretch into consideration.
+
+
+
+
+ Gets the actual bounds of FrameworkElement.
+ includes logical bounds, stretch, and stroke thickness.
+
+
+
+
+ Specifics the geometry from the previous geometry effect process.
+
+
+
+
+ Notifies that the geometry has been invalidated because of external changes.
+
+
+ The geometry is typically invalidated when parameters are changed.
+ If any geometry has been invalidated externally, the geometry will be recomputed regardless if the layout bounds change.
+
+
+
+
+ Update the geometry based on the given parameters and layoutBounds.
+ Returns false if the geometry hasn't been changed.
+
+
+
+
+ Extends the way to provide geometry by implementing this function.
+ Returns true when any of the geometry is changed.
+
+
+
+
+ Extends the way to handle stretch mode.
+ The default is to always use Stretch.Fill and center stroke.
+
+
+
+
+ Apply the geometry effect when dirty or forced and update this.Geometry.
+ Otherwise, keep this.Geometry as this.cachedGeometry.
+
+
+
+
+ Gets or sets the resulting geometry after the latest UpdateGeometry().
+
+
+
+
+ Gets the bounding box that the geometry should stretch to.
+ The actual geometry might be smaller or larger than this.
+ should already take stroke thickness and stretch into consideration.
+
+
+
+
+
+ Gets the actual bounds of FrameworkElement.
+ includes logical bounds, stretch and stroke thickness.
+
+
+
+
+
+ Arc recognizes Stretch.None as the same as Stretch.Fill, assuming aspect ratio = 1:1.
+
+
+
+
+ Normalize thickness, both relative to the bounding box and the absolute pixel.
+ Relative thickness = 0 -> full circle radius or clamped.
+ Relative thickness = 1 -> shrank to a dot, or degenerated.
+
+
+
+
+ The arc is degenerated to a line pointing to center / normal inward.
+
+
+
+
+ Compute a list of angle pairs, defining the ranges in which arc sample should locate.
+ The return value have 2, 4, or 6 double values, each pair defines a range and they are in the order
+ to span the angles from given start to end angles. The ranges will break at the self-intersect angle.
+ If input start/end are within the invalid range between self intersect angle, it will be moved to neighboring self intersect.
+
+
+
+
+ Move angle to 0-90 range.
+
+
+
+
+ Compute all pieces of inner curves with each pair of input angles, and connect them with poly Bezier segments.
+ The new segments are output to given figure.Segments list from the given index. The start point is output seperately.
+
+
+
+
+ Compute one piece of inner curve with given angle range, and output one piece of smooth curve in format of poly Beizer semgents.
+
+
+
+
+ Compute the parameter (angle) of the self-intersect point for given ellipse with given thickness.
+ The result is always in first quadrant, and might be 0 or 90 indicating no self-intersect.
+ Basic algorithm is to binary search for the angle that sample point is not in first quadrant.
+
+
+
+
+ Specifies the direction the arrow points.
+
+
+
+
+ The arrow points to the left.
+
+
+
+
+ The arrow points to the right.
+
+
+
+
+ The arrow points up.
+
+
+
+
+ The arrow points down.
+
+
+
+
+ B
+ /|
+ / C--D
+ A |
+ \ C--D
+ \|
+ B
+ Algorithm only uses Width/Height assuming top-left at 0,0.
+
+
+
+
+ Specifies the rendering style of a callout shape.
+
+
+
+
+ A rectangular callout.
+
+
+
+
+ A rectangular callout with rounded corners.
+
+
+
+
+ A oval-shaped callout.
+
+
+
+
+ A cloud-shaped callout.
+
+
+
+
+ Updates the edge line, and then connects to the anchor point if necessary.
+
+
+
+
+ Updates the polyline segment, and then connects start, anchor, and end points with the callout style.
+
+
+
+
+ Updates the line segment to a given point.
+
+
+
+
+ Computes the corner points in a clockwise direction, with eight points for the four corners.
+
+
+
+
+ The corner arc is always smaller than a 90-degree arc.
+
+
+
+
+ Provides the base class for GeometryEffect that transforms a geometry into another geometry.
+
+
+ This class provides the basic implementation of processing the rendered geometry of a IShape before it's passed to rendering.
+ A typical implementation will extend the virtual function to transform the input geometry.
+ is typically attached to as an attached property and activated when geometry is updated.
+ The of a will replace the rendered geometry in .
+
+
+
+
+ Gets the geometry effect as an attached property on a given dependency object.
+
+
+
+
+ Sets the geometry effect as an attached property on a given dependency object.
+
+
+
+
+ Makes a deep copy of the using its current values.
+
+
+
+
+ Makes a deep copy of the geometry effect. Implements CloneCurrentValue in Silverlight.
+
+ A clone of the current instance of the geometry effect.
+
+
+
+ Tests if the given geometry effect is equivalent to the current instance.
+
+ A geometry effect to compare with.
+ Returns true when two effects render with the same appearance.
+
+
+
+ Specifics the geometry from the previous geometry effect process.
+
+
+
+
+ Invalidates the geometry effect without actually computing the geometry.
+ Notifies all parent shapes or effects to invalidate accordingly.
+
+
+
+
+ Processes the geometry effect on a given input geometry.
+ Stores the result in GeometryEffect.OutputGeometry.
+
+ Returns false if nothing has been changed.
+
+
+
+ Extends the way of updating cachedGeometry based on a given input geometry.
+
+
+
+
+ Notified when detached from a parent chain.
+
+
+
+
+ Notified when attached to a parent chain.
+
+
+
+
+ Invalidates the geometry on a given dependency object when
+ the object is a valid parent type (IShape or GeometryEffect).
+
+
+
+
+ Implement the Freezable in WPF.
+
+
+
+
+ The default geometry effect that only passes through the input geometry.
+
+
+
+
+ Gets the output geometry of this geometry effect.
+
+
+
+
+ Parent can be either IShape or GeometryEffectGroup.
+
+
+
+
+ Provides the conversion between string and geometry effects.
+
+
+ This class enables the brief syntax in XAML like GeometryEffect="Sketch".
+ Creates a clone of the instance of the geometry effect so it can be used as a resource.
+
+
+
+
+ Builds a preset list of supported geometry effects.
+
+
+
+
+ A GeometryEffect that can be converted from a string type.
+
+
+
+
+ A GeometryEffect that can be converted to a string type.
+
+
+
+
+ Converts a string to a geometry effect. The fallback value is null.
+
+
+
+
+ Converts a geometry effect into a string. The fallback value is null.
+
+
+
+
+ Specifies the reason of being called.
+
+
+
+
+ Geometry has been invalidated because a property has been changed.
+
+
+
+
+ Geometry has been invalidated because a property is being animated.
+
+
+
+
+ Geometry has been invalidated because a child has been invalidated.
+
+
+
+
+ Geometry has been invalidated because a parent has been invalidated.
+
+
+
+
+ Geometry has been invalidated because a new template has been applied.
+
+
+
+
+ Provides helper extension methods to work with IGeometrySource and parameters.
+
+
+
+
+ Specifies the arrow head type.
+
+
+
+
+ No arrow head.
+
+
+
+
+ A triangle arrow head.
+
+
+
+
+ A stealth triangle arrow head.
+
+
+
+
+ An open triangle arrow head.
+
+
+
+
+ An oval arrow head.
+
+
+
+
+ Specifies the corner location.
+
+
+
+
+ On the top left of the bounding box.
+
+
+
+
+ On the top right of the bounding box.
+
+
+
+
+ On the bottom right of the bounding box.
+
+
+
+
+ On the bottom left of the bounding box.
+
+
+
+
+ Polygon recognizes Stretch.None as the same as Stretch.Fill.
+
+
+
+
+ A geometry effect that transforms any geometry into a Sketch style as in SketchFlow.
+
+
+
+
+ Makes a deep copy of the geometry effect.
+
+ A clone of the current instance of the geometry effect.
+
+
+
+ Tests if the given geometry effect is equivalent to the current instance.
+
+ A geometry effect to compare with.
+ Returns true when two effects render with the same appearance.
+
+
+
+ Updating cachedGeometry based on the given input geometry.
+
+ An input geometry.
+ Returns true when anything on cachedGeometry has been updated.
+
+
+
+ Use the same random seed on creation to keep visual flickering to a minimum.
+
+
+
+
+ Iterates all simple segments in given path figure including the closing chord.
+
+
+
+
+ Renders an arc shape supporting Arc, Ring, and Pie mode controlled by ArcThickness.
+
+
+
+
+ Platform-neutral implementation of Shape deriving from WPF:Shape or SL:Path.
+
+
+ Provides the WPF implementation of Shape that derives from the platform Shape.
+
+
+
+
+ Extends how the shape is drawn with creating geometry source.
+
+
+
+
+ Invalidates the geometry for a . After the invalidation, the will recompute the geometry, which will occur asynchronously.
+
+
+
+ Provides the behavior for the Measure portion of Silverlight layout pass. Classes can override this method to define their own Measure pass behavior.
+ The size that this object determines it requires during layout, based on its calculations of child object allotted sizes, or possibly on other considerations such as fixed container size.
+ The available size that this object can provide to child objects. Infinity () can be specified as a value to indicate that the object will size to whatever content is available.
+
+ In WPF, measure override works from Shape.DefiningGeometry which is not always as expected
+ see bug 99497 for details where WPF is not having correct measure by default.
+
+ In Silverlight, measure override on Path does not work the same as primitive shape works.
+
+ We should return the smallest size this shape can correctly render without clipping.
+ By default a shape can render as small as a dot, therefore returning the strokethickness.
+
+
+
+ Provides the behavior for the Arrange portion of Silverlight layout pass. Classes can override this method to define their own Arrange pass behavior.
+ The actual size used once the element is arranged in layout.
+ The final area within the parent that this object should use to arrange itself and its children.
+ will recompute the Geometry when it's invalidated and update the RenderedGeometry and GeometryMargin.
+
+
+
+ Occurs when RenderedGeometry is changed.
+
+
+
+
+ Gets the margin between logical bounds and actual geometry bounds.
+ This can be either positive (as in ) or negative (as in ).
+
+
+
+
+ Gets or sets the start angle.
+
+ The start angle in degrees. Zero degrees is pointing up.
+
+
+
+ Gets or sets the end angle.
+
+ The end angle in degrees. Zero degrees is pointing up.
+
+
+
+ Gets or sets the arc thickness.
+
+ The arc thickness in pixels or percentage depending on "ArcThicknessUnit".
+
+
+
+ Gets or sets the arc thickness unit.
+
+ The arc thickness unit in pixels or percentage.
+
+
+
+ Renders a block arrow shape that supports resizable arrow head and body.
+
+
+
+
+ Gets or sets the orientation.
+
+ The orientation where the arrow is pointing to.
+
+
+
+ Gets or sets the arrow head angle.
+
+ The arrow head angle in degrees.
+
+
+
+ Gets or sets the size of the arrow body.
+
+ The size of the arrow body in pixels.
+
+
+
+ Renders a regular polygon shape or corresponding star shape with variable number of points.
+
+
+
+
+ Gets or sets the number of points of the .
+
+
+
+
+ Gets or sets the the distance between the center and the innermost point.
+
+ The distance between the center and the innermost point.
+
+
+
diff --git a/SCADA/Example/Microsoft.Expression.Interactions.dll b/SCADA/Example/Microsoft.Expression.Interactions.dll
new file mode 100644
index 0000000..979c965
Binary files /dev/null and b/SCADA/Example/Microsoft.Expression.Interactions.dll differ
diff --git a/SCADA/Example/Microsoft.Expression.Interactions.xml b/SCADA/Example/Microsoft.Expression.Interactions.xml
new file mode 100644
index 0000000..59fce87
--- /dev/null
+++ b/SCADA/Example/Microsoft.Expression.Interactions.xml
@@ -0,0 +1,1295 @@
+
+
+
+ Microsoft.Expression.Interactions
+
+
+
+
+ A basic implementation of ICommand that wraps a method that takes no parameters or a method that takes one parameter.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The action.
+ Use this constructor to provide an action that ignores the ICommand parameter.
+
+
+
+ Initializes a new instance of the class.
+
+ An action that takes an object parameter.
+ Use this constructor to provide an action that uses the object parameter passed by the Execute method.
+
+
+
+ Defines the method that determines whether the command can execute in its current state.
+
+ Data used by the command. If the command does not require data to be passed, then this object can be set to null.
+
+ Always returns true.
+
+
+
+
+ Defines the method to be called when the command is invoked.
+
+ Data used by the command. If the command does not require data to be passed, then this object can be set to null.
+
+
+
+ Occurs when changes occur that affect whether the command should execute. Will not be fired by ActionCommand.
+
+
+
+
+ Calls a method on a specified object when invoked.
+
+
+
+
+ Invokes the action.
+
+ The parameter of the action. If the action does not require a parameter, the parameter may be set to a null reference.
+
+
+
+ Called after the action is attached to an AssociatedObject.
+
+ Override this to hook up functionality to the AssociatedObject.
+
+
+
+ Called when the action is getting detached from its AssociatedObject, but before it has actually occurred.
+
+ Override this to unhook functionality from the AssociatedObject.
+
+
+
+ The object that exposes the method of interest. This is a dependency property.
+
+
+
+
+ The name of the method to invoke. This is a dependency property.
+
+
+
+
+ An action that will change a specified property to a specified value when invoked.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Invokes the action.
+
+ The parameter of the action. If the action does not require a parameter, then the parameter may be set to a null reference.
+ A property with could not be found on the Target.
+ Could not set to the value specified by .
+
+
+
+ Gets or sets the name of the property to change. This is a dependency property.
+
+ The name of the property to change.
+
+
+
+ Gets or sets the value to set. This is a dependency property.
+
+ The value to set.
+
+
+
+ Gets or sets the duration of the animation that will occur when the ChangePropertyAction is invoked. This is a dependency property.
+ If the duration is unset, no animation will be applied.
+
+
+
+
+ Increment by Value if true; otherwise, set the value directly. If the property cannot be incremented, it will instead try to set the value directly.
+
+
+
+
+ Represents one ternary condition.
+
+
+
+
+ Method that evaluates the condition. Note that this method can throw ArgumentException if the operator is
+ incompatible with the type. For instance, operators LessThan, LessThanOrEqual, GreaterThan, and GreaterThanOrEqual
+ require both operators to implement IComparable.
+
+ Returns true if the condition has been met; otherwise, returns false.
+
+
+
+ Ensure that any binding on DP operands are up-to-date.
+
+
+
+
+ Gets or sets the left operand.
+
+
+
+
+ Gets or sets the right operand.
+
+
+
+
+ Gets or sets the comparison operator.
+
+
+
+
+ Enumeration of different comparison operators.
+
+
+
+
+ This method evaluates operands.
+
+ Left operand from the LeftOperand property.
+ Operator from Operator property.
+ Right operand from the RightOperand property.
+ Returns true if the condition is met; otherwise, returns false.
+
+
+
+ Evaluates both operands that implement the IComparable interface.
+
+ Left operand from the LeftOperand property.
+ Operator from Operator property.
+ Right operand from the RightOperand property.
+ Returns true if the condition is met; otherwise, returns false.
+
+
+
+ Forward chaining.
+
+
+
+
+ Represents a conditional expression that is set on a ConditionBehavior.Condition property.
+ Contains a list of conditions that gets evaluated in order to return true or false for ICondition.Evaluate().
+
+
+
+
+ An interface that a given object must implement in order to be
+ set on a ConditionBehavior.Condition property.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Goes through the Conditions collection and evalutes each condition based on
+ ForwardChaining property.
+
+ Returns true if conditions are met; otherwise, returns false.
+
+
+
+ Gets or sets forward chaining for the conditions.
+ If forward chaining is set to ForwardChaining.And, all conditions must be met.
+ If forward chaining is set to ForwardChaining.Or, only one condition must be met.
+
+
+
+
+ Return the Condition collections.
+
+
+
+
+ A behavior that attaches to a trigger and controls the conditions
+ to fire the actions.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ The event handler that is listening to the preview invoke event that is fired by
+ the trigger. Setting PreviewInvokeEventArgs.Cancelling to True will
+ cancel the invocation.
+
+ The trigger base object.
+ An object of type PreviewInvokeEventArgs where e.Cancelling can be set to True.
+
+
+
+ Gets or sets the IConditon object on behavior.
+
+ The name of the condition to change.
+
+
+
+ Helper class for managing binding expressions on dependency objects.
+
+
+
+
+ Ensure that all DP on an action with binding expressions are
+ up to date. DataTrigger fires during data binding phase. Since
+ actions are children of the trigger, any bindings on the action
+ may not be up-to-date. This routine is called before the action
+ is invoked in order to guarantee that all bindings are up-to-date
+ with the most current data.
+
+
+
+
+ Ensures that all binding expression on actions are up to date
+
+
+
+
+ This helper function ensures that, if a dependency property on a dependency object
+ has a binding expression, the binding expression is up-to-date.
+
+
+
+
+
+
+ Toggles between two states based on a conditional statement.
+
+
+
+
+ Called after the behavior is attached to an AssociatedObject.
+
+ Override this to hook up functionality to the AssociatedObject.
+
+
+
+ A helper function to take the place of FrameworkElement.IsLoaded, as this property isn't available in Silverlight.
+
+ The element of interest.
+ Returns true if the element has been loaded; otherwise, returns false.
+
+
+
+ Gets or sets the binding that produces the property value of the data object. This is a dependency property.
+
+
+
+
+ Gets or sets the value to be compared with the property value of the data object. This is a dependency property.
+
+
+
+
+ Gets or sets the name of the visual state to transition to when the condition is met. This is a dependency property.
+
+
+
+
+ Gets or sets the name of the visual state to transition to when the condition is not met. This is a dependency property.
+
+
+
+
+ Trigger designed to be bound to a data store property. Fires when the property changes.
+
+
+
+
+ Represents a trigger that performs actions when the bound data have changed.
+
+ UA_REVIEW:chabiss
+
+
+
+ Called when the binding property has changed.
+ UA_REVIEW:chabiss
+
+ argument.
+
+
+
+ Called after the trigger is attached to an AssociatedObject.
+ UA_REVIEW:chabiss
+
+
+
+
+ Called when the trigger is being detached from its AssociatedObject, but before it has actually occurred.
+ UA_REVIEW:chabiss
+
+
+
+
+ A binding object that the trigger will listen to, and that causes the trigger to fire when it changes.
+
+ UA_REVIEW:chabiss
+
+
+
+ Represents a trigger that performs actions when the bound data meets a specified condition.
+
+
+
+
+ Called when the binding property has changed.
+ UA_REVIEW:chabiss
+
+ argument.
+
+
+
+ Gets or sets the value to be compared with the property value of the data object. This is a dependency property.
+
+
+
+
+ Gets or sets the type of comparison to be performed between the specified values. This is a dependency property.
+
+
+
+
+ ExtendedVisualStateManager is a custom VisualStateManager that can smooth out the animation of layout properties.
+ With this custom VisualStateManager, states can include changes to properties like Grid.Column, can change element heights to or from Auto, and so on.
+ These changes will be smoothed out over time using the GeneratedDuration and GeneratedEasingFunction of the appropriate transition.
+ See the "VisualStateManager overrides" region below for a general description of the algorithm.
+
+
+
+
+ A VisualStateGroup that can use FluidLayout or not.
+
+
+
+
+ Visibility is shadowed by a custom attached property at runtime.
+
+
+
+
+ A VisualStateGroup keeps a list of these original values in an attached property.
+
+
+
+
+ For every state, the layout-specific properties get extracted and then are attached to the state. These properties are removed from the state itself.
+
+
+
+
+ Remember the current state.
+
+
+
+
+ The TransitionEffect to use when the state changes.
+
+
+
+
+ The TransitionEffectStoryboard in use during the state change.
+
+
+
+
+ The cached background in use during the state change.
+
+
+
+
+ The cached background in use during the state change.
+
+
+
+
+ The cached background in use during the state change.
+
+
+
+
+ This is the set of elements that are currently in motion.
+
+
+
+
+ This is the storyboard that is animating the transition.
+
+
+
+
+ This list contains all the known layout properties.
+
+
+
+
+ Stop the animation and replace the layout changes that were made to support that animation.
+
+
+
+
+ Locate the transition that VisualStateManager will use to animate the change, so that the layout animation can match the duration and easing.
+
+ The group in which the transition is taking place.
+ The state that you are coming from.
+ The state you are going to.
+ The transition
+
+
+
+ Remove all layout-affecting properties from the Storyboard for the state and cache them in an attached property.
+
+ The state you are moving to.
+ A Storyboard containing the layout properties in that state.
+
+
+
+ The set of target elements is the set of all elements that might have moved in a layout transition. This set is the closure of:
+ - Elements with layout properties animated in the state.
+ - Siblings of elements in the set.
+ - Parents of elements in the set.
+
+ Subsequent code will check these rectangles both before and after the layout change.
+
+ The control whose layout is changing state.
+ The storyboard containing the layout changes.
+ Any previous values from previous state navigations that might be reverted.
+ The set of elements currently in motion, if there is a state change transition ongoing.
+ The full set of elements whose layout may have changed.
+
+
+
+ Gets a set of rectangles for all the elements in the target list.
+
+ The set of elements to consider.
+ The set of elements currently in motion.
+ A Dictionary mapping elements to their Rects.
+
+
+
+ Get the layout rectangle of an element, by getting the layout slot and then computing which portion of the slot is being used.
+
+ The element whose layout Rect will be retrieved.
+ The layout Rect of that element.
+
+
+
+ Get the opacities of elements at the time of the state change, instead of visibilities, because the state change may be in process and the current value is the most important.
+
+ The control whose state is changing.
+ The storyboard with the layout properties.
+ The set of original values.
+
+
+
+
+ Go through the layout Storyboard and set all the properties by using SetValue to enable calling UpdateLayout without
+ ticking the timeline, which would cause a render.
+ All values that are overwritten will be stored in the collection of OriginalValueRecords so that they can be replaced later.
+
+ The control whose state is changing.
+ The Storyboard holding the layout properties.
+ The store of original values.
+
+
+
+ Take all the elements that will be moving as a result of the layout animation, and wrap them in Canvas panels so that
+ they do not affect their sibling elements.
+
+ The set of elements that will be moving.
+
+
+
+ Take all the elements that have been moving as a result of the layout animation, and unwrap them from their Canvas panels.
+
+ The set of elements that have been moving.
+
+
+
+ Copy the layout properties from the source element to the target element, clearing them from the source.
+
+ The source of the layout properties.
+ The destination of the layout properties.
+
+
+
+ Create the actual Storyboard that will be used to animate the transition. Use all previously calculated results.
+
+ The duration of the animation.
+ The easing function to be used in the animation.
+ The set of elements that will be moving.
+ The old opacities of the elements whose visibility properties are changing.
+ The Storyboard.
+
+
+
+ OriginalValueRecord remembers the original value of a property that was changed in a state.
+
+
+
+
+ This enumerated type indicates whether a FluidMoveBehavior applies to the element to which it is attached, or to the children of that element.
+ "Self" is useful when there is a single element that should behave in a special manner; "Children" is useful when the same behavior should apply to all
+ children of a WrapPanel or to the ItemsHost panel of an ItemsControl.
+
+
+
+
+ This enumerated type indicates whether an element is identified by itself, or by its DataContext.
+ DataContext identification allows movement from one data-driven location to another.
+
+
+
+
+ Dependency property for the scope of the behavior. See FluidMoveScope for more details.
+
+
+
+
+ Dependency property for the active state of the behavior.
+
+
+
+
+ Dependency property that provides the ability to use the element as its own tag, or the binding on the element.
+
+
+
+
+ Dependency property for the extra path to add to the binding when UsaBindingAsTag is true.
+
+
+
+
+ Identity tag used to detect element motion between containers.
+
+
+
+
+ Indicates whether the behavior applies just to this element, or to all children of the element (if the element is a Panel).
+
+
+
+
+ Indicates whether the behavior is currently active.
+
+
+
+
+ Indicates whether to use the element as its own tag, or to use the binding on the element as the tag.
+
+
+
+
+ Extra path to add to the binding when TagType is specified.
+
+
+
+
+ Private structure that stores all relevant data pertaining to a tagged item.
+
+
+
+
+ Behavior that watches an element (or a set of elements) for layout changes, and moves the element smoothly to the new position when needed.
+ This behavior does not animate the size or visibility of an element; it only animates the offset of that element within its parent container.
+
+
+
+
+ Dependency property for the duration of the move.
+
+
+
+
+ Dependency property for the tag type to use just before the object is loaded.
+
+
+
+
+ Dependency property for the extra path to add to the binding when UsaBindingAsTag is true.
+
+
+
+
+ Identity tag used to detect element motion between containers.
+
+
+
+
+ Dependency property for the FloatAbove flag.
+
+
+
+
+ Dependency property for the EasingFunction to use for the horizontal component of the move.
+
+
+
+
+ Dependency property for the EasingFunction to use for the vertical component of the move.
+
+
+
+
+ Remember the popup/adorner being used, in case of element motion between containers when FloatAbove is true.
+
+
+
+
+ Opacity cache used when floating a Popup.
+
+
+
+
+ Marks the animation transform.
+
+
+
+
+ The duration of the move.
+
+
+
+
+ Spawning point for this item.
+
+
+
+
+ Extra path to add to the binding when TagType is specified.
+
+
+
+
+ Flag that says whether elements are allowed to float above their containers (in a Popup or Adorner) when changing containers.
+
+
+
+
+ EasingFunction to use for the horizontal component of the move.
+
+
+
+
+ EasingFunction to use for the vertical component of the move.
+
+
+
+
+ Simple helper class to allow any UIElements to be used as an Adorner.
+
+
+
+
+ An action that will transition a FrameworkElement to a specified VisualState when invoked.
+
+
+ If the TargetName property is set, this action will attempt to change the state of the targeted element. If not, it walks
+ the element tree in an attempt to locate an alternative target that defines states. ControlTemplate and UserControl are
+ two common possibilities.
+
+
+
+
+ Called when the target changes. If the TargetName property isn't set, this action has custom behavior.
+
+
+
+ Could not locate an appropriate FrameworkElement with states.
+
+
+
+ This method is called when some criteria is met and the action is invoked.
+
+
+ Could not change the target to the specified StateName.
+
+
+
+ Determines whether or not to use a VisualTransition to transition between states.
+
+
+
+
+ The name of the VisualState.
+
+
+
+
+ A Trigger that is triggered by a keyboard event. If the target Key and Modifiers are detected, it fires.
+
+
+
+
+ The key that must be pressed for the trigger to fire.
+
+
+
+
+ The modifiers that must be active for the trigger to fire (the default is no modifiers pressed).
+
+
+
+
+ If true, the Trigger only listens to its trigger Source object, which means that element must have focus for the trigger to fire.
+ If false, the Trigger listens at the root, so any unhandled KeyDown/Up messages will be caught.
+
+
+
+
+ Determines whether or not to listen to the KeyDown or KeyUp event.
+
+
+
+
+ An action that will launch a process to open a file or Uri. For files, this action will launch the default program
+ for the given file extension. A Uri will open in a web browser.
+
+
+
+
+ This method is called when some criteria is met and the action is invoked.
+
+
+
+
+
+ The file or Uri to open.
+
+
+
+
+ Repositions the attached element in response to mouse drag gestures on the element.
+
+
+
+
+ Dependency property for the X position of the dragged element, relative to the left of the root element.
+
+
+
+
+ Dependency property for the Y position of the dragged element, relative to the top of the root element.
+
+
+
+
+ Dependency property for the ConstrainToParentBounds property. If true, the dragged element will be constrained to stay within the bounds of its parent container.
+
+
+
+
+ Attempts to update the position of the associated element to the specified coordinates.
+
+ The desired position of the element in root coordinates.
+
+
+
+ Applies a relative position translation to the associated element.
+
+ The X component of the desired translation in root coordinates.
+ The Y component of the desired translation in root coordinates.
+
+
+
+ Applies the given translation to the RenderTransform of the associated element.
+
+ The X component of the translation in parent coordinates.
+ The Y component of the translation in parent coordinates.
+
+
+
+ Does a recursive deep copy of the specified transform.
+
+ The transform to clone.
+ A deep copy of the specified transform, or null if the specified transform is null.
+ Thrown if the type of the Transform is not recognized.
+
+
+
+ Updates the X and Y properties based on the current rendered position of the associated element.
+
+
+
+
+ Check if one Rect is contained by another.
+
+ The containing Rect.
+ The contained Rect.
+ True if rect1 contains rect2; otherwise, False.
+
+
+
+ Transforms as vector.
+
+ The transform.
+ The X component of the vector.
+ The Y component of the vector.
+ A point containing the values of X and Y transformed by transform as a vector.
+
+
+
+ Gets the transform offset.
+
+ The transform.
+ The offset of the transform.
+
+
+
+ Called after the behavior is attached to an AssociatedObject.
+
+ Override this to hook up functionality to the AssociatedObject.
+
+
+
+ Called when the behavior is getting detached from its AssociatedObject, but before it has actually occurred.
+
+ Override this to unhook functionality from the AssociatedObject.
+
+
+
+ Occurs when a drag gesture is initiated.
+
+
+
+
+ Occurs when a drag gesture update is processed.
+
+
+
+
+ Occurs when a drag gesture is finished.
+
+
+
+
+ Gets or sets the X position of the dragged element, relative to the left of the root element. This is a dependency property.
+
+
+
+
+ Gets or sets the Y position of the dragged element, relative to the top of the root element. This is a dependency property.
+
+
+
+
+ Gets or sets a value indicating whether the dragged element is constrained to stay within the bounds of its parent container. This is a dependency property.
+
+
+ True if the dragged element should be constrained to its parents bounds; otherwise, False.
+
+
+
+
+ Gets the on-screen position of the associated element in root coordinates.
+
+ The on-screen position of the associated element in root coordinates.
+
+
+
+ Gets the element bounds in element coordinates.
+
+ The element bounds in element coordinates.
+
+
+
+ Gets the parent element of the associated object.
+
+ The parent element of the associated object.
+
+
+
+ Gets the root element of the scene in which the associated object is located.
+
+ The root element of the scene in which the associated object is located.
+
+
+
+ Gets and sets the RenderTransform of the associated element.
+
+
+
+
+ An action that will play a sound to completion.
+
+
+ This action is intended for use with short sound effects that don't need to be stopped or controlled. If you're trying
+ to create a music player or game, it may not meet your needs.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ When the action is invoked, this method is used to customize the dynamically created MediaElement.
+
+
+ This method may be useful for Action authors who wish to extend PlaySoundAction. If you want to control the
+ MediaElement Balance property, you could inherit from PlaySoundAction and override this method.
+
+
+
+
+
+ This method is called when some criteria are met and the action should be invoked.
+
+
+ Each invocation of the Action plays a new sound. Although the implementation is subject-to-change, the caller should
+ anticipate that this will create a new MediaElement that will be cleaned up when the sound completes or if the media
+ fails to play.
+
+
+
+
+
+ A Uri defining the location of the sound file. This is used to set the source property of the MediaElement. This is a dependency property.
+
+
+ The sound can be any file format supported by MediaElement. In the case of a video, it will play only the
+ audio portion.
+
+
+
+
+ Control the volume of the sound. This is used to set the Volume property of the MediaElement. This is a dependency property.
+
+
+
+
+ An action that will remove the targeted element from the tree when invoked.
+
+
+ This action may fail. The action understands how to remove elements from common parents but not from custom collections or direct manipulation
+ of the visual tree.
+
+
+
+
+ An action that will change the value of a property from a data store object.
+ This class is identical to ChangePropertyAction. The only difference is that the data store picker is loaded
+ for this action.
+
+
+
+
+ An abstract class that provides the ability to target a Storyboard.
+
+
+ For action authors, this class provides a standard way to target a Storyboard. Design tools may choose to provide a
+ special editing experience for classes that inherit from this action, thereby improving the designer experience.
+
+
+
+
+ This method is called when the Storyboard property is changed.
+
+
+
+
+
+ The targeted Storyboard. This is a dependency property.
+
+
+
+
+ An action that will change the state of a targeted storyboard when invoked.
+
+
+
+
+ This method is called when some criteria is met and the action should be invoked. This method will attempt to
+ change the targeted storyboard in a way defined by the ControlStoryboardOption.
+
+
+
+
+
+ An abstract class that provides the ability to target a Storyboard.
+
+
+ For Trigger authors, this class provides a standard way to target a Storyboard. Design tools may choose to provide a
+ special editing experience for classes that inherit from this trigger, thereby improving the designer experience.
+
+
+
+
+ This method is called when the Storyboard property is changed.
+
+
+
+
+ The targeted Storyboard. This is a dependency property.
+
+
+
+
+ A trigger that listens for the completion of a Storyboard.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ A trigger that is triggered by a specified event occurring on its source and fires after a delay when that event is fired.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Gets or sets the number of milliseconds to wait between ticks. This is a dependency property.
+
+
+
+
+ Gets or sets the total number of ticks to be fired before the trigger is finished. This is a dependency property.
+
+
+
+
+ Defines a transition effect shader that transitions from one visual to another visual
+ using an interpolated value between 0 and 1.
+
+
+
+
+ Brush-valued properties that turn into sampler-properties in the shader.
+ Represents the image present in the final state of the transition.
+
+
+
+
+ Brush-valued properties that turn into sampler-properties in the shader.
+ Represents the image present in the initial state of the transition.
+
+
+
+
+ A Dependency property as the backing store for Progress.
+ Also used to represent the state of a transition from start to finish (range between 0 and 1).
+
+
+
+
+ Creates a modifiable clone (deep copy) of the using its current values.
+
+
+
+
+ Makes a deep copy of the transition effect. Implements CloneCurrentValue in Silverlight.
+
+ A clone of current instance of transition effect.
+
+
+
+ Updates the shader's variables to the default values.
+
+
+
+
+ Gets or sets the Input variable within the shader.
+
+
+
+
+ Gets or sets the OldImage variable within the shader.
+
+
+
+
+ Gets or sets the Progress variable within the shader.
+
+
+
+
+ Allows the user to use common touch gestures to translate, zoom, and rotate the attached object.
+
+
+
+
+ Called after the behavior is attached to an AssociatedObject.
+
+ Override this to hook up functionality to the AssociatedObject.
+
+
+
+ Called when the behavior is getting detached from its AssociatedObject, but before it has actually occurred.
+
+ Override this to unhook functionality from the AssociatedObject.
+
+
+
+ Gets or sets a value specifying which zooming and translation variants to support.
+
+
+
+
+ Gets or sets a number describing the rate at which the translation will decrease.
+
+
+
+
+ Gets or sets a number describing the rate at which the rotation will decrease.
+
+
+
+
+ Gets or sets the value indicating whether the zoom and translate position of the attached object is limited by the bounds of the parent object.
+
+
+
+
+ Gets or sets a number indicating the minimum zoom value allowed.
+
+
+
+
+ Gets or sets a number indicating the maximum zoom value allowed.
+
+
+
+
+ This class provides various platform agnostic standard operations for working with VisualStateManager.
+
+
+
+
+ Transitions the control between two states.
+
+ The element to transition between states.
+ The state to transition to.
+ True to use a System.Windows.VisualTransition to transition between states; otherwise, false.
+ True if the control successfully transitioned to the new state; otherwise, false.
+ Control is null.
+ StateName is null.
+
+
+
+ Gets the value of the VisualStateManager.VisualStateGroups attached property.
+
+ The element from which to get the VisualStateManager.VisualStateGroups.
+
+
+
+
+ Find the nearest parent which contains visual states.
+
+ The element from which to find the nearest stateful control.
+ The nearest stateful control if True; else null.
+ True if a parent contains visual states; else False.
+
+
+
+ A strongly-typed resource class, for looking up localized strings, etc.
+
+
+
+
+ Returns the cached ResourceManager instance used by this class.
+
+
+
+
+ Overrides the current thread's CurrentUICulture property for all
+ resource lookups using this strongly typed resource class.
+
+
+
+
+ Looks up a localized string similar to Could not find method named '{0}' on object of type '{1}' that matches the expected signature..
+
+
+
+
+ Looks up a localized string similar to More than one potential addition operator was found on type '{0}'..
+
+
+
+
+ Looks up a localized string similar to Cannot animate a property change on a type '{0}' Target. Property changes can only be animated on types derived from DependencyObject..
+
+
+
+
+ Looks up a localized string similar to Cannot find a property named "{0}" on type "{1}"..
+
+
+
+
+ Looks up a localized string similar to The Increment property cannot be set to True if the Duration property is set..
+
+
+
+
+ Looks up a localized string similar to The '{0}' property cannot be incremented because its value cannot be read..
+
+
+
+
+ Looks up a localized string similar to Cannot assign value of type "{0}" to property "{1}" of type "{2}". The "{1}" property can be assigned only values of type "{2}"..
+
+
+
+
+ Looks up a localized string similar to Property "{0}" defined by type "{1}" does not expose a set method and therefore cannot be modified..
+
+
+
+
+ Looks up a localized string similar to Cannot find state named '{0}' on type '{1}'. Ensure that the state exists and that it can be accessed from this context..
+
+
+
+
+ Looks up a localized string similar to Target {0} does not define any VisualStateGroups. .
+
+
+
+
+ Looks up a localized string similar to LeftOperand of type "{0}" cannot be used with operator "{1}"..
+
+
+
+
+ Looks up a localized string similar to LeftOperand of type "{1}" and RightOperand of type "{0}" cannot be used with operator "{2}"..
+
+
+
+
+ Looks up a localized string similar to RightOperand of type "{0}" cannot be used with operator "{1}"..
+
+
+
+
+ Looks up a localized string similar to The target of the RemoveElementAction is not supported..
+
+
+
+
diff --git a/SCADA/Example/Microsoft.ReportViewer.Common.dll b/SCADA/Example/Microsoft.ReportViewer.Common.dll
new file mode 100644
index 0000000..fe74ce4
Binary files /dev/null and b/SCADA/Example/Microsoft.ReportViewer.Common.dll differ
diff --git a/SCADA/Example/Microsoft.ReportViewer.WinForms.dll b/SCADA/Example/Microsoft.ReportViewer.WinForms.dll
new file mode 100644
index 0000000..21cd6b2
Binary files /dev/null and b/SCADA/Example/Microsoft.ReportViewer.WinForms.dll differ
diff --git a/SCADA/Example/Microsoft.ReportViewer.WinForms.xml b/SCADA/Example/Microsoft.ReportViewer.WinForms.xml
new file mode 100644
index 0000000..bb086b5
--- /dev/null
+++ b/SCADA/Example/Microsoft.ReportViewer.WinForms.xml
@@ -0,0 +1,1846 @@
+
+
+
+ Microsoft.ReportViewer.WinForms
+
+
+
+ The namespace contains methods and properties for the ReportViewer Windows forms control.
+
+
+ Provides data for the Back event.
+
+
+ Constructs a new BackEventArgs object.
+ The parent report of the drillthrough report.
+
+
+ Gets the parent report of the drillthrough report.
+ A (if the ReportViewer control is in local processing mode) or object (if the ReportViewer control is in remote processing mode) containing the parent report of the drillthrough report.
+
+
+ Represents the method that will handle the event of a .
+ The object that raised the event.
+ A object that contains the event arguments.
+
+
+ Provides data for the event.
+
+
+ Constructs a BookmarkNavigationEventArgs object.
+ The bookmark identification string.
+
+
+ Gets the bookmark identification string.
+ A read-only string object.
+
+
+ Represents the method that will handle the event of a .
+ The object that raised the event.
+ A object that contains the event arguments.
+
+
+ Represents errors that occur when the control is rendering a processed report from report page layout (RPL) format into GDI+ format.
+
+
+ Provides a stream to the ReportViewer control for rendering.
+ A Stream object to which the ReportViewer control can write data.
+ The name of the stream.
+ The file name extension to use if a file stream is being created.
+ An Encoding enumerator value specifying the character encoding of the stream. This may be null if the stream does not contain characters.
+ A string containing the MIME type of the stream.
+ A Boolean value indicated whether the stream needs to support seeking. If the value is false, the stream will be forward-only and will be sent to the client in chunks as it is created. If the value is true, the stream may be written in any order.
+
+
+ Represents data source credentials.
+
+
+ Constructs a DataSourceCredentials object.
+
+
+ Gets or sets the user name to be used by the data source for connecting to a report server.
+ A string value.
+
+
+ Gets or sets the password to be used by the data source for connecting to the report server.
+ A string containing the password.
+
+
+ Gets or sets the user identification to be used by the data source for connecting to the report server.
+ A string containing the user ID.
+
+
+ Represents a collection of objects.
+
+
+ Initializes a new instance of the class.
+
+
+ Gets the object of the specified name from the collection.
+ A object.
+ Name of the object. This parameter is not case sensitive.
+
+
+ Represents a possible display mode for the ReportViewer control.
+
+
+ Specifies that the control is in normal mode. This mode causes the control to display logical pages.
+
+
+ Specifies that the control is in print layout mode. In this mode, the control displays physical pages.
+
+
+ Provides data for the event.
+
+
+ Construct a new DocumentMapNavigationEventArgs object.
+ A string containing the document map node ID.
+
+
+ Gets the unique identifier of the document map node selected.
+ A read-only string value containing the document map node ID.
+
+
+ Represents the method that will handle the event of a .
+ The object raising the event.
+ A object containing the event arguments.
+
+
+ Represents a single node in the document map.
+
+
+ Gets a collection of child document map nodes.
+ A read-only array of objects.
+
+
+ Gets the unique identifier of the document map node.
+ A read-only string value.
+
+
+ Gets the label associated with the document map node.
+ A read-only string value.
+
+
+ Provides data for the event.
+
+
+ Constructs a new DrillthroughEventArgs object.
+ The path of the drillthrough report.
+ The target report of the drillthrough action.
+
+
+ Gets the target report of the drillthrough action.
+ A read-only or object.
+
+
+ Gets the path of the drillthrough report.
+ A read-only string value.
+
+
+ Represents the method that will handle the event of a .
+ The object that raised the event.
+ A object that contains the event data.
+
+
+ Represents the method that will handle the event.
+ The object firing the event.
+ A class containing the arguments for the event.
+
+
+ Contains information about a event.
+
+
+ Gets the URL that the user clicked on in a report.
+ A string value containing the hyperlink.
+
+
+ Represents the method that will handle a event.
+ The object that raised the event.
+ A object that contains the arguments for this event.
+
+
+ Allows objects to provide credentials to use for connecting to a report server.
+
+
+ Provides forms authentication to be used to connect to the report server.
+ A Boolean value. A value of true indicates that forms authentication should be used.
+ [out] A report server authentication cookie.
+ [out] The name of the user.
+ [out] The password of the user.
+ [out] The authority to use when authenticating the user, such as a Microsoft Windows domain.
+
+
+ Specifies the user to impersonate when connecting to a report server.
+ A WindowsIdentity object representing the user to impersonate.
+
+
+ Returns network credentials to be used for authentication with the report server.
+ A NetworkCredentials object.
+
+
+ Allows applications to provide customized user interface messages.
+
+
+ Provides the ToolTip text for the Back button.
+ A string value.
+
+
+ Provides the text for the Back menu item.
+ A string value.
+
+
+ Provides the text for the Change Credentials button.
+ A string value.
+
+
+ Provides the ToolTip text for the Current Page text box.
+ A string value.
+
+
+ Provides the ToolTip text for the Document Map button.
+ A string value.
+
+
+ Provides the text for the document map menu item.
+ A string value.
+
+
+ Provides the ToolTip text for the Export button.
+ A string value.
+
+
+ Provides the text for the Export menu item.
+ A string value.
+
+
+ Provides the text for a false value.
+ A string value.
+
+
+ Provides the text for a Find button.
+ A string value.
+
+
+ Provides the ToolTip text for the Find button.
+ A string value.
+
+
+ Provides the text for the Find Next button.
+ A string value.
+
+
+ Provides the ToolTip text for the Find Next button.
+ A string value.
+
+
+ Provides the ToolTip text for the First Page button.
+ A string value.
+
+
+ Provides the ToolTip text for the Last Page button.
+ A string value.
+
+
+ Provides the ToolTip text for the Next Page button.
+ A string value.
+
+
+ Provides the text for the no more matches message.
+ A string value.
+
+
+ Provides the text for the Null check box.
+ A string value.
+
+
+ Provides the ToolTip text for the Null check box.
+ A string value.
+
+
+ Provides the text for a null value.
+ A string value.
+
+
+ Provides the text for the pagination message.
+ A string value.
+
+
+ Provides the ToolTip text for the Page Setup button.
+ A string value.
+
+
+ Provides the text for the Page Setup menu item.
+ A string value.
+
+
+ Provides the ToolTip text for the Parameter Area button.
+ A string value.
+
+
+ Provides the text for the password prompt.
+ A string value.
+
+
+ Provides the ToolTip text for the Previous Page button.
+ A string value.
+
+
+ Provides the text for the Print button.
+ A string value.
+
+
+ Provides the ToolTip text for the Print Layout button.
+ A string value.
+
+
+ Provides the text for the Print Layout menu item.
+ A string value.
+
+
+ Provides the text for the Print menu item.
+ A string value.
+
+
+ Provides the text for the progress message that is displayed when a report is processing.
+ A string value.
+
+
+ Provides the ToolTip text for the Refresh button.
+ A string value.
+
+
+ Provides the text for the Refresh menu item.
+ A string value.
+
+
+ Provides the ToolTip text for the Search text box.
+ A string value.
+
+
+ Provides text for the Select All item in a multivalue drop-down list box.
+ A string value.
+
+
+ Provides text for the Select a value prompt.
+ A string value.
+
+
+ Provides the ToolTip text for the Stop button.
+ A string value.
+
+
+ Provides the text for the Stop menu item.
+ A string value.
+
+
+ Provides the text for the text not found message.
+ A string value.
+
+
+ Provides the ToolTip text for the Total Pages item.
+ A string value.
+
+
+ Provides the text for a true value.
+ A string value.
+
+
+ Provides the text for the user name prompt.
+ A string value.
+
+
+ Provides the text for the View Report button.
+ A string value.
+
+
+ Provides the ToolTip text for the View Report button.
+ A string value.
+
+
+ Provides the ToolTip text for the Zoom control.
+ A string value.
+
+
+ Provides the text for the Zoom menu item.
+ A string value.
+
+
+ Provides the text for the Zoom To Page Width option.
+ A string value.
+
+
+ Provides text for the Zoom To Whole Page item.
+ A string value.
+
+
+ Defines methods and properties for implementing customized user interface messages.
+
+
+ Returns the error text to display when the user name has not been supplied for the data source credentials.
+ Returns a String that contains the error text to display when the user name has not been supplied for the data source credentials.
+ The prompt value that identifies which data source is missing a value.
+
+
+ Returns a localized name for the current export format.
+ Returns a String that contains the localized name for the current export format.
+ The name of the current export format (for example, EXCEL, PDF).
+
+
+ Returns the error text to display when a selection has not been made for a multivalue report parameter.
+ Returns a String that contains the error text to display when a selection has not been made for a multivalue report parameter.
+ The prompt value that identifies which report parameter has not been specified.
+
+
+ Returns the error text to display when a report parameter has not been specified.
+ Returns a String that contains the error text to display when a report parameter has not been specified.
+ The prompt value that identifies which report parameter has not been specified.
+
+
+ Gets the text for the All Files filter option in the Save As dialog box when a report is exported.
+ A String that contains the text to display for the All Files filter option in the Save As dialog box when a report is exported.
+
+
+ Gets the ToolTip text to display when a pointer pauses over a report parameter with a data type of DateTime.
+ A String that contains the ToolTip text to display when a pointer pauses over a report parameter that has a data type of DateTime.
+
+
+ Gets the title text for the dialog box when an error occurs exporting a report.
+ A String that contains the title text for the dialog box when an error occurs exporting a report.
+
+
+ Gets the ToolTip text to display when a pointer pauses over a report parameter with a data type of Float.
+ A String that contains the ToolTip text to display when a pointer pauses over a report parameter that has a data type of Float.
+
+
+ Gets the title text for the dialog box if an error occurs when the user selects a Hyperlink in the report.
+ A String that contains the title text for the dialog box if an error occurs when the user selects a Hyperlink in the report.
+
+
+ Gets the ToolTip text to display when a pointer pauses over a report parameter with a data type of Integer.
+ A String that contains the ToolTip text to display when a pointer pauses over a report parameter that has a data type of Integer.
+
+
+ Gets the title text for the message box dialog box displayed by the report viewer.
+ A String that contains the title text for the message box dialog box displayed by the report viewer.
+
+
+ Gets the text to display when the processing of a report has been stopped.
+ A String that contains the text to display when the processing of a report has been stopped.
+
+
+ Gets the title text for the dialog box when an error occurs in the prompt area.
+ A String that contains the title text for the dialog box when an error occurs in the prompt area.
+
+
+ Gets the ToolTip text to display when a pointer pauses over a report parameter with a data type of String.
+ A String that contains the ToolTip text to display when a pointer pauses over a report parameter that has a data type of String.
+
+
+ Allows applications to provide customized user interface messages.
+
+
+ Returns the string in the default toolbar that represents the total number of pages in the current report and the that was used to determine it.
+ A localized string that represents the total number of pages and the page count mode.
+ The total number of pages in the current report.
+ Indicates whether the pageCount parameter represents an estimated or actual number of pages.
+
+
+ Gets the text of the Cancel link in the wait control.
+ A string value that represents the Cancel link text.
+
+
+ Gets the text displayed on the Cancel button in the Exporting dialog box after the user selects an export format.
+ A string value that represents the text of the Cancel button.
+
+
+ Gets the text displayed in the Exporting dialog box after the user selects an export format and that indicates that the export is in progress and the user must wait for it to complete.
+ A string value that indicates that an export is in progress and that the user needs to wait for it to complete.
+
+
+ Gets the title of the Exporting dialog box that opens after the user selects an export format.
+ A string value that specifies the title of the Exporting dialog box.
+
+
+ Gets the tooltip text for the radio button that indicates false for a Boolean parameter.
+ A string value that represents the tooltip text for the radio button that indicates false for a Boolean parameter.
+
+
+ Gets the tooltip text for the radio button that indicates true for a Boolean parameter.
+ A string value that represents the tooltip text for the radio button that indicates true for a Boolean parameter.
+
+
+ Represents errors that occur while viewing a locally processed report.
+
+
+ Represents a report that is processed and rendered locally without connecting to a report server.
+
+
+ Initializes a new instance of the class.
+
+
+ Occurs when a subreport is processed.
+
+
+ Adds the supplied assembly to the list of assemblies that run in full trust mode in the sandboxed application domain.
+ The name of the assembly to be added.
+
+
+ Adds the supplied assembly to the list of assemblies that are trusted to execute in the current .
+ The name of the assembly to be added.
+
+
+ Releases all resources that are used by the object.
+
+
+ Causes processing extensions and expressions in the report to be executed in the current .
+ An object that contains security information about the report.
+
+
+ Causes processing extensions and expressions to be run in an application domain with limited permissions.
+
+
+ Returns the names of all datasets used within the local report.
+ An array of string objects that contain the list of dataset names.
+
+
+ Gets the default page settings specified in the local report.
+ A object that contains the default page settings for the local report.
+
+
+ Returns report parameter properties for the report.
+ A object that contains a collection of objects.
+
+
+ Returns the total number of soft pages in the report and a enumeration value that indicates the current page count mode.
+ An integer value containing the total number of soft pages in the report. For more information on soft pages, see Understanding Rendering Behaviors.
+ [out] A enumeration value that indicates the page count mode used to calculate the total number of soft pages.
+
+
+ Returns all available rendering extensions for the local report.
+ An array of objects.
+
+
+ Loads a report definition from the local file system using a .
+ A class that contains the report definition for the local report.
+
+
+ Loads a subreport definition using a .
+ The path and file name of the subreport definition.
+ A class that can be used to read the report definition language (RDL) file for the subreport.
+
+
+ Loads a subreport definition using a .
+ The path and file name of the subreport definition.
+ A object that will contain the report definition language (RDL) for the subreport.
+
+
+ Causes the local report to be rendered with new data.
+
+
+ Causes the object to release its reference to the sandboxed application domain immediately.
+
+
+ Processes the report and renders it in the specified format using a stream provided by a callback function.
+ The format in which to render the report. This argument maps to a rendering extension. Supported formats include Excel, PDF, Word, and Image. To access the list of available rendering extensions, use the method.
+ An XML string that contains the device-specific content that is required by the rendering extension specified in the format parameter. For more information about device information settings for specific output formats, see Device Information Settings in SQL Server Books Online.
+ A delegate function that will be used to provide a object for rendering.
+ [out] An array of objects that describes any warnings that occurred during report processing and rendering.
+
+
+ Processes the report with a specified page count mode and renders it in the specified format using a stream provided by a callback function.
+ The format in which to render the report. This argument maps to a rendering extension. Supported formats include Excel, PDF, Word, and Image. To access the list of available rendering extensions, use the method.
+ An XML string that contains the device-specific content that is required by the rendering extension specified in the format parameter. For more information about device information settings for specific output formats, see Device Information Settings in SQL Server Books Online.
+ A enumeration value that specifies the page count mode.
+ A delegate function that will be used to provide a object for rendering.
+ [out] An array of objects that describes any warnings that occurred during report processing and rendering.
+
+
+ Processes the report with a specified page count mode and renders it in the specified format.
+ A array of the report in the specified format.
+ The format in which to render the report. This argument maps to a rendering extension. Supported formats include Excel, PDF, Word, and Image. To access the list of available rendering extensions, use the method.
+ An XML string that contains the device-specific content that is required by the rendering extension specified in the format parameter. For more information about device information settings for specific output formats, see Device Information Settings in SQL Server Books Online.
+ A enumeration value that specifies the page count mode.
+ [out] The MIME type of the rendered report.
+ [out] The encoding used when rendering the contents of the report.
+ [out] The file name extension used for the output file.
+ [out] The stream identifiers. You can use them to render external resources (images, for example) that are associated with the report.
+ [out] An array of objects that describes any warnings that occurred during report processing and rendering.
+
+
+ Sets the base permissions for the sandboxed application domain with the supplied permission set.
+ The to set. The default base permission is Execution.
+
+
+ Sets report parameter properties for the local report.
+ An of objects that contains a list of the report parameter properties.
+
+
+ Gets a collection of data sources used by the report.
+ A read-only object.
+
+
+ Indicates whether the report can be rendered if it has external images.
+ A Boolean value. A value of true indicates that the local report can be rendered if it has external images. The default value is false.
+
+
+ Indicates whether the report can be rendered if it contains hyperlink actions.
+ A Boolean value. A value of true indicates that the report can be rendered if it contains hyperlink actions. The default value is false.
+
+
+ Returns the parameters passed from a parent report to this report, if it is a drillthrough report.
+ An of objects that represent the parameters passed from the parent reports to the drillthrough report, or an empty collection if this report is not a drillthrough report.
+
+
+ Gets or sets the name of the report-embedded resource.
+ A string containing the name of the embedded resource.
+
+
+ Gets or sets the file system path of the local report.
+ A string value.
+
+
+ Gets or sets a boolean value that indicates whether detailed messages should be displayed when an error occurs in a subreport.
+ true if detailed messages should be displayed; otherwise, false. The default is true.
+
+
+ Represents an exception that occurs when credentials have not been supplied for a data source used by a report.
+
+
+ Represents the error that occurs when a data source expected by the report has not been supplied.
+
+
+ Represents the error that occurs when the SOAP endpoint used by the ReportViewer control could not be accessed.
+
+
+ Represents the exception that occurs when a parameter expected by the report has not been supplied.
+
+
+ Represents the exception that occurs when no report source has been specified.
+
+
+ Represents values that control whether to calculate the actual page count or use an estimate.
+
+
+ Calculate the actual page count for the report.
+
+
+ Provide an estimate of the page count for the report instead of calculating the actual page count.
+
+
+ Provides data for a event.
+
+
+ Constructs a new PageNavigationEventArgs object.
+ An integer value containing the new page number.
+
+
+ Gets the number of the page resulting from the event.
+ An integer value containing the new page number.
+
+
+ Represents the method that will handle the event of a .
+ The object that raised the event.
+ A object that contains the arguments for this event.
+
+
+ Specifies the data type of a parameter.
+
+
+ A Boolean data type that represents a true or false condition.
+
+
+ A DateTime data type that represents the date and time.
+
+
+ A Float data type that represents a floating point decimal value.
+
+
+ An Integer data type.
+
+
+ A String data type that represents an array of characters.
+
+
+ Specifies the state of a parameter.
+
+
+ The parameter values are unavailable. This state indicates that no valid, query-based values were returned as a result of the query.
+
+
+ The parameter has outstanding dependencies. This generally occurs when the valid values or the default value of a parameter is query-based and dependencies exist that have not been submitted to the method.
+
+
+ A valid value for the parameter exists.
+
+
+ A valid value for the parameter does not exist.
+
+
+ Sets the processing mode of the ReportViewer control.
+
+
+ Specifies that the report will be processed and rendered using the reporting engine provided by the ReportViewer control.
+
+
+ Specifies remote processing mode against a Reporting Services report server.
+
+
+ Provides data for the event.
+
+
+ Contains an object if an exception has occurred.
+ An object if an exception has occurred during report rendering, or null if no exception has occurred.
+
+
+ Gets a list of warnings produced during report processing or rendering.
+ A collection of objects if warnings have occurred; otherwise a null value.
+
+
+ Represents the method that will handle the event of a .
+ The object that raised the event.
+ A object that contains information about the event.
+
+
+ Encapsulates a rendering extension that can be used with the Report Viewer's report.
+
+
+ Gets the localized display name of the rendering extension.
+ A read-only String value.
+
+
+ Gets the name of the rendering extension.
+ A read-only String value.
+
+
+ Indicates whether the rendering extension is visible in the user interface.
+ A Boolean value.
+
+
+ Contains methods and properties that can apply to both local and server reports.
+
+
+ Gets the default page settings specified in the report.
+ A object containing the default page settings for the local report.
+
+
+ Returns the representation of the document map for the local report.
+ A object containing the top level node of the document map hierarchy for the report.
+
+
+ Returns report parameter properties for the report.
+ A collection of objects.
+
+
+ Returns the total number of soft pages in the report.
+ An integer value containing the total number of soft pages in the report. For more information on soft pages, see Understanding Rendering Behaviors.
+
+
+ Returns the total number of soft pages in the report and a value that indicates the current page count mode.
+ An integer value containing the total number of soft pages in the report. For more information on soft pages, see Understanding Rendering Behaviors.
+ [out] A enumeration value that indicates the page count mode that was used to calculate the total number of pages.
+
+
+ Returns all available rendering extensions for the local report.
+ An array of objects.
+
+
+ Loads a report definition for processing using a .
+ A class that contains the report definition for the report.
+
+
+ Loads a report definition for processing using a .
+ A class that contains the report definition for the report.
+
+
+ Causes the report to be rendered with new data.
+
+
+ Processes the report and renders it in the specified format.
+ A byte array of the report in the specified format.
+ The format in which to render the report. This parameter maps to a rendering extension In local processing mode, supported extensions are Excel, PDF, Word, and Image. In remote processing mode, supported extensions depend on the extensions supported by the report server.You can access the list of available rendering extensions using the ListRenderingExtensions method in or , depending on the processing mode (see ).
+
+
+ Processes the report and renders it in the specified format.
+ A byte array of the report in the specified format.
+ The format in which to render the report. This parameter maps to a rendering extension. In local processing mode, supported extensions are Excel, PDF, Word, and Image. In remote processing mode, supported extensions depend on the extensions supported by the report server.You can access the list of available rendering extensions using the ListRenderingExtensions method in or , depending on the processing mode (see ).
+ An XML string that contains the device-specific content that is required by the rendering extension specified in the format parameter. For more information about device information settings for specific output formats, see Device Information Settings in SQL Server Books Online.
+
+
+ Processes the report and renders it in the specified format.
+ A array of the report in the specified format.
+ The format in which to render the report. This argument maps to a rendering extension. In local processing mode, supported extensions are Excel, PDF, Word, and Image. In remote processing mode, supported extensions depend on the extensions supported by the report server.You can access the list of available rendering extensions using the ListRenderingExtensions method in or , depending on the processing mode (see ).
+ An XML string that contains the device-specific content that is required by the rendering extension specified in the format parameter. For more information about device information settings for specific output formats, see Device Information Settings in SQL Server Books Online.
+ [out] The MIME type of the rendered report.
+ [out] The encoding used when rendering the contents of the report.
+ [out] The filename extension used for the output file.
+ [out] The stream identifiers. You can use them to render the external resources (images, etc.) that are associated with the report.
+ [out] An array of objects that describes any warnings that occurred during report processing.
+
+
+ Processes the report with the specified value and renders it in the specified format.
+ A byte array of the report in the specified format.
+ The format in which to render the report. This parameter maps to a rendering extension. In local processing mode, supported extensions are Excel, PDF, Word, and Image. In remote processing mode, supported extensions depend on the extensions supported by the report server.You can access the list of available rendering extensions using the ListRenderingExtensions method in or , depending on the processing mode (see ).
+ An XML string that contains the device-specific content that is required by the rendering extension specified in the format parameter. For more information about device information settings for specific output formats, see Device Information Settings in SQL Server Books Online.
+ A enumeration value that specifies the page count mode.
+ [out] The MIME type of the rendered report.
+ [out] The encoding used when rendering the contents of the report.
+ [out] The filename extension used for the output file.
+ [out] The stream identifiers. You can use them to render the external resources (images, etc.) that are associated with the report.
+ [out] An array of objects that describes any warnings that occurred during report processing.
+
+
+ Sets report parameter properties for the report.
+ An array of objects that contains a list of the report parameters properties.
+
+
+ Sets report parameter properties for the report.
+ A object.
+
+
+ Gets or sets the display name of the report.
+ A String containing the report's display name.
+
+
+ Indicates whether the report is a drillthrough report.
+ A Boolean value. A value of true indicates that this is a drillthrough report.
+
+
+ Gets a Boolean value that indicates whether a report definition and all required parameters have been specified, and all data sources are ready for use.
+ true if a report definition and all required parameters have been specified, and all data sources are ready for use; otherwise, false. The default is false.
+
+
+ Provides data for the event.
+
+
+ Gets a collection of .
+ A collection of objects.
+
+
+ Represents the method that will handle a event.
+ The source of the event.
+ A that contains the event data.
+
+
+ Represents a data source for a report.
+
+
+ Constructs an empty data source.
+
+
+ Constructs a named data source.
+ The name of the data source.
+
+
+ Constructs a named data source with a object in the property.
+ The name of the data source, as specified in the report definition for the current report.
+ A object that contains the data.
+
+
+ Constructs a named data source with a object in the property.
+ The name of the data source, as specified in the report definition for the current report.
+ A object that contains the data.
+
+
+ Constructs a named data source with an object in the property.
+ The name of the data source, as specified in the report definition for the current report.
+ An object that contains the data.
+
+
+ Constructs a named data source with a value.
+ The name of the data source.
+ A value for the data source.
+
+
+ Constructs a named data source with the property initialized as a particular type.
+ The name of the data source, as specified in the report definition for the current report.
+ A object that contains the data.
+
+
+ Gets or sets the name of the report data source.
+ A String containing the name of the data source.
+
+
+ Gets or sets the instance of the report data source.
+ An Object containing an instance of the report data source.
+
+
+ Contains a collection of objects.
+
+
+ Returns a report data source from the collection that matches a specified name.
+ A object.
+ The name of the report data source to retrieve from the collection.
+
+
+ Represents information about a report data source.
+
+
+ Gets the name of the report data source.
+ A String containing the name of the report data source.
+
+
+ Gets a prompt for the data source.
+ A String containing a prompt for the data source.
+
+
+ Represents a collection of objects.
+
+
+ Returns a specific object from the collection.
+ A object.
+ The name of the object to return.
+
+
+ Provides data for the event.
+
+
+ Returns an Exception object containing information about the report error.
+ An Exception object containing information about the report error.
+
+
+ Indicates whether the host application has handled the error.
+ A Boolean value indicating whether the host application has handled the error. The default value is false.
+
+
+ Represents the method that will handle a event.
+ The object that raised the event.
+ A object that contains information about the event.
+
+
+ Provides data for the report event.
+
+
+ Constructs a ReportExportEventArgs object.
+ A used for exporting the report.
+
+
+ Gets or sets an XML string that contains the device-specific content that is required by the rendering extension specified in the Extension parameter.
+ A String value containing the device-specific information.
+
+
+ Returns a used for exporting the report.
+ A object.
+
+
+ Represents the page settings for a report.
+
+
+ Indicates whether the orientation of the report as defined in the report definition file is landscape.
+ true if the orientation of the report as defined in the report definition file is landscape; otherwise, false.
+
+
+ Represents the margins for a report page. Read-only.
+ A read-only Margins object containing margin information about the report page.
+
+
+ Represents the paper size settings for a report page. Read-only.
+ A read-only PaperSize object containing information about report page size.
+
+
+ Represents a parameter for a report.
+
+
+ Instantiates a new ReportParameter.
+
+
+ Instantiates a new ReportParameter with a name.
+ The name of the parameter.
+
+
+ Instantiates a new ReportParameter with a name and a value.
+ The name of the parameter.
+ The value of the parameter.
+
+
+ Instantiates a new multivalued ReportParameter with a name.
+ The name of the parameter.
+ The values of the parameter.
+
+
+ Instantiates a new ReportParameter with a name, a value, and a visibility flag.
+ The name of the parameter.
+ The value of the parameter.
+ Determines if the parameter is displayed in the user interface.
+
+
+ Instantiates a new ReportParameter with a name, multiple values, and a visibility flag.
+ The name of the parameter.
+ The values of the parameter.
+ Determines if the parameter is displayed in the user interface.
+
+
+ Gets or sets the name of the parameter.
+ A String value.
+
+
+ Gets a collection of String objects containing one or more values for the parameter.
+ A StringCollection object.
+
+
+ Determines whether the parameter can be displayed in the user interface.
+ A Boolean value.
+
+
+ Represents a collection of objects.
+
+
+ Initializes a new instance of the class.
+
+
+ Gets an object in the collection by its name.
+ A with the specified name, if found; otherwise, a null reference (Nothing in Visual Basic).
+ The name of the object to get. This is the value of the property.This parameter is not case sensitive.
+
+
+ Encapsulates information about report parameters.
+
+
+ Indicates whether an empty string is a valid value for the parameter. Read-only.
+ A read-only Boolean value.
+
+
+ Indicates whether the default values of the parameter are based on a query. Read-only.
+ A read-only Boolean value.
+
+
+ Indicates whether the parameter's valid values are based on a query. Read-only.
+ A read-only Boolean value.
+
+
+ Gets the data type of the parameter. Read-only.
+ A read-only value.
+
+
+ Gets a list of parameters whose values are used to retrieve additional parameter values in a query. Read-only.
+ A read-only .
+
+
+ A list of parameters that use the value of this parameter as parameters into queries to retrieve and/or .
+ A read-only .
+
+
+ Gets the error message that is returned when the parameter fails validation. Read-only.
+ A read-only String containing the text of the error message.
+
+
+ Indicates whether the parameter is used in a query to an external data source. Read-only.
+ A read-only Boolean value.
+
+
+ Indicates whether the parameter can be a multi-value parameter. Read-only.
+ A read-only Boolean value.
+
+
+ Gets the name of the parameter. Read-only.
+ A String containing the name of the parameter.
+
+
+ Indicates whether the value of the parameter can be null. Read-only.
+ A read-only Boolean value.
+
+
+ The text that prompts the user to provide parameter values.
+ A String containing the text of the prompt.
+
+
+ Indicates whether the user is prompted for the value of the parameter.
+ A read-only Boolean value.
+
+
+ Describes the state of the parameter. Read-only.
+ A read-only value.
+
+
+ Gets the available valid values for the parameter. Read-only.
+ A read-only array of objects.
+
+
+ Gets the values for the parameter.
+ A read-only list of String values.
+
+
+ Determines whether the parameter can be displayed in the user interface.
+ A Boolean value.
+
+
+ A collection of objects.
+
+
+ Returns a named item from the ReportParameterInfoCollection.
+ A object from the collection.
+ The name of the item to retrieve.
+
+
+ Provides data for the event.
+
+
+ Gets a value indicating whether the event is triggered by the automatic submission of report parameters due to dependencies between them.
+ true if the event is triggered by the automatic submission of report parameters; false if it is triggered by the user clicking the View Report button.
+
+
+ Gets the parameters from the parameter prompt area that are being submitted to the report server.
+ A object containing the parameter values submitted by the user.
+
+
+ Represents the callback method that will handle the event.
+ The source of the event.
+ A that contains the event data.
+
+
+ Provides data for the and events.
+
+
+ Gets or sets the printer settings to use for the current operation.
+ A object that contains the printer settings.
+
+
+ Represents the method that will handle the and events.
+ The source of the event.
+ A that contains the event data.
+
+
+ Represents the error that occurs when a report contains a security violation.
+
+
+ Specifies the credentials for the ReportViewer control to use when connecting to a report server.
+
+
+ Returns a Boolean value indicating whether forms authentication will be used when connecting to the report server, as well as information about the forms credentials to be used for authentication.
+ Returns true if forms authentication is to be used when connecting to the report server. Information about the credentials to be used for forms authentication is returned via the out parameters used in the method call.
+ [out] An authentication cookie used by the report server.
+ [out] The user name that will be used to connect to the report server.
+ [out] The password that will be used to connect to the report server.
+ [out] The authority to use when authenticating the user, for example, a Windows domain name.
+
+
+ Specifies that forms authentication is to be used when connecting to the report server and provides the forms credentials.
+ An authentication cookie used by the report server.
+ The user name that will be used to connect to the report server.
+ The password that will be used to connect to the report server.
+ The authority to use when authenticating the user, for example, a Windows domain name.
+
+
+ Specifies the user to impersonate when connecting to the report server.
+ A WindowsIdentity object encapsulating the user to impersonate when connecting to a report server.
+
+
+ Gets or sets the network credentials used for authentication with the report server.
+ A NetworkCredentials object containing the network credentials used for authentication with the report server.
+
+
+ Represents errors that occur while connecting to a report server and also errors that occur on the report server while processing a server report or rendering the report to the report page layout (RPL) format.
+
+
+ Returns the error code from the exception.
+ A String value containing the error code returned by the report server, or null if the connection attempt to the report server is unsuccessful.
+
+
+ Encapsulates the methods and properties used for the ReportViewer control.
+
+
+ Constructs a ReportViewer object.
+
+
+ Occurs when a user navigates back to a parent report from a drillthrough report.
+
+
+ Occurs when the user navigates to a bookmark in a report.
+
+
+ Occurs when a document map node is selected.
+
+
+ Occurs when a drillthrough item is selected in a report.
+
+
+ Occurs when a user clicks a hyperlink in a report.
+
+
+ Occurs when a user changes pages in a report.
+
+
+ Occurs when the margins or the page size for the current report in the ReportViewer control have changed.
+
+
+ Occurs when a user prints the report.
+
+
+ Occurs when the user clicks the Print button in the Print dialog box.
+
+
+ Occurs when the report in the ReportViewer begins rendering.
+
+
+ Occurs when the report finishes rendering.
+
+
+ Raised when an error occurs in the report.
+
+
+ Occurs when the user clicks the Export button.
+
+
+ Occurs when the report is refreshed.
+
+
+ This event occurs when the user clicks the Find or Find Next button, or when a search operation is invoked programmatically.
+
+
+ Occurs when the user activates a sort.
+
+
+ Occurs whenever the user interface state of the ReportViewer control changes.
+
+
+ Occurs when the user submits new data source credentials viaby using the built-in prompt area.
+
+
+ Occurs when parameter values are submitted to the report server.
+
+
+ Occurs when the user toggles the visibility of an item in the report.
+
+
+ Occurs when the user clicks the View button.
+
+
+ Occurs when the user changes the zoom level of the ReportViewer control.
+
+
+ A constant that represents the maximum number of pages in a report when the current page count mode is .
+
+
+ Stops background processing of the report.
+ A Boolean value. A value of true is returned if the background rendering has terminated. A value of false is returned if background rendering has not terminated after the amount of time specified in the millisecondsTimeout parameter has elapsed, or if the millisecondsTimeout parameter was set to 0.
+ The number of milliseconds to wait for the background rendering to terminate. A value of -1 waits forever. A value of 0 returns immediately without waiting for the rendering to terminate.
+
+
+ Clears the report view and fills it with the background color of the control.
+
+
+ Opens in the Exporting dialog box for a specific rendering extension.
+ if the user clicked the Cancel button; if the export operation failed; otherwise, .
+ The rendering extension to use for the export. Typically, youTo access the list of available rendering extensions, use using the ListRenderingExtensions method in or , depending on the processing mode (see ).
+
+
+ Opens in the export dialog box for a specific rendering extension.
+ if the user clicked the Cancel button; if the export operation failed; otherwise, .
+ The rendering extension to use for the export.Typically, youTo access the list of available rendering extensions, use using the ListRenderingExtensions method in or , depending on the processing mode (see ).
+ An XML string that contains the device-specific content that is required by the rendering extension specified in the format parameter. For more information about device information settings for specific output formats, see Device Information Settings in SQL Server Books Online.
+
+
+ Opens in the Exporting dialog box for a specific rendering extension and specifies device information and saves the exported report to a file with the specified file name.
+ if the user clicked the Cancel button; if the export operation failed; otherwise, .
+ The rendering extension to use for the export.To access the list of available rendering extensions, use the ListRenderingExtensions method in or , depending on the processing mode (see ).
+ An XML string that contains the device-specific content that is required by the rendering extension specified in the format parameter. For more information about device information settings for specific output formats, see Device Information Settings in SQL Server Books Online.
+ The name of the exported file. The user is prompted for a file name if this parameter is null.
+
+
+ Searches the report for the specified text string.
+ An integer value containing the page number on which the search string was found, or 0 if the search string was not found.
+ The search string.
+ The page number on which to start searching.
+
+
+ Continues the search for the specified text string.
+ An integer value containing the page number on which the search string was found, or 0 if the search string was not found.
+
+
+ Returns the page settings that are used to print the current report in the ReportViewer control or display it in print layout mode.
+ A object that contains the page settings that are used to print the current report in the ReportViewer control or display it in print layout mode, or null if the ReportViewer control has not yet processed a report.
+
+
+ Returns the total number of pages in the report.
+ An integer value containing the total number of pages in the report.
+
+
+ Returns the page count of the report and a value that indicates whether the page count is estimated or actual.
+ An integer value containing the total number of pages in the report.
+ [out] A enumeration value that indicates whether the return value should be treated as an estimate or actual page count. This value is always when is .
+
+
+ Moves the report to the specified bookmark.
+ The ID of the bookmark.
+
+
+ Moves to the specified area of the document map.
+ The ID of the document map node.
+
+
+ Opens the page setup dialog box.
+ A enumeration value. Possible values are and depending on how the user closed the dialog box.
+
+
+ Navigates the report viewer control back to the parent report from a drillthrough report.
+
+
+ Displays the Print dialog box.
+ if the user clicked the Cancel button or if the event is cancelled; if the user clicked the OK button.
+
+
+ Displays the Print dialog box.
+ if the user clicked the Cancel button or if the event is cancelled; if the user clicked the OK button.
+ A object, used to initialize the dialog box. Unlike in the , this object's page ranged properties, such as the , , and properties, are used by the ReportViewer to initialize the print range in the Print dialog box.
+
+
+ Causes the current report in the Report Viewer to be processed and rendered.
+
+
+ Resets the control to its default values.
+
+
+ Reverts the page settings for the current report in the ReportViewer control to the settings in the report definition.
+
+
+ Sets the control display to normal or print preview mode.
+ A enumeration value specifying which display mode to use. Valid values are Normal or PrintLayout.
+
+
+ Sets the page settings that are used to print the current report in the ReportViewer control or display it in print layout mode.
+ A object that contains the new page settings.This parameter must not be null.
+
+
+ Gets or sets the background color of the control's report area.
+ A value indicating the background color of the control's report area.
+
+
+ Gets or sets the background image of the ReportViewer control.
+ An Image object containing the background image for the control.
+
+
+ Gets or sets the layout for the background image of the ReportViewer control.
+ An ImageLayout object containing the layout for the background image of the ReportViewer control.
+
+
+ Gets or sets the border style of the ReportViewer control.
+ A BorderStyle value.
+
+
+ Gets or sets the current page of the ReportViewer control's active report.
+ An integer value containing the current page of the report. The default value is 0.
+
+
+ Gets a object that indicates which operations can currently be performed on the ReportViewer control, the status of the prompt area, and the status of the document map area.
+ A object.
+
+
+ Gets a value that indicates the current display mode of the ReportViewer control.
+ A object. The default value is .
+
+
+ Gets or sets the collapsed state of the document map.
+ A Boolean value. A value of true indicates that the document map is collapsed. The default value is false.
+
+
+ Gets or sets the width of the document map in pixels.
+ An integer value containing the width of the document map in pixels. The default value is 40.
+
+
+ Indicates whether the size of the document map panel is fixed or changes when the viewer resizes.
+ A Boolean value indicating whether the size of the document map panel is fixed. The default value is true.
+
+
+ Gets or sets a Boolean value that indicates whether to keep the report server session from expiring as long as ReportViewer is running.
+ true to keep the report server session from expiring; otherwise false. The default is true.
+
+
+ Returns the local report in the ReportViewer control.
+ A object containing the local report in the ReportViewer control.
+
+
+ Gets or sets an object that contains custom messages for use by the ReportViewer control.
+ An object that implements the interface.
+
+
+ Gets or sets a enumeration value that indicates the default page count mode to use when rendering a report in the report area.
+ A object. The default value is .
+
+
+ Gets or sets a object that contains the settings for the default printer and print options that are used to initialize the Print dialog and the printer's Preferences dialog.
+ A object.
+
+
+ Gets or sets the processing mode of the ReportViewer control.
+ A enumerator value of either Local or Remote. The default value is Local.
+
+
+ Gets or sets the collapsed state of the parameter prompt area or the credentials prompt area.
+ true if the prompt area is collapsed; otherwise, false. The default is false.
+
+
+ Gets the search text and the start page of the current report search operation.
+ A object, or null if there is not an ongoing report search operation.
+
+
+ Gets a server report in the Report Viewer.
+ A object containing the server report in the Report Viewer.
+
+
+ Indicates whether the Back button is visible on the control.
+ A Boolean value indicating the visibility of the Back button. The default is value true.
+
+
+ Indicates whether the Context menu is visible.
+ A Boolean value. The default is value true.
+
+
+ Indicates whether prompts for user credentials will be displayed.
+ A Boolean value. The default value is true.
+
+
+ Indicates whether the button that shows and collapses the document map is visible on the split bar.
+ true if the button is visible on the split bar; otherwise, false. The default is true.
+
+
+ Indicates whether the Export button is visible on the control.
+ A Boolean value. The default value is true.
+
+
+ Indicates whether the Find text box is visible on the control.
+ A Boolean value. The default value is true.
+
+
+ Indicates whether the page navigation controls are visible.
+ A Boolean value. The default value is true.
+
+
+ Indicates whether parameter prompts are visible.
+ A Boolean value. The default value is true.
+
+
+ Gets or sets a value that indicates whether the Print button is visible.
+ true if the buttons for the print functions are visible; otherwise, false. The default is true.
+
+
+ Indicates whether progress animation is displayed during report processing.
+ A Boolean value. The default value is true.
+
+
+ Indicates whether the button that shows and collapses the prompt area is visible on the split bar.
+ true if the button is visible on the split bar; otherwise, false. The default is true.
+
+
+ Indicates whether the Refresh button is visible.
+ A Boolean value. The default value is true.
+
+
+ Indicates whether the Stop button is visible.
+ A Boolean value. The default value is true.
+
+
+ Indicates whether the Toolbar is visible.
+ A Boolean value. The default value is true.
+
+
+ Indicates whether the Zoom list box is visible.
+ A Boolean value. The default value is true.
+
+
+ Gets or sets the used to customize the look and feel of the ReportViewer control's toolbar as well as the context menu on the report.
+ A object. By default, a object is returned.
+
+
+ Gets or sets the delay in milliseconds before the busy status indicator is displayed to the user.
+ An int value that specifies the time in milliseconds. The default value is 1000 (1 second).
+
+
+ Gets the page zoom that is calculated based on the zoom mode.
+ An integer that represents the calculated zoom percentage. The default value is 100.
+
+
+ Gets or sets the zoom mode of the control.
+ A enumerator value indicating the zoom mode of the control. The default value is 100%.
+
+
+ Gets or sets the percentage of zoom used for the report display.
+ An integer value containing the percentage of zoom.
+
+
+ Represents a collection of objects.
+
+
+ Represents errors that occur while viewing or configuring a report.
+
+
+ This constructor supports the .NET Framework infrastructure and is not intended to be used directly from your code.
+
+
+ This constructor supports the .NET Framework infrastructure and is not intended to be used directly from your code.
+
+
+ Represents a collection of strings that contain custom headers.
+
+
+ Contains a set of read-only properties that indicate which operations are currently allowed in the ReportViewer control and the status of the prompt and document map areas.
+
+
+ Gets a Boolean value that indicates whether the prompt area of the ReportViewer control is currently visible.
+ true if the prompt area is currently visible; otherwise, false.
+
+
+ Gets a Boolean value that indicates whether the ReportViewer control has not started processing the report or has completed processing the report, and can change the display mode without canceling a report processing operation.
+ true if the ReportViewer control can change the display mode without canceling a report processing operation; otherwise, false.
+
+
+ Gets a Boolean value that indicates whether the currently displayed content will be affected by a zoom change.
+ true if the currently displayed content will be affected by a zoom change; otherwise, false.
+
+
+ Gets a Boolean value that indicates whether there is a previous search to continue and whether you can continue the previous search without canceling an existing report processing or interactive rendering operation.
+ true if the there is a previous search to continue and if you can continue the previous search without canceling an existing report processing or interactive rendering operation; otherwise, false.
+
+
+ Gets a Boolean value that indicates whether the report can be exported without canceling an existing report processing or interactive rendering operation.
+ true if the report can be exported without canceling an existing report processing or interactive rendering operation; otherwise, false.
+
+
+ Gets a Boolean value that indicates whether the current report is a drillthrough report and you can navigate back to its parent report without canceling an existing report processing or interactive rendering operation.
+ true if the current report is a drillthrough report and you can navigate back to its parent report without canceling an existing report processing or interactive rendering operation; otherwise, false.
+
+
+ Gets a Boolean value that indicates whether the property can be changed without canceling an existing report processing or interactive rendering operation.
+ true if the property can be changed without canceling an existing report processing or interactive rendering operation; otherwise, false.
+
+
+ Gets a Boolean value that indicates whether you can start printing the report without canceling an existing report processing or interactive rendering operation.
+ true if you can start printing the report without canceling an existing report processing or interactive rendering operation; otherwise, false.
+
+
+ Gets a Boolean value that indicates whether you can refresh the report data without cancelling an existing report processing or interactive rendering operation.
+ true if you can refresh the report data without canceling an existing report processing or interactive rendering operation; otherwise, false.
+
+
+ Gets a Boolean value that indicates whether you can search the report and highlight the search results without canceling an existing report processing or interactive rendering operation.
+ true if the you can search the report and highlight the search results without canceling an existing report processing or interactive rendering operation; otherwise, false.
+
+
+ Gets a Boolean value that indicates whether prompted parameters and prompted data source credentials can be submitted for the current report without canceling an existing report processing or interactive rendering operation.
+ true if prompted parameters and prompted data source credentials can be submitted for the current report without canceling an existing report processing or interactive rendering operation; otherwise, false.
+
+
+ Gets a Boolean value that indicates whether the current report has a document map and the document map can be displayed in the current display mode.
+ true if the current report has a document map and the document map can be displayed in the current display mode; otherwise, false.
+
+
+ Gets a Boolean value that indicates whether prompting is supported and there are prompts that can be displayed based on the visibility settings in the ReportViewer control. This property does not indicate whether the prompt areas are actually visible.
+ true if prompting is supported and there are prompts that can be displayed based on the visibility settings in the ReportViewer control; otherwise, false.
+
+
+ Gets a Boolean value that indicates whether ReportViewer is currently performing a potentially lengthy operation that can be canceled.
+ true if ReportViewer is currently performing a potentially lengthy operation that can be canceled; otherwise, false.
+
+
+ Gets a Boolean value that indicates whether the report has a document map and the document map is currently displayed.
+ true if the report has a document map and the document map is currently displayed; otherwise, false.
+
+
+ Gets a Boolean value that indicates whether the current processing mode supports prompting for parameters and data source credentials.
+ true if the current processing mode supports prompting for parameters and data source credentials; otherwise, false.
+
+
+ Provides data for a event in the ReportViewer control.
+
+
+ Constructs a SearchEventArgs object.
+ The search string.
+ The page on which to start searching.
+ Indicates that this event is occurring as a result of a Find Next command.
+
+
+ Indicates that this event is occurring as a result of a Find Next command.
+ A Boolean value. A value of true indicates that this event occurred because of a Find Next command.
+
+
+ Returns the search string being used for the search.
+ A String value containing the search string.
+
+
+ Returns the page number on which to start searching.
+ An integer containing the starting page number to search.
+
+
+ Represents the method that will handle a event.
+ The object that raised the event.
+ A object that contains information about the event.
+
+
+ Contains the search text and the start page of a search operation.
+
+
+ Gets the start page of the search operation.
+ An int value that represents the start page of the search operation.
+
+
+ Gets the search text.
+ A string that represents the search text.
+
+
+ Represents a report that is processed on the report server.
+
+
+ Initializes a new instance of the class.
+
+
+ Retrieves information about the data sources used for a report.
+ A that contains objects.
+
+
+ Retrieves information about the data sources used for a report, including whether all required credentials have been supplied for the report data sources.
+ A containing objects.
+ [out] Indicates whether all required credentials have been supplied for the data sources used by the server report.
+
+
+ Gets the default page settings specified in the report definition.
+ A object containing the default page settings for the local report.
+
+
+ Returns the current execution ID, or null (Nothing in Visual Basic) if no execution ID is available.
+ A String containing the execution ID.
+
+
+ Returns report parameter properties for the report.
+ A object containing an array of objects.
+
+
+ Returns the version of the report server.
+ A String value containing the server version information.
+
+
+ Returns the total number of soft pages in the report and a value that indicates the current page count mode.
+ An integer value containing the total number of soft pages in the report. For more information on soft pages, see Understanding Rendering Behaviors.
+ [out] A enumeration value that indicates the page count mode used to calculate the total number of soft pages.
+
+
+ Indicates whether the report can execute queries.
+ A Boolean value indicating whether the report can execute queries.
+
+
+ Returns all available rendering extensions for the server report.
+ An array of objects.
+
+
+ Loads the report definition on the report server for remote processing using a .
+ A class that can be used to read the Report Definition Language (RDL) file for the report.
+
+
+ Causes the report to be rendered with new data.
+
+
+ Renders the report with optional URL access parameters.
+ A containing the rendered report.
+ The format in which to render the report. This argument maps to a rendering extension. You can use any rendering extension available on the report server.To access the list of available rendering extensions, use the method.
+ An XML string that contains the device-specific content that is required by the rendering extension specified in the format parameter. For more information about device information settings for specific output formats, see Device Information Settings in SQL Server Books Online.
+ URL access parameters to pass to the report server. For more information, see the URL Access documentation in SQL Server Books Online.This parameter may be set to null.
+ [out] The MIME type of the rendered report.
+ [out] The file name extension used for the output file.
+
+
+ Renders the report with optional URL access parameters.
+ The format in which to render the report. This argument maps to a rendering extension. You can use any rendering extension available on the report server.To access the list of available rendering extensions, use the method.
+ An XML string that contains the device-specific content that is required by the rendering extension specified in the format parameter. For more information about device information settings for specific output formats, see Device Information Settings in SQL Server Books Online.
+ URL access parameters to pass to the report server. For more information, see the URL Access documentation in SQL Server Books Online.This parameter may be set to null.
+ The stream into which the rendered report will be written.
+ [out] The MIME type of the rendered report.
+ [out] The file name extension used for the output file.
+
+
+ Processes the report with the specified valuevalue and renders it in the specified format.
+ A array of the report in the specified format.
+ The format in which to render the report. This argument maps to a rendering extension. You can use any formatting extension available on the report server.To access the list of available rendering extensions, use the method.
+ An XML string that contains the device-specific content that is required by the rendering extension specified in the format parameter. For more information about device information settings for specific output formats, see Device Information Settings in SQL Server Books Online.
+ A enumeration value that specifies the page count mode.
+ [out] The MIME type of the rendered report.
+ [out] The encoding used when rendering the contents of the report.
+ [out] The file name extension used for the output file.
+ [out] The stream identifiers. You can use them to render external resources (images, for example) that are associated with the report.
+ [out] An array of objects that describes any warnings that occurred during report processing.
+
+
+ Returns a secondary stream associated with a processed report.
+ A array of the stream in the specified format. For more information about this data type, see "Byte Structure" in the .NET Framework documentation.
+ The format in which to render the stream. This argument maps to a rendering extension. You can use any rendering extension available on the report server.To access the list of available rendering extensions, use the method.
+ The stream identifier.
+ An XML string that contains the device-specific content that is required by the rendering extension specified in the format parameter. For more information about device information settings for specific output formats, see Device Information Settings in SQL Server Books Online.
+ The MIME type of the stream.
+ The Microsoft .NET Framework encoding class name.
+
+
+ Sets data source credentials for the report.
+ A set of data source credentials to submit to the report server.
+
+
+ Initializes a server report using a specific report execution on the server.
+ A String containing the execution ID to use.
+
+
+ Sets report parameter properties for the report.
+ An of objects that contains a list of the report parameters properties.
+
+
+ Gets a collection of objects. The object uses the cookies in this collection when making server requests.
+ A object that contains a collection of objects.
+
+
+ Gets a collection of strings that contain custom headers.
+ A object that contains a collection custom headers.
+
+
+ Gets or sets the unique identifier of the report history snapshot used for the server report.
+ A String value containing the unique identifier of the report history snapshot used for the server report.
+
+
+ Gets or sets the path to the report on the server.
+ A String value.
+
+
+ Gets or sets credentials to be used with the report server.
+ A object containing the credentials to be used with the report server.
+
+
+ Gets or sets the URL for the report server.
+ A object containing the URL for the report server.
+
+
+ Gets or sets the number of milliseconds to wait for server communications.
+ An integer value that contains the server time-out, in milliseconds. The default value is 600000 milliseconds.
+
+
+ Specifies the severity of a warning.
+
+
+ The severity level of the warning is Error.
+
+
+ The severity level of the warning is Warning.
+
+
+ Represents the exception that occurs when the report server version is not compatible with the report control.
+
+
+ Provides data for the event.
+
+
+ Constructs a SortEventArgs object.
+ The ID of the sort action.
+ A enumeration value that indicates the direction of the sort. The default value is None.
+ A Boolean value that indicates whether all other existing sorts should be cleared. The default is false.
+
+
+ Indicates whether all other existing sorts should be cleared.
+ A Boolean value that indicates whether all other existing sorts should be cleared. The default is false.
+
+
+ Gets an enumeration value that indicates the direction of the sort.
+ A enumeration value that indicates the direction of the sort.
+
+
+ Gets the unique identifier of the sort action.
+ A String containing the ID of the sort action.
+
+
+ Represents the method that will handle the event of a .
+ The object raising the event.
+ A object containing information about the event.
+
+
+ Indicates the direction of a sort operation.
+
+
+ Indicates an ascending sort.
+
+
+ Indicates a descending sort.
+
+
+ Provides data for the event.
+
+
+ Gets the list of data source names for the subreport.
+ A list of String objects containing the names of the data sources for the subreport.
+
+
+ Returns a collection of data sources for the subreport.
+ A collection of objects.
+
+
+ Gets a collection of parameters for the subreport.
+ A containing information about the subreport parameters.
+
+
+ Returns the name of the subreport.
+ A string containing the name of the subreport.
+
+
+ Represents the method that will handle the event of a .
+ The object that raised the event.
+ A object containing information about the event.
+
+
+ Represents a possible valid value for a parameter.
+
+
+ Gets a label for the valid value.
+ A read-only String object.
+
+
+ Gets a valid value.
+ A read-only String object.
+
+
+ Represents a list of errors or warnings that are returned when a report is rendered or processed.
+
+
+ Gets the error code that is assigned to the warning. Read-only.
+ A read-only string value.
+
+
+ Gets a message that describes the error or warning. Read-only.
+ A read-only string value.
+
+
+ Gets the name of the object in the report definition that contributed to the warning. Read-only.
+ A read-only string value.
+
+
+ Gets the type of object in the report definition that caused the error or warning. Read-only.
+ A read-only string value.
+
+
+ Gets the severity type of the error or warning. Read-only.
+ A read-only string value.
+
+
+ Represents the method that will handle the event of a .
+ The object raising the event.
+ A object containing information about the event.
+
+
+ Provides data for a event.
+
+
+ Constructs a new ZoomChangeEventArgs object.
+ A enumerator value specifying the zoom mode selected.
+ An integer specifying the selected percentage of zoom.
+
+
+ Gets the zoom mode select for the event.
+ A enumerator value specifying the zoom mode selected.
+
+
+ Gets the zoom percentage value specified for the event.
+ An integer specifying the selected percentage of zoom.
+
+
+ Specifies the zoom mode for the ReportViewer control.
+
+
+ Sets the zoom mode to full page.
+
+
+ Sets the zoom mode to page width.
+
+
+ Sets the zoom mode to a percentage.
+
+
+
\ No newline at end of file
diff --git a/SCADA/Example/System.Windows.Interactivity.dll b/SCADA/Example/System.Windows.Interactivity.dll
new file mode 100644
index 0000000..0419e95
Binary files /dev/null and b/SCADA/Example/System.Windows.Interactivity.dll differ
diff --git a/SCADA/Example/System.Windows.Interactivity.xml b/SCADA/Example/System.Windows.Interactivity.xml
new file mode 100644
index 0000000..10cdad6
--- /dev/null
+++ b/SCADA/Example/System.Windows.Interactivity.xml
@@ -0,0 +1,1072 @@
+
+
+
+ System.Windows.Interactivity
+
+
+
+
+ Represents a collection of IAttachedObject with a shared AssociatedObject and provides change notifications to its contents when that AssociatedObject changes.
+
+
+
+
+ An interface for an object that can be attached to another object.
+
+
+
+
+ Attaches to the specified object.
+
+ The object to attach to.
+
+
+
+ Detaches this instance from its associated object.
+
+
+
+
+ Gets the associated object.
+
+ The associated object.
+ Represents the object the instance is attached to.
+
+
+
+ Initializes a new instance of the class.
+
+ Internal, because this should not be inherited outside this assembly.
+
+
+
+ Called immediately after the collection is attached to an AssociatedObject.
+
+
+
+
+ Called when the collection is being detached from its AssociatedObject, but before it has actually occurred.
+
+
+
+
+ Called when a new item is added to the collection.
+
+ The new item.
+
+
+
+ Called when an item is removed from the collection.
+
+ The removed item.
+
+
+ Cannot add the instance to a collection more than once.
+
+
+
+ Attaches to the specified object.
+
+ The object to attach to.
+ The IAttachedObject is already attached to a different object.
+
+
+
+ Detaches this instance from its associated object.
+
+
+
+
+ The object on which the collection is hosted.
+
+
+
+
+ Gets the associated object.
+
+ The associated object.
+
+
+
+ Encapsulates state information and zero or more ICommands into an attachable object.
+
+ The type the can be attached to.
+
+ Behavior is the base class for providing attachable state and commands to an object.
+ The types the Behavior can be attached to can be controlled by the generic parameter.
+ Override OnAttached() and OnDetaching() methods to hook and unhook any necessary handlers
+ from the AssociatedObject.
+
+
+
+
+ Encapsulates state information and zero or more ICommands into an attachable object.
+
+ This is an infrastructure class. Behavior authors should derive from Behavior<T> instead of from this class.
+
+
+
+ Called after the behavior is attached to an AssociatedObject.
+
+ Override this to hook up functionality to the AssociatedObject.
+
+
+
+ Called when the behavior is being detached from its AssociatedObject, but before it has actually occurred.
+
+ Override this to unhook functionality from the AssociatedObject.
+
+
+
+ Attaches to the specified object.
+
+ The object to attach to.
+ The Behavior is already hosted on a different element.
+ dependencyObject does not satisfy the Behavior type constraint.
+
+
+
+ Detaches this instance from its associated object.
+
+
+
+
+ The type to which this behavior can be attached.
+
+
+
+
+ Gets the object to which this behavior is attached.
+
+
+
+
+ Gets the associated object.
+
+ The associated object.
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Gets the object to which this is attached.
+
+
+
+
+ Represents a collection of behaviors with a shared AssociatedObject and provides change notifications to its contents when that AssociatedObject changes.
+
+
+
+
+ Initializes a new instance of the class.
+
+ Internal, because this should not be inherited outside this assembly.
+
+
+
+ Called immediately after the collection is attached to an AssociatedObject.
+
+
+
+
+ Called when the collection is being detached from its AssociatedObject, but before it has actually occurred.
+
+
+
+
+ Called when a new item is added to the collection.
+
+ The new item.
+
+
+
+ Called when an item is removed from the collection.
+
+ The removed item.
+
+
+
+ Creates a new instance of the BehaviorCollection.
+
+ The new instance.
+
+
+
+ Enumerates possible values for reusable property value editors.
+
+
+
+
+ Uses the element picker, if supported, to edit this property at design time.
+
+
+
+
+ Uses the storyboard picker, if supported, to edit this property at design time.
+
+
+
+
+ Uses the state picker, if supported, to edit this property at design time.
+
+
+
+
+ Uses the element-binding picker, if supported, to edit this property at design time.
+
+
+
+
+ Uses the property-binding picker, if supported, to edit this property at design time.
+
+
+
+
+ Associates the given editor type with the property on which the CustomPropertyValueEditor is applied.
+
+ Use this attribute to get improved design-time editing for properties that denote element (by name), storyboards, or states (by name).
+
+
+
+ Initializes a new instance of the class.
+
+ The custom property value editor.
+
+
+
+ Gets or sets the custom property value editor.
+
+ The custom property value editor.
+
+
+
+ Provides design tools information about what to instantiate for a given action or command.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The type this attribute applies to.
+ The type of to instantiate.
+ A single argument for the specified .
+ is not derived from TriggerBase.
+ This constructor is useful if the specifed has a single argument. The
+ resulting code will be CLS compliant.
+
+
+
+ Initializes a new instance of the class.
+
+ The type this attribute applies to.
+ The type of to instantiate.
+ The constructor arguments for the specified .
+ is not derived from TriggerBase.
+
+
+
+ Instantiates this instance.
+
+ The specified by the DefaultTriggerAttribute.
+
+
+
+ Gets the type that this DefaultTriggerAttribute applies to.
+
+ The type this DefaultTriggerAttribute applies to.
+
+
+
+ Gets the type of the to instantiate.
+
+ The type of the to instantiate.
+
+
+
+ Gets the parameters to pass to the constructor.
+
+ The parameters to pass to the constructor.
+
+
+
+ This method will use the VisualTreeHelper.GetParent method to do a depth first walk up
+ the visual tree and return all ancestors of the specified object, including the object itself.
+
+ The object in the visual tree to find ancestors of.
+ Returns itself an all ancestors in the visual tree.
+
+
+
+ EventObserver is designed to help manage event handlers by detatching when disposed. Creating this object will also attach in the constructor.
+
+
+
+
+ Creates an instance of EventObserver and attaches to the supplied event on the supplied target. Call dispose to detach.
+
+ The event to attach and detach from.
+ The target object the event is defined on. Null if the method is static.
+ The delegate to attach to the event.
+
+
+
+ Detaches the handler from the event.
+
+
+
+
+ A trigger that listens for a specified event on its source and fires when that event is fired.
+
+
+
+
+ Represents a trigger that can listen to an element other than its AssociatedObject.
+
+ The type that this trigger can be associated with.
+
+ EventTriggerBase extends TriggerBase to add knowledge of another object than the one it is attached to.
+ This allows a user to attach a Trigger/Action pair to one element and invoke the Action in response to a
+ change in another object somewhere else. Override OnSourceChanged to hook or unhook handlers on the source
+ element, and OnAttached/OnDetaching for the associated element. The type of the Source element can be
+ constrained by the generic type parameter. If you need control over the type of the
+ AssociatedObject, set a TypeConstraintAttribute on your derived type.
+
+
+
+
+ Represents a trigger that can listen to an object other than its AssociatedObject.
+
+ This is an infrastructure class. Trigger authors should derive from EventTriggerBase<T> instead of this class.
+
+
+
+ Represents an object that can invoke Actions conditionally.
+
+ This is an infrastructure class. Trigger authors should derive from Trigger<T> instead of this class.
+
+
+
+ Invoke all actions associated with this trigger.
+
+ Derived classes should call this to fire the trigger.
+
+
+
+ Called after the trigger is attached to an AssociatedObject.
+
+
+
+
+ Called when the trigger is being detached from its AssociatedObject, but before it has actually occurred.
+
+
+
+
+ Creates a new instance of the TriggerBase derived class.
+
+ The new instance.
+
+
+
+ Attaches to the specified object.
+
+ The object to attach to.
+ Cannot host the same trigger on more than one object at a time.
+ dependencyObject does not satisfy the trigger type constraint.
+
+
+
+ Detaches this instance from its associated object.
+
+
+
+
+ Gets the object to which the trigger is attached.
+
+ The associated object.
+
+
+
+ Gets the type constraint of the associated object.
+
+ The associated object type constraint.
+
+
+
+ Gets the actions associated with this trigger.
+
+ The actions associated with this trigger.
+
+
+
+ Event handler for registering to PreviewInvoke.
+
+
+
+
+ Gets the associated object.
+
+ The associated object.
+
+
+
+ Specifies the name of the Event this EventTriggerBase is listening for.
+
+
+
+
+
+ Called when the event associated with this EventTriggerBase is fired. By default, this will invoke all actions on the trigger.
+
+ The instance containing the event data.
+ Override this to provide more granular control over when actions associated with this trigger will be invoked.
+
+
+
+ Called when the source changes.
+
+ The old source.
+ The new source.
+ This function should be overridden in derived classes to hook functionality to and unhook functionality from the changing source objects.
+
+
+
+ Called after the trigger is attached to an AssociatedObject.
+
+
+
+
+ Called when the trigger is being detached from its AssociatedObject, but before it has actually occurred.
+
+
+
+ Could not find eventName on the Target.
+
+
+
+ Gets the type constraint of the associated object.
+
+ The associated object type constraint.
+ Define a TypeConstraintAttribute on a derived type to constrain the types it may be attached to.
+
+
+
+ Gets the source type constraint.
+
+ The source type constraint.
+
+
+
+ Gets or sets the target object. If TargetObject is not set, the target will look for the object specified by TargetName. If an element referred to by TargetName cannot be found, the target will default to the AssociatedObject. This is a dependency property.
+
+ The target object.
+
+
+
+ Gets or sets the name of the element this EventTriggerBase listens for as a source. If the name is not set or cannot be resolved, the AssociatedObject will be used. This is a dependency property.
+
+ The name of the source element.
+
+
+
+ Gets the resolved source. If is not set or cannot be resolved, defaults to AssociatedObject.
+
+ The resolved source object.
+ In general, this property should be used in place of AssociatedObject in derived classes.
+ The element pointed to by does not satisify the type constraint.
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Called when the source property changes.
+
+ Override this to hook functionality to and unhook functionality from the specified source, rather than the AssociatedObject.
+ The old source.
+ The new source.
+
+
+
+ Gets the resolved source. If is not set or cannot be resolved, defaults to AssociatedObject.
+
+ The resolved source object.
+ In general, this property should be used in place of AssociatedObject in derived classes.
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+ Name of the event.
+
+
+
+ Gets or sets the name of the event to listen for. This is a dependency property.
+
+ The name of the event.
+
+
+
+ Static class that owns the Triggers and Behaviors attached properties. Handles propagation of AssociatedObject change notifications.
+
+
+
+
+ This property is used as the internal backing store for the public Triggers attached property.
+
+
+ This property is not exposed publicly. This forces clients to use the GetTriggers and SetTriggers methods to access the
+ collection, ensuring the collection exists and is set before it is used.
+
+
+
+
+ This property is used as the internal backing store for the public Behaviors attached property.
+
+
+ This property is not exposed publicly. This forces clients to use the GetBehaviors and SetBehaviors methods to access the
+ collection, ensuring the collection exists and is set before it is used.
+
+
+
+
+ Gets the TriggerCollection containing the triggers associated with the specified object.
+
+ The object from which to retrieve the triggers.
+ A TriggerCollection containing the triggers associated with the specified object.
+
+
+
+ Gets the associated with a specified object.
+
+ The object from which to retrieve the .
+ A containing the behaviors associated with the specified object.
+
+
+ Cannot host the same BehaviorCollection on more than one object at a time.
+
+
+ Cannot host the same TriggerCollection on more than one object at a time.
+
+
+
+ A helper function to take the place of FrameworkElement.IsLoaded, as this property is not available in Silverlight.
+
+ The element of interest.
+ True if the element has been loaded; otherwise, False.
+
+
+
+ Gets or sets a value indicating whether to run as if in design mode.
+
+
+ True if [should run in design mode]; otherwise, False.
+
+ Not to be used outside unit tests.
+
+
+
+ Executes a specified ICommand when invoked.
+
+
+
+
+ Represents an attachable object that encapsulates a unit of functionality.
+
+ The type to which this action can be attached.
+
+
+
+ Represents an attachable object that encapsulates a unit of functionality.
+
+ This is an infrastructure class. Action authors should derive from TriggerAction<T> instead of this class.
+
+
+
+ Attempts to invoke the action.
+
+ The parameter to the action. If the action does not require a parameter, the parameter may be set to a null reference.
+
+
+
+ Invokes the action.
+
+ The parameter to the action. If the action does not require a parameter, the parameter may be set to a null reference.
+
+
+
+ Called after the action is attached to an AssociatedObject.
+
+
+
+
+ Called when the action is being detached from its AssociatedObject, but before it has actually occurred.
+
+
+
+
+ When implemented in a derived class, creates a new instance of the derived class.
+
+ The new instance.
+
+
+
+ Attaches to the specified object.
+
+ The object to attach to.
+ Cannot host the same TriggerAction on more than one object at a time.
+ dependencyObject does not satisfy the TriggerAction type constraint.
+
+
+
+ Detaches this instance from its associated object.
+
+
+
+
+ Gets or sets a value indicating whether this action will run when invoked. This is a dependency property.
+
+
+ True if this action will be run when invoked; otherwise, False.
+
+
+
+
+ Gets the object to which this action is attached.
+
+ The associated object.
+
+
+
+ Gets the associated object type constraint.
+
+ The associated object type constraint.
+
+
+
+ Gets or sets a value indicating whether this instance is attached.
+
+ True if this instance is attached; otherwise, False.
+
+
+
+ Gets the associated object.
+
+ The associated object.
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Gets the object to which this is attached.
+
+ The associated object.
+
+
+
+ Gets the associated object type constraint.
+
+ The associated object type constraint.
+
+
+
+ Invokes the action.
+
+ The parameter to the action. If the action does not require a parameter, the parameter may be set to a null reference.
+
+
+
+ Gets or sets the name of the command this action should invoke.
+
+ The name of the command this action should invoke.
+ This property will be superseded by the Command property if both are set.
+
+
+
+ Gets or sets the command this action should invoke. This is a dependency property.
+
+ The command to execute.
+ This property will take precedence over the CommandName property if both are set.
+
+
+
+ Gets or sets the command parameter. This is a dependency property.
+
+ The command parameter.
+ This is the value passed to ICommand.CanExecute and ICommand.Execute.
+
+
+
+ Provides data about which objects were affected when resolving a name change.
+
+
+
+
+ Helper class to handle the logic of resolving a TargetName into a Target element
+ based on the context provided by a host element.
+
+
+
+
+ Attempts to update the resolved object from the name within the context of the namescope reference element.
+
+ The old resolved object.
+
+ Resets the existing target and attempts to resolve the current TargetName from the
+ context of the current Host. If it cannot resolve from the context of the Host, it will
+ continue up the visual tree until it resolves. If it has not resolved it when it reaches
+ the root, it will set the Target to null and write a warning message to Debug output.
+
+
+
+
+ Occurs when the resolved element has changed.
+
+
+
+
+ Gets or sets the name of the element to attempt to resolve.
+
+ The name to attempt to resolve.
+
+
+
+ The resolved object. Will return the reference element if TargetName is null or empty, or if a resolve has not been attempted.
+
+
+
+
+ Gets or sets the reference element from which to perform the name resolution.
+
+ The reference element.
+
+
+
+ Gets or sets a value indicating whether the reference element load is pending.
+
+
+ True if [pending reference element load]; otherwise, False.
+
+
+ If the Host has not been loaded, the name will not be resolved.
+ In that case, delay the resolution and track that fact with this property.
+
+
+
+
+ Represents an action that can be targeted to affect an object other than its AssociatedObject.
+
+ The type constraint on the target.
+
+ TargetedTriggerAction extends TriggerAction to add knowledge of another element than the one it is attached to.
+ This allows a user to invoke the action on an element other than the one it is attached to in response to a
+ trigger firing. Override OnTargetChanged to hook or unhook handlers on the target element, and OnAttached/OnDetaching
+ for the associated element. The type of the Target element can be constrained by the generic type parameter. If
+ you need control over the type of the AssociatedObject, set a TypeConstraintAttribute on your derived type.
+
+
+
+
+ Represents an action that can be targeted to affect an object other than its AssociatedObject.
+
+ This is an infrastructure class. Action authors should derive from TargetedTriggerAction<T> instead of this class.
+
+
+
+ Called when the target changes.
+
+ The old target.
+ The new target.
+ This function should be overriden in derived classes to hook and unhook functionality from the changing source objects.
+
+
+
+ Called after the action is attached to an AssociatedObject.
+
+
+
+
+ Called when the action is being detached from its AssociatedObject, but before it has actually occurred.
+
+
+
+
+ Gets or sets the target object. If TargetObject is not set, the target will look for the object specified by TargetName. If an element referred to by TargetName cannot be found, the target will default to the AssociatedObject. This is a dependency property.
+
+ The target object.
+
+
+
+ Gets or sets the name of the object this action targets. If Target is set, this property is ignored. If Target is not set and TargetName is not set or cannot be resolved, the target will default to the AssociatedObject. This is a dependency property.
+
+ The name of the target object.
+
+
+
+ Gets the target object. If TargetObject is set, returns TargetObject. Else, if TargetName is not set or cannot be resolved, defaults to the AssociatedObject.
+
+ The target object.
+ In general, this property should be used in place of AssociatedObject in derived classes.
+ The Target element does not satisfy the type constraint.
+
+
+
+ Gets the associated object type constraint.
+
+ The associated object type constraint.
+ Define a TypeConstraintAttribute on a derived type to constrain the types it may be attached to.
+
+
+
+ Gets the target type constraint.
+
+ The target type constraint.
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Called when the target property changes.
+
+ Override this to hook and unhook functionality on the specified Target, rather than the AssociatedObject.
+ The old target.
+ The new target.
+
+
+
+ Gets the target object. If TargetName is not set or cannot be resolved, defaults to the AssociatedObject.
+
+ The target.
+ In general, this property should be used in place of AssociatedObject in derived classes.
+
+
+
+ Represents a collection of actions with a shared AssociatedObject and provides change notifications to its contents when that AssociatedObject changes.
+
+
+
+
+ Initializes a new instance of the class.
+
+ Internal, because this should not be inherited outside this assembly.
+
+
+
+ Called immediately after the collection is attached to an AssociatedObject.
+
+
+
+
+ Called when the collection is being detached from its AssociatedObject, but before it has actually occurred.
+
+
+
+
+ Called when a new item is added to the collection.
+
+ The new item.
+
+
+
+ Called when an item is removed from the collection.
+
+ The removed item.
+
+
+
+ Creates a new instance of the TriggerActionCollection.
+
+ The new instance.
+
+
+
+ Represents an object that can invoke actions conditionally.
+
+ The type to which this trigger can be attached.
+
+ TriggerBase is the base class for controlling actions. Override OnAttached() and
+ OnDetaching() to hook and unhook handlers on the AssociatedObject. You may
+ constrain the types that a derived TriggerBase may be attached to by specifying
+ the generic parameter. Call InvokeActions() to fire all Actions associated with
+ this TriggerBase.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Gets the object to which the trigger is attached.
+
+ The associated object.
+
+
+
+ Gets the type constraint of the associated object.
+
+ The associated object type constraint.
+
+
+
+ Argument passed to PreviewInvoke event. Assigning Cancelling to True will cancel the invoking of the trigger.
+
+ This is an infrastructure class. Behavior attached to a trigger base object can add its behavior as a listener to TriggerBase.PreviewInvoke.
+
+
+
+ Represents a collection of triggers with a shared AssociatedObject and provides change notifications to its contents when that AssociatedObject changes.
+
+
+
+
+ Initializes a new instance of the class.
+
+ Internal, because this should not be inherited outside this assembly.
+
+
+
+ Called immediately after the collection is attached to an AssociatedObject.
+
+
+
+
+ Called when the collection is being detached from its AssociatedObject, but before it has actually occurred.
+
+
+
+
+ Called when a new item is added to the collection.
+
+ The new item.
+
+
+
+ Called when an item is removed from the collection.
+
+ The removed item.
+
+
+
+ Creates a new instance of the .
+
+ The new instance.
+
+
+
+ Specifies type constraints on the AssociatedObject of TargetedTriggerAction and EventTriggerBase.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The constraint type.
+
+
+
+ Gets the constraint type.
+
+ The constraint type.
+
+
+
+ A strongly-typed resource class, for looking up localized strings, etc.
+
+
+
+
+ Returns the cached ResourceManager instance used by this class.
+
+
+
+
+ Overrides the current thread's CurrentUICulture property for all
+ resource lookups using this strongly typed resource class.
+
+
+
+
+ Looks up a localized string similar to Cannot set the same BehaviorCollection on multiple objects..
+
+
+
+
+ Looks up a localized string similar to An instance of a Behavior cannot be attached to more than one object at a time..
+
+
+
+
+ Looks up a localized string similar to Cannot host an instance of a TriggerAction in multiple TriggerCollections simultaneously. Remove it from one TriggerCollection before adding it to another..
+
+
+
+
+ Looks up a localized string similar to Cannot set the same TriggerCollection on multiple objects..
+
+
+
+
+ Looks up a localized string similar to An instance of a trigger cannot be attached to more than one object at a time..
+
+
+
+
+ Looks up a localized string similar to The command "{0}" does not exist or is not publicly exposed on {1}..
+
+
+
+
+ Looks up a localized string similar to "{0}" is not a valid type for the TriggerType parameter. Make sure "{0}" derives from TriggerBase..
+
+
+
+
+ Looks up a localized string similar to Cannot add the same instance of "{0}" to a "{1}" more than once..
+
+
+
+
+ Looks up a localized string similar to The event "{0}" on type "{1}" has an incompatible signature. Make sure the event is public and satisfies the EventHandler delegate..
+
+
+
+
+ Looks up a localized string similar to Cannot find an event named "{0}" on type "{1}"..
+
+
+
+
+ Looks up a localized string similar to An object of type "{0}" cannot have a {3} property of type "{1}". Instances of type "{0}" can have only a {3} property of type "{2}"..
+
+
+
+
+ Looks up a localized string similar to Cannot attach type "{0}" to type "{1}". Instances of type "{0}" can only be attached to objects of type "{2}"..
+
+
+
+
+ Looks up a localized string similar to Unable to resolve TargetName "{0}"..
+
+
+
+
diff --git a/SCADA/Example/WPFToolkit.Extended.dll b/SCADA/Example/WPFToolkit.Extended.dll
new file mode 100644
index 0000000..5b8149a
Binary files /dev/null and b/SCADA/Example/WPFToolkit.Extended.dll differ
diff --git a/SCADA/Program/BatchCoreService/App.config b/SCADA/Program/BatchCoreService/App.config
new file mode 100644
index 0000000..3c90996
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/App.config
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/BatchCoreService/BatchCoreService.Designer.cs b/SCADA/Program/BatchCoreService/BatchCoreService.Designer.cs
new file mode 100644
index 0000000..7971923
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/BatchCoreService.Designer.cs
@@ -0,0 +1,40 @@
+namespace BatchCoreService
+{
+ partial class BatchCoreService
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ //
+ // BatchCoreService
+ //
+ this.ServiceName = "BatchCoreService";
+
+ }
+
+ #endregion
+ }
+}
diff --git a/SCADA/Program/BatchCoreService/BatchCoreService.cs b/SCADA/Program/BatchCoreService/BatchCoreService.cs
new file mode 100644
index 0000000..819069a
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/BatchCoreService.cs
@@ -0,0 +1,39 @@
+using System.ServiceModel;
+using System.ServiceProcess;
+
+namespace BatchCoreService
+{
+ public partial class BatchCoreService : ServiceBase
+ {
+ public ServiceHost serviceHost = null;
+ public BatchCoreService()
+ {
+ InitializeComponent();
+ }
+
+ protected override void OnStart(string[] args)
+ {
+ if (serviceHost != null)
+ {
+ serviceHost.Close();
+ }
+
+ // Create a ServiceHost for the CalculatorService type and
+ // provide the base address.
+ serviceHost = new ServiceHost(typeof(DAService));
+
+ // Open the ServiceHostBase to create listeners and start
+ // listening for messages.
+ serviceHost.Open();
+ }
+
+ protected override void OnStop()
+ {
+ if (serviceHost != null)
+ {
+ serviceHost.Close();
+ serviceHost = null;
+ }
+ }
+ }
+}
diff --git a/SCADA/Program/BatchCoreService/BatchCoreService.csproj b/SCADA/Program/BatchCoreService/BatchCoreService.csproj
new file mode 100644
index 0000000..dccb7d1
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/BatchCoreService.csproj
@@ -0,0 +1,103 @@
+
+
+
+ Debug
+ x86
+ 8.0.30703
+ 2.0
+ {0AF1DB09-5771-4F3B-8F48-DAAA09290C0F}
+ WinExe
+ Properties
+ BatchCoreService
+ BatchCoreService
+ v4.0
+
+
+ 512
+
+
+ x86
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ x86
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Component
+
+
+ BatchCoreService.cs
+
+
+
+
+ Component
+
+
+ ProjectInstaller.cs
+
+
+
+
+
+
+ {6DF53968-152D-4CA9-B62F-FF1C27069C4D}
+ ClientDriver
+
+
+ {755c5459-bca4-4729-a93c-0c73a41bdf3c}
+ DataHelper
+
+
+ {8965e389-6466-4b30-bd43-83c909044637}
+ DataService
+
+
+
+
+ PreserveNewest
+ Designer
+
+
+
+
+ BatchCoreService.cs
+
+
+ ProjectInstaller.cs
+
+
+
+
+
\ No newline at end of file
diff --git a/SCADA/Program/BatchCoreService/BatchCoreService.resx b/SCADA/Program/BatchCoreService/BatchCoreService.resx
new file mode 100644
index 0000000..e5858cc
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/BatchCoreService.resx
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ False
+
+
\ No newline at end of file
diff --git a/SCADA/Program/BatchCoreService/DAService.cs b/SCADA/Program/BatchCoreService/DAService.cs
new file mode 100644
index 0000000..6cb401b
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/DAService.cs
@@ -0,0 +1,2206 @@
+using ClientDriver;
+using DatabaseLib;
+using DataService;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Net.Sockets;
+using System.Reflection;
+using System.ServiceModel;
+using System.Text;
+using System.Threading;
+using System.Timers;
+using System.Xml;
+
+namespace BatchCoreService
+{
+ [ServiceContract(Namespace = "http://BatchCoreService")]
+ public interface IDataExchangeService
+ {
+ [OperationContract]
+ string Read(string id);
+
+ [OperationContract]
+ bool ReadExpression(string expression);
+
+ [OperationContract]
+ int Write(string id, string value);
+
+ [OperationContract]
+ Dictionary BatchRead(string[] tags);
+
+ [OperationContract]
+ int BatchWrite(Dictionary tags);
+
+ [OperationContract]
+ Stream LoadMetaData();
+
+ [OperationContract]
+ Stream LoadHdaBatch(DateTime start, DateTime end);
+
+ [OperationContract]
+ Stream LoadHdaSingle(DateTime start, DateTime end, short id);
+ }
+
+ [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, Namespace = "http://BatchCoreService")]
+ public class DAService : IDataExchangeService, IDataServer, IAlarmServer
+ {
+ const int PORT = 6543;
+
+ const char SPLITCHAR = '.';
+ const string SERVICELOGSOURCE = "DataProcess";
+ const string SERVICELOGNAME = "DataProcess";
+ const string PATH = @"C:\DataConfig\";
+ const string FILENAME = "server.xml";
+
+
+ //可配置参数,从XML文件读取
+ int DELAY = 3000;
+ int MAXHDACAP = 10000;
+ int ALARMLIMIT = 1000;
+ int CYCLE = 60000;
+ int CYCLE2 = 600000;
+ int SENDTIMEOUT = 60000;
+ //int SENDSIZE = ushort.MaxValue;
+ int HDALEN = 1024 * 1024;
+ int MAXLOGSIZE = 1024;
+ int HDADELAY = 3600 * 1000;
+ int ALARMDELAY = 3600 * 1000;
+ int ARCHIVEINTERVAL = 100;
+
+ static EventLog Log;
+
+ private System.Timers.Timer timer1 = new System.Timers.Timer();
+ private System.Timers.Timer timer2 = new System.Timers.Timer();
+ private System.Timers.Timer timer3 = new System.Timers.Timer();
+ private DateTime _hdastart = DateTime.Now;
+ private DateTime _alarmstart = DateTime.Now;
+
+ #region DAServer(标签数据服务器)
+ public ITag this[short id]
+ {
+ get
+ {
+ int index = GetItemProperties(id);
+ if (index >= 0)
+ {
+ return this[_list[index].Name];
+ }
+ return null;
+ }
+ }
+
+ public ITag this[string name]
+ {
+ get
+ {
+ if (string.IsNullOrEmpty(name)) return null;
+ ITag dataItem;
+ _mapping.TryGetValue(name.ToUpper(), out dataItem);
+ return dataItem;
+ }
+ }
+
+ List _list;
+ public IList MetaDataList
+ {
+ get
+ {
+ return _list;
+ }
+ }
+
+ public IList ScalingList
+ {
+ get
+ {
+ return _scales;
+ }
+ }
+
+ object _syncRoot;
+ public object SyncRoot
+ {
+ get
+ {
+ if (this._syncRoot == null)
+ {
+ Interlocked.CompareExchange(ref this._syncRoot, new object(), null);
+ }
+ return this._syncRoot;
+ }
+ }
+
+ bool _hasHda = false;
+ List _hda;
+ Dictionary _archiveTimes = new Dictionary();
+
+ Socket tcpServer = null;
+
+ Dictionary _socketThreadList;
+ public Dictionary SocketList
+ {
+ get
+ {
+ return _socketThreadList;
+ }
+ }
+
+ Dictionary _mapping;
+
+ List _scales;
+
+ SortedList _drivers;
+ public IEnumerable Drivers
+ {
+ get { return _drivers.Values; }
+ }
+
+ CompareCondBySource _compare;
+
+ ExpressionEval reval;
+ public ExpressionEval Eval
+ {
+ get
+ {
+ return reval;
+ }
+ }
+
+ private object _myLock = new object();
+ Dictionary _archiveList = null;//是否需要lock
+ public Dictionary ArchiveList
+ {
+ get
+ {
+ lock (_myLock)
+ {
+ if (_archiveList == null)
+ {
+ var list = MetaDataList.Where(x => x.Archive).Select(y => y.ID);//&& x.DataType != DataType.BOOL
+ if (list != null && list.Count() > 0)
+ {
+ string sql = "SELECT TAGID,DESCRIPTION FROM META_TAG WHERE TAGID IN(" + string.Join(",", list) + ");";
+ using (var reader = DataHelper.ExecuteReader(sql))
+ {
+ if (reader != null)
+ {
+ _archiveList = new Dictionary();
+ while (reader.Read())
+ {
+ _archiveList.Add(reader.GetInt16(0), reader.GetNullableString(1));
+ }
+ }
+ }
+ }
+ }
+ }
+ return _archiveList;
+ }
+ }
+
+ public DAService()
+ {
+ if (!EventLog.SourceExists(SERVICELOGSOURCE))
+ {
+ EventLog.CreateEventSource(SERVICELOGSOURCE, SERVICELOGNAME);
+ }
+ Log = new EventLog(SERVICELOGNAME);
+ Log.Source = SERVICELOGSOURCE;
+ InitServerByXml();
+ if (Log.MaximumKilobytes != MAXLOGSIZE)
+ Log.MaximumKilobytes = MAXLOGSIZE;
+ if (Log.OverflowAction != OverflowAction.OverwriteAsNeeded)
+ {
+ // 當EventLog 滿了就把最早的那一筆log 蓋掉。
+ Log.ModifyOverflowPolicy(OverflowAction.OverwriteAsNeeded, 7);
+ }
+ _scales = new List();
+ _drivers = new SortedList();
+ _alarmList = new List(ALARMLIMIT + 10);
+ reval = new ExpressionEval(this);
+ _hda = new List();
+ InitServerByDatabase();
+ InitConnection();
+ _socketThreadList = new Dictionary();
+ InitHost();
+
+ timer1.Elapsed += timer1_Elapsed;
+ timer2.Elapsed += timer2_Elapsed;
+ timer3.Elapsed += timer3_Elapsed;
+ timer1.Interval = CYCLE;
+ timer1.Enabled = true;
+ timer1.Start();
+ timer2.Interval = CYCLE2;
+ timer2.Enabled = true;
+ timer2.Start();
+ if (_hasHda)
+ {
+ foreach (var item in _archiveTimes.Values)
+ {
+ if (item != null)
+ {
+ timer3.Interval = ARCHIVEINTERVAL;
+ timer3.Enabled = true;
+ timer3.Start();
+ return;
+ }
+ }
+ }
+ }
+
+ public void Dispose()
+ {
+ lock (this)
+ {
+ try
+ {
+ if (timer1 != null)
+ timer1.Dispose();
+ if (timer2 != null)
+ timer2.Dispose();
+ if (timer3 != null)
+ timer3.Dispose();
+ if (_drivers != null)
+ {
+ foreach (var driver in Drivers)
+ {
+ driver.OnClose -= this.reader_OnClose;
+ driver.Dispose();
+ }
+ foreach (var condition in _conditionList)
+ {
+ if (condition != null)
+ condition.AlarmActive -= cond_SendAlarm;
+ }
+
+ if (_hasHda)
+ {
+ Flush();
+ //hda.Clear();
+ }
+ SaveAlarm();
+ foreach (var socket in _socketThreadList.Values)
+ {
+ socket.Dispose();
+ }
+ if (tcpServer != null && tcpServer.Connected)
+ tcpServer.Disconnect(false);
+
+ _mapping.Clear();
+ _conditionList.Clear();
+ reval.Dispose();
+ }
+ }
+ catch (Exception e)
+ {
+ AddErrorLog(e);
+ }
+ }
+ }
+
+ public void AddErrorLog(Exception e)
+ {
+ Log.WriteEntry(e.GetExceptionMsg(), EventLogEntryType.Error);
+ }
+
+ private void timer1_Elapsed(object sender, ElapsedEventArgs e)
+ {
+ foreach (IDriver d in Drivers)
+ {
+ if (d.IsClosed)
+ {
+ d.Connect();//t.IsAlive可加入判断;如线程异常,重新启动。
+ }
+ }
+ }
+
+ private void timer2_Elapsed(object sender, ElapsedEventArgs e)
+ {
+ if (HDADELAY > 0 && _hda.Count > 0 && (DateTime.Now - _hdastart).TotalMilliseconds > HDADELAY)
+ {
+ lock (_hdaRoot)
+ {
+ ThreadPool.UnsafeQueueUserWorkItem(new WaitCallback(this.SaveCachedData), _hda.ToArray());
+ _hda.Clear();
+ }
+ }
+ if (ALARMDELAY > 0 && _alarmList.Count > 0 && (DateTime.Now - _alarmstart).TotalMilliseconds > ALARMDELAY)
+ SaveAlarm();
+ DateTime today = DateTime.Today;
+ try
+ {
+ if (e.SignalTime > today.AddHours(2))
+ {
+ DateTime startTime = DateTime.MinValue;
+ DateTime endTime = DateTime.MaxValue;
+ HDAIOHelper.GetRangeFromDatabase(null, ref startTime, ref endTime);
+ if (startTime >= today || startTime == DateTime.MinValue)
+ {
+ return;
+ }
+ bool success = true;
+ if (endTime < today && _hda.Count > 0 && _hda[0].TimeStamp < today)
+ {
+ success = SaveRange(endTime, today);
+ }
+ if (success)
+ {
+ startTime = startTime.Date.AddDays(1);
+ endTime = endTime.Date.AddDays(1);
+ if (endTime >= today) endTime = today;
+ while (startTime <= endTime)
+ {
+ HDAIOHelper.BackUpFile(startTime);
+ startTime = startTime.AddDays(1);
+ }
+ }
+ }
+ }
+ catch (Exception err)
+ {
+ AddErrorLog(err);
+ }
+ }
+
+ private void timer3_Elapsed(object sender, ElapsedEventArgs e)
+ {
+ var now = e.SignalTime;
+ List tempData = new List();
+ foreach (var archive in _archiveTimes)
+ {
+ var archiveTime = archive.Value;
+ if (archiveTime != null && (now - archiveTime.LastTime).TotalMilliseconds > archiveTime.Cycle)
+ {
+ var tag = this[archive.Key];
+ if (tag != null && tag.TimeStamp > archiveTime.LastTime)
+ {
+ tempData.Add(new HistoryData(tag.ID, tag.Quality, tag.Value, now));
+ archive.Value.LastTime = now;
+ }
+ }
+ }
+ if (tempData.Count > 0)
+ {
+ ThreadPool.UnsafeQueueUserWorkItem(new WaitCallback(this.OnUpdate), tempData);
+ }
+ //var result = from item in _archiveTimes where item.Value.Cycle > 0 && (now - item.Value.LastTime).Milliseconds > item.Value.Cycle select item.Key;
+ }
+
+ #region 初始化(标签数据服务器)
+ void InitConnection()
+ {
+ foreach (IDriver reader in _drivers.Values)
+ {
+ reader.OnClose += new ShutdownRequestEventHandler(reader_OnClose);
+ if (reader.IsClosed)
+ {
+ //if (reader is IFileDriver)
+ reader.Connect();
+ }
+ foreach (IGroup grp in reader.Groups)
+ {
+ grp.DataChange += new DataChangeEventHandler(grp_DataChange);
+ //可在此加入判断,如为ClientDriver发出,则变化数据毋须广播,只需归档。
+ grp.IsActive = grp.IsActive;
+ }
+ }
+ //此处需改进,与Condition采用相同的处理方式,可配置
+ }
+
+ void InitServerByDatabase()
+ {
+ using (var dataReader = DataHelper.ExecuteProcedureReader("InitServer", new SqlParameter("@TYPE", SqlDbType.Int) { Value = 0 }))
+ {
+ if (dataReader == null) return;// Stopwatch sw = Stopwatch.StartNew();
+ while (dataReader.Read())
+ {
+ AddDriver(dataReader.GetInt16(0), dataReader.GetNullableString(1),
+ dataReader.GetNullableString(2), dataReader.GetInt32(3), dataReader.GetNullableString(4), dataReader.GetNullableString(5),
+ dataReader.GetNullableString(6), dataReader.GetNullableString(7));
+ }
+
+ dataReader.NextResult();
+ dataReader.Read();
+ int count = dataReader.GetInt32(0);
+ _list = new List(count);
+ _mapping = new Dictionary(count);
+ dataReader.NextResult();
+ while (dataReader.Read())
+ {
+ var meta = new TagMetaData(dataReader.GetInt16(0), dataReader.GetInt16(1), dataReader.GetString(2), dataReader.GetString(3), (DataType)dataReader.GetByte(4),
+ (ushort)dataReader.GetInt16(5), dataReader.GetBoolean(6), dataReader.GetFloat(7), dataReader.GetFloat(8), dataReader.GetInt32(9));
+ _list.Add(meta);
+ if (meta.Archive)
+ {
+ _archiveTimes.Add(meta.ID, meta.Cycle == 0 ? null : new ArchiveTime(meta.Cycle, DateTime.MinValue));
+ }
+ //Advise(DDETOPIC, meta.Name);
+ }
+ _list.Sort();
+ dataReader.NextResult();
+ while (dataReader.Read())
+ {
+ IDriver dv;
+ _drivers.TryGetValue(dataReader.GetInt16(0), out dv);
+ if (dv != null)
+ {
+ IGroup grp = dv.AddGroup(dataReader.GetString(1), dataReader.GetInt16(2), dataReader.GetInt32(3),
+ dataReader.GetFloat(4), dataReader.GetBoolean(5));
+ if (grp != null)
+ grp.AddItems(_list);
+ }
+ }
+ dataReader.NextResult();
+ while (dataReader.Read())
+ {
+ ITag tag = this[dataReader.GetNullableString(0)];
+ if (tag != null)
+ {
+ tag.ValueChanged += OnValueChanged;
+ }
+ }
+ dataReader.NextResult();
+ _conditions = new List();
+ _conditionList = new List();
+ while (dataReader.Read())
+ {
+ int id = dataReader.GetInt32(0);
+ AlarmType type = (AlarmType)dataReader.GetInt32(2);
+ ICondition cond;
+ string source = dataReader.GetString(1);
+ if (_conditions.Count > 0)
+ {
+ cond = _conditions[_conditions.Count - 1];
+ if (cond.ID == id)
+ {
+ cond.AddSubCondition(new SubCondition((SubAlarmType)dataReader.GetInt32(9), dataReader.GetFloat(10),
+ (Severity)dataReader.GetByte(11), dataReader.GetString(12), dataReader.GetBoolean(13)));
+ continue;
+ }
+ }
+ switch (type)
+ {
+ case AlarmType.Complex:
+ cond = new ComplexCondition(id, source, dataReader.GetString(6), dataReader.GetFloat(7), dataReader.GetInt32(8));
+ break;
+ case AlarmType.Level:
+ cond = new LevelAlarm(id, source, dataReader.GetString(6), dataReader.GetFloat(7), dataReader.GetInt32(8));
+ break;
+ case AlarmType.Dev:
+ cond = new DevAlarm(id, (ConditionType)dataReader.GetByte(4), source, dataReader.GetString(6),
+ dataReader.GetFloat(5), dataReader.GetFloat(7), dataReader.GetInt32(8));
+ break;
+ case AlarmType.ROC:
+ cond = new ROCAlarm(id, source, dataReader.GetString(6), dataReader.GetFloat(7), dataReader.GetInt32(8));
+ break;
+ case AlarmType.Quality:
+ cond = new QualitiesAlarm(id, source, dataReader.GetString(6));
+ break;
+ case AlarmType.WordDsc:
+ cond = new WordDigitAlarm(id, source, dataReader.GetString(6), dataReader.GetInt32(8));
+ break;
+ default:
+ cond = new DigitAlarm(id, source, dataReader.GetString(6), dataReader.GetInt32(8));
+ break;
+ }
+ cond.AddSubCondition(new SubCondition((SubAlarmType)dataReader.GetInt32(9), dataReader.GetFloat(10),
+ (Severity)dataReader.GetByte(11), dataReader.GetString(12), dataReader.GetBoolean(13)));
+
+ cond.IsEnabled = dataReader.GetBoolean(3);
+ var simpcond = cond as SimpleCondition;
+ if (simpcond != null)
+ {
+ simpcond.Tag = this[source];
+ }
+ else
+ {
+ var complexcond = cond as ComplexCondition;
+ if (complexcond != null)
+ {
+ var action = complexcond.SetFunction(reval.Eval(source));
+ if (action != null)
+ {
+ ValueChangedEventHandler handle = (s1, e1) => { action(); };
+ foreach (ITag tag in reval.TagList)
+ {
+ tag.ValueChanged += handle;// tag.Refresh();
+ }
+ }
+ }
+ }
+ cond.AlarmActive += new AlarmEventHandler(cond_SendAlarm);
+ //_conditions.Add(cond);// UpdateCondition(cond);
+ _conditions.Add(cond);
+ }
+ dataReader.NextResult();
+ while (dataReader.Read())
+ {
+ _scales.Add(new Scaling(dataReader.GetInt16(0), (ScaleType)dataReader.GetByte(1),
+ dataReader.GetFloat(2), dataReader.GetFloat(3), dataReader.GetFloat(4), dataReader.GetFloat(5)));
+ }
+ }
+ if (_archiveTimes.Count > 0)
+ {
+ _hasHda = true;
+ _hda.Capacity = MAXHDACAP;
+ }
+ reval.Clear();
+ _scales.Sort();
+ _compare = new CompareCondBySource();
+ _conditions.Sort(_compare);
+ }
+
+ void InitHost()
+ {
+ /*对关闭状态的判断,最好用心跳检测;冗余切换,可广播冗余命令,包含新主机名、数据库连接、IP地址等。
+ * 服务启动时,向整个局域网UDP广播加密的主机名、连接字符串等信息
+ */
+ //socketThreadList = new Dictionary();
+ tcpServer = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+ IPEndPoint LocalPort = new IPEndPoint(IPAddress.Any, PORT);
+ tcpServer.Bind(LocalPort);
+ tcpServer.Listen(100);
+ ThreadPool.QueueUserWorkItem(new WaitCallback(AcceptWorkThread));
+ }
+
+ void InitServerByXml()
+ {
+ string path = PATH + '\\' + FILENAME;
+ if (File.Exists(path))
+ {
+ try
+ {
+ using (var reader = XmlTextReader.Create(path))
+ {
+ while (reader.Read())
+ {
+ if (reader.NodeType == XmlNodeType.Element)
+ {
+ switch (reader.Name)
+ {
+ case "Server":
+ {
+ if (reader.MoveToAttribute("MaxLogSize"))
+ int.TryParse(reader.Value, out MAXLOGSIZE);
+ }
+ break;
+ case "Data":
+ {
+ if (reader.MoveToAttribute("TestCycle"))
+ int.TryParse(reader.Value, out CYCLE);
+ if (reader.MoveToAttribute("SendTimeout"))
+ int.TryParse(reader.Value, out SENDTIMEOUT);
+ }
+ break;
+ case "Hda":
+ {
+ if (reader.MoveToAttribute("MaxHdaCap"))
+ {
+ int.TryParse(reader.Value, out MAXHDACAP);
+ }
+ if (reader.MoveToAttribute("HdaLen"))
+ int.TryParse(reader.Value, out HDALEN);
+ if (reader.MoveToAttribute("WriteCycle"))
+ int.TryParse(reader.Value, out CYCLE2);
+ if (reader.MoveToAttribute("Delay"))
+ int.TryParse(reader.Value, out HDADELAY);
+ if (reader.MoveToAttribute("Interval"))
+ int.TryParse(reader.Value, out ARCHIVEINTERVAL);
+ }
+ break;
+ case "Alarm":
+ {
+ if (reader.MoveToAttribute("AlarmLimit"))
+ int.TryParse(reader.Value, out ALARMLIMIT);
+ if (reader.MoveToAttribute("Delay"))
+ int.TryParse(reader.Value, out ALARMDELAY);
+ }
+ break;
+ }
+ }
+ }
+ }
+ }
+ catch (Exception err)
+ {
+ AddErrorLog(err);
+ }
+ }
+ }
+ #endregion
+
+ void AcceptWorkThread(object state)
+ {
+ while (true)
+ {
+ //if (tcpServer.Poll(0, SelectMode.SelectRead))
+ Socket s_Accept = tcpServer.Accept();
+ //IPAddress addr = (s_Accept.RemoteEndPoint as IPEndPoint).Address;
+ s_Accept.SendTimeout = SENDTIMEOUT;
+ IPAddress addr = (s_Accept.RemoteEndPoint as IPEndPoint).Address;
+ try
+ {
+ if (!_socketThreadList.ContainsKey(addr))
+ _socketThreadList.Add(addr, s_Accept);
+ }
+ catch (Exception err)
+ {
+ AddErrorLog(err);
+ }
+ ThreadPool.UnsafeQueueUserWorkItem(new WaitCallback(ReceiveWorkThread), s_Accept);
+ }
+ }
+
+ void ReceiveWorkThread(object obj)
+ {
+ Socket s_Receive = (Socket)obj;
+ IPAddress addr = null;
+ try
+ {
+ addr = (s_Receive.RemoteEndPoint as IPEndPoint).Address;
+ }
+ catch (Exception err)
+ {
+ AddErrorLog(err);
+ return;
+ }
+ byte[] buffer = new byte[s_Receive.ReceiveBufferSize]; // 创建接收缓冲
+ while (true)
+ {
+ try
+ {
+ if (addr == null || !_socketThreadList.ContainsKey(addr)) return;
+ /*if (!s_Receive.Connected) return;
+ 关于数据传输协议:命令可分为:订单指令(订单类型,增删改标记可各用一个字段,路径ID用GUID,路径状态包括暂停、继续
+ 、终止、启动);可返回客户端一个可行的路径设备链、ERP交换数据指令(包含DATASET),冗余切换指令等)
+ */
+ int ReceiveCount = s_Receive.Receive(buffer);
+
+ if (buffer[0] == FCTCOMMAND.fctHead)
+ {
+ //buffer[0]是协议头,1是指令号,2是读方式(缓存还是设备),3、4是ID,5是长度,后接变量值
+ byte command = buffer[1];
+ switch (command)
+ {
+ case FCTCOMMAND.fctReadSingle:
+ {
+ //DataSource source = buffer[2] == 0 ? DataSource.Cache : DataSource.Device;
+ short id = BitConverter.ToInt16(buffer, 3);
+ byte length = buffer[5];
+ byte[] send = new byte[5 + length];
+ for (int i = 0; i < 5; i++)
+ {
+ send[i] = buffer[i];
+ }
+ ITag tag = this[id];
+ if (tag != null)
+ {
+ Storage value = buffer[2] == 0 ? tag.Value : tag.Read(DataSource.Device);
+ byte[] bt = tag.ToByteArray(value);
+ for (int k = 0; k < bt.Length; k++)
+ {
+ send[5 + k] = bt[k];
+ }
+ }
+ else
+ {
+ //出错处理,可考虑返回一个DATATYPE.NONE类型
+ }
+ s_Receive.Send(send);
+ }
+ break;
+ case FCTCOMMAND.fctReadMultiple:
+ {
+ //buffer[0]是协议头,1是指令号,2是读方式(缓存还是设备),3、4是变量数,后接变量值
+ //DataSource source = buffer[2] == 0 ? DataSource.Cache : DataSource.Device;
+ byte[] send = new byte[s_Receive.SendBufferSize];
+ send[0] = FCTCOMMAND.fctHead;
+ short count = BitConverter.ToInt16(buffer, 3);//要读取的变量数
+ int j = 5; int l = 5;
+ if (buffer[2] == 0)
+ {
+ for (int i = 0; i < count; i++)
+ {
+ short id = BitConverter.ToInt16(buffer, l);
+ send[j++] = buffer[l++];
+ send[j++] = buffer[l++];
+ ITag tag = this[id];
+ if (tag != null)
+ {
+ byte[] bt = tag.ToByteArray();
+ var length = (byte)bt.Length;
+ send[j++] = length;
+ for (int k = 0; k < length; k++)
+ {
+ send[j + k] = bt[k];
+ }
+ j += length;
+ }
+ else
+ {//类型后跟长度
+ send[j++] = 0;
+ }
+ }
+ }
+ else
+ {
+ Dictionary> dict = new Dictionary>();
+ for (int i = 0; i < count; i++)
+ {
+ short id = BitConverter.ToInt16(buffer, l);
+ l += 2;
+ ITag tag = this[id];
+ if (tag != null)
+ {
+ IGroup grp = tag.Parent;
+ if (!dict.ContainsKey(grp))
+ dict.Add(grp, new List { tag });
+ else
+ dict[grp].Add(tag);
+ }
+ }
+ foreach (var dev in dict)
+ {
+ var list = dev.Value;
+ var array = dev.Key.BatchRead(DataSource.Device, true, list.ToArray());
+ if (array == null) continue;
+ for (int i = 0; i < list.Count; i++)
+ {
+ byte[] bt = list[i].ToByteArray(array[i].Value);
+ var length = (byte)bt.Length;
+ send[j++] = length;
+ for (int k = 0; k < bt.Length; k++)
+ {
+ send[j + k] = bt[k];
+ }
+ j += length;
+ }
+ }
+ }
+ s_Receive.Send(send, 0, j, SocketFlags.None);
+ }
+ break;
+ case FCTCOMMAND.fctWriteSingle:
+ {
+ //buffer[0]是协议头,1是指令号,2是写方式(缓存还是设备),3、4是ID,5是长度
+ short id = BitConverter.ToInt16(buffer, 3);
+ byte rs = 0;
+ ITag tag = this[id];
+ if (tag != null)//此处应考虑万一写失败,是否需要更新值
+ {
+ if (tag.Address.VarType == DataType.STR)
+ {
+ StringTag strTag = tag as StringTag;
+ if (strTag != null)
+ {
+ string txt = Encoding.ASCII.GetString(buffer, 6, buffer[5]).Trim((char)0);
+ rs = (byte)tag.Write(txt);
+ if (rs == 0)
+ strTag.String = txt;
+ }
+ }
+ else
+ {
+ Storage value = Storage.Empty;
+ switch (tag.Address.VarType)
+ {
+ case DataType.BOOL:
+ value.Boolean = BitConverter.ToBoolean(buffer, 6);
+ break;
+ case DataType.BYTE:
+ value.Byte = buffer[6];
+ break;
+ case DataType.WORD:
+ case DataType.SHORT:
+ value.Int16 = BitConverter.ToInt16(buffer, 6);
+ break;
+ case DataType.TIME:
+ case DataType.INT:
+ value.Int32 = BitConverter.ToInt32(buffer, 6);
+ break;
+ case DataType.FLOAT:
+ value.Single = BitConverter.ToSingle(buffer, 6);
+ break;
+ default:
+ break;
+ }
+ rs = (byte)tag.Write(value, false);
+ }
+ }
+ else
+ {
+ rs = 0xFF;//此处长度应注意;如无此变量,应返回一个错误代码
+ }
+ s_Receive.Send(new byte[] { FCTCOMMAND.fctWriteSingle, rs }, 0, 2, SocketFlags.None);//应返回一个错误代码;
+ }
+ break;
+ case FCTCOMMAND.fctWriteMultiple:
+ { //int BatchWrite(IDictionary items, bool isSync = true);
+ int count = BitConverter.ToInt16(buffer, 2);
+ int j = 4; byte rs = 0;
+ Dictionary> dict = new Dictionary>();
+ for (int i = 0; i < count; i++)
+ {
+ short id = BitConverter.ToInt16(buffer, j);
+ j += 2;
+ byte length = buffer[j++];
+ ITag tag = this[id];
+ IGroup grp = tag.Parent;
+ SortedDictionary values;
+ if (!dict.ContainsKey(grp))
+ {
+ values = new SortedDictionary();
+ dict.Add(grp, values);
+ }
+ else
+ values = dict[grp];
+ if (tag != null)
+ {
+ switch (tag.Address.VarType)
+ {
+ case DataType.BOOL:
+ values.Add(tag, BitConverter.ToBoolean(buffer, j));
+ break;
+ case DataType.BYTE:
+ values.Add(tag, buffer[j]);
+ break;
+ case DataType.WORD:
+ case DataType.SHORT:
+ values.Add(tag, BitConverter.ToInt16(buffer, j));
+ break;
+ case DataType.TIME:
+ case DataType.INT:
+ values.Add(tag, BitConverter.ToInt32(buffer, j));
+ break;
+ case DataType.FLOAT:
+ values.Add(tag, BitConverter.ToSingle(buffer, j));
+ break;
+ case DataType.STR:
+ values.Add(tag, Encoding.ASCII.GetString(buffer, j, length).Trim((char)0));
+ break;
+ }
+ }
+ j += length;
+ }
+ foreach (var dev in dict)
+ {
+ if (dev.Key.BatchWrite(dev.Value) < 0) rs = 0xFF;
+ }
+ s_Receive.Send(new byte[] { FCTCOMMAND.fctWriteMultiple, rs }, 0, 2, SocketFlags.None);
+ }
+ break;
+ case FCTCOMMAND.fctAlarmRequest://刷新报警数据
+ {
+ if (_alarmList.Count > 0)
+ {
+ long startTime = BitConverter.ToInt64(buffer, 2);
+ long endTime = BitConverter.ToInt64(buffer, 10);
+ if (_alarmstart > DateTime.FromFileTime(startTime) || DateTime.FromFileTime(endTime) > _alarmstart)
+ {
+ SaveAlarm();
+ }
+ }
+ s_Receive.Send(new byte[] { FCTCOMMAND.fctAlarmRequest, 0 }, 0, 2, SocketFlags.None);
+ }
+ break;
+ case FCTCOMMAND.fctReset://重置连接
+ {
+ byte[] iparry = new byte[4];
+ Array.Copy(buffer, 2, iparry, 0, 4);
+ IPAddress ipaddr = new IPAddress(iparry);
+ if (_socketThreadList.Count > 0 && _socketThreadList.ContainsKey(ipaddr))
+ {
+ var scok = _socketThreadList[ipaddr];
+ _socketThreadList.Remove(ipaddr);
+ if (scok != null)
+ {
+ scok.Dispose();
+ }
+ }
+ }
+ break;
+ case FCTCOMMAND.fctHdaRequest:
+ {
+ DateTime start = DateTime.FromFileTime(BitConverter.ToInt64(buffer, 2));
+ DateTime end = DateTime.FromFileTime(BitConverter.ToInt64(buffer, 10));
+ try
+ {
+ SendHData(GetHData(start, end), new byte[HDALEN], s_Receive);
+ }
+ catch (Exception err)
+ {
+ AddErrorLog(err);
+ }
+ s_Receive.Send(new byte[] { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, 24, SocketFlags.None);
+ }
+ break;
+ case FCTCOMMAND.fctHdaIdRequest://优先读取本地HDA文件夹下的二进制归档文件
+ {
+ DateTime start = DateTime.FromFileTime(BitConverter.ToInt64(buffer, 2));
+ DateTime end = DateTime.FromFileTime(BitConverter.ToInt64(buffer, 10));
+ short ID = BitConverter.ToInt16(buffer, 18);
+ try
+ {
+ SendHData(GetHData(start, end, ID), new byte[HDALEN], s_Receive, this[ID]);
+ }
+ catch (Exception err)
+ {
+ AddErrorLog(err);
+ }
+ s_Receive.Send(new byte[] { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, 24, SocketFlags.None);
+ }
+ break;
+ }
+ }
+ }
+ catch (SocketException ex)
+ {
+ var err = ex.SocketErrorCode;
+ if (err == SocketError.ConnectionAborted || err == SocketError.HostDown || err == SocketError.NetworkDown || err == SocketError.Shutdown || err == SocketError.ConnectionReset)
+ {
+ s_Receive.Dispose();
+ if (addr != null)
+ _socketThreadList.Remove(addr);
+ //s_Receive.Dispose();
+ }
+ AddErrorLog(ex);
+ }
+ catch (Exception ex)
+ {
+ AddErrorLog(ex);
+ }
+ }
+ }
+
+ #region 历史数据归档查询
+ private IEnumerable GetHData(DateTime start, DateTime end, short ID)
+ {
+ if (start > end) yield break;
+ DateTime now = DateTime.Now;
+ if (start > now) yield break;
+ if (end > now) end = now;
+ if (now.Date > start.Date)
+ {
+ DateTime tempstart = DateTime.MinValue;
+ DateTime tempend = end;
+ HDAIOHelper.GetRangeFromDatabase(ID, ref tempend, ref tempstart);
+ if (tempend > end) tempend = end;
+ if (tempend > start)
+ {
+ int eyear = tempend.Year;
+ int syear = start.Year;
+ int emonth = tempend.Month;
+ int smonth = start.Month;
+ int year = syear;
+ while (year <= eyear)
+ {
+ int month = (year == syear ? smonth : 1);
+ while (month <= (year == eyear ? emonth : 12))
+ {
+ var result = HDAIOHelper.LoadFromFile((year == syear && month == smonth ? start : new DateTime(year, month, 1)),
+ (year == eyear && month == emonth ? tempend : new DateTime(year, month, 1).AddMonths(1).AddMilliseconds(-2)), ID);//考虑按月遍历
+ if (result != null)
+ {
+ foreach (var data in result)
+ {
+ yield return data;
+ }
+ }
+ month++;
+ }
+ year++;
+ }
+ }
+ }
+ var tempdata = _hda.ToArray();
+ DateTime ftime = (tempdata.Length > 0 ? tempdata[0].TimeStamp : DateTime.Now);
+ if (start < ftime)
+ {
+ var result = HDAIOHelper.LoadFromDatabase(start, ftime > end ? end : ftime, ID);//范围冲突
+ if (result != null)
+ {
+ foreach (var data in result)
+ {
+ yield return data;
+ }
+ }
+ }
+ if (end > ftime)
+ {
+ var result = tempdata.Where(x => x.ID == ID && x.TimeStamp >= ftime && x.TimeStamp <= end);
+ if (result != null)
+ {
+ foreach (var data in result)
+ {
+ yield return data;
+ }
+ }
+ }
+ yield break;
+ }
+
+ private IEnumerable GetHData(DateTime start, DateTime end)
+ {
+ if (start > end) yield break;
+ DateTime now = DateTime.Now;
+ if (start > now) yield break;
+ if (end > now) end = now;
+ if (now.Date > start.Date)
+ {
+ DateTime tempstart = DateTime.MinValue;
+ DateTime tempend = end;
+ HDAIOHelper.GetRangeFromDatabase(null, ref tempend, ref tempstart);
+ if (tempend > start)
+ {
+ int eyear = tempend.Year;
+ int syear = start.Year;
+ int emonth = tempend.Month;
+ int smonth = start.Month;
+ int year = syear;
+ while (year <= eyear)
+ {
+ int month = (year == syear ? smonth : 1);
+ while (month <= (year == eyear ? emonth : 12))
+ {
+ var result = HDAIOHelper.LoadFromFile((year == syear && month == smonth ? start : new DateTime(year, month, 1)),
+ (year == eyear && month == emonth ? tempend : new DateTime(year, month, 1).AddMonths(1).AddMilliseconds(-2)));//考虑按月遍历
+ if (result != null)
+ {
+ foreach (var data in result)
+ {
+ yield return data;
+ }
+ }
+ month++;
+ }
+ year++;
+ }
+ }
+ }
+ var tempdata = _hda.ToArray();
+ DateTime ftime = (tempdata.Length > 0 ? tempdata[0].TimeStamp : DateTime.Now);
+ if (start < ftime)
+ {
+ var result = HDAIOHelper.LoadFromDatabase(start, ftime > end ? end : ftime);//范围冲突
+ if (result != null)
+ {
+ foreach (var data in result)
+ {
+ yield return data;
+ }
+ }
+ }
+ if (end > ftime)
+ {
+ var result = tempdata.Where(x => x.TimeStamp >= ftime && x.TimeStamp <= end);
+ if (result != null)
+ {
+ foreach (var data in result)
+ {
+ yield return data;
+ }
+ }
+ }
+ yield break;
+ }
+
+ private void SendHData(IEnumerable result, byte[] buffer, Socket socket, ITag tag)
+ {
+ if (result == null || tag == null || socket == null || !socket.Connected) return;
+ int index = 0;
+ int len = buffer.Length;
+ int size = tag.Address.DataSize;
+ foreach (var data in result)
+ {
+ if (index + 8 + size >= len)
+ {
+ //s_Receive.BeginSend(tempbuffer, 0, index, SocketFlags.None, null, null);
+ socket.Send(buffer, index, SocketFlags.None);
+ index = 0;
+ }
+ byte[] bits = tag.ToByteArray(data.Value);
+ bits.CopyTo(buffer, index);
+ index += size;
+ bits = BitConverter.GetBytes(data.TimeStamp.ToFileTime());
+ bits.CopyTo(buffer, index);
+ index += 8;
+ }
+ socket.Send(buffer, index, SocketFlags.None);
+ }
+
+ private void SendHData(IEnumerable result, byte[] buffer, Socket socket)
+ {
+ if (result == null || socket == null || !socket.Connected) return;
+ int index = 0;
+ int len = buffer.Length;
+ short tempid = short.MinValue;
+ ITag tag = null;
+ byte[] idarray = new byte[2];
+ foreach (var data in result)
+ {
+ if (tempid != data.ID)
+ {
+ tempid = data.ID;
+ idarray = BitConverter.GetBytes(tempid);
+ tag = this[tempid];
+ }
+ if (tag == null) continue;
+ int size = tag.Address.DataSize;
+ if (index + 10 + size >= len)
+ {
+ //s_Receive.BeginSend(tempbuffer, 0, index, SocketFlags.None, null, null);这里有一个同步的问题,发生ID号错位。
+ socket.Send(buffer, index, SocketFlags.None);
+ index = 0;
+ }
+ idarray.CopyTo(buffer, index);
+ index += 2;
+ byte[] bits = tag.ToByteArray(data.Value);
+ bits.CopyTo(buffer, index);
+ index += size;
+ bits = BitConverter.GetBytes(data.TimeStamp.ToFileTime());
+ bits.CopyTo(buffer, index);
+ index += 8;
+ }
+ socket.Send(buffer, index, SocketFlags.None);
+ }
+
+ private object _hdaRoot = new object();
+ public void Flush()
+ {
+ lock (_hdaRoot)
+ {
+ if (_hda.Count == 0) return;
+ //_array.CopyTo(data, 0);
+ SqlConnection m_Conn = new SqlConnection(DataHelper.ConnectString);
+ SqlTransaction sqlT = null;
+ try
+ {
+ if (m_Conn.State == ConnectionState.Closed)
+ m_Conn.Open();
+ sqlT = m_Conn.BeginTransaction();
+ SqlCommand cmd = new SqlCommand(string.Format("DELETE FROM Log_HData WHERE [TIMESTAMP]>'{0}'",
+ _hda[0].TimeStamp.ToString()), m_Conn);
+ cmd.Transaction = sqlT;
+ cmd.ExecuteNonQuery();
+ HDASqlReader reader = new HDASqlReader(_hda, this);
+ SqlBulkCopy copy = new SqlBulkCopy(m_Conn, SqlBulkCopyOptions.Default, sqlT);
+ copy.DestinationTableName = "Log_HData";
+ copy.BulkCopyTimeout = 100000;
+ //copy.BatchSize = _capacity;
+ copy.WriteToServer(reader);
+ //Clear();
+ sqlT.Commit();
+ m_Conn.Close();
+ _hda.Clear();
+ _hdastart = DateTime.Now;
+ }
+ catch (Exception e)
+ {
+ if (sqlT != null)
+ sqlT.Rollback();
+ m_Conn.Close();
+ DataHelper.AddErrorLog(e);
+ }
+ }
+ }
+
+ public bool SaveRange(DateTime startTime, DateTime endTime)
+ {
+ var tempdata = _hda.ToArray();
+ if (tempdata.Length == 0) return true;
+ SqlConnection m_Conn = new SqlConnection(DataHelper.ConnectString);
+ SqlTransaction sqlT = null;
+ try
+ {
+ if (m_Conn.State == ConnectionState.Closed)
+ m_Conn.Open();
+ sqlT = m_Conn.BeginTransaction();
+ SqlCommand cmd = new SqlCommand(string.Format("DELETE FROM Log_HData WHERE [TIMESTAMP] BETWEEN '{0}' AND '{1}'",
+ startTime, endTime), m_Conn);
+ cmd.Transaction = sqlT;
+ cmd.ExecuteNonQuery();
+ SqlBulkCopy copy = new SqlBulkCopy(m_Conn, SqlBulkCopyOptions.Default, sqlT);
+ copy.DestinationTableName = "Log_HData";
+ copy.BulkCopyTimeout = 100000;
+ //copy.BatchSize = _capacity;
+ copy.WriteToServer(new HDASqlReader(GetData(tempdata, startTime, endTime), this));
+ //Clear();
+ sqlT.Commit();
+ m_Conn.Close();
+ return true;
+ }
+ catch (Exception e)
+ {
+ if (sqlT != null)
+ sqlT.Rollback();
+ m_Conn.Close();
+ DataHelper.AddErrorLog(e);
+ return false;
+ }
+ }
+
+ public void OnUpdate(object stateInfo)
+ {
+ lock (_hdaRoot)
+ {
+ var tempData = (List)stateInfo;
+ _hda.AddRange(tempData);
+ if (_hda.Count >= MAXHDACAP)
+ {
+ //Reverse(data);
+ DateTime start = _hda[0].TimeStamp;
+ //_array.CopyTo(data, 0);
+ SqlConnection m_Conn = new SqlConnection(DataHelper.ConnectString);
+ SqlTransaction sqlT = null;
+ try
+ {
+ if (m_Conn.State == ConnectionState.Closed)
+ m_Conn.Open();
+ sqlT = m_Conn.BeginTransaction();
+ SqlCommand cmd = new SqlCommand(string.Format("DELETE FROM Log_HData WHERE [TIMESTAMP]>'{0}'",
+ start.ToString()), m_Conn);
+ cmd.Transaction = sqlT;
+ cmd.ExecuteNonQuery();
+ HDASqlReader reader = new HDASqlReader(_hda, this);
+ SqlBulkCopy copy = new SqlBulkCopy(m_Conn, SqlBulkCopyOptions.Default, sqlT);
+ copy.DestinationTableName = "Log_HData";
+ copy.BulkCopyTimeout = 100000;
+ //copy.BatchSize = _capacity;
+ copy.WriteToServer(reader);//如果写入失败,考虑不能无限增加线程数
+ //Clear();
+ sqlT.Commit();
+ m_Conn.Close();
+ _hdastart = DateTime.Now;
+ }
+ catch (Exception e)
+ {
+ if (sqlT != null)
+ sqlT.Rollback();
+ m_Conn.Close();
+ ThreadPool.UnsafeQueueUserWorkItem(new WaitCallback(this.SaveCachedData), _hda.ToArray());
+ DataHelper.AddErrorLog(e);
+ }
+ finally
+ {
+ _hda.Clear();
+ }
+ }
+ }
+ }
+
+ public void SaveCachedData(object stateInfo)
+ {
+ var tempData = (HistoryData[])stateInfo;
+ if (tempData.Length == 0) return;
+ DateTime startTime = tempData[0].TimeStamp;
+ DateTime endTime = tempData[tempData.Length - 1].TimeStamp;
+ //Thread.Sleep(TimeSpan.FromMinutes(10));
+ int count = 0;
+ while (true)
+ {
+ if (count >= 5) return;
+ SqlConnection m_Conn = new SqlConnection(DataHelper.ConnectString);
+ SqlTransaction sqlT = null;
+ try
+ {
+ if (m_Conn.State == ConnectionState.Closed)
+ m_Conn.Open();
+ sqlT = m_Conn.BeginTransaction();
+ SqlCommand cmd = new SqlCommand(string.Format("DELETE FROM Log_HData WHERE [TIMESTAMP] BETWEEN '{0}' AND '{1}'",
+ startTime, endTime), m_Conn);
+ cmd.Transaction = sqlT;
+ cmd.ExecuteNonQuery();
+ SqlBulkCopy copy = new SqlBulkCopy(m_Conn, SqlBulkCopyOptions.Default, sqlT);
+ copy.DestinationTableName = "Log_HData";
+ copy.BulkCopyTimeout = 100000;
+ //copy.BatchSize = _capacity;
+ copy.WriteToServer(new HDASqlReader(tempData, this));
+ //Clear();
+ sqlT.Commit();
+ m_Conn.Close();
+ stateInfo = null;
+ _hdastart = DateTime.Now;
+ return;
+ }
+ catch (Exception e)
+ {
+ if (sqlT != null)
+ sqlT.Rollback();
+ m_Conn.Close();
+ DataHelper.AddErrorLog(e);
+ }
+ count++;
+ Thread.Sleep(CYCLE2);
+ }
+ }
+
+ public IEnumerable GetData(HistoryData[] hdaarray, DateTime startTime, DateTime endTime)
+ {
+ //if (hdaarray.Length == 0) yield break;
+ foreach (var data in hdaarray)
+ {
+ if (data.TimeStamp >= startTime)
+ {
+ if (data.TimeStamp <= endTime)
+ yield return data;
+ else
+ yield break;
+ }
+ }
+ }
+ #endregion
+
+ void OnValueChanged(object sender, ValueChangedEventArgs e)
+ {
+ var tag = sender as ITag;
+ DataHelper.ExecuteStoredProcedure("AddEventLog",
+ new SqlParameter("@StartTime", SqlDbType.DateTime) { SqlValue = tag.TimeStamp },
+ new SqlParameter("@Source", SqlDbType.NVarChar, 50) { SqlValue = tag.ID.ToString() },
+ new SqlParameter("@Comment", SqlDbType.NVarChar, 50) { SqlValue = tag.ToString() });
+ }
+
+ public HistoryData[] BatchRead(DataSource source, bool sync, params ITag[] itemArray)
+ {
+ int count = itemArray.Length;
+ HistoryData[] data = new HistoryData[count];
+ Dictionary> dict = new Dictionary>();
+ for (int i = 0; i < count; i++)
+ {
+ short id = itemArray[i].ID;
+ ITag tag = this[id];
+ if (tag != null)
+ {
+ IGroup grp = tag.Parent;
+ if (!dict.ContainsKey(grp))
+ dict.Add(grp, new List { tag });
+ else
+ dict[grp].Add(tag);
+ }
+ }
+ int j = 0;
+ foreach (var dev in dict)
+ {
+ var list = dev.Value;
+ var array = dev.Key.BatchRead(source, sync, list.ToArray());
+ if (array == null) continue;
+ Array.Copy(array, 0, data, j, array.Length);
+ j += array.Length;
+ }
+ return data;
+ }
+
+ public int BatchWrite(Dictionary tags, bool sync)
+ {
+ int rs = -1;
+ Dictionary> dict = new Dictionary>();
+ foreach (var item in tags)
+ {
+ var tag = this[item.Key];
+ if (tag != null)
+ {
+ IGroup grp = tag.Parent;
+ SortedDictionary values;
+ if (!dict.ContainsKey(grp))
+ {
+ values = new SortedDictionary();
+ if (tag.Address.VarType != DataType.BOOL && tag.Address.VarType != DataType.STR)
+ {
+ values.Add(tag, tag.ValueToScale(Convert.ToSingle(item.Value)));
+ }
+ else
+ values.Add(tag, item.Value);
+ dict.Add(grp, values);
+ }
+ else
+ {
+ values = dict[grp];
+ if (tag.Address.VarType != DataType.BOOL && tag.Address.VarType != DataType.STR)
+ {
+ values.Add(tag, tag.ValueToScale(Convert.ToSingle(item.Value)));
+ }
+ else
+ values.Add(tag, item.Value);
+ }
+ }
+ else Log.WriteEntry(string.Format("变量{0}不在变量表中,无法下载", item.Key), EventLogEntryType.Error);
+ }
+ foreach (var dev in dict)
+ {
+ rs = dev.Key.BatchWrite(dev.Value, sync);
+ }
+ return rs;
+ }
+
+ void grp_DataChange(object sender, DataChangeEventArgs e)
+ {
+ var data = e.Values;
+ var now = DateTime.Now;
+ if (_hasHda)
+ {
+ ArchiveTime archiveTime;
+ List tempData = new List(20);
+ for (int i = 0; i < data.Count; i++)
+ {
+ if (_archiveTimes.TryGetValue(data[i].ID, out archiveTime) && archiveTime == null && data[i].TimeStamp != DateTime.MinValue)
+ {
+ tempData.Add(data[i]);
+ }
+ }
+ if (tempData.Count > 0)
+ {
+ ThreadPool.UnsafeQueueUserWorkItem(new WaitCallback(this.OnUpdate), tempData);
+ }
+ }
+ if (_socketThreadList != null && _socketThreadList.Count > 0)
+ {
+ IPAddress addr = null;
+ var grp = sender as ClientGroup;
+ if (grp != null)
+ addr = grp.RemoteAddress;
+ ThreadPool.UnsafeQueueUserWorkItem(new WaitCallback(this.SendData), new TempCachedData(addr, data));
+ }
+ }
+ //此处发生内存泄漏;需要试验CLRProfile确定泄漏原因;改回原方法测试;看是否解决队列堵塞问题。对于客户端Grp,要过滤掉
+ private void SendData(object obj)
+ {
+ var tempdata = obj as TempCachedData;
+ var data = tempdata.Data;
+ byte[] sendBuffer = new byte[8192];
+ sendBuffer[0] = FCTCOMMAND.fctHead;
+ sendBuffer[1] = FCTCOMMAND.fctReadMultiple;
+ //bytes[2] = 0;
+ int len = data.Count;
+ short j = 5;
+ for (int i = 0; i < len; i++)
+ {
+ short id = data[i].ID;
+ byte[] dt = BitConverter.GetBytes(id);
+ sendBuffer[j++] = dt[0];
+ sendBuffer[j++] = dt[1];
+ switch (_list[GetItemProperties(id)].DataType)
+ {
+ case DataType.BOOL:
+ sendBuffer[j++] = 1;
+ sendBuffer[j++] = data[i].Value.Boolean ? (byte)1 : (byte)0;
+ break;
+ case DataType.BYTE:
+ sendBuffer[j++] = 1;
+ sendBuffer[j++] = data[i].Value.Byte;
+ break;
+ case DataType.WORD:
+ case DataType.SHORT:
+ {
+ sendBuffer[j++] = 2;
+ byte[] bt = BitConverter.GetBytes(data[i].Value.Int16);
+ sendBuffer[j++] = bt[0];
+ sendBuffer[j++] = bt[1];
+ }
+ break;
+ case DataType.TIME:
+ case DataType.INT:
+ {
+ sendBuffer[j++] = 4;
+ byte[] bt = BitConverter.GetBytes(data[i].Value.Int32);
+ sendBuffer[j++] = bt[0];
+ sendBuffer[j++] = bt[1];
+ sendBuffer[j++] = bt[2];
+ sendBuffer[j++] = bt[3];
+ }
+ break;
+ case DataType.FLOAT:
+ {
+ sendBuffer[j++] = 4;
+ byte[] bt = BitConverter.GetBytes(data[i].Value.Single);
+ sendBuffer[j++] = bt[0];
+ sendBuffer[j++] = bt[1];
+ sendBuffer[j++] = bt[2];
+ sendBuffer[j++] = bt[3];
+ }
+ break;
+ case DataType.STR:
+ {
+ byte[] bt = Encoding.ASCII.GetBytes(this[data[i].ID].ToString());
+ sendBuffer[j++] = (byte)bt.Length;
+ for (int k = 0; k < bt.Length; k++)
+ {
+ sendBuffer[j++] = bt[k];
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ Array.Copy(BitConverter.GetBytes((data[i].TimeStamp == DateTime.MinValue ? DateTime.Now : data[i].TimeStamp).ToFileTime()), 0, sendBuffer, j, 8);
+ j += 8;
+ }
+ byte[] dt1 = BitConverter.GetBytes(j);
+ sendBuffer[3] = dt1[0];
+ sendBuffer[4] = dt1[1];
+ SocketError err;
+ //bytes.CopyTo(bytes2, 0);
+ List sockets = new List(_socketThreadList.Count);
+ foreach (var socket in _socketThreadList)
+ {
+ if (!socket.Key.Equals(tempdata.Address))
+ sockets.Add(socket.Value);
+ }
+ data = null;
+ obj = null;
+ tempdata = null;
+ foreach (var socket in sockets)
+ {
+ try
+ {
+ socket.Send(sendBuffer, 0, j, SocketFlags.None, out err);
+ if (err == SocketError.ConnectionAborted || err == SocketError.HostDown ||
+ err == SocketError.NetworkDown || err == SocketError.Shutdown)
+ {
+ _socketThreadList.Remove((socket.RemoteEndPoint as IPEndPoint).Address);
+ }
+ }
+ catch (Exception ex1)
+ {
+ AddErrorLog(ex1);
+ }
+ }
+ }
+
+ public IDriver AddDriver(short id, string name, string server, int timeOut,
+ string assembly, string className, string spare1, string spare2)
+ {
+ if (_drivers.ContainsKey(id))
+ return _drivers[id];
+ IDriver dv = null;
+ try
+ {
+ Assembly ass = Assembly.LoadFrom(assembly);
+ var dvType = ass.GetType(className);
+ if (dvType != null)
+ {
+ dv = Activator.CreateInstance(dvType, new object[] { this, id, name, server, timeOut, spare1, spare2 }) as IDriver;
+ if (dv != null)
+ _drivers.Add(id, dv);
+ }
+ }
+ catch (Exception e)
+ {
+ AddErrorLog(e);
+ }
+ return dv;
+ }
+
+ public bool RemoveDriver(IDriver device)
+ {
+ lock (SyncRoot)
+ {
+ if (_drivers.Remove(device.ID))
+ {
+ device.Dispose();
+ device = null;
+ return true;
+ }
+ return false;
+ }
+ }
+
+ void reader_OnClose(object sender, ShutdownRequestEventArgs e)
+ {
+ Log.WriteEntry(e.shutdownReason, EventLogEntryType.Error);
+ //AddErrorLog(new Exception(e.shutdownReason));
+ }
+
+ public bool AddItemIndex(string key, ITag value)
+ {
+ key = key.ToUpper();
+ if (_mapping.ContainsKey(key))
+ return false;
+ _mapping.Add(key, value);
+ return true;
+ }
+
+ public bool RemoveItemIndex(string key)
+ {
+ return _mapping.Remove(key.ToUpper());
+ }
+
+
+ object _alarmsync = new object();
+
+ string[] itemList = null;
+ public IEnumerable BrowseItems(BrowseType browseType, string tagName, DataType dataType)
+ {
+ lock (SyncRoot)
+ {
+ if (_list.Count == 0) yield break;
+ int len = _list.Count;
+ if (itemList == null)
+ {
+ itemList = new string[len];
+ for (int i = 0; i < len; i++)
+ {
+ itemList[i] = _list[i].Name;
+ }
+ Array.Sort(itemList);
+ }
+ int ii = 0;
+ bool hasTag = !string.IsNullOrEmpty(tagName);
+ bool first = true;
+ string str = hasTag ? tagName + SPLITCHAR : string.Empty;
+ if (hasTag)
+ {
+ ii = Array.BinarySearch(itemList, tagName);
+ if (ii < 0) first = false;
+ //int strLen = str.Length;
+ ii = Array.BinarySearch(itemList, str);
+ if (ii < 0) ii = ~ii;
+ }
+ //while (++i < len && temp.Length >= strLen && temp.Substring(0, strLen) == str)
+ do
+ {
+ if (first && hasTag)
+ {
+ first = false;
+ yield return tagName;
+ }
+ string temp = itemList[ii];
+ if (hasTag && !temp.StartsWith(str, StringComparison.Ordinal))
+ break;
+ if (dataType == DataType.NONE || _mapping[temp].Address.VarType == dataType)
+ {
+ bool b3 = true;
+ if (browseType != BrowseType.Flat)
+ {
+ string curr = temp + SPLITCHAR;
+ int index = Array.BinarySearch(itemList, ii, len - ii, curr);
+ if (index < 0) index = ~index;
+ b3 = itemList[index].StartsWith(curr, StringComparison.Ordinal);
+ if (browseType == BrowseType.Leaf)
+ b3 = !b3;
+ }
+ if (b3)
+ yield return temp;
+ }
+ } while (++ii < len);
+ }
+ }
+
+ public int GetScaleByID(short Id)
+ {
+ if (_scales == null || _scales.Count == 0) return -1;
+ return _scales.BinarySearch(new Scaling { ID = Id });
+ }
+
+ public IGroup GetGroupByName(string name)
+ {
+ if (string.IsNullOrEmpty(name)) return null;
+ foreach (IDriver device in Drivers)
+ {
+ foreach (IGroup grp in device.Groups)
+ {
+ if (grp.Name == name)
+ return grp;
+ }
+ }
+ return null;
+ }
+
+ public void ActiveItem(bool active, params ITag[] items)
+ {
+ Dictionary> dict = new Dictionary>();
+ for (int i = 0; i < items.Length; i++)
+ {
+ List list = null;
+ ITag item = items[i];
+ dict.TryGetValue(item.Parent, out list);
+ if (list != null)
+ {
+ list.Add(item.ID);
+ }
+ else
+ dict.Add(item.Parent, new List { item.ID });
+
+ }
+ foreach (var grp in dict)
+ {
+ grp.Key.SetActiveState(active, grp.Value.ToArray());
+ }
+ }
+
+ public int GetItemProperties(short id)
+ {
+ return _list.BinarySearch(new TagMetaData { ID = id });
+ }
+ #endregion
+
+ #region Condition & Alarm(报警和条件)
+ List _conditions;
+ List _conditionList;
+
+ List _alarmList;
+ public IEnumerable AlarmList
+ {
+ get
+ {
+ return _alarmList;
+ }
+ }
+
+ public IList ActivedConditionList
+ {
+ get
+ {
+ return _conditionList;
+ }
+ }
+
+ public IList ConditionList
+ {
+ get
+ {
+ return _conditions;
+ }
+ }
+
+ void cond_SendAlarm(object sender, AlarmItem e)
+ {
+ lock (_alarmsync)
+ {
+ int index2 = _conditions.BinarySearch(new DigitAlarm(0, e.Source), _compare);
+ if (index2 > -1)
+ {
+ var cond = _conditions[index2];
+ _conditionList.Remove(cond);
+ if (e.SubAlarmType != SubAlarmType.None)
+ {
+ _conditionList.Add(cond);
+ }
+ }
+
+ if (_alarmList.Count < ALARMLIMIT)
+ {
+ _alarmList.Add(e);
+ }
+ else
+ {
+ SaveAlarm();
+ _alarmList.Add(e);
+ }
+ }
+ /*应加入判断,是否需要更新数据库(if(Index>=ALARMLIMIT){Save(); Index=0;}else Index++;
+ * 客户端查询前先发送一个查询报警(alarmQuery)请求,包含起始时间参数,服务器从判断是否要将缓存写入数据库,
+ * 待服务器返回就绪后,客户端再从数据库查询报警记录。
+ */
+ }
+
+ private bool SaveAlarm()
+ {
+ if (_alarmList.Count == 0) return true;
+ try
+ {
+ AlarmDataReader reader = new AlarmDataReader(_alarmList);
+ using (SqlBulkCopy bulk = new SqlBulkCopy(DataHelper.ConnectString, SqlBulkCopyOptions.KeepIdentity))
+ {
+ bulk.DestinationTableName = "Log_Alarm";
+ bulk.WriteToServer(reader);
+ }
+ _alarmList.Clear();
+ _alarmstart = DateTime.Now;
+ return true;
+ }
+ catch (Exception e)
+ {
+ AddErrorLog(e);
+ return false;
+ }
+ }
+
+ public ICondition GetCondition(string tagName, AlarmType type)
+ {
+ ITag tag = this[tagName];
+ if (tag == null) return null;
+ short id = tag.ID;
+ int index = _conditions.BinarySearch(new DigitAlarm(0, tagName));
+ if (index < 0) return null;
+ int ind1 = index - 1;
+ ICondition cond = _conditions[index];
+ while (index < _conditions.Count && cond.Source == tagName)
+ {
+ cond = _conditions[index++];
+ if (cond.AlarmType == type)
+ {
+ return cond;
+ }
+ }
+ while (ind1 >= 0 && cond.Source == tagName)
+ {
+ cond = _conditions[ind1--];
+ if (cond.AlarmType == type)
+ {
+ return cond;
+ }
+ }
+ return null;
+ }
+
+ public IList QueryConditions(string sourceName)
+ {
+ if (_conditions == null || sourceName == null) return null;
+ ITag tag = this[sourceName];
+ if (tag == null) return null;
+ int index = _conditions.BinarySearch(new DigitAlarm(0, sourceName));
+ if (index < 0) return null;
+ List condList = new List();
+ ICondition cond = _conditions[index];
+ int ind1 = index - 1;
+ while (cond.Source == sourceName)
+ {
+ condList.Add(cond);
+ if (++index < _conditions.Count)
+ cond = _conditions[index];
+ else
+ break;
+ }
+ while (ind1 >= 0)
+ {
+ if (cond.Source == sourceName)
+ condList.Add(cond);
+ }
+ return condList;
+ }
+
+ public int DisableCondition(string sourceName, AlarmType type)
+ {
+ var cond = GetCondition(sourceName, type);
+ if (cond != null)
+ {
+ cond.IsEnabled = false;
+ return 1;
+ }
+ return -1;
+ }
+
+ public int EnableCondition(string sourceName, AlarmType type)
+ {
+ var cond = GetCondition(sourceName, type);
+ if (cond != null)
+ {
+ cond.IsEnabled = true;
+ return 1;
+ }
+ return -1;
+ }
+
+ public int RemoveConditon(string sourceName, AlarmType type)
+ {
+ var cond = GetCondition(sourceName, type);
+ if (cond != null)
+ {
+ _conditions.Remove(cond);
+ return 1;
+ }
+ return -1;
+ }
+
+ public int RemoveConditons(string sourceName)
+ {
+ ITag tag = this[sourceName];
+ if (_conditions == null || tag == null) return -1;
+ int index = _conditions.BinarySearch(new DigitAlarm(0, sourceName));
+ if (index < 0) return index;
+ int ind1 = index - 1;
+ ICondition cond = _conditions[index];
+ List li = new List();
+ while (cond.Source == sourceName)
+ {
+ li.Add(index);
+ if (++index < _conditions.Count)
+ cond = _conditions[index];
+ else
+ break;
+ }
+ while (ind1 >= 0)
+ {
+ cond = _conditions[ind1--];
+ if (cond.Source == sourceName)
+ li.Add(ind1);
+ }
+ if (li.Count == 0) return -1;
+ for (int i = li.Count - 1; i >= 0; i--)
+ {
+ _conditions.RemoveAt(i);
+ }
+ return 1;
+ }
+
+ public int AckConditions(params ICondition[] conditions)
+ {
+ if (conditions == null || conditions.Length == 0) return -1;
+ foreach (ICondition cond in conditions)
+ {
+ cond.IsAcked = true;
+ cond.LastAckTime = DateTime.Now;
+ }
+ return 1;
+ }
+ #endregion
+
+ #region DataExchange(数据交换服务器)
+ public Dictionary BatchRead(string[] tags)
+ {
+ var itags = new List(tags.Length);
+ for (int i = 0; i < tags.Length; i++)
+ {
+ var tag = this[tags[i]];
+ if (tag != null)
+ itags.Add(tag);
+ }
+ var ds = new Dictionary(tags.Length);
+ foreach (var tag in itags)
+ {
+ string obj;
+ if (tag.Address.VarType == DataType.FLOAT && Math.Abs(tag.Value.Single) < 5 * 10E-33)
+ {
+ obj = "0";
+ }
+ else obj = tag.ToString();
+ ds.Add(tag.GetTagName(), obj ?? "");//此处大小写应注意与元数据表一致。
+ }
+ return ds;
+ }
+
+ public int BatchWrite(Dictionary tags)
+ {
+ var dict = new Dictionary();
+ foreach (var tag in tags)
+ {
+ dict.Add(tag.Key, tag.Value);
+ }
+ return BatchWrite(dict, true);
+ }
+
+ public string Read(string id)
+ {
+ var tag = this[id];
+ return tag == null ? string.Empty : tag.Address.VarType == DataType.BOOL ? tag.Value.Boolean ? "1" : "0" : tag.ToString();
+ }
+
+ public int Write(string id, string value)
+ {
+ var tag = this[id];
+ return tag == null ? -1 : tag.Write(value);
+ }
+
+ Dictionary> _exprdict = new Dictionary>();
+
+ public bool ReadExpression(string expression)
+ {
+ Func func;
+ if (_exprdict.TryGetValue(expression, out func))
+ {
+ return func();
+ }
+ else
+ {
+ func = Eval.Eval(expression) as Func;
+ if (func != null)
+ {
+ _exprdict[expression] = func;
+ return func();
+ }
+ else return false;
+ }
+ }
+
+ public Stream LoadMetaData()
+ {
+ var stream = new MemoryStream(); // var sb = new StringBuilder();
+ using (var writer = XmlTextWriter.Create(stream))
+ {
+ writer.WriteStartDocument();
+ writer.WriteStartElement("Sever");
+ foreach (var device in _drivers.Values)
+ {
+ writer.WriteStartElement("Device");
+ writer.WriteAttributeString("id", device.ID.ToString());
+ writer.WriteAttributeString("name", device.Name);
+ if (!string.IsNullOrEmpty(device.ServerName))
+ writer.WriteAttributeString("server", device.ServerName);
+ writer.WriteAttributeString("timeout", device.TimeOut.ToString());
+ foreach (var grp in device.Groups)
+ {
+ writer.WriteStartElement("Group");
+ writer.WriteAttributeString("id", grp.ID.ToString());
+ writer.WriteAttributeString("name", grp.Name);
+ writer.WriteAttributeString("deviceId", device.ID.ToString());
+ writer.WriteAttributeString("updateRate", grp.UpdateRate.ToString());
+ writer.WriteAttributeString("deadBand", grp.DeadBand.ToString());
+ writer.WriteAttributeString("active", grp.IsActive.ToString());
+ var list = _list.FindAll(x => x.GroupID == grp.ID);
+ if (list != null && list.Count > 0)
+ {
+ foreach (var tag in list)
+ {
+ writer.WriteStartElement("Tag");
+ writer.WriteAttributeString("id", tag.ID.ToString());
+ writer.WriteAttributeString("groupid", tag.GroupID.ToString());
+ writer.WriteAttributeString("name", tag.Name);
+ writer.WriteAttributeString("address", tag.Address);
+ writer.WriteAttributeString("datatype", ((byte)tag.DataType).ToString());
+ writer.WriteAttributeString("size", tag.Size.ToString());
+ writer.WriteAttributeString("archive", tag.Archive.ToString());
+ writer.WriteAttributeString("min", tag.Minimum.ToString());
+ writer.WriteAttributeString("max", tag.Maximum.ToString());
+ writer.WriteAttributeString("cycle", tag.Cycle.ToString());
+ writer.WriteEndElement();
+ }
+
+ }
+ writer.WriteEndElement();
+ }
+ writer.WriteEndElement();
+ }
+ writer.WriteStartElement("Conditions");
+ foreach (var cond in _conditions)
+ {
+ writer.WriteStartElement("Condition");
+ writer.WriteAttributeString("id", cond.ID.ToString());
+ writer.WriteAttributeString("alarmtype", ((int)cond.AlarmType).ToString());
+ writer.WriteAttributeString("enabled", cond.IsEnabled.ToString());
+ writer.WriteAttributeString("severity", ((int)cond.Severity).ToString());
+ writer.WriteAttributeString("source", cond.Source);
+ writer.WriteAttributeString("comment", cond.Comment);
+ writer.WriteAttributeString("conditiontype", ((byte)cond.ConditionType).ToString());
+ writer.WriteAttributeString("para", cond.Para.ToString());
+ writer.WriteAttributeString("deadband", cond.DeadBand.ToString());
+ writer.WriteAttributeString("delay", cond.Delay.ToString());
+ foreach (var subcond in cond.SubConditions)
+ {
+ if (subcond.SubAlarmType != SubAlarmType.None)
+ {
+ writer.WriteStartElement("SubCondition");
+ writer.WriteAttributeString("subalarmtype", ((int)subcond.SubAlarmType).ToString());
+ writer.WriteAttributeString("enabled", subcond.IsEnabled.ToString());
+ writer.WriteAttributeString("severity", ((int)subcond.Severity).ToString());
+ writer.WriteAttributeString("threshold", subcond.Threshold.ToString());
+ writer.WriteAttributeString("message", subcond.Message);
+ writer.WriteEndElement();
+ }
+ }
+ writer.WriteEndElement();
+ }
+ writer.WriteEndElement();
+ writer.WriteStartElement("Scales");
+ foreach (var scale in _scales)
+ {
+ writer.WriteStartElement("Scale");
+ writer.WriteAttributeString("id", scale.ID.ToString());
+ writer.WriteAttributeString("scaletype", ((byte)scale.ScaleType).ToString());
+ writer.WriteAttributeString("euhi", scale.EUHi.ToString());
+ writer.WriteAttributeString("eulo", scale.EULo.ToString());
+ writer.WriteAttributeString("rawhi", scale.RawHi.ToString());
+ writer.WriteAttributeString("rawlo", scale.RawLo.ToString());
+ writer.WriteEndElement();
+ }
+ writer.WriteEndElement();
+ if (ArchiveList != null)
+ {
+ writer.WriteStartElement("ArchiveList");
+ foreach (var archv in _archiveList)
+ {
+ writer.WriteStartElement("Archive");
+ writer.WriteAttributeString("id", archv.Key.ToString());
+ writer.WriteAttributeString("desp", archv.Value);
+ writer.WriteEndElement();
+ }
+ writer.WriteEndElement();
+ }
+ writer.WriteEndElement();
+ }
+ stream.Position = 0L;
+ return stream;
+ }
+
+ public Stream LoadHdaBatch(DateTime start, DateTime end)
+ {
+ List list = new List();
+ var result = GetHData(start, end);
+ short tempid = short.MinValue;
+ ITag tag = null;
+ byte[] idarray = new byte[2];
+ foreach (var data in result)
+ {
+ if (tempid != data.ID)
+ {
+ tempid = data.ID;
+ idarray = BitConverter.GetBytes(tempid);
+ tag = this[tempid];
+ }
+ if (tag == null) continue;
+ list.AddRange(idarray);
+ list.AddRange(tag.ToByteArray(data.Value));
+ list.AddRange(BitConverter.GetBytes(data.TimeStamp.ToFileTime()));
+ }
+ list.AddRange(new byte[] { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF});
+ return new MemoryStream(list.ToArray());
+ }
+
+ public Stream LoadHdaSingle(DateTime start, DateTime end, short id)
+ {
+ var tag = this[id];
+ if (tag == null) return new MemoryStream();
+ List list = new List();
+ var result = GetHData(start, end, id);
+ list.AddRange(BitConverter.GetBytes(id));
+ foreach (var data in result)
+ {
+ list.AddRange(tag.ToByteArray(data.Value));
+ list.AddRange(BitConverter.GetBytes(data.TimeStamp.ToFileTime()));
+ }
+ list.AddRange(new byte[] { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF});
+ return new MemoryStream(list.ToArray());
+ }
+ #endregion
+ }
+
+ class TempCachedData
+ {
+ IPAddress _addr;
+ public IPAddress Address
+ {
+ get { return _addr; }
+ }
+
+ IList _data;
+ public IList Data
+ {
+ get { return _data; }
+ }
+
+ public TempCachedData(IPAddress addr, IList data)
+ {
+ _addr = addr;
+ _data = data;
+ }
+ }
+
+ internal sealed class ArchiveTime
+ {
+ public int Cycle;
+ public DateTime LastTime;
+ public ArchiveTime(int cycle, DateTime last)
+ {
+ Cycle = cycle;
+ LastTime = last;
+ }
+ }
+}
diff --git a/SCADA/Program/BatchCoreService/Program.cs b/SCADA/Program/BatchCoreService/Program.cs
new file mode 100644
index 0000000..01e820a
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/Program.cs
@@ -0,0 +1,20 @@
+using System.ServiceProcess;
+
+namespace BatchCoreService
+{
+ static class Program
+ {
+ ///
+ /// The main entry point for the application.
+ ///
+ static void Main()
+ {
+ ServiceBase[] ServicesToRun;
+ ServicesToRun = new ServiceBase[]
+ {
+ new BatchCoreService()
+ };
+ ServiceBase.Run(ServicesToRun);
+ }
+ }
+}
diff --git a/SCADA/Program/BatchCoreService/ProjectInstaller.Designer.cs b/SCADA/Program/BatchCoreService/ProjectInstaller.Designer.cs
new file mode 100644
index 0000000..eb821b3
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/ProjectInstaller.Designer.cs
@@ -0,0 +1,61 @@
+namespace BatchCoreService
+{
+ partial class ProjectInstaller
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();
+ this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller();
+ //
+ // serviceProcessInstaller1
+ //
+ this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
+ this.serviceProcessInstaller1.Password = null;
+ this.serviceProcessInstaller1.Username = null;
+ //
+ // serviceInstaller1
+ //
+ this.serviceInstaller1.Description = "数据服务";
+ this.serviceInstaller1.ServiceName = "BatchCoreService";
+ this.serviceInstaller1.ServicesDependedOn = new string[] {
+ "MSSQL$SQLEXPRESS"};
+ this.serviceInstaller1.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
+ //
+ // ProjectInstaller
+ //
+ this.Installers.AddRange(new System.Configuration.Install.Installer[] {
+ this.serviceProcessInstaller1,
+ this.serviceInstaller1});
+
+ }
+
+ #endregion
+
+ private System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller1;
+ private System.ServiceProcess.ServiceInstaller serviceInstaller1;
+ }
+}
\ No newline at end of file
diff --git a/SCADA/Program/BatchCoreService/ProjectInstaller.cs b/SCADA/Program/BatchCoreService/ProjectInstaller.cs
new file mode 100644
index 0000000..eac443b
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/ProjectInstaller.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Configuration.Install;
+using System.Linq;
+
+
+namespace BatchCoreService
+{
+ [RunInstaller(true)]
+ public partial class ProjectInstaller : System.Configuration.Install.Installer
+ {
+ public ProjectInstaller()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/SCADA/Program/BatchCoreService/ProjectInstaller.resx b/SCADA/Program/BatchCoreService/ProjectInstaller.resx
new file mode 100644
index 0000000..235f1b0
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/ProjectInstaller.resx
@@ -0,0 +1,129 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 17, 56
+
+
+ 196, 17
+
+
+ False
+
+
\ No newline at end of file
diff --git a/SCADA/Program/BatchCoreService/Properties/AssemblyInfo.cs b/SCADA/Program/BatchCoreService/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..93b7212
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("BatchCoreService")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("BatchCoreService")]
+[assembly: AssemblyCopyright("Copyright © 2014")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("90a674e3-631e-42cb-a286-bb4a53494b42")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/SCADA/Program/BatchCoreService/SqlMapping.cs b/SCADA/Program/BatchCoreService/SqlMapping.cs
new file mode 100644
index 0000000..c7a9ec8
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/SqlMapping.cs
@@ -0,0 +1,556 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using DataService;
+
+namespace BatchCoreService
+{
+ internal class AlarmDataReader : IDataReader
+ {
+ IEnumerator _enumer;
+
+ public AlarmDataReader(IEnumerable list)
+ {
+ this._enumer = list.GetEnumerator();
+ }
+
+ #region IDataReader Members
+
+ public void Close()
+ {
+
+ }
+ public int Depth
+ {
+ get { return 0; }
+ }
+
+ public DataTable GetSchemaTable()
+ {
+ DataTable table = new DataTable("AlarmItem");
+ table.Columns.Add("StartTime", typeof(DateTime));
+ table.Columns.Add("Source", typeof(string));
+ table.Columns.Add("ConditionId", typeof(int));
+ table.Columns.Add("AlarmText", typeof(string));
+ table.Columns.Add("AlarmValue", typeof(object));
+ table.Columns.Add("Duration", typeof(int));
+ table.Columns.Add("Severity", typeof(int));
+ table.Columns.Add("SubAlarmType", typeof(int));
+ return table;
+ }
+ public bool IsClosed
+ {
+ get { return false; }
+ }
+
+ public bool NextResult()
+ {
+ return false;
+ }
+
+ public bool Read()
+ {
+ return _enumer.MoveNext();
+ }
+
+ public int RecordsAffected
+ {
+ get { throw new NotImplementedException(); }
+ }
+
+ #endregion
+
+ #region IDisposable Members
+
+ public void Dispose()
+ {
+ }
+
+ #endregion
+
+ #region IDataRecord Members
+
+ public int FieldCount
+ {
+ get { return 8; }
+ }
+
+ public bool GetBoolean(int i)
+ {
+ return (bool)GetValue(i);
+ }
+
+ public byte GetByte(int i)
+ {
+ return (byte)GetValue(i);
+ }
+
+ public long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length)
+ {
+ throw new NotImplementedException();
+ }
+
+ public char GetChar(int i)
+ {
+ return (char)GetValue(i);
+ }
+
+ public long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length)
+ {
+ throw new NotImplementedException();
+ }
+
+ public IDataReader GetData(int i)
+ {
+ throw new NotImplementedException();
+ }
+
+ public string GetDataTypeName(int i)
+ {
+ throw new NotImplementedException();
+ }
+
+ public DateTime GetDateTime(int i)
+ {
+ return (DateTime)GetValue(i);
+ }
+
+ public decimal GetDecimal(int i)
+ {
+ return (decimal)GetValue(i);
+ }
+
+ public double GetDouble(int i)
+ {
+ return (double)GetValue(i);
+ }
+
+ public Type GetFieldType(int i)
+ {
+ switch (i)
+ {
+ case 0:
+ return typeof(DateTime);
+ case 1:
+ return typeof(string);
+ case 2:
+ return typeof(int);
+ case 3:
+ return typeof(string);
+ case 4:
+ return typeof(object);
+ case 5:
+ return typeof(int);
+ case 6:
+ return typeof(int);
+ case 7:
+ return typeof(int);
+ default:
+ return typeof(string);
+ }
+ }
+
+ public float GetFloat(int i)
+ {
+ return (float)GetValue(i);
+ }
+
+ public Guid GetGuid(int i)
+ {
+ return (Guid)GetValue(i);
+ }
+
+ public short GetInt16(int i)
+ {
+ return (short)GetValue(i);
+ }
+ public int GetInt32(int i)
+ {
+ return (int)GetValue(i);
+ }
+
+ public long GetInt64(int i)
+ {
+ return (long)GetValue(i);
+ }
+
+ public string GetName(int i)
+ {
+ switch (i)
+ {
+ case 0:
+ return "StartTime";
+ case 1:
+ return "Source";
+ case 2:
+ return "ConditionId";
+ case 3:
+ return "AlarmText";
+ case 4:
+ return "AlarmValue";
+ case 5:
+ return "Duration";
+ case 6:
+ return "Severity";
+ case 7:
+ return "SubAlarmType";
+ default:
+ return "";
+ }
+ }
+
+ public int GetOrdinal(string name)
+ {
+ switch (name)
+ {
+ case "StartTime":
+ return 0;
+ case "Source":
+ return 1;
+ case "ConditionId":
+ return 2;
+ case "AlarmText":
+ return 3;
+ case "AlarmValue":
+ return 4;
+ case "Duration":
+ return 5;
+ case "Severity":
+ return 6;
+ case "SubAlarmType":
+ return 7;
+ default:
+ return -1;
+ }
+ }
+
+ public string GetString(int i)
+ {
+ return (string)GetValue(i);
+ }
+
+ public object GetValue(int i)
+ {
+ switch (i)
+ {
+ case 0:
+ return _enumer.Current.StartTime;
+ case 1:
+ return _enumer.Current.Source;
+ case 2:
+ return _enumer.Current.ConditionId;
+ case 3:
+ return _enumer.Current.AlarmText;
+ case 4:
+ return _enumer.Current.AlarmValue;
+ case 5:
+ return _enumer.Current.Duration.Seconds;
+ case 6:
+ return _enumer.Current.Severity;
+ case 7:
+ return _enumer.Current.SubAlarmType;
+ default:
+ return null;
+ }
+ }
+
+ public int GetValues(object[] values)
+ {
+ throw new NotImplementedException();
+ }
+
+ public bool IsDBNull(int i)
+ {
+ switch (i)
+ {
+ case 0:
+ return _enumer.Current.StartTime == DateTime.MinValue;
+ case 1:
+ return string.IsNullOrEmpty(_enumer.Current.Source);
+ case 2:
+ return _enumer.Current.ConditionId == 0;
+ case 3:
+ return string.IsNullOrEmpty(_enumer.Current.AlarmText);
+ case 4:
+ return _enumer.Current.AlarmValue == null;
+ case 5:
+ case 6:
+ case 7:
+ default:
+ return false;
+ }
+ }
+
+ public object this[string name]
+ {
+ get
+ {
+ return GetValue(GetOrdinal(name));
+ }
+ }
+
+ public object this[int i]
+ {
+ get
+ {
+ return GetValue(i);
+ }
+ }
+
+ #endregion
+ }
+
+ internal class HDASqlReader : IDataReader
+ {
+ IEnumerator _enumer;
+ IDataServer _server;
+
+ public HDASqlReader(IEnumerable list, IDataServer server)
+ {
+ this._enumer = list.GetEnumerator();
+ _server = server;
+ }
+
+ #region IDataReader Members
+
+ public void Close()
+ {
+
+ }
+
+ public int Depth
+ {
+ get { return 0; }
+ }
+
+ public DataTable GetSchemaTable()
+ {
+ DataTable table = new DataTable("Log_HData");
+ table.Columns.Add("ID", typeof(short));
+ table.Columns.Add("TimeStamp", typeof(DateTime));
+ table.Columns.Add("Value", typeof(float));
+ return table;
+ }
+ public bool IsClosed
+ {
+ get { return false; }
+ }
+
+ public bool NextResult()
+ {
+ return false;
+ }
+
+ public bool Read()
+ {
+ return _enumer.MoveNext();
+ }
+
+ public int RecordsAffected
+ {
+ get { throw new NotImplementedException(); }
+ }
+
+ #endregion
+
+ #region IDisposable Members
+
+ public void Dispose()
+ {
+ }
+
+ #endregion
+
+ #region IDataRecord Members
+
+ public int FieldCount
+ {
+ get { return 3; }
+ }
+
+ public bool GetBoolean(int i)
+ {
+ return (bool)GetValue(i);
+ }
+
+ public byte GetByte(int i)
+ {
+ return (byte)GetValue(i);
+ }
+
+ public long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length)
+ {
+ throw new NotImplementedException();
+ }
+
+ public char GetChar(int i)
+ {
+ return (char)GetValue(i);
+ }
+
+ public long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length)
+ {
+ throw new NotImplementedException();
+ }
+
+ public IDataReader GetData(int i)
+ {
+ return this;
+ }
+
+ public string GetDataTypeName(int i)
+ {
+ throw new NotImplementedException();
+ }
+
+ public DateTime GetDateTime(int i)
+ {
+ return (DateTime)GetValue(i);
+ }
+
+ public decimal GetDecimal(int i)
+ {
+ return (decimal)GetValue(i);
+ }
+
+ public double GetDouble(int i)
+ {
+ return (double)GetValue(i);
+ }
+
+ public Type GetFieldType(int i)
+ {
+ switch (i)
+ {
+ case 0:
+ return typeof(Int16);
+ case 1:
+ return typeof(DateTime);
+ case 2:
+ return typeof(Single);
+ default:
+ return typeof(Int32);
+ }
+ }
+
+ public float GetFloat(int i)
+ {
+ return Convert.ToSingle(GetValue(i));
+ }
+
+ public Guid GetGuid(int i)
+ {
+ return (Guid)GetValue(i);
+ }
+
+ public short GetInt16(int i)
+ {
+ return (short)GetValue(i);
+ }
+ public int GetInt32(int i)
+ {
+ return (int)GetValue(i);
+ }
+
+ public long GetInt64(int i)
+ {
+ return (long)GetValue(i);
+ }
+
+ public string GetName(int i)
+ {
+ switch (i)
+ {
+ case 0:
+ return "ID";
+ case 1:
+ return "TimeStamp";
+ case 2:
+ return "Value";
+ default:
+ return string.Empty;
+ }
+ }
+
+ public int GetOrdinal(string name)
+ {
+ switch (name)
+ {
+ case "ID":
+ return 0;
+ case "TimeStamp":
+ return 1;
+ case "Value":
+ return 2;
+ default:
+ return -1;
+ }
+ }
+
+ public string GetString(int i)
+ {
+ return (string)GetValue(i);
+ }
+
+ public object GetValue(int i)
+ {
+ switch (i)
+ {
+ case 0:
+ return _enumer.Current.ID;
+ case 1:
+ return _enumer.Current.TimeStamp;
+ case 2:
+ var index = _server.GetItemProperties(_enumer.Current.ID);
+ if (index < 0) return 0f;
+ switch (_server.MetaDataList[index].DataType)
+ {
+ case DataType.FLOAT:
+ var ff = _enumer.Current.Value.Single;
+ return ff > -2E-38 && ff < 2E-38 ? 0f : ff;
+ case DataType.BOOL:
+ return _enumer.Current.Value.Boolean ? 1f : 0f;
+ case DataType.INT:
+ return _enumer.Current.Value.Int32;
+ case DataType.WORD:
+ case DataType.SHORT:
+ return _enumer.Current.Value.Int16;
+ case DataType.BYTE:
+ return _enumer.Current.Value.Byte;
+ default:
+ return 0f;
+ }
+ default:
+ return 0f; ;
+ }
+ }
+
+ public int GetValues(object[] values)
+ {
+ throw new NotImplementedException();
+ }
+
+ public bool IsDBNull(int i)
+ {
+ return false;
+ }
+
+ public object this[string name]
+ {
+ get
+ {
+ return GetValue(GetOrdinal(name));
+ }
+ }
+
+ public object this[int i]
+ {
+ get
+ {
+ return GetValue(i);
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/SCADA/Program/BatchCoreService/bin/Debug/App.config b/SCADA/Program/BatchCoreService/bin/Debug/App.config
new file mode 100644
index 0000000..3c90996
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/bin/Debug/App.config
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/BatchCoreService/bin/Debug/BatchCoreService.exe b/SCADA/Program/BatchCoreService/bin/Debug/BatchCoreService.exe
new file mode 100644
index 0000000..80c648e
Binary files /dev/null and b/SCADA/Program/BatchCoreService/bin/Debug/BatchCoreService.exe differ
diff --git a/SCADA/Program/BatchCoreService/bin/Debug/BatchCoreService.exe.config b/SCADA/Program/BatchCoreService/bin/Debug/BatchCoreService.exe.config
new file mode 100644
index 0000000..3c90996
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/bin/Debug/BatchCoreService.exe.config
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/BatchCoreService/bin/Debug/BatchCoreService.vshost.exe b/SCADA/Program/BatchCoreService/bin/Debug/BatchCoreService.vshost.exe
new file mode 100644
index 0000000..bb84a51
Binary files /dev/null and b/SCADA/Program/BatchCoreService/bin/Debug/BatchCoreService.vshost.exe differ
diff --git a/SCADA/Program/BatchCoreService/bin/Debug/BatchCoreService.vshost.exe.config b/SCADA/Program/BatchCoreService/bin/Debug/BatchCoreService.vshost.exe.config
new file mode 100644
index 0000000..faed99f
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/bin/Debug/BatchCoreService.vshost.exe.config
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SCADA/Program/BatchCoreService/bin/Debug/BatchCoreService.vshost.exe.manifest b/SCADA/Program/BatchCoreService/bin/Debug/BatchCoreService.vshost.exe.manifest
new file mode 100644
index 0000000..061c9ca
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/bin/Debug/BatchCoreService.vshost.exe.manifest
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/BatchCoreService/bin/Debug/ClientDriver.dll b/SCADA/Program/BatchCoreService/bin/Debug/ClientDriver.dll
new file mode 100644
index 0000000..0078ad8
Binary files /dev/null and b/SCADA/Program/BatchCoreService/bin/Debug/ClientDriver.dll differ
diff --git a/SCADA/Program/BatchCoreService/bin/Debug/DataHelper.dll b/SCADA/Program/BatchCoreService/bin/Debug/DataHelper.dll
new file mode 100644
index 0000000..21bf117
Binary files /dev/null and b/SCADA/Program/BatchCoreService/bin/Debug/DataHelper.dll differ
diff --git a/SCADA/Program/BatchCoreService/bin/Debug/DataService.dll b/SCADA/Program/BatchCoreService/bin/Debug/DataService.dll
new file mode 100644
index 0000000..e84e58d
Binary files /dev/null and b/SCADA/Program/BatchCoreService/bin/Debug/DataService.dll differ
diff --git a/SCADA/Program/BatchCoreService/bin/Release/App.config b/SCADA/Program/BatchCoreService/bin/Release/App.config
new file mode 100644
index 0000000..3c90996
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/bin/Release/App.config
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/BatchCoreService/bin/Release/BatchCommon.dll b/SCADA/Program/BatchCoreService/bin/Release/BatchCommon.dll
new file mode 100644
index 0000000..6a3ca6d
Binary files /dev/null and b/SCADA/Program/BatchCoreService/bin/Release/BatchCommon.dll differ
diff --git a/SCADA/Program/BatchCoreService/bin/Release/BatchCoreService.InstallLog b/SCADA/Program/BatchCoreService/bin/Release/BatchCoreService.InstallLog
new file mode 100644
index 0000000..ed3bd1e
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/bin/Release/BatchCoreService.InstallLog
@@ -0,0 +1,147 @@
+Installing assembly 'D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe'.
+Affected parameters are:
+ logtoconsole =
+ logfile = D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.InstallLog
+ assemblypath = D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+Installing service BatchCoreService...
+Service BatchCoreService has been successfully installed.
+Creating EventLog source BatchCoreService in log Application...
+Committing assembly 'D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe'.
+Affected parameters are:
+ logtoconsole =
+ logfile = D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.InstallLog
+ assemblypath = D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+Uninstalling assembly 'D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe'.
+Affected parameters are:
+ logtoconsole =
+ logfile = D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.InstallLog
+ assemblypath = D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+Removing EventLog source BatchCoreService.
+Service BatchCoreService is being removed from the system...
+Service BatchCoreService was successfully removed from the system.
+Installing assembly 'D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe'.
+Affected parameters are:
+ logtoconsole =
+ logfile = D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.InstallLog
+ assemblypath = D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+Installing service BatchCoreService...
+Service BatchCoreService has been successfully installed.
+Creating EventLog source BatchCoreService in log Application...
+Committing assembly 'D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe'.
+Affected parameters are:
+ logtoconsole =
+ logfile = D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.InstallLog
+ assemblypath = D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+Uninstalling assembly 'D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe'.
+Affected parameters are:
+ logtoconsole =
+ logfile = D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.InstallLog
+ assemblypath = D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+Removing EventLog source BatchCoreService.
+Service BatchCoreService is being removed from the system...
+Service BatchCoreService was successfully removed from the system.
+Installing assembly 'D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe'.
+Affected parameters are:
+ logtoconsole =
+ logfile = D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.InstallLog
+ assemblypath = D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+Installing service BatchCoreService...
+Service BatchCoreService has been successfully installed.
+Creating EventLog source BatchCoreService in log Application...
+Committing assembly 'D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe'.
+Affected parameters are:
+ logtoconsole =
+ logfile = D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.InstallLog
+ assemblypath = D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+Uninstalling assembly 'D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe'.
+Affected parameters are:
+ logtoconsole =
+ logfile = D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.InstallLog
+ assemblypath = D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+Removing EventLog source BatchCoreService.
+Service BatchCoreService is being removed from the system...
+Service BatchCoreService was successfully removed from the system.
+Installing assembly 'D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe'.
+Affected parameters are:
+ logtoconsole =
+ logfile = D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.InstallLog
+ assemblypath = D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+Installing service BatchCoreService...
+Service BatchCoreService has been successfully installed.
+Creating EventLog source BatchCoreService in log Application...
+Committing assembly 'D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe'.
+Affected parameters are:
+ logtoconsole =
+ logfile = D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.InstallLog
+ assemblypath = D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+正在安装程序集“D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe”。
+受影响的参数是:
+ logtoconsole =
+ logfile = D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.InstallLog
+ assemblypath = D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+正在安装服务 BatchCoreService...
+正在日志 Application 中创建 EventLog 源 BatchCoreService...
+正在回滚程序集“D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe”。
+受影响的参数是:
+ logtoconsole =
+ logfile = D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.InstallLog
+ assemblypath = D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+正在将事件日志还原到源 BatchCoreService 的前一状态。
+在 System.Diagnostics.EventLogInstaller 安装程序的“回滚”阶段发生异常。
+System.Security.SecurityException: 未找到源,但未能搜索某些或全部事件日志。不可访问的日志: Security。
+在安装的“回滚”阶段发生异常。将忽略该异常并继续回滚。但是,在完成回滚后计算机可能无法完全还原到它的初始状态。
+正在安装程序集“D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe”。
+受影响的参数是:
+ logtoconsole =
+ logfile = D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.InstallLog
+ assemblypath = D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+正在安装服务 BatchCoreService...
+正在日志 Application 中创建 EventLog 源 BatchCoreService...
+正在回滚程序集“D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe”。
+受影响的参数是:
+ logtoconsole =
+ logfile = D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.InstallLog
+ assemblypath = D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+正在将事件日志还原到源 BatchCoreService 的前一状态。
+在 System.Diagnostics.EventLogInstaller 安装程序的“回滚”阶段发生异常。
+System.Security.SecurityException: 未找到源,但未能搜索某些或全部事件日志。不可访问的日志: Security。
+在安装的“回滚”阶段发生异常。将忽略该异常并继续回滚。但是,在完成回滚后计算机可能无法完全还原到它的初始状态。
+正在安装程序集“D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe”。
+受影响的参数是:
+ logtoconsole =
+ logfile = D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.InstallLog
+ assemblypath = D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+正在安装服务 BatchCoreService...
+已成功安装服务 BatchCoreService。
+正在日志 Application 中创建 EventLog 源 BatchCoreService...
+正在提交程序集“D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe”。
+受影响的参数是:
+ logtoconsole =
+ logfile = D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.InstallLog
+ assemblypath = D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+Installing assembly 'G:\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe'.
+Affected parameters are:
+ logtoconsole =
+ logfile = G:\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.InstallLog
+ assemblypath = G:\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+Installing service BatchCoreService...
+Service BatchCoreService has been successfully installed.
+Creating EventLog source BatchCoreService in log Application...
+Committing assembly 'G:\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe'.
+Affected parameters are:
+ logtoconsole =
+ logfile = G:\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.InstallLog
+ assemblypath = G:\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+Installing assembly 'E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe'.
+Affected parameters are:
+ logtoconsole =
+ logfile = E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.InstallLog
+ assemblypath = E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+Installing service BatchCoreService...
+Service BatchCoreService has been successfully installed.
+Creating EventLog source BatchCoreService in log Application...
+Committing assembly 'E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe'.
+Affected parameters are:
+ logtoconsole =
+ logfile = E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.InstallLog
+ assemblypath = E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
diff --git a/SCADA/Program/BatchCoreService/bin/Release/BatchCoreService.InstallState b/SCADA/Program/BatchCoreService/bin/Release/BatchCoreService.InstallState
new file mode 100644
index 0000000..d0d1367
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/bin/Release/BatchCoreService.InstallState
@@ -0,0 +1 @@
+0.7223_reserved_nestedSavedStates_reserved_lastInstallerAttempted0.72230.7247AccountLocalSystem-10.7247installedtrue0.7267logExistsalreadyRegisteredbaseInstalledAndPlatformOKtrue-1falsetrue010
\ No newline at end of file
diff --git a/SCADA/Program/BatchCoreService/bin/Release/BatchCoreService.exe b/SCADA/Program/BatchCoreService/bin/Release/BatchCoreService.exe
new file mode 100644
index 0000000..2847f25
Binary files /dev/null and b/SCADA/Program/BatchCoreService/bin/Release/BatchCoreService.exe differ
diff --git a/SCADA/Program/BatchCoreService/bin/Release/BatchCoreService.exe.config b/SCADA/Program/BatchCoreService/bin/Release/BatchCoreService.exe.config
new file mode 100644
index 0000000..3c90996
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/bin/Release/BatchCoreService.exe.config
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/BatchCoreService/bin/Release/BatchCoreService.vshost.exe b/SCADA/Program/BatchCoreService/bin/Release/BatchCoreService.vshost.exe
new file mode 100644
index 0000000..bb84a51
Binary files /dev/null and b/SCADA/Program/BatchCoreService/bin/Release/BatchCoreService.vshost.exe differ
diff --git a/SCADA/Program/BatchCoreService/bin/Release/BatchCoreService.vshost.exe.config b/SCADA/Program/BatchCoreService/bin/Release/BatchCoreService.vshost.exe.config
new file mode 100644
index 0000000..faed99f
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/bin/Release/BatchCoreService.vshost.exe.config
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SCADA/Program/BatchCoreService/bin/Release/BatchCoreService.vshost.exe.manifest b/SCADA/Program/BatchCoreService/bin/Release/BatchCoreService.vshost.exe.manifest
new file mode 100644
index 0000000..061c9ca
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/bin/Release/BatchCoreService.vshost.exe.manifest
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/BatchCoreService/bin/Release/ClientDriver.dll b/SCADA/Program/BatchCoreService/bin/Release/ClientDriver.dll
new file mode 100644
index 0000000..f53d754
Binary files /dev/null and b/SCADA/Program/BatchCoreService/bin/Release/ClientDriver.dll differ
diff --git a/SCADA/Program/BatchCoreService/bin/Release/DataHelper.dll b/SCADA/Program/BatchCoreService/bin/Release/DataHelper.dll
new file mode 100644
index 0000000..53b2c68
Binary files /dev/null and b/SCADA/Program/BatchCoreService/bin/Release/DataHelper.dll differ
diff --git a/SCADA/Program/BatchCoreService/bin/Release/DataService.dll b/SCADA/Program/BatchCoreService/bin/Release/DataService.dll
new file mode 100644
index 0000000..f03c31e
Binary files /dev/null and b/SCADA/Program/BatchCoreService/bin/Release/DataService.dll differ
diff --git a/SCADA/Program/BatchCoreService/obj/x86/Debug/BatchCoreService.BatchCoreService.resources b/SCADA/Program/BatchCoreService/obj/x86/Debug/BatchCoreService.BatchCoreService.resources
new file mode 100644
index 0000000..6c05a97
Binary files /dev/null and b/SCADA/Program/BatchCoreService/obj/x86/Debug/BatchCoreService.BatchCoreService.resources differ
diff --git a/SCADA/Program/BatchCoreService/obj/x86/Debug/BatchCoreService.ProjectInstaller.resources b/SCADA/Program/BatchCoreService/obj/x86/Debug/BatchCoreService.ProjectInstaller.resources
new file mode 100644
index 0000000..6c05a97
Binary files /dev/null and b/SCADA/Program/BatchCoreService/obj/x86/Debug/BatchCoreService.ProjectInstaller.resources differ
diff --git a/SCADA/Program/BatchCoreService/obj/x86/Debug/BatchCoreService.csproj.FileListAbsolute.txt b/SCADA/Program/BatchCoreService/obj/x86/Debug/BatchCoreService.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..0566a3b
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/obj/x86/Debug/BatchCoreService.csproj.FileListAbsolute.txt
@@ -0,0 +1,134 @@
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Debug\App.config
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Debug\BatchCoreService.exe.config
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Debug\BatchCoreService.exe
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Debug\BatchCoreService.pdb
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Debug\BatchCommon.dll
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Debug\ClientDriver.dll
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Debug\DataHelper.dll
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Debug\DataService.dll
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Debug\protobuf-net.dll
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Debug\DataService.pdb
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Debug\BatchCommon.pdb
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Debug\ClientDriver.pdb
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.csprojResolveAssemblyReference.cache
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.BatchCoreService.resources
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.ProjectInstaller.resources
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.csproj.GenerateResource.Cache
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.exe
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.pdb
+F:\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\App.config
+F:\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\BatchCoreService.exe.config
+F:\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\BatchCoreService.exe
+F:\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\BatchCoreService.pdb
+F:\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\BatchCommon.dll
+F:\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\ClientDriver.dll
+F:\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\DataHelper.dll
+F:\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\DataService.dll
+F:\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\DataService.pdb
+F:\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\BatchCommon.pdb
+F:\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\ClientDriver.pdb
+F:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.csprojResolveAssemblyReference.cache
+F:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.BatchCoreService.resources
+F:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.ProjectInstaller.resources
+F:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.csproj.GenerateResource.Cache
+F:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.exe
+F:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.pdb
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\App.config
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\BatchCoreService.exe.config
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\BatchCoreService.exe
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\BatchCoreService.pdb
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\BatchCommon.dll
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\ClientDriver.dll
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\DataHelper.dll
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\DataService.dll
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\DataService.pdb
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\BatchCommon.pdb
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\ClientDriver.pdb
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.csprojResolveAssemblyReference.cache
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.BatchCoreService.resources
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.ProjectInstaller.resources
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.csproj.GenerateResource.Cache
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.exe
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.pdb
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.csprojResolveAssemblyReference.cache
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.BatchCoreService.resources
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.ProjectInstaller.resources
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.csproj.GenerateResource.Cache
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.exe
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Debug\BatchCoreService.pdb
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\App.config
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\BatchCoreService.exe.config
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\BatchCoreService.exe
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\BatchCoreService.pdb
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\BatchCommon.dll
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\ClientDriver.dll
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\DataHelper.dll
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\DataService.dll
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\DataService.pdb
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\BatchCommon.pdb
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\bin\Debug\ClientDriver.pdb
+E:\Project\牧羊上位机\Program\BatchCoreService\bin\Debug\App.config
+E:\Project\牧羊上位机\Program\BatchCoreService\bin\Debug\BatchCoreService.exe.config
+E:\Project\牧羊上位机\Program\BatchCoreService\bin\Debug\BatchCoreService.exe
+E:\Project\牧羊上位机\Program\BatchCoreService\bin\Debug\BatchCoreService.pdb
+E:\Project\牧羊上位机\Program\BatchCoreService\bin\Debug\BatchCommon.dll
+E:\Project\牧羊上位机\Program\BatchCoreService\bin\Debug\ClientDriver.dll
+E:\Project\牧羊上位机\Program\BatchCoreService\bin\Debug\DataHelper.dll
+E:\Project\牧羊上位机\Program\BatchCoreService\bin\Debug\DataService.dll
+E:\Project\牧羊上位机\Program\BatchCoreService\bin\Debug\BatchCommon.pdb
+E:\Project\牧羊上位机\Program\BatchCoreService\bin\Debug\ClientDriver.pdb
+E:\Project\牧羊上位机\Program\BatchCoreService\bin\Debug\DataService.pdb
+E:\Project\牧羊上位机\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.csprojResolveAssemblyReference.cache
+E:\Project\牧羊上位机\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.BatchCoreService.resources
+E:\Project\牧羊上位机\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.ProjectInstaller.resources
+E:\Project\牧羊上位机\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.csproj.GenerateResource.Cache
+E:\Project\牧羊上位机\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.exe
+E:\Project\牧羊上位机\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.pdb
+E:\Project\SCADA\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.csprojResolveAssemblyReference.cache
+E:\Project\SCADA\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.BatchCoreService.resources
+E:\Project\SCADA\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.ProjectInstaller.resources
+E:\Project\SCADA\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.csproj.GenerateResource.Cache
+E:\Project\SCADA\Program\BatchCoreService\bin\Debug\App.config
+E:\Project\SCADA\Program\BatchCoreService\bin\Debug\BatchCoreService.exe.config
+E:\Project\SCADA\Program\BatchCoreService\bin\Debug\BatchCoreService.exe
+E:\Project\SCADA\Program\BatchCoreService\bin\Debug\BatchCoreService.pdb
+E:\Project\SCADA\Program\BatchCoreService\bin\Debug\ClientDriver.dll
+E:\Project\SCADA\Program\BatchCoreService\bin\Debug\DataHelper.dll
+E:\Project\SCADA\Program\BatchCoreService\bin\Debug\DataService.dll
+E:\Project\SCADA\Program\BatchCoreService\bin\Debug\ClientDriver.pdb
+E:\Project\SCADA\Program\BatchCoreService\bin\Debug\DataHelper.pdb
+E:\Project\SCADA\Program\BatchCoreService\bin\Debug\DataService.pdb
+E:\Project\SCADA\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.exe
+E:\Project\SCADA\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.pdb
+E:\SCADA\Program\BatchCoreService\bin\Debug\App.config
+E:\SCADA\Program\BatchCoreService\bin\Debug\BatchCoreService.exe.config
+E:\SCADA\Program\BatchCoreService\bin\Debug\BatchCoreService.exe
+E:\SCADA\Program\BatchCoreService\bin\Debug\BatchCoreService.pdb
+E:\SCADA\Program\BatchCoreService\bin\Debug\ClientDriver.dll
+E:\SCADA\Program\BatchCoreService\bin\Debug\DataHelper.dll
+E:\SCADA\Program\BatchCoreService\bin\Debug\DataService.dll
+E:\SCADA\Program\BatchCoreService\bin\Debug\ClientDriver.pdb
+E:\SCADA\Program\BatchCoreService\bin\Debug\DataHelper.pdb
+E:\SCADA\Program\BatchCoreService\bin\Debug\DataService.pdb
+E:\SCADA\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.csprojResolveAssemblyReference.cache
+E:\SCADA\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.BatchCoreService.resources
+E:\SCADA\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.ProjectInstaller.resources
+E:\SCADA\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.csproj.GenerateResource.Cache
+E:\SCADA\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.exe
+E:\SCADA\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.pdb
+E:\新建文件夹\SCADA\Program\BatchCoreService\bin\Debug\App.config
+E:\新建文件夹\SCADA\Program\BatchCoreService\bin\Debug\BatchCoreService.exe.config
+E:\新建文件夹\SCADA\Program\BatchCoreService\bin\Debug\BatchCoreService.exe
+E:\新建文件夹\SCADA\Program\BatchCoreService\bin\Debug\BatchCoreService.pdb
+E:\新建文件夹\SCADA\Program\BatchCoreService\bin\Debug\ClientDriver.dll
+E:\新建文件夹\SCADA\Program\BatchCoreService\bin\Debug\DataHelper.dll
+E:\新建文件夹\SCADA\Program\BatchCoreService\bin\Debug\DataService.dll
+E:\新建文件夹\SCADA\Program\BatchCoreService\bin\Debug\ClientDriver.pdb
+E:\新建文件夹\SCADA\Program\BatchCoreService\bin\Debug\DataHelper.pdb
+E:\新建文件夹\SCADA\Program\BatchCoreService\bin\Debug\DataService.pdb
+E:\新建文件夹\SCADA\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.csprojResolveAssemblyReference.cache
+E:\新建文件夹\SCADA\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.BatchCoreService.resources
+E:\新建文件夹\SCADA\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.ProjectInstaller.resources
+E:\新建文件夹\SCADA\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.csproj.GenerateResource.Cache
+E:\新建文件夹\SCADA\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.exe
+E:\新建文件夹\SCADA\Program\BatchCoreService\obj\x86\Debug\BatchCoreService.pdb
diff --git a/SCADA/Program/BatchCoreService/obj/x86/Debug/BatchCoreService.exe b/SCADA/Program/BatchCoreService/obj/x86/Debug/BatchCoreService.exe
new file mode 100644
index 0000000..80c648e
Binary files /dev/null and b/SCADA/Program/BatchCoreService/obj/x86/Debug/BatchCoreService.exe differ
diff --git a/SCADA/Program/BatchCoreService/obj/x86/Release/BatchCoreService.BatchCoreService.resources b/SCADA/Program/BatchCoreService/obj/x86/Release/BatchCoreService.BatchCoreService.resources
new file mode 100644
index 0000000..6c05a97
Binary files /dev/null and b/SCADA/Program/BatchCoreService/obj/x86/Release/BatchCoreService.BatchCoreService.resources differ
diff --git a/SCADA/Program/BatchCoreService/obj/x86/Release/BatchCoreService.ProjectInstaller.resources b/SCADA/Program/BatchCoreService/obj/x86/Release/BatchCoreService.ProjectInstaller.resources
new file mode 100644
index 0000000..6c05a97
Binary files /dev/null and b/SCADA/Program/BatchCoreService/obj/x86/Release/BatchCoreService.ProjectInstaller.resources differ
diff --git a/SCADA/Program/BatchCoreService/obj/x86/Release/BatchCoreService.csproj.FileListAbsolute.txt b/SCADA/Program/BatchCoreService/obj/x86/Release/BatchCoreService.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..4a2aecf
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/obj/x86/Release/BatchCoreService.csproj.FileListAbsolute.txt
@@ -0,0 +1,230 @@
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\App.config
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe.config
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.pdb
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCommon.dll
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\ClientDriver.dll
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\DataHelper.dll
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\DataService.dll
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\protobuf-net.dll
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\DataService.pdb
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCommon.pdb
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\ClientDriver.pdb
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.csprojResolveAssemblyReference.cache
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.BatchCoreService.resources
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.ProjectInstaller.resources
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.csproj.GenerateResource.Cache
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.exe
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.pdb
+D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\App.config
+D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe.config
+D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.pdb
+D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCommon.dll
+D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\ClientDriver.dll
+D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\DataHelper.dll
+D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\DataService.dll
+D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\protobuf-net.dll
+D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\DataService.pdb
+D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCommon.pdb
+D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\bin\Release\ClientDriver.pdb
+D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.csprojResolveAssemblyReference.cache
+D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.BatchCoreService.resources
+D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.ProjectInstaller.resources
+D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.csproj.GenerateResource.Cache
+D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.exe
+D:\大成0211new_20140302\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.pdb
+D:\大成0211\DataExchange\BatchCoreService\bin\Release\App.config
+D:\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe.config
+D:\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+D:\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.pdb
+D:\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCommon.dll
+D:\大成0211\DataExchange\BatchCoreService\bin\Release\ClientDriver.dll
+D:\大成0211\DataExchange\BatchCoreService\bin\Release\DataHelper.dll
+D:\大成0211\DataExchange\BatchCoreService\bin\Release\DataService.dll
+D:\大成0211\DataExchange\BatchCoreService\bin\Release\protobuf-net.dll
+D:\大成0211\DataExchange\BatchCoreService\bin\Release\DataService.pdb
+D:\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCommon.pdb
+D:\大成0211\DataExchange\BatchCoreService\bin\Release\ClientDriver.pdb
+D:\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.csprojResolveAssemblyReference.cache
+D:\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.BatchCoreService.resources
+D:\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.ProjectInstaller.resources
+D:\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.csproj.GenerateResource.Cache
+D:\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.exe
+D:\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.pdb
+G:\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCommon.dll
+G:\大成0211\DataExchange\BatchCoreService\bin\Release\ClientDriver.dll
+G:\大成0211\DataExchange\BatchCoreService\bin\Release\DataHelper.dll
+G:\大成0211\DataExchange\BatchCoreService\bin\Release\DataService.dll
+G:\大成0211\DataExchange\BatchCoreService\bin\Release\protobuf-net.dll
+G:\大成0211\DataExchange\BatchCoreService\bin\Release\DataService.pdb
+G:\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCommon.pdb
+G:\大成0211\DataExchange\BatchCoreService\bin\Release\ClientDriver.pdb
+G:\大成0211\DataExchange\BatchCoreService\obj\x86\Release\ResolveAssemblyReference.cache
+G:\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.BatchCoreService.resources
+G:\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.ProjectInstaller.resources
+G:\大成0211\DataExchange\BatchCoreService\obj\x86\Release\GenerateResource.read.1.tlog
+G:\大成0211\DataExchange\BatchCoreService\obj\x86\Release\GenerateResource.write.1.tlog
+G:\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.exe
+G:\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.pdb
+G:\大成0211\DataExchange\BatchCoreService\bin\Release\App.config
+G:\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe.config
+G:\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+G:\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.pdb
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Release\App.config
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe.config
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCoreService.pdb
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCommon.dll
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Release\ClientDriver.dll
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Release\DataHelper.dll
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Release\DataService.dll
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Release\protobuf-net.dll
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Release\DataService.pdb
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Release\BatchCommon.pdb
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\bin\Release\ClientDriver.pdb
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.csprojResolveAssemblyReference.cache
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.BatchCoreService.resources
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.ProjectInstaller.resources
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.csproj.GenerateResource.Cache
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.exe
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.pdb
+E:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\App.config
+E:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe.config
+E:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+E:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCoreService.pdb
+E:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCommon.dll
+E:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\ClientDriver.dll
+E:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\DataHelper.dll
+E:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\DataService.dll
+E:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\DataService.pdb
+E:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCommon.pdb
+E:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\ClientDriver.pdb
+E:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.BatchCoreService.resources
+E:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.ProjectInstaller.resources
+E:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.exe
+E:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.pdb
+D:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\App.config
+D:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe.config
+D:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+D:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCoreService.pdb
+D:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCommon.dll
+D:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\ClientDriver.dll
+D:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\DataHelper.dll
+D:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\DataService.dll
+D:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\protobuf-net.dll
+D:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\DataService.pdb
+D:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCommon.pdb
+D:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\ClientDriver.pdb
+D:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\ResolveAssemblyReference.cache
+D:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.BatchCoreService.resources
+D:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.ProjectInstaller.resources
+D:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\GenerateResource.read.1.tlog
+D:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\GenerateResource.write.1.tlog
+D:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.exe
+D:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.pdb
+E:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.csprojResolveAssemblyReference.cache
+E:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.csproj.GenerateResource.Cache
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreService\bin\Release\App.config
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe.config
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCoreService.pdb
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCommon.dll
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreService\bin\Release\ClientDriver.dll
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreService\bin\Release\DataHelper.dll
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreService\bin\Release\DataService.dll
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreService\bin\Release\protobuf-net.dll
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreService\bin\Release\DataService.pdb
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCommon.pdb
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreService\bin\Release\ClientDriver.pdb
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.csprojResolveAssemblyReference.cache
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.BatchCoreService.resources
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.ProjectInstaller.resources
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.csproj.GenerateResource.Cache
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.exe
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.pdb
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\App.config
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe.config
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCoreService.pdb
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCommon.dll
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\ClientDriver.dll
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\DataHelper.dll
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\DataService.dll
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\protobuf-net.dll
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\DataService.pdb
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCommon.pdb
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\ClientDriver.pdb
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.csprojResolveAssemblyReference.cache
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.BatchCoreService.resources
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.ProjectInstaller.resources
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.csproj.GenerateResource.Cache
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.exe
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.pdb
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\App.config
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe.config
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCoreService.pdb
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCommon.dll
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\ClientDriver.dll
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\DataHelper.dll
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\DataService.dll
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\DataService.pdb
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCommon.pdb
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\bin\Release\ClientDriver.pdb
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.csprojResolveAssemblyReference.cache
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.BatchCoreService.resources
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.ProjectInstaller.resources
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.csproj.GenerateResource.Cache
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.exe
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.pdb
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\bin\Release\App.config
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe.config
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCoreService.pdb
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCommon.dll
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\bin\Release\ClientDriver.dll
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\bin\Release\DataHelper.dll
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\bin\Release\DataService.dll
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\bin\Release\DataService.pdb
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCommon.pdb
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\bin\Release\ClientDriver.pdb
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.csprojResolveAssemblyReference.cache
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.BatchCoreService.resources
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.ProjectInstaller.resources
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.csproj.GenerateResource.Cache
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.exe
+E:\Project\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.pdb
+F:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\App.config
+F:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe.config
+F:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCoreService.exe
+F:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCoreService.pdb
+F:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCommon.dll
+F:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\ClientDriver.dll
+F:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\DataHelper.dll
+F:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\DataService.dll
+F:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\DataService.pdb
+F:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\BatchCommon.pdb
+F:\牧羊上位机\DataExchange\BatchCoreService\bin\Release\ClientDriver.pdb
+F:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.csprojResolveAssemblyReference.cache
+F:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.BatchCoreService.resources
+F:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.ProjectInstaller.resources
+F:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.csproj.GenerateResource.Cache
+F:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.exe
+F:\牧羊上位机\DataExchange\BatchCoreService\obj\x86\Release\BatchCoreService.pdb
+E:\SCADA\Program\BatchCoreService\bin\Release\App.config
+E:\SCADA\Program\BatchCoreService\bin\Release\BatchCoreService.exe.config
+E:\SCADA\Program\BatchCoreService\bin\Release\BatchCoreService.exe
+E:\SCADA\Program\BatchCoreService\bin\Release\BatchCoreService.pdb
+E:\SCADA\Program\BatchCoreService\bin\Release\ClientDriver.dll
+E:\SCADA\Program\BatchCoreService\bin\Release\DataHelper.dll
+E:\SCADA\Program\BatchCoreService\bin\Release\DataService.dll
+E:\SCADA\Program\BatchCoreService\bin\Release\ClientDriver.pdb
+E:\SCADA\Program\BatchCoreService\bin\Release\DataHelper.pdb
+E:\SCADA\Program\BatchCoreService\bin\Release\DataService.pdb
+E:\SCADA\Program\BatchCoreService\obj\x86\Release\BatchCoreService.csprojResolveAssemblyReference.cache
+E:\SCADA\Program\BatchCoreService\obj\x86\Release\BatchCoreService.BatchCoreService.resources
+E:\SCADA\Program\BatchCoreService\obj\x86\Release\BatchCoreService.ProjectInstaller.resources
+E:\SCADA\Program\BatchCoreService\obj\x86\Release\BatchCoreService.csproj.GenerateResource.Cache
+E:\SCADA\Program\BatchCoreService\obj\x86\Release\BatchCoreService.exe
+E:\SCADA\Program\BatchCoreService\obj\x86\Release\BatchCoreService.pdb
diff --git a/SCADA/Program/BatchCoreService/obj/x86/Release/BatchCoreService.exe b/SCADA/Program/BatchCoreService/obj/x86/Release/BatchCoreService.exe
new file mode 100644
index 0000000..2847f25
Binary files /dev/null and b/SCADA/Program/BatchCoreService/obj/x86/Release/BatchCoreService.exe differ
diff --git a/SCADA/Program/BatchCoreService/obj/x86/Release/build.force b/SCADA/Program/BatchCoreService/obj/x86/Release/build.force
new file mode 100644
index 0000000..e69de29
diff --git a/SCADA/Program/BatchCoreTest/App.config b/SCADA/Program/BatchCoreTest/App.config
new file mode 100644
index 0000000..88a4443
--- /dev/null
+++ b/SCADA/Program/BatchCoreTest/App.config
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/BatchCoreTest/BatchCoreTest.csproj b/SCADA/Program/BatchCoreTest/BatchCoreTest.csproj
new file mode 100644
index 0000000..b49662e
--- /dev/null
+++ b/SCADA/Program/BatchCoreTest/BatchCoreTest.csproj
@@ -0,0 +1,110 @@
+
+
+
+ Debug
+ x86
+ 8.0.30703
+ 2.0
+ {42D3168A-BBD0-4546-8C29-B2BECB795DA5}
+ Exe
+ Properties
+ BatchCoreService
+ BatchCoreTest
+ v4.0
+
+
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+
+
+ x86
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ x86
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DAService.cs
+
+
+ SqlMapping.cs
+
+
+ Code
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+ Designer
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+ {6DF53968-152D-4CA9-B62F-FF1C27069C4D}
+ ClientDriver
+
+
+ {755c5459-bca4-4729-a93c-0c73a41bdf3c}
+ DataHelper
+
+
+ {8965e389-6466-4b30-bd43-83c909044637}
+ DataService
+
+
+
+
+
\ No newline at end of file
diff --git a/SCADA/Program/BatchCoreTest/Program.cs b/SCADA/Program/BatchCoreTest/Program.cs
new file mode 100644
index 0000000..55e9ef3
--- /dev/null
+++ b/SCADA/Program/BatchCoreTest/Program.cs
@@ -0,0 +1,50 @@
+using System;
+using System.ServiceModel;
+
+namespace BatchCoreService
+{
+ static class Program
+ {
+ ///
+ /// The main entry point for the application.
+ ///
+ static void Main()
+ {
+ BatchCoreTest srv = new BatchCoreTest();
+ Console.ReadLine();
+ }
+ }
+
+ public class BatchCoreTest : IDisposable
+ {
+ //DAService service;
+ ServiceHost serviceHost = null;
+
+ public BatchCoreTest()
+ {
+ //service = new DAService();
+ if (serviceHost != null)
+ {
+ serviceHost.Close();
+ }
+
+ // Create a ServiceHost for the CalculatorService type and
+ // provide the base address.
+ serviceHost = new ServiceHost(typeof(DAService));
+
+ // Open the ServiceHostBase to create listeners and start
+ // listening for messages.
+ serviceHost.Open();
+ //Console.ReadLine();
+ }
+
+ public void Dispose()
+ {
+ if (serviceHost != null)
+ {
+ serviceHost.Close();
+ serviceHost = null;
+ }
+ }
+ }
+}
diff --git a/SCADA/Program/BatchCoreTest/Properties/AssemblyInfo.cs b/SCADA/Program/BatchCoreTest/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..5ac0983
--- /dev/null
+++ b/SCADA/Program/BatchCoreTest/Properties/AssemblyInfo.cs
@@ -0,0 +1,43 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("BatchCoreTest")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("BatchCoreTest")]
+[assembly: AssemblyCopyright("Copyright © 2014")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+//In order to begin building localizable applications, set
+//CultureYouAreCodingWith in your .csproj file
+//inside a . For example, if you are using US english
+//in your source files, set the to en-US. Then uncomment
+//the NeutralResourceLanguage attribute below. Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/SCADA/Program/BatchCoreTest/Properties/Resources.Designer.cs b/SCADA/Program/BatchCoreTest/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..c551a50
--- /dev/null
+++ b/SCADA/Program/BatchCoreTest/Properties/Resources.Designer.cs
@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18063
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace BatchCoreService.Properties {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BatchCoreService.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/SCADA/Program/BatchCoreTest/Properties/Resources.resx b/SCADA/Program/BatchCoreTest/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/SCADA/Program/BatchCoreTest/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/SCADA/Program/BatchCoreTest/Properties/Settings.Designer.cs b/SCADA/Program/BatchCoreTest/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..8ed59f3
--- /dev/null
+++ b/SCADA/Program/BatchCoreTest/Properties/Settings.Designer.cs
@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18063
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace BatchCoreService.Properties {
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default {
+ get {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/SCADA/Program/BatchCoreTest/Properties/Settings.settings b/SCADA/Program/BatchCoreTest/Properties/Settings.settings
new file mode 100644
index 0000000..033d7a5
--- /dev/null
+++ b/SCADA/Program/BatchCoreTest/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SCADA/Program/BatchCoreTest/bin/Debug/BatchCoreTest.exe b/SCADA/Program/BatchCoreTest/bin/Debug/BatchCoreTest.exe
new file mode 100644
index 0000000..515f469
Binary files /dev/null and b/SCADA/Program/BatchCoreTest/bin/Debug/BatchCoreTest.exe differ
diff --git a/SCADA/Program/BatchCoreTest/bin/Debug/BatchCoreTest.exe.config b/SCADA/Program/BatchCoreTest/bin/Debug/BatchCoreTest.exe.config
new file mode 100644
index 0000000..88a4443
--- /dev/null
+++ b/SCADA/Program/BatchCoreTest/bin/Debug/BatchCoreTest.exe.config
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/BatchCoreTest/bin/Debug/BatchCoreTest.vshost.exe b/SCADA/Program/BatchCoreTest/bin/Debug/BatchCoreTest.vshost.exe
new file mode 100644
index 0000000..681ab77
Binary files /dev/null and b/SCADA/Program/BatchCoreTest/bin/Debug/BatchCoreTest.vshost.exe differ
diff --git a/SCADA/Program/BatchCoreTest/bin/Debug/BatchCoreTest.vshost.exe.config b/SCADA/Program/BatchCoreTest/bin/Debug/BatchCoreTest.vshost.exe.config
new file mode 100644
index 0000000..88a4443
--- /dev/null
+++ b/SCADA/Program/BatchCoreTest/bin/Debug/BatchCoreTest.vshost.exe.config
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/BatchCoreTest/bin/Debug/BatchCoreTest.vshost.exe.manifest b/SCADA/Program/BatchCoreTest/bin/Debug/BatchCoreTest.vshost.exe.manifest
new file mode 100644
index 0000000..061c9ca
--- /dev/null
+++ b/SCADA/Program/BatchCoreTest/bin/Debug/BatchCoreTest.vshost.exe.manifest
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/BatchCoreTest/bin/Debug/ClientDriver.dll b/SCADA/Program/BatchCoreTest/bin/Debug/ClientDriver.dll
new file mode 100644
index 0000000..0078ad8
Binary files /dev/null and b/SCADA/Program/BatchCoreTest/bin/Debug/ClientDriver.dll differ
diff --git a/SCADA/Program/BatchCoreTest/bin/Debug/DataHelper.dll b/SCADA/Program/BatchCoreTest/bin/Debug/DataHelper.dll
new file mode 100644
index 0000000..21bf117
Binary files /dev/null and b/SCADA/Program/BatchCoreTest/bin/Debug/DataHelper.dll differ
diff --git a/SCADA/Program/BatchCoreTest/bin/Debug/DataService.dll b/SCADA/Program/BatchCoreTest/bin/Debug/DataService.dll
new file mode 100644
index 0000000..e84e58d
Binary files /dev/null and b/SCADA/Program/BatchCoreTest/bin/Debug/DataService.dll differ
diff --git a/SCADA/Program/BatchCoreTest/bin/Release/AsyncClientDriver.dll b/SCADA/Program/BatchCoreTest/bin/Release/AsyncClientDriver.dll
new file mode 100644
index 0000000..474a5da
Binary files /dev/null and b/SCADA/Program/BatchCoreTest/bin/Release/AsyncClientDriver.dll differ
diff --git a/SCADA/Program/BatchCoreTest/bin/Release/BatchCommon.dll b/SCADA/Program/BatchCoreTest/bin/Release/BatchCommon.dll
new file mode 100644
index 0000000..6a3ca6d
Binary files /dev/null and b/SCADA/Program/BatchCoreTest/bin/Release/BatchCommon.dll differ
diff --git a/SCADA/Program/BatchCoreTest/bin/Release/BatchCoreTest.exe b/SCADA/Program/BatchCoreTest/bin/Release/BatchCoreTest.exe
new file mode 100644
index 0000000..3cae248
Binary files /dev/null and b/SCADA/Program/BatchCoreTest/bin/Release/BatchCoreTest.exe differ
diff --git a/SCADA/Program/BatchCoreTest/bin/Release/BatchCoreTest.exe.config b/SCADA/Program/BatchCoreTest/bin/Release/BatchCoreTest.exe.config
new file mode 100644
index 0000000..88a4443
--- /dev/null
+++ b/SCADA/Program/BatchCoreTest/bin/Release/BatchCoreTest.exe.config
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/BatchCoreTest/bin/Release/BatchCoreTest.vshost.exe b/SCADA/Program/BatchCoreTest/bin/Release/BatchCoreTest.vshost.exe
new file mode 100644
index 0000000..681ab77
Binary files /dev/null and b/SCADA/Program/BatchCoreTest/bin/Release/BatchCoreTest.vshost.exe differ
diff --git a/SCADA/Program/BatchCoreTest/bin/Release/BatchCoreTest.vshost.exe.config b/SCADA/Program/BatchCoreTest/bin/Release/BatchCoreTest.vshost.exe.config
new file mode 100644
index 0000000..88a4443
--- /dev/null
+++ b/SCADA/Program/BatchCoreTest/bin/Release/BatchCoreTest.vshost.exe.config
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/BatchCoreTest/bin/Release/BatchCoreTest.vshost.exe.manifest b/SCADA/Program/BatchCoreTest/bin/Release/BatchCoreTest.vshost.exe.manifest
new file mode 100644
index 0000000..061c9ca
--- /dev/null
+++ b/SCADA/Program/BatchCoreTest/bin/Release/BatchCoreTest.vshost.exe.manifest
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/BatchCoreTest/bin/Release/ClientDriver.dll b/SCADA/Program/BatchCoreTest/bin/Release/ClientDriver.dll
new file mode 100644
index 0000000..38a3ac6
Binary files /dev/null and b/SCADA/Program/BatchCoreTest/bin/Release/ClientDriver.dll differ
diff --git a/SCADA/Program/BatchCoreTest/bin/Release/DataHelper.dll b/SCADA/Program/BatchCoreTest/bin/Release/DataHelper.dll
new file mode 100644
index 0000000..4bd0b06
Binary files /dev/null and b/SCADA/Program/BatchCoreTest/bin/Release/DataHelper.dll differ
diff --git a/SCADA/Program/BatchCoreTest/bin/Release/DataService.dll b/SCADA/Program/BatchCoreTest/bin/Release/DataService.dll
new file mode 100644
index 0000000..f2fda2d
Binary files /dev/null and b/SCADA/Program/BatchCoreTest/bin/Release/DataService.dll differ
diff --git a/SCADA/Program/BatchCoreTest/obj/x86/Debug/App.g.i.cs b/SCADA/Program/BatchCoreTest/obj/x86/Debug/App.g.i.cs
new file mode 100644
index 0000000..67785d2
--- /dev/null
+++ b/SCADA/Program/BatchCoreTest/obj/x86/Debug/App.g.i.cs
@@ -0,0 +1,69 @@
+#pragma checksum "..\..\..\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "12034D0952AF1C1ECD2F6DA3895F79F2"
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18063
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+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.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 BatchCoreTest {
+
+
+ ///
+ /// App
+ ///
+ public partial class App : System.Windows.Application {
+
+ ///
+ /// InitializeComponent
+ ///
+ [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent() {
+
+ #line 4 "..\..\..\App.xaml"
+ this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
+
+ #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() {
+ BatchCoreTest.App app = new BatchCoreTest.App();
+ app.InitializeComponent();
+ app.Run();
+ }
+ }
+}
+
diff --git a/SCADA/Program/BatchCoreTest/obj/x86/Debug/BatchCoreService.Properties.Resources.resources b/SCADA/Program/BatchCoreTest/obj/x86/Debug/BatchCoreService.Properties.Resources.resources
new file mode 100644
index 0000000..6c05a97
Binary files /dev/null and b/SCADA/Program/BatchCoreTest/obj/x86/Debug/BatchCoreService.Properties.Resources.resources differ
diff --git a/SCADA/Program/BatchCoreTest/obj/x86/Debug/BatchCoreTest.csproj.FileListAbsolute.txt b/SCADA/Program/BatchCoreTest/obj/x86/Debug/BatchCoreTest.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..0551944
--- /dev/null
+++ b/SCADA/Program/BatchCoreTest/obj/x86/Debug/BatchCoreTest.csproj.FileListAbsolute.txt
@@ -0,0 +1,123 @@
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\obj\x86\Debug\BatchCoreTest.csprojResolveAssemblyReference.cache
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\obj\x86\Debug\BatchCoreService.Properties.Resources.resources
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\obj\x86\Debug\BatchCoreTest.csproj.GenerateResource.Cache
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\bin\Debug\BatchCoreTest.exe.config
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\bin\Debug\BatchCoreTest.exe
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\bin\Debug\BatchCoreTest.pdb
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\bin\Debug\AsyncClientDriver.dll
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\bin\Debug\BatchCommon.dll
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\bin\Debug\DataHelper.dll
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\bin\Debug\DataService.dll
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\bin\Debug\protobuf-net.dll
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\bin\Debug\DataService.pdb
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\bin\Debug\AsyncClientDriver.pdb
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\bin\Debug\BatchCommon.pdb
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\obj\x86\Debug\BatchCoreTest.exe
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\obj\x86\Debug\BatchCoreTest.pdb
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\BatchCoreTest.exe.config
+F:\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Debug\BatchCoreTest.exe
+F:\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Debug\BatchCoreTest.pdb
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\BatchCoreTest.exe
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\BatchCoreTest.pdb
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\AsyncClientDriver.dll
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\BatchCommon.dll
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\ClientDriver.dll
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\DataHelper.dll
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\DataService.dll
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\DataService.pdb
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\AsyncClientDriver.pdb
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\BatchCommon.pdb
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\ClientDriver.pdb
+F:\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Debug\BatchCoreTest.csprojResolveAssemblyReference.cache
+F:\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Debug\BatchCoreService.Properties.Resources.resources
+F:\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Debug\BatchCoreTest.csproj.GenerateResource.Cache
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\BatchCoreTest.exe.config
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Debug\BatchCoreTest.exe
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Debug\BatchCoreTest.pdb
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\BatchCoreTest.exe
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\BatchCoreTest.pdb
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\AsyncClientDriver.dll
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\BatchCommon.dll
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\ClientDriver.dll
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\DataHelper.dll
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\DataService.dll
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\DataService.pdb
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\AsyncClientDriver.pdb
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\BatchCommon.pdb
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\ClientDriver.pdb
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Debug\BatchCoreTest.csprojResolveAssemblyReference.cache
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Debug\BatchCoreService.Properties.Resources.resources
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Debug\BatchCoreTest.csproj.GenerateResource.Cache
+E:\Project\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Debug\BatchCoreTest.csprojResolveAssemblyReference.cache
+E:\Project\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Debug\BatchCoreService.Properties.Resources.resources
+E:\Project\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Debug\BatchCoreTest.csproj.GenerateResource.Cache
+E:\Project\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Debug\BatchCoreTest.exe
+E:\Project\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Debug\BatchCoreTest.pdb
+E:\Project\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\BatchCoreTest.exe.config
+E:\Project\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\BatchCoreTest.exe
+E:\Project\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\BatchCoreTest.pdb
+E:\Project\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\BatchCommon.dll
+E:\Project\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\ClientDriver.dll
+E:\Project\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\DataHelper.dll
+E:\Project\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\DataService.dll
+E:\Project\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\DataService.pdb
+E:\Project\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\BatchCommon.pdb
+E:\Project\牧羊上位机\DataExchange\BatchCoreTest\bin\Debug\ClientDriver.pdb
+E:\Project\牧羊上位机\Program\BatchCoreTest\bin\Debug\BatchCoreTest.exe.config
+E:\Project\牧羊上位机\Program\BatchCoreTest\bin\Debug\BatchCoreTest.exe
+E:\Project\牧羊上位机\Program\BatchCoreTest\bin\Debug\BatchCoreTest.pdb
+E:\Project\牧羊上位机\Program\BatchCoreTest\bin\Debug\ClientDriver.dll
+E:\Project\牧羊上位机\Program\BatchCoreTest\bin\Debug\DataHelper.dll
+E:\Project\牧羊上位机\Program\BatchCoreTest\bin\Debug\DataService.dll
+E:\Project\牧羊上位机\Program\BatchCoreTest\bin\Debug\ClientDriver.pdb
+E:\Project\牧羊上位机\Program\BatchCoreTest\bin\Debug\DataService.pdb
+E:\Project\牧羊上位机\Program\BatchCoreTest\obj\x86\Debug\BatchCoreTest.csprojResolveAssemblyReference.cache
+E:\Project\牧羊上位机\Program\BatchCoreTest\obj\x86\Debug\BatchCoreService.Properties.Resources.resources
+E:\Project\牧羊上位机\Program\BatchCoreTest\obj\x86\Debug\BatchCoreTest.csproj.GenerateResource.Cache
+E:\Project\牧羊上位机\Program\BatchCoreTest\obj\x86\Debug\BatchCoreTest.exe
+E:\Project\牧羊上位机\Program\BatchCoreTest\obj\x86\Debug\BatchCoreTest.pdb
+E:\Project\SCADA\Program\BatchCoreTest\bin\Debug\BatchCoreTest.exe.config
+E:\Project\SCADA\Program\BatchCoreTest\obj\x86\Debug\BatchCoreTest.exe
+E:\Project\SCADA\Program\BatchCoreTest\obj\x86\Debug\BatchCoreTest.pdb
+E:\Project\SCADA\Program\BatchCoreTest\bin\Debug\BatchCoreTest.exe
+E:\Project\SCADA\Program\BatchCoreTest\bin\Debug\BatchCoreTest.pdb
+E:\Project\SCADA\Program\BatchCoreTest\bin\Debug\ClientDriver.dll
+E:\Project\SCADA\Program\BatchCoreTest\bin\Debug\DataHelper.dll
+E:\Project\SCADA\Program\BatchCoreTest\bin\Debug\DataService.dll
+E:\Project\SCADA\Program\BatchCoreTest\bin\Debug\ClientDriver.pdb
+E:\Project\SCADA\Program\BatchCoreTest\bin\Debug\DataService.pdb
+E:\Project\SCADA\Program\BatchCoreTest\obj\x86\Debug\BatchCoreService.Properties.Resources.resources
+E:\Project\SCADA\Program\BatchCoreTest\obj\x86\Debug\BatchCoreTest.csproj.GenerateResource.Cache
+E:\Project\SCADA\Program\BatchCoreTest\obj\x86\Debug\BatchCoreTest.csprojResolveAssemblyReference.cache
+E:\Project\SCADA\Program\BatchCoreTest\bin\Debug\DataHelper.pdb
+E:\SCADA\Program\BatchCoreTest\bin\Debug\BatchCoreTest.exe.config
+E:\SCADA\Program\BatchCoreTest\obj\x86\Debug\BatchCoreTest.exe
+E:\SCADA\Program\BatchCoreTest\obj\x86\Debug\BatchCoreTest.pdb
+E:\SCADA\Program\BatchCoreTest\bin\Debug\BatchCoreTest.exe
+E:\SCADA\Program\BatchCoreTest\bin\Debug\BatchCoreTest.pdb
+E:\SCADA\Program\BatchCoreTest\bin\Debug\ClientDriver.dll
+E:\SCADA\Program\BatchCoreTest\bin\Debug\DataHelper.dll
+E:\SCADA\Program\BatchCoreTest\bin\Debug\DataService.dll
+E:\SCADA\Program\BatchCoreTest\bin\Debug\ClientDriver.pdb
+E:\SCADA\Program\BatchCoreTest\bin\Debug\DataHelper.pdb
+E:\SCADA\Program\BatchCoreTest\bin\Debug\DataService.pdb
+E:\SCADA\Program\BatchCoreTest\obj\x86\Debug\BatchCoreTest.csprojResolveAssemblyReference.cache
+E:\SCADA\Program\BatchCoreTest\obj\x86\Debug\BatchCoreService.Properties.Resources.resources
+E:\SCADA\Program\BatchCoreTest\obj\x86\Debug\BatchCoreTest.csproj.GenerateResource.Cache
+F:\SCADA\Program\BatchCoreTest\bin\Debug\BatchCoreTest.exe.config
+F:\SCADA\Program\BatchCoreTest\obj\x86\Debug\BatchCoreTest.exe
+F:\SCADA\Program\BatchCoreTest\obj\x86\Debug\BatchCoreTest.pdb
+E:\新建文件夹\SCADA\Program\BatchCoreTest\bin\Debug\BatchCoreTest.exe.config
+E:\新建文件夹\SCADA\Program\BatchCoreTest\obj\x86\Debug\BatchCoreTest.exe
+E:\新建文件夹\SCADA\Program\BatchCoreTest\obj\x86\Debug\BatchCoreTest.pdb
+E:\新建文件夹\SCADA\Program\BatchCoreTest\bin\Debug\BatchCoreTest.exe
+E:\新建文件夹\SCADA\Program\BatchCoreTest\bin\Debug\BatchCoreTest.pdb
+E:\新建文件夹\SCADA\Program\BatchCoreTest\bin\Debug\ClientDriver.dll
+E:\新建文件夹\SCADA\Program\BatchCoreTest\bin\Debug\DataHelper.dll
+E:\新建文件夹\SCADA\Program\BatchCoreTest\bin\Debug\DataService.dll
+E:\新建文件夹\SCADA\Program\BatchCoreTest\bin\Debug\ClientDriver.pdb
+E:\新建文件夹\SCADA\Program\BatchCoreTest\bin\Debug\DataHelper.pdb
+E:\新建文件夹\SCADA\Program\BatchCoreTest\bin\Debug\DataService.pdb
+E:\新建文件夹\SCADA\Program\BatchCoreTest\obj\x86\Debug\BatchCoreTest.csprojResolveAssemblyReference.cache
+E:\新建文件夹\SCADA\Program\BatchCoreTest\obj\x86\Debug\BatchCoreService.Properties.Resources.resources
+E:\新建文件夹\SCADA\Program\BatchCoreTest\obj\x86\Debug\BatchCoreTest.csproj.GenerateResource.Cache
diff --git a/SCADA/Program/BatchCoreTest/obj/x86/Debug/BatchCoreTest.exe b/SCADA/Program/BatchCoreTest/obj/x86/Debug/BatchCoreTest.exe
new file mode 100644
index 0000000..515f469
Binary files /dev/null and b/SCADA/Program/BatchCoreTest/obj/x86/Debug/BatchCoreTest.exe differ
diff --git a/SCADA/Program/BatchCoreTest/obj/x86/Debug/MainWindow.g.i.cs b/SCADA/Program/BatchCoreTest/obj/x86/Debug/MainWindow.g.i.cs
new file mode 100644
index 0000000..4b90ce1
--- /dev/null
+++ b/SCADA/Program/BatchCoreTest/obj/x86/Debug/MainWindow.g.i.cs
@@ -0,0 +1,74 @@
+#pragma checksum "..\..\..\MainWindow.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "7630CF7F3160DFE0693ADE37EC76F831"
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18063
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+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.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 BatchCoreTest {
+
+
+ ///
+ /// MainWindow
+ ///
+ public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
+
+ 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("/BatchCoreTest;component/mainwindow.xaml", System.UriKind.Relative);
+
+ #line 1 "..\..\..\MainWindow.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) {
+ this._contentLoaded = true;
+ }
+ }
+}
+
diff --git a/SCADA/Program/BatchCoreTest/obj/x86/Debug/TempPE/Properties.Resources.Designer.cs.dll b/SCADA/Program/BatchCoreTest/obj/x86/Debug/TempPE/Properties.Resources.Designer.cs.dll
new file mode 100644
index 0000000..33cfe50
Binary files /dev/null and b/SCADA/Program/BatchCoreTest/obj/x86/Debug/TempPE/Properties.Resources.Designer.cs.dll differ
diff --git a/SCADA/Program/BatchCoreTest/obj/x86/Release/App.g.i.cs b/SCADA/Program/BatchCoreTest/obj/x86/Release/App.g.i.cs
new file mode 100644
index 0000000..d138499
--- /dev/null
+++ b/SCADA/Program/BatchCoreTest/obj/x86/Release/App.g.i.cs
@@ -0,0 +1,69 @@
+#pragma checksum "..\..\..\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "5D31F11D4F413D3FAD3347DEE603094F"
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18063
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+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.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 BatchCoreService {
+
+
+ ///
+ /// App
+ ///
+ public partial class App : System.Windows.Application {
+
+ ///
+ /// InitializeComponent
+ ///
+ [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent() {
+
+ #line 4 "..\..\..\App.xaml"
+ this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
+
+ #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() {
+ BatchCoreService.App app = new BatchCoreService.App();
+ app.InitializeComponent();
+ app.Run();
+ }
+ }
+}
+
diff --git a/SCADA/Program/BatchCoreTest/obj/x86/Release/BatchCoreService.Properties.Resources.resources b/SCADA/Program/BatchCoreTest/obj/x86/Release/BatchCoreService.Properties.Resources.resources
new file mode 100644
index 0000000..6c05a97
Binary files /dev/null and b/SCADA/Program/BatchCoreTest/obj/x86/Release/BatchCoreService.Properties.Resources.resources differ
diff --git a/SCADA/Program/BatchCoreTest/obj/x86/Release/BatchCoreTest.csproj.FileListAbsolute.txt b/SCADA/Program/BatchCoreTest/obj/x86/Release/BatchCoreTest.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..36b8947
--- /dev/null
+++ b/SCADA/Program/BatchCoreTest/obj/x86/Release/BatchCoreTest.csproj.FileListAbsolute.txt
@@ -0,0 +1,150 @@
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.exe.config
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.csprojResolveAssemblyReference.cache
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.csproj.GenerateResource.Cache
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.exe
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.pdb
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreTest\bin\Release\AsyncClientDriver.dll
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreTest\bin\Release\BatchCommon.dll
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreTest\bin\Release\DataHelper.dll
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreTest\bin\Release\DataService.dll
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreTest\bin\Release\protobuf-net.dll
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreTest\bin\Release\DataService.pdb
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreTest\bin\Release\AsyncClientDriver.pdb
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreTest\bin\Release\BatchCommon.pdb
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.exe
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.pdb
+D:\大成\大成0211new_20140302\大成0211\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreService.Properties.Resources.resources
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.exe.config
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.exe
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.pdb
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\bin\Release\AsyncClientDriver.dll
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\bin\Release\BatchCommon.dll
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\bin\Release\DataHelper.dll
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\bin\Release\DataService.dll
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\bin\Release\protobuf-net.dll
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\bin\Release\DataService.pdb
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\bin\Release\AsyncClientDriver.pdb
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\bin\Release\BatchCommon.pdb
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.csprojResolveAssemblyReference.cache
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreService.Properties.Resources.resources
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.csproj.GenerateResource.Cache
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.exe
+E:\双胞胎项目\大成0211\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.pdb
+E:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.exe.config
+E:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.exe
+E:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.pdb
+E:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\AsyncClientDriver.dll
+E:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCommon.dll
+E:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\DataHelper.dll
+E:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\DataService.dll
+E:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\DataService.pdb
+E:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\AsyncClientDriver.pdb
+E:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCommon.pdb
+E:\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreService.Properties.Resources.resources
+E:\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.exe
+E:\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.pdb
+D:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.exe.config
+D:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.exe
+D:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.pdb
+D:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\AsyncClientDriver.dll
+D:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCommon.dll
+D:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\DataHelper.dll
+D:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\DataService.dll
+D:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\protobuf-net.dll
+D:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\DataService.pdb
+D:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\AsyncClientDriver.pdb
+D:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCommon.pdb
+D:\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\ResolveAssemblyReference.cache
+D:\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreService.Properties.Resources.resources
+D:\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\GenerateResource.read.1.tlog
+D:\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\GenerateResource.write.1.tlog
+D:\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.exe
+D:\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.pdb
+E:\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.csprojResolveAssemblyReference.cache
+E:\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.csproj.GenerateResource.Cache
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.exe.config
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.exe
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.pdb
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\AsyncClientDriver.dll
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCommon.dll
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\DataHelper.dll
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\DataService.dll
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\protobuf-net.dll
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\DataService.pdb
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\AsyncClientDriver.pdb
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCommon.pdb
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.csprojResolveAssemblyReference.cache
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreService.Properties.Resources.resources
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.csproj.GenerateResource.Cache
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.exe
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.pdb
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\ClientDriver.dll
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\ClientDriver.pdb
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.exe.config
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.exe
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.pdb
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\AsyncClientDriver.dll
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCommon.dll
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\ClientDriver.dll
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\DataHelper.dll
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\DataService.dll
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\protobuf-net.dll
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\DataService.pdb
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\AsyncClientDriver.pdb
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCommon.pdb
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\ClientDriver.pdb
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.csprojResolveAssemblyReference.cache
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreService.Properties.Resources.resources
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.csproj.GenerateResource.Cache
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.exe
+E:\南宁华港\华港\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.pdb
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.csprojResolveAssemblyReference.cache
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreService.Properties.Resources.resources
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.csproj.GenerateResource.Cache
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.exe.config
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.exe
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.pdb
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\AsyncClientDriver.dll
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCommon.dll
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\ClientDriver.dll
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\DataHelper.dll
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\DataService.dll
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\DataService.pdb
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\AsyncClientDriver.pdb
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCommon.pdb
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\ClientDriver.pdb
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.exe
+E:\南宁华港\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.pdb
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.exe.config
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.exe
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCoreTest.pdb
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\AsyncClientDriver.dll
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCommon.dll
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\ClientDriver.dll
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\DataHelper.dll
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\DataService.dll
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\DataService.pdb
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\AsyncClientDriver.pdb
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\BatchCommon.pdb
+F:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\ClientDriver.pdb
+F:\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.csprojResolveAssemblyReference.cache
+F:\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreService.Properties.Resources.resources
+F:\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.csproj.GenerateResource.Cache
+F:\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.exe
+F:\牧羊上位机\DataExchange\BatchCoreTest\obj\x86\Release\BatchCoreTest.pdb
+E:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\ClientDriver.dll
+E:\牧羊上位机\DataExchange\BatchCoreTest\bin\Release\ClientDriver.pdb
+E:\SCADA\Program\BatchCoreTest\bin\Release\BatchCoreTest.exe.config
+E:\SCADA\Program\BatchCoreTest\obj\x86\Release\BatchCoreTest.exe
+E:\SCADA\Program\BatchCoreTest\obj\x86\Release\BatchCoreTest.pdb
+E:\SCADA\Program\BatchCoreTest\bin\Release\BatchCoreTest.exe
+E:\SCADA\Program\BatchCoreTest\bin\Release\BatchCoreTest.pdb
+E:\SCADA\Program\BatchCoreTest\bin\Release\ClientDriver.dll
+E:\SCADA\Program\BatchCoreTest\bin\Release\DataHelper.dll
+E:\SCADA\Program\BatchCoreTest\bin\Release\DataService.dll
+E:\SCADA\Program\BatchCoreTest\bin\Release\ClientDriver.pdb
+E:\SCADA\Program\BatchCoreTest\bin\Release\DataHelper.pdb
+E:\SCADA\Program\BatchCoreTest\bin\Release\DataService.pdb
+E:\SCADA\Program\BatchCoreTest\obj\x86\Release\BatchCoreTest.csprojResolveAssemblyReference.cache
+E:\SCADA\Program\BatchCoreTest\obj\x86\Release\BatchCoreService.Properties.Resources.resources
+E:\SCADA\Program\BatchCoreTest\obj\x86\Release\BatchCoreTest.csproj.GenerateResource.Cache
diff --git a/SCADA/Program/BatchCoreTest/obj/x86/Release/BatchCoreTest.exe b/SCADA/Program/BatchCoreTest/obj/x86/Release/BatchCoreTest.exe
new file mode 100644
index 0000000..3cae248
Binary files /dev/null and b/SCADA/Program/BatchCoreTest/obj/x86/Release/BatchCoreTest.exe differ
diff --git a/SCADA/Program/BatchCoreTest/obj/x86/Release/MainWindow.g.i.cs b/SCADA/Program/BatchCoreTest/obj/x86/Release/MainWindow.g.i.cs
new file mode 100644
index 0000000..5f8a636
--- /dev/null
+++ b/SCADA/Program/BatchCoreTest/obj/x86/Release/MainWindow.g.i.cs
@@ -0,0 +1,74 @@
+#pragma checksum "..\..\..\MainWindow.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "9BB3D9CFACD7F658523483F89A7AEC37"
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18063
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+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.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 BatchCoreService {
+
+
+ ///
+ /// MainWindow
+ ///
+ public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
+
+ 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("/BatchCoreTest;component/mainwindow.xaml", System.UriKind.Relative);
+
+ #line 1 "..\..\..\MainWindow.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) {
+ this._contentLoaded = true;
+ }
+ }
+}
+
diff --git a/SCADA/Program/BatchCoreTest/obj/x86/Release/TempPE/Properties.Resources.Designer.cs.dll b/SCADA/Program/BatchCoreTest/obj/x86/Release/TempPE/Properties.Resources.Designer.cs.dll
new file mode 100644
index 0000000..250dd21
Binary files /dev/null and b/SCADA/Program/BatchCoreTest/obj/x86/Release/TempPE/Properties.Resources.Designer.cs.dll differ
diff --git a/SCADA/Program/BatchCoreTest/obj/x86/Release/build.force b/SCADA/Program/BatchCoreTest/obj/x86/Release/build.force
new file mode 100644
index 0000000..e69de29
diff --git a/SCADA/Program/ClientDriver/ClientDriver.cs b/SCADA/Program/ClientDriver/ClientDriver.cs
new file mode 100644
index 0000000..f80f146
--- /dev/null
+++ b/SCADA/Program/ClientDriver/ClientDriver.cs
@@ -0,0 +1,1129 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Net;
+using System.Net.Sockets;
+using System.Text;
+using System.Threading;
+using DataService;
+
+namespace ClientDriver
+{
+ [Description("客户端驱动")]
+ public class ClientReader : IDriver//客户端存在对TLV数据的字节序转换问题,需测试
+ {
+ short _id;
+ public short ID
+ {
+ get
+ {
+ return _id;
+ }
+ }
+
+ private int _timeout = 0;
+ public int TimeOut
+ {
+ get { return _timeout; }
+ set { _timeout = value; }
+ }
+
+ string _name;
+ public string Name
+ {
+ get
+ {
+ return _name;
+ }
+ }
+
+ string _ip;
+ public string ServerName
+ {
+ get { return _ip; }
+ set { _ip = value; }
+ }
+
+ internal Socket tcpSend;
+ internal Socket tcpRecive;
+
+ public bool IsClosed
+ {
+ get
+ {
+ //return tcpASynCl.Poll(-1, SelectMode.SelectRead);
+ return tcpSend == null || tcpRecive == null || !tcpSend.Connected || !tcpRecive.Connected;
+ }
+ }
+
+ List _grps = new List(1);
+ public IEnumerable Groups
+ {
+ get { return _grps; }
+ }
+
+ IDataServer _server;
+ public IDataServer Parent
+ {
+ get { return _server; }
+ }
+
+ public ClientReader(IDataServer server, short id, string name, string ip, int timeout)
+ {
+ _id = id;
+ _server = server;
+ _ip = ip;
+ _name = name;
+ _timeout = timeout;
+ Connect();
+ }
+
+ public bool Connect()
+ {
+ int port = 6543;
+ lock (this)
+ {
+ try
+ {
+ if (tcpRecive != null)
+ {
+ tcpRecive.Dispose();
+ }
+ if (tcpSend != null)
+ {
+ tcpSend.Dispose();
+ }
+ tcpRecive = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+ tcpRecive.Connect(_ip, port);
+ tcpRecive.SendTimeout = _timeout;
+ tcpRecive.ReceiveTimeout = -1;
+
+ tcpSend = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+ tcpSend.Connect(_ip, port);
+ tcpSend.SendTimeout = _timeout;
+ tcpSend.ReceiveTimeout = _timeout;
+ return true;
+ }
+ catch (SocketException error)
+ {
+ if (OnClose != null)
+ OnClose(this, new ShutdownRequestEventArgs(error.Message));
+ return false;
+ }
+ }
+ }
+
+ public IGroup AddGroup(string name, short id, int updateRate, float deadBand = 0f, bool active = false)
+ {
+ ClientGroup grp = new ClientGroup(id, name, updateRate, active, this);
+ _grps.Add(grp);
+ return grp;
+ }
+
+ public bool RemoveGroup(IGroup grp)
+ {
+ grp.IsActive = false;
+ return _grps.Remove(grp);
+ }
+
+ public event ShutdownRequestEventHandler OnClose;
+
+ public void Dispose()
+ {
+ foreach (IGroup grp in _grps)
+ {
+ grp.Dispose();
+ }
+ _grps.Clear();
+ try
+ {
+ if (tcpRecive != null)
+ {
+ if (tcpRecive.Connected)
+ tcpRecive.Shutdown(SocketShutdown.Both);
+ tcpRecive.Dispose();
+ }
+ if (tcpSend != null)
+ {
+ if (tcpSend.Connected)
+ tcpSend.Shutdown(SocketShutdown.Both);
+ tcpSend.Dispose();
+ }
+ }
+ catch (SocketException err)
+ {
+ if (OnClose != null)
+ OnClose(this, new ShutdownRequestEventArgs(err.Message));
+ }
+ }
+ }
+
+ public class ClientGroup : IGroup
+ {
+ bool _active = false;
+ public bool IsActive
+ {
+ get
+ {
+ return _active;
+ }
+ set
+ {
+ _active = value;
+ if (value)
+ {
+ if (_plcReader != null && _plcReader.tcpSend != null)
+ {
+ this._tcpRecive = _plcReader.tcpRecive;
+ this._tcpSend = _plcReader.tcpSend;
+ try
+ {
+ _addr = (_tcpSend.RemoteEndPoint as IPEndPoint).Address;
+ }
+ catch { }
+ Thread workItem = new Thread(new ThreadStart(ReciveData));
+ workItem.Priority = ThreadPriority.Highest;
+ workItem.Start();
+ if (_updateRate > 0)
+ ThreadPool.QueueUserWorkItem(new WaitCallback(this.OnUpdate));
+ else
+ Init();
+ }
+ }
+ }
+ }
+
+ protected short _id;
+ public short ID
+ {
+ get
+ {
+ return _id;
+ }
+ }
+
+ protected int _updateRate;
+ public int UpdateRate
+ {
+ get
+ {
+ return _updateRate;
+ }
+ set
+ {
+ _updateRate = value;
+ }
+ }
+
+ protected DeviceAddress _start;
+ public DeviceAddress Start
+ {
+ get
+ {
+ return _start;
+ }
+ }
+
+ protected string _name;
+ public string Name
+ {
+ get
+ {
+ return _name;
+ }
+ set
+ {
+ _name = value;
+ }
+ }
+
+ protected float _deadband;
+ public float DeadBand
+ {
+ get
+ {
+ return _deadband;
+ }
+ set
+ {
+ _deadband = value;
+ }
+ }
+
+ protected ClientReader _plcReader;
+ public IDriver Parent
+ {
+ get
+ {
+ return _plcReader;
+ }
+ }
+
+ protected Dictionary _items;
+ public IEnumerable Items
+ {
+ get { return _items.Values; }
+ }
+
+ IDataServer _server;
+ public IDataServer Server
+ {
+ get
+ {
+ return _server;
+ }
+ }
+
+ Socket _tcpSend, _tcpRecive;
+ byte[] tcpBuffer;
+
+ IPAddress _addr;
+ public IPAddress RemoteAddress
+ {
+ get { return _addr; }
+ }
+
+ public ClientGroup(short id, string name, int updateRate, bool active, ClientReader plcReader)
+ {
+ this._id = id;
+ this._name = name;
+ this._updateRate = updateRate;
+ this._active = active;
+ this._plcReader = plcReader;
+ this._server = plcReader.Parent;
+ tcpBuffer = new byte[8192];
+ }
+
+ object sendasync = new object();
+ private byte[] ReadSingleData(DeviceAddress address, DataSource source = DataSource.Cache)
+ {
+ if (_tcpSend == null) return null;
+ short ID = (short)address.Start;
+ byte type = (byte)address.VarType;
+ byte len = (byte)(address.DataSize);
+ byte[] idbits = BitConverter.GetBytes(ID);
+ byte[] write_data = new byte[6] { FCTCOMMAND.fctHead, FCTCOMMAND.fctReadSingle,
+ source == DataSource.Cache?(byte)0:(byte)1, idbits[0], idbits[1] ,len};
+ byte[] data = new byte[len];
+ SocketError error;
+ lock (sendasync)
+ {
+ _tcpSend.Send(write_data, 0, 6, SocketFlags.None, out error);
+ int result = _tcpSend.Receive(tcpBuffer, 0, data.Length + 5, SocketFlags.None, out error);
+ }
+ Array.Copy(tcpBuffer, 5, data, 0, data.Length);
+ if (error == SocketError.Success)
+ return data;
+ else
+ {
+ return null;
+ }
+ }
+
+ private int WriteSingleData(DeviceAddress address, byte[] value)
+ {
+ if (_tcpSend == null) return -1;
+ short ID = (short)address.Start;
+ byte type = (byte)address.VarType;
+ byte[] idbits = BitConverter.GetBytes(ID);
+ byte[] write_data = new byte[6] { FCTCOMMAND.fctHead, FCTCOMMAND.fctWriteSingle, 1, idbits[0], idbits[1], (byte)(value.Length) };
+ byte[] data = new byte[6 + value.Length];
+ write_data.CopyTo(data, 0);
+ value.CopyTo(data, 6);
+ SocketError error;
+ lock (sendasync)
+ {
+ _tcpSend.Send(data, 0, data.Length, SocketFlags.None, out error);
+ _tcpSend.Receive(tcpBuffer, 0, 2, SocketFlags.None, out error);
+ }
+ if (error == SocketError.Success)
+ return tcpBuffer[1];//可在此处返回一个错误号
+ else
+ {
+ return (int)error;
+ }
+ }
+
+ public void Init()
+ {
+ if (_items != null && _tcpSend != null)
+ {
+ int len = 0;
+ List tags = new List();
+ foreach (var tag in _items.Values)
+ {
+ len += (3 + tag.Address.DataSize);
+ if (len >= tcpBuffer.Length - 10)
+ {
+ len = 0;
+ BatchRead(DataSource.Cache, true, tags.ToArray());
+ tags.Clear();
+ }
+ tags.Add(tag);
+ }
+ BatchRead(DataSource.Cache, true, tags.ToArray());
+ }
+ }
+
+ private void ReciveData()
+ {
+ if (!_active || _plcReader.tcpRecive == null) return;
+ List historys = null;
+ byte[] bytes = new byte[ushort.MaxValue];
+ byte[] temp = new byte[_tcpRecive.ReceiveBufferSize];
+ Storage value = Storage.Empty;
+ int result = 0;
+ int start = 0;
+ SocketError error;
+ do
+ {
+ if (!_tcpRecive.Connected) return;
+ result = _tcpRecive.Receive(bytes, 0, bytes.Length, SocketFlags.None, out error);
+ if (error == SocketError.Success)
+ {
+ if (DataChange != null)
+ historys = new List();
+ //DateTime time = DateTime.Now;//当前时间戳
+ if (start != 0 && temp[0] == FCTCOMMAND.fctHead)
+ {
+ int j = 3;
+ if (start < 0)
+ {
+ Array.Copy(bytes, 0, temp, -start, 5 + start);
+ }
+ short tc = BitConverter.ToInt16(temp, j);//总字节数
+ if (start < 0)
+ start += tc;
+ Array.Copy(bytes, 0, temp, tc - start, start);
+ j += 2;
+ while (j < tc)
+ {
+ short id = BitConverter.ToInt16(temp, j);//标签ID、数据长度、数据值(T,L,V)
+ j += 2;
+ byte length = temp[j++];
+ ITag tag;
+ if (_items.TryGetValue(id, out tag))
+ {
+ //数据类型
+ switch (tag.Address.VarType)
+ {
+ case DataType.BOOL:
+ value.Boolean = BitConverter.ToBoolean(temp, j);
+ break;
+ case DataType.BYTE:
+ value.Byte = temp[j];
+ break;
+ case DataType.WORD:
+ case DataType.SHORT:
+ value.Int16 = BitConverter.ToInt16(temp, j);//需测试
+ break;
+ case DataType.INT:
+ value.Int32 = BitConverter.ToInt32(temp, j);//需测试
+ break;
+ case DataType.FLOAT:
+ value.Single = BitConverter.ToSingle(temp, j);
+ break;
+ case DataType.STR:
+ StringTag strTag = tag as StringTag;
+ if (strTag != null)
+ {
+ strTag.String = Encoding.ASCII.GetString(temp, j, length).Trim((char)0);
+ }
+ break;
+ default:
+ break;
+ }
+ j += length;
+ DateTime time = DateTime.FromFileTime(BitConverter.ToInt64(temp, j));
+ j += 8;
+ tag.Update(value, time, QUALITIES.QUALITY_GOOD);
+ if (historys != null)
+ historys.Add(new HistoryData(id, QUALITIES.QUALITY_GOOD, value, time));
+ }
+ else
+ j += length + 8;
+ }
+ }
+ byte head = bytes[start];
+ int count = start;
+ while (head == FCTCOMMAND.fctHead && result > count)
+ {
+ if (count + 5 > bytes.Length)
+ {
+ start = count - bytes.Length;
+ Array.Copy(bytes, count, temp, 0, -start);
+ break;
+ }
+ int j = count + 3;
+ short tc = BitConverter.ToInt16(bytes, j);//总标签数
+ count += tc;
+ if (count >= bytes.Length)
+ {
+ start = count - bytes.Length;
+ Array.Copy(bytes, count - tc, temp, 0, tc - start);
+ break;
+ }
+ else start = 0;
+ j += 2;
+ while (j < count)
+ {
+ short id = BitConverter.ToInt16(bytes, j);//标签ID、数据长度、数据值(T,L,V)
+ j += 2;
+ byte length = bytes[j++];
+ ITag tag;
+ if (_items.TryGetValue(id, out tag))
+ {
+ //数据类型
+ switch (tag.Address.VarType)
+ {
+ case DataType.BOOL:
+ value.Boolean = BitConverter.ToBoolean(bytes, j);
+ break;
+ case DataType.BYTE:
+ value.Byte = bytes[j];
+ break;
+ case DataType.WORD:
+ case DataType.SHORT:
+ value.Int16 = BitConverter.ToInt16(bytes, j);//需测试
+ break;
+ case DataType.INT:
+ value.Int32 = BitConverter.ToInt32(bytes, j);//需测试
+ break;
+ case DataType.FLOAT:
+ value.Single = BitConverter.ToSingle(bytes, j);
+ break;
+ case DataType.STR:
+ StringTag strTag = tag as StringTag;
+ if (strTag != null)
+ {
+ strTag.String = Encoding.ASCII.GetString(bytes, j, length).Trim((char)0);
+ }
+ break;
+ default:
+ break;
+ }
+ j += length;
+ DateTime time = DateTime.FromFileTime(BitConverter.ToInt64(bytes, j));
+ j += 8;
+ tag.Update(value, time, QUALITIES.QUALITY_GOOD);
+ if (historys != null)
+ historys.Add(new HistoryData(id, QUALITIES.QUALITY_GOOD, value, time));
+ }
+ else
+ j += length + 8;
+ }
+ head = bytes[count];
+ }
+ if (DataChange != null && historys.Count > 0)
+ DataChange(this, new DataChangeEventArgs(1, historys));
+
+ }
+ else if (error == SocketError.ConnectionReset || error == SocketError.Interrupted
+ || error == SocketError.HostDown || error == SocketError.NetworkDown || error == SocketError.Shutdown)
+ {
+ _tcpRecive.Dispose();
+ _active = false;
+ return;
+ }
+ }
+ while (result > 0);
+ }
+
+ public void OnUpdate(object stateInfo)
+ {
+ while (true)
+ {
+ Thread.Sleep(_updateRate);
+ lock (this)
+ {
+ if (!_active)
+ {
+ return;
+ }
+ Init();
+ }
+ }
+ }
+
+ public bool AddItems(IList items)
+ {
+ int count = items.Count;
+ if (_items == null) _items = new Dictionary(count);
+ lock (_server.SyncRoot)
+ {
+ for (int i = 0; i < count; i++)
+ {
+ ITag dataItem = null;
+ TagMetaData meta = items[i];
+ DeviceAddress addr = new DeviceAddress(0, 0, 0, meta.ID, meta.Size, 0, meta.DataType);
+ switch (meta.DataType)
+ {
+ case DataType.BOOL:
+ dataItem = new BoolTag(meta.ID, addr, this);
+ break;
+ case DataType.BYTE:
+ dataItem = new ByteTag(meta.ID, addr, this);
+ break;
+ case DataType.WORD:
+ case DataType.SHORT:
+ dataItem = new ShortTag(meta.ID, addr, this);
+ break;
+ case DataType.TIME:
+ case DataType.INT:
+ dataItem = new IntTag(meta.ID, addr, this);
+ break;
+ case DataType.FLOAT:
+ dataItem = new FloatTag(meta.ID, addr, this);
+ break;
+ case DataType.STR:
+ dataItem = new StringTag(meta.ID, addr, this);
+ break;
+ default:
+ dataItem = new BoolTag(meta.ID, addr, this);
+ break;
+ }
+ _items.Add(meta.ID, dataItem);
+ _server.AddItemIndex(meta.Name, dataItem);
+ }
+ }
+ //Init();
+ return true;
+ }
+
+ public bool AddTags(IEnumerable tags)
+ {
+ if (_items == null)
+ {
+ _items = new Dictionary();
+ }
+ foreach (ITag tag in tags)
+ {
+ if (tag != null)
+ {
+ _items.Add(tag.ID, tag);
+ }
+ }
+ //Init();
+ return true;
+ }
+
+ public bool RemoveItems(params ITag[] items)
+ {
+ foreach (var item in items)
+ {
+ _server.RemoveItemIndex(item.GetTagName());
+ _items.Remove(item.ID);
+ }
+ return true;
+ }
+
+ public bool SetActiveState(bool active, params short[] items)
+ {
+ return true;
+ }
+
+ public ITag FindItemByAddress(DeviceAddress addr)
+ {
+ ITag tag;
+ if (_items.TryGetValue((short)addr.Start, out tag))
+ return tag;
+ return _server[(short)addr.Start];
+ }
+
+ public HistoryData[] BatchRead(DataSource source, bool isSync, params ITag[] itemArray)
+ {
+ if (itemArray.Length == 0 || _tcpSend == null || !_tcpSend.Connected) return null;
+ short len = (short)itemArray.Length;
+ byte[] bt = new byte[2];
+ byte[] data = new byte[5 + len * 2];
+ int j = 0;
+ data[j++] = FCTCOMMAND.fctHead;
+ data[j++] = FCTCOMMAND.fctReadMultiple;
+ data[j++] = source == DataSource.Cache ? (byte)0 : (byte)1;
+ bt = BitConverter.GetBytes(len);
+ data[j++] = bt[0];
+ data[j++] = bt[1];
+ for (int i = 0; i < len; i++)
+ {
+ bt = BitConverter.GetBytes(itemArray[i].ID);
+ data[j++] = bt[0];
+ data[j++] = bt[1];
+ }
+ SocketError error;
+ lock (sendasync)
+ {
+ _tcpSend.Send(data, 0, data.Length, SocketFlags.None, out error);
+ int result = _tcpSend.Receive(tcpBuffer, 0, tcpBuffer.Length, SocketFlags.None, out error);
+ }
+ //!!!!此处的协议应注意,如批量读入的数据量超过缓存,必须分批合并;在协议头应加入总字节数,以和result比较是否需要循环读入。
+ j = 5;
+ if (error == SocketError.Success)
+ {
+ DateTime time = DateTime.Now;
+ HistoryData[] values = new HistoryData[len];
+ for (int i = 0; i < len; i++)
+ {
+ short id = BitConverter.ToInt16(tcpBuffer, j);
+ j += 2;
+ ITag tag = _server[id];
+ byte length = tcpBuffer[j++];
+ if (tag != null && length > 0)
+ {
+ switch (tag.Address.VarType)
+ {
+ case DataType.BOOL:
+ values[i].Value.Boolean = BitConverter.ToBoolean(tcpBuffer, j);
+ break;
+ case DataType.BYTE:
+ values[i].Value.Byte = tcpBuffer[j];
+ break;
+ case DataType.WORD:
+ case DataType.SHORT:
+ values[i].Value.Int16 = BitConverter.ToInt16(tcpBuffer, j);
+ break;
+ case DataType.INT:
+ values[i].Value.Int32 = BitConverter.ToInt32(tcpBuffer, j);
+ break;
+ case DataType.FLOAT:
+ values[i].Value.Single = BitConverter.ToSingle(tcpBuffer, j);
+ break;
+ case DataType.STR:
+ StringTag strTag = tag as StringTag;
+ if (strTag != null)
+ {
+ strTag.String = Encoding.ASCII.GetString(tcpBuffer, j, length).Trim();
+ }
+ break;
+ }
+ if (values[i].Value != tag.Value)
+ tag.Update(values[i].Value, time, QUALITIES.QUALITY_GOOD);
+ }
+ j += length;
+ }
+ return values;
+ }
+ else
+ return null;
+ }
+
+ public int BatchWrite(SortedDictionary items, bool isSync = true)
+ {
+ if (_tcpSend == null || !_tcpSend.Connected) return -1;
+ List list = new List(new byte[] { FCTCOMMAND.fctHead, FCTCOMMAND.fctWriteMultiple });
+ list.AddRange(BitConverter.GetBytes((short)items.Count));
+ foreach (var item in items)
+ {
+ ITag tag = item.Key;
+ list.AddRange(BitConverter.GetBytes(tag.ID));
+ var addr = tag.Address;
+ if (addr.VarType != DataType.STR)
+ list.Add((byte)(addr.DataSize));//此处存疑
+ switch (addr.VarType)
+ {
+ case DataType.BOOL:
+ list.Add(Convert.ToBoolean(item.Value) ? (byte)1 : (byte)0);
+ break;
+ case DataType.BYTE:
+ list.Add(Convert.ToByte(item.Value));
+ break;
+ case DataType.WORD:
+ case DataType.SHORT:
+ list.AddRange(BitConverter.GetBytes(Convert.ToInt16(item.Value)));
+ break;
+ case DataType.INT:
+ list.AddRange(BitConverter.GetBytes(Convert.ToInt32(item.Value)));
+ break;
+ case DataType.FLOAT:
+ list.AddRange(BitConverter.GetBytes(Convert.ToSingle(item.Value)));
+ break;
+ case DataType.STR:
+ var bts = Encoding.ASCII.GetBytes(Convert.ToString(item.Value));
+ list.Add((byte)bts.Length);
+ list.AddRange(bts);
+ break;
+ }
+ }
+ SocketError error;
+ lock (sendasync)
+ {
+ _tcpSend.Send(list.ToArray(), 0, list.Count, SocketFlags.None, out error);
+ _tcpSend.Receive(tcpBuffer, 0, 2, SocketFlags.None, out error);
+ }
+ if (error == SocketError.Success)
+ return tcpBuffer[1];
+ else
+ {
+ return (int)error;
+ }
+ }
+
+ public IEnumerable SendHdaRequest(DateTime start, DateTime end)
+ {
+ if (_tcpSend == null || !_tcpSend.Connected) yield break;
+ byte[] hdaReq = new byte[18];
+ hdaReq[0] = FCTCOMMAND.fctHead;
+ hdaReq[1] = FCTCOMMAND.fctHdaRequest;
+ byte[] startbuffer = BitConverter.GetBytes(start.ToFileTime());
+ startbuffer.CopyTo(hdaReq, 2);
+ byte[] endbuffer = BitConverter.GetBytes(end.ToFileTime());
+ endbuffer.CopyTo(hdaReq, 10);
+ SocketError error;
+ HistoryData data = HistoryData.Empty;
+ short tempid = short.MinValue;
+ byte[] temp = new byte[14];
+ ITag tag = null;
+ int index = 0;
+ int size = 0;
+ int result = 0;
+ short id = 0;
+ lock (sendasync)
+ {
+ _tcpSend.Send(hdaReq);
+ do
+ {
+ result = _tcpSend.Receive(tcpBuffer, 0, tcpBuffer.Length, SocketFlags.None, out error);
+ if (error == SocketError.ConnectionReset || error == SocketError.Interrupted || error == SocketError.HostDown || error == SocketError.NetworkDown || error == SocketError.Shutdown)
+ {
+ _tcpSend.Dispose();
+ yield break;
+ }
+ if (index != 0)
+ {
+ Array.Copy(tcpBuffer, 0, temp, 14 - index, index);
+ id = BitConverter.ToInt16(temp, 0);
+ tempid = id;
+ tag = _server[id];
+ if (tag == null) yield break;
+ data.ID = id;
+ size = tag.Address.DataSize;
+ index -= (4 - size);
+ switch (tag.Address.VarType)
+ {
+ case DataType.BOOL:
+ data.Value.Boolean = BitConverter.ToBoolean(temp, 2);
+ break;
+ case DataType.BYTE:
+ data.Value.Byte = tcpBuffer[index];
+ break;
+ case DataType.WORD:
+ case DataType.SHORT:
+ data.Value.Int16 = BitConverter.ToInt16(temp, 2);
+ break;
+ case DataType.TIME:
+ case DataType.INT:
+ data.Value.Int32 = BitConverter.ToInt32(temp, 2);
+ break;
+ case DataType.FLOAT:
+ data.Value.Single = BitConverter.ToSingle(temp, 2);
+ break;
+ }
+ long fileTime = BitConverter.ToInt64(temp, 2 + size);
+ if (fileTime == -1) yield break;
+ data.TimeStamp = DateTime.FromFileTime(fileTime);
+ yield return data;
+ }
+ while (result >= index + 2)
+ {
+ id = BitConverter.ToInt16(tcpBuffer, index);
+ if (tempid != id)
+ {
+ tempid = id;
+ tag = _server[id];
+ if (tag == null) yield break;
+ size = tag.Address.DataSize;
+ }
+ if (index + 10 + size > result)
+ break;
+ data.ID = id;
+ index += 2;
+ switch (tag.Address.VarType)
+ {
+ case DataType.BOOL:
+ data.Value.Boolean = BitConverter.ToBoolean(tcpBuffer, index);
+ break;
+ case DataType.BYTE:
+ data.Value.Byte = tcpBuffer[index];
+ break;
+ case DataType.WORD:
+ case DataType.SHORT:
+ data.Value.Int16 = BitConverter.ToInt16(tcpBuffer, index);
+ break;
+ case DataType.TIME:
+ case DataType.INT:
+ data.Value.Int32 = BitConverter.ToInt32(tcpBuffer, index);
+ break;
+ case DataType.FLOAT:
+ data.Value.Single = BitConverter.ToSingle(tcpBuffer, index);
+ break;
+ }
+ index += size;
+ long fileTime = BitConverter.ToInt64(tcpBuffer, index);
+ if (fileTime == -1) yield break;
+ data.TimeStamp = DateTime.FromFileTime(fileTime);
+ index += 8;
+ yield return data;
+ }
+ if (index == result)
+ index = 0;
+ else
+ {
+ Array.Copy(tcpBuffer, index, temp, 0, result - index);
+ index += 14 - result;
+ }
+ } while (result > 0);
+ }
+ yield break;
+ }
+
+ public IEnumerable SendHdaRequest(DateTime start, DateTime end, short id)
+ {
+ if (_tcpSend == null || !_tcpSend.Connected) yield break;
+ ITag tag = _server[id];
+ if (tag == null) yield break;
+ byte[] hdaReq = new byte[20];
+ hdaReq[0] = FCTCOMMAND.fctHead;
+ hdaReq[1] = FCTCOMMAND.fctHdaIdRequest;
+ byte[] startbuffer = BitConverter.GetBytes(start.ToFileTime());
+ startbuffer.CopyTo(hdaReq, 2);
+ byte[] endbuffer = BitConverter.GetBytes(end.ToFileTime());
+ endbuffer.CopyTo(hdaReq, 10);
+ byte[] idbuffer = BitConverter.GetBytes(id);
+ idbuffer.CopyTo(hdaReq, 18);
+ SocketError error;
+ int index = 0;
+ HistoryData data = HistoryData.Empty;
+ data.ID = id;
+ int result = 0;
+ lock (sendasync)
+ {
+ _tcpSend.Send(hdaReq);
+ switch (tag.Address.VarType)
+ {
+ case DataType.FLOAT:
+ do
+ {
+ result = _tcpSend.Receive(tcpBuffer, 0, tcpBuffer.Length, SocketFlags.None, out error);
+ if (error == SocketError.ConnectionReset || error == SocketError.Interrupted || error == SocketError.HostDown || error == SocketError.NetworkDown || error == SocketError.Shutdown)
+ {
+ _tcpSend.Dispose();
+ yield break;
+ }
+ while (index + 12 <= result)
+ {
+ data.Value.Single = BitConverter.ToSingle(tcpBuffer, index);//未来可考虑量程转换和其他数据类型
+ index += 4;
+ long fileTime = BitConverter.ToInt64(tcpBuffer, index);
+ if (fileTime == -1) yield break;
+ data.TimeStamp = DateTime.FromFileTime(fileTime);
+ index += 8;
+ yield return data;
+ }
+ if (index == result)
+ index = 0;
+ else
+ index += 12 - result;//丢弃一个值
+ } while (result > 0);
+ break;
+ case DataType.INT:
+ do
+ {
+ result = _tcpSend.Receive(tcpBuffer, 0, tcpBuffer.Length, SocketFlags.None, out error);
+ if (error == SocketError.ConnectionReset || error == SocketError.Interrupted || error == SocketError.HostDown || error == SocketError.NetworkDown || error == SocketError.Shutdown)
+ {
+ _tcpSend.Dispose();
+ yield break;
+ }
+ while (index + 12 <= result)
+ {
+ data.Value.Int32 = BitConverter.ToInt32(tcpBuffer, index);//未来可考虑量程转换和其他数据类型
+ index += 4;
+ long fileTime = BitConverter.ToInt64(tcpBuffer, index);
+ if (fileTime == -1) yield break;
+ data.TimeStamp = DateTime.FromFileTime(fileTime);
+ index += 8;
+ yield return data;
+ }
+ if (index == result)
+ index = 0;
+ else
+ index += 12 - result;//丢弃一个值
+ } while (result > 0);
+ break;
+ case DataType.BOOL://布尔量一个都不能少
+ {
+ byte[] temp = new byte[9];
+ do
+ {
+ result = _tcpSend.Receive(tcpBuffer, 0, tcpBuffer.Length, SocketFlags.None, out error);
+ if (error == SocketError.ConnectionReset || error == SocketError.Interrupted || error == SocketError.HostDown || error == SocketError.NetworkDown || error == SocketError.Shutdown)
+ {
+ _tcpSend.Dispose();
+ yield break;
+ }
+ if (index != 0)
+ {
+ Array.Copy(tcpBuffer, 0, temp, 9 - index, index);
+ data.Value.Boolean = BitConverter.ToBoolean(temp, 0);
+ long fileTime = BitConverter.ToInt64(temp, 1);
+ if (fileTime == -1) yield break;
+ data.TimeStamp = DateTime.FromFileTime(fileTime);
+ yield return data;
+ }
+ while (index + 9 <= result)
+ {
+ data.Value.Boolean = BitConverter.ToBoolean(tcpBuffer, index);
+ index += 1;
+ long fileTime = BitConverter.ToInt64(tcpBuffer, index);
+ if (fileTime == -1) yield break;
+ data.TimeStamp = DateTime.FromFileTime(fileTime);
+ index += 8;
+ yield return data;
+ }
+ if (index == result)
+ index = 0;
+ else
+ {
+ Array.Copy(tcpBuffer, index, temp, 0, result - index);
+ index += 9 - result;
+ }
+ } while (result > 0);
+ }
+ break;
+ }
+ }
+ }
+
+ public int SendResetRequest()
+ {
+ if (_tcpSend != null && _tcpSend.Connected)
+ {
+ var ipaddr = (_tcpSend.LocalEndPoint as IPEndPoint).Address;
+ byte[] resetReq = new byte[6];
+ resetReq[0] = FCTCOMMAND.fctHead;
+ resetReq[1] = FCTCOMMAND.fctReset;
+ ipaddr.GetAddressBytes().CopyTo(resetReq, 2);
+ lock (sendasync)
+ {
+ return _tcpSend.Send(resetReq);
+ }
+ }
+ return -1;
+ }
+
+ public int SendAlarmRequest(DateTime? start, DateTime? end)
+ {
+ if (_tcpSend != null && _tcpSend.Connected)
+ {
+ byte[] alarmReq = new byte[18];
+ alarmReq[0] = FCTCOMMAND.fctHead;
+ alarmReq[1] = FCTCOMMAND.fctAlarmRequest;
+ if (start.HasValue)
+ {
+ byte[] startbuffer = BitConverter.GetBytes(start.Value.ToFileTime());
+ startbuffer.CopyTo(alarmReq, 2);
+ }
+ if (end.HasValue)
+ {
+ byte[] endbuffer = BitConverter.GetBytes(end.Value.ToFileTime());
+ endbuffer.CopyTo(alarmReq, 10);
+ }
+ SocketError error;
+ lock (sendasync)
+ {
+ _tcpSend.Send(alarmReq);
+ _tcpSend.Receive(tcpBuffer, 0, 2, SocketFlags.None, out error);
+ }
+ return (int)error;
+ }
+ return -1;
+ }
+
+ public ItemData ReadInt32(DeviceAddress address, DataSource source = DataSource.Cache)
+ {
+ var data = ReadSingleData(address, source);
+ return data == null ? new ItemData(0, 0, QUALITIES.QUALITY_BAD) :
+ new ItemData(BitConverter.ToInt32(data, 0), 0, QUALITIES.QUALITY_GOOD);
+ }
+
+ public ItemData ReadInt16(DeviceAddress address, DataSource source = DataSource.Cache)
+ {
+ var data = ReadSingleData(address, source);
+ return data == null ? new ItemData(0, 0, QUALITIES.QUALITY_BAD) :
+ new ItemData(BitConverter.ToInt16(data, 0), 0, QUALITIES.QUALITY_GOOD);
+ }
+
+ public ItemData ReadByte(DeviceAddress address, DataSource source = DataSource.Cache)
+ {
+ var data = ReadSingleData(address, source);
+ return data == null ? new ItemData(0, 0, QUALITIES.QUALITY_BAD) :
+ new ItemData(data[0], 0, QUALITIES.QUALITY_GOOD);
+ }
+
+ public unsafe ItemData ReadFloat(DeviceAddress address, DataSource source = DataSource.Cache)
+ {
+ var data = ReadSingleData(address, source);
+ if (data == null)
+ return new ItemData(0.0f, 0, QUALITIES.QUALITY_BAD);
+ else
+ {
+ int value = BitConverter.ToInt32(data, 0);
+ return new ItemData(*(((float*)&value)), 0, QUALITIES.QUALITY_GOOD);
+ }
+ }
+
+ public ItemData ReadBool(DeviceAddress address, DataSource source = DataSource.Cache)
+ {
+ var data = ReadSingleData(address, source);
+ return data == null ? new ItemData(false, 0, QUALITIES.QUALITY_BAD) :
+ new ItemData(BitConverter.ToBoolean(data, address.Bit), 0, QUALITIES.QUALITY_GOOD);
+ }
+
+ public ItemData ReadString(DeviceAddress address, DataSource source = DataSource.Cache)
+ {
+ var data = ReadSingleData(address, source);
+ return data == null ? new ItemData(string.Empty, 0, QUALITIES.QUALITY_BAD) :
+ new ItemData(Encoding.ASCII.GetString(data, 0, Math.Min((int)address.DataSize, 254)).Trim((char)0), 0, QUALITIES.QUALITY_GOOD);
+ }
+
+ public int WriteInt32(DeviceAddress address, int value)
+ {
+ return WriteSingleData(address, BitConverter.GetBytes(value));
+ }
+
+ public int WriteInt16(DeviceAddress address, short value)
+ {
+ return WriteSingleData(address, BitConverter.GetBytes(value));
+ }
+
+ public int WriteFloat(DeviceAddress address, float value)
+ {
+ return WriteSingleData(address, BitConverter.GetBytes(value));
+ }
+
+ public int WriteString(DeviceAddress address, string value)
+ {
+ return WriteSingleData(address, Encoding.ASCII.GetBytes(value));
+ }
+
+ public int WriteBit(DeviceAddress address, bool value)
+ {
+ return WriteSingleData(address, new byte[] { (byte)(value ? 1 : 0) });
+ }
+
+ public int WriteBits(DeviceAddress address, byte value)
+ {
+ return WriteSingleData(address, new byte[] { value });
+ }
+
+ public event DataChangeEventHandler DataChange;
+
+ public void Dispose()
+ {
+ if (_items != null)
+ {
+ _items.Clear();
+ }
+ _items = null;
+ }
+ }
+}
diff --git a/SCADA/Program/ClientDriver/ClientDriver.csproj b/SCADA/Program/ClientDriver/ClientDriver.csproj
new file mode 100644
index 0000000..481262d
--- /dev/null
+++ b/SCADA/Program/ClientDriver/ClientDriver.csproj
@@ -0,0 +1,56 @@
+
+
+
+ Debug
+ AnyCPU
+ 8.0.30703
+ 2.0
+ {6DF53968-152D-4CA9-B62F-FF1C27069C4D}
+ Library
+ Properties
+ ClientDriver
+ ClientDriver
+ v4.0
+ 512
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+ true
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+ true
+
+
+
+
+
+
+
+
+
+
+ {8965e389-6466-4b30-bd43-83c909044637}
+ DataService
+
+
+
+
+
\ No newline at end of file
diff --git a/SCADA/Program/ClientDriver/Properties/AssemblyInfo.cs b/SCADA/Program/ClientDriver/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..ef9a99d
--- /dev/null
+++ b/SCADA/Program/ClientDriver/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("ClientDriver")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("ClientDriver")]
+[assembly: AssemblyCopyright("Copyright © 2014")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("23c52ec3-bdbe-4776-8324-4e8842fbdd5a")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/SCADA/Program/ClientDriver/bin/Debug/ClientDriver.dll b/SCADA/Program/ClientDriver/bin/Debug/ClientDriver.dll
new file mode 100644
index 0000000..0078ad8
Binary files /dev/null and b/SCADA/Program/ClientDriver/bin/Debug/ClientDriver.dll differ
diff --git a/SCADA/Program/ClientDriver/bin/Debug/DataService.dll b/SCADA/Program/ClientDriver/bin/Debug/DataService.dll
new file mode 100644
index 0000000..e84e58d
Binary files /dev/null and b/SCADA/Program/ClientDriver/bin/Debug/DataService.dll differ
diff --git a/SCADA/Program/ClientDriver/bin/Release/ClientDriver.dll b/SCADA/Program/ClientDriver/bin/Release/ClientDriver.dll
new file mode 100644
index 0000000..bc1aff4
Binary files /dev/null and b/SCADA/Program/ClientDriver/bin/Release/ClientDriver.dll differ
diff --git a/SCADA/Program/ClientDriver/bin/Release/DataService.dll b/SCADA/Program/ClientDriver/bin/Release/DataService.dll
new file mode 100644
index 0000000..afed82c
Binary files /dev/null and b/SCADA/Program/ClientDriver/bin/Release/DataService.dll differ
diff --git a/SCADA/Program/ClientDriver/obj/Debug/ClientDriver.csproj.FileListAbsolute.txt b/SCADA/Program/ClientDriver/obj/Debug/ClientDriver.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..ee040c4
--- /dev/null
+++ b/SCADA/Program/ClientDriver/obj/Debug/ClientDriver.csproj.FileListAbsolute.txt
@@ -0,0 +1,68 @@
+D:\大成\大成0211new_20140302\大成0211\DataExchange\ClientDriver\bin\Debug\ClientDriver.dll
+D:\大成\大成0211new_20140302\大成0211\DataExchange\ClientDriver\bin\Debug\ClientDriver.pdb
+D:\大成\大成0211new_20140302\大成0211\DataExchange\ClientDriver\bin\Debug\DataService.dll
+D:\大成\大成0211new_20140302\大成0211\DataExchange\ClientDriver\bin\Debug\DataService.pdb
+D:\大成\大成0211new_20140302\大成0211\DataExchange\ClientDriver\obj\Debug\ClientDriver.dll
+D:\大成\大成0211new_20140302\大成0211\DataExchange\ClientDriver\obj\Debug\ClientDriver.pdb
+E:\双胞胎项目\大成0211\DataExchange\ClientDriver\bin\Debug\ClientDriver.dll
+E:\双胞胎项目\大成0211\DataExchange\ClientDriver\bin\Debug\ClientDriver.pdb
+E:\双胞胎项目\大成0211\DataExchange\ClientDriver\bin\Debug\DataService.dll
+E:\双胞胎项目\大成0211\DataExchange\ClientDriver\bin\Debug\DataService.pdb
+E:\双胞胎项目\大成0211\DataExchange\ClientDriver\obj\Debug\ClientDriver.dll
+E:\双胞胎项目\大成0211\DataExchange\ClientDriver\obj\Debug\ClientDriver.pdb
+F:\牧羊上位机\DataExchange\ClientDriver\bin\Debug\ClientDriver.dll
+F:\牧羊上位机\DataExchange\ClientDriver\bin\Debug\ClientDriver.pdb
+F:\牧羊上位机\DataExchange\ClientDriver\bin\Debug\DataService.dll
+F:\牧羊上位机\DataExchange\ClientDriver\bin\Debug\DataService.pdb
+F:\牧羊上位机\DataExchange\ClientDriver\obj\Debug\ClientDriver.csprojResolveAssemblyReference.cache
+F:\牧羊上位机\DataExchange\ClientDriver\obj\Debug\ClientDriver.dll
+F:\牧羊上位机\DataExchange\ClientDriver\obj\Debug\ClientDriver.pdb
+E:\南宁华港\牧羊上位机\DataExchange\ClientDriver\bin\Debug\ClientDriver.dll
+E:\南宁华港\牧羊上位机\DataExchange\ClientDriver\bin\Debug\ClientDriver.pdb
+E:\南宁华港\牧羊上位机\DataExchange\ClientDriver\bin\Debug\DataService.dll
+E:\南宁华港\牧羊上位机\DataExchange\ClientDriver\bin\Debug\DataService.pdb
+E:\南宁华港\牧羊上位机\DataExchange\ClientDriver\obj\Debug\ClientDriver.csprojResolveAssemblyReference.cache
+E:\南宁华港\牧羊上位机\DataExchange\ClientDriver\obj\Debug\ClientDriver.dll
+E:\南宁华港\牧羊上位机\DataExchange\ClientDriver\obj\Debug\ClientDriver.pdb
+E:\Project\牧羊上位机\DataExchange\ClientDriver\bin\Debug\ClientDriver.dll
+E:\Project\牧羊上位机\DataExchange\ClientDriver\bin\Debug\ClientDriver.pdb
+E:\Project\牧羊上位机\DataExchange\ClientDriver\bin\Debug\DataService.dll
+E:\Project\牧羊上位机\DataExchange\ClientDriver\bin\Debug\DataService.pdb
+E:\Project\牧羊上位机\DataExchange\ClientDriver\obj\Debug\ClientDriver.csprojResolveAssemblyReference.cache
+E:\Project\牧羊上位机\DataExchange\ClientDriver\obj\Debug\ClientDriver.dll
+E:\Project\牧羊上位机\DataExchange\ClientDriver\obj\Debug\ClientDriver.pdb
+E:\Project\牧羊上位机\Program\ClientDriver\bin\Debug\ClientDriver.dll
+E:\Project\牧羊上位机\Program\ClientDriver\bin\Debug\ClientDriver.pdb
+E:\Project\牧羊上位机\Program\ClientDriver\bin\Debug\DataService.dll
+E:\Project\牧羊上位机\Program\ClientDriver\bin\Debug\DataService.pdb
+E:\Project\牧羊上位机\Program\ClientDriver\obj\Debug\ClientDriver.csprojResolveAssemblyReference.cache
+E:\Project\牧羊上位机\Program\ClientDriver\obj\Debug\ClientDriver.dll
+E:\Project\牧羊上位机\Program\ClientDriver\obj\Debug\ClientDriver.pdb
+E:\Project\SCADA\Program\ClientDriver\bin\Debug\ClientDriver.dll
+E:\Project\SCADA\Program\ClientDriver\bin\Debug\ClientDriver.pdb
+E:\Project\SCADA\Program\ClientDriver\bin\Debug\DataService.dll
+E:\Project\SCADA\Program\ClientDriver\bin\Debug\DataService.pdb
+E:\Project\SCADA\Program\ClientDriver\obj\Debug\ClientDriver.csprojResolveAssemblyReference.cache
+E:\Project\SCADA\Program\ClientDriver\obj\Debug\ClientDriver.dll
+E:\Project\SCADA\Program\ClientDriver\obj\Debug\ClientDriver.pdb
+E:\SCADA\Program\ClientDriver\bin\Debug\ClientDriver.dll
+E:\SCADA\Program\ClientDriver\bin\Debug\ClientDriver.pdb
+E:\SCADA\Program\ClientDriver\bin\Debug\DataService.dll
+E:\SCADA\Program\ClientDriver\bin\Debug\DataService.pdb
+E:\SCADA\Program\ClientDriver\obj\Debug\ClientDriver.csprojResolveAssemblyReference.cache
+E:\SCADA\Program\ClientDriver\obj\Debug\ClientDriver.dll
+E:\SCADA\Program\ClientDriver\obj\Debug\ClientDriver.pdb
+F:\SCADA\Program\ClientDriver\bin\Debug\ClientDriver.dll
+F:\SCADA\Program\ClientDriver\bin\Debug\ClientDriver.pdb
+F:\SCADA\Program\ClientDriver\bin\Debug\DataService.dll
+F:\SCADA\Program\ClientDriver\bin\Debug\DataService.pdb
+F:\SCADA\Program\ClientDriver\obj\Debug\ClientDriver.csprojResolveAssemblyReference.cache
+F:\SCADA\Program\ClientDriver\obj\Debug\ClientDriver.dll
+F:\SCADA\Program\ClientDriver\obj\Debug\ClientDriver.pdb
+E:\新建文件夹\SCADA\Program\ClientDriver\bin\Debug\ClientDriver.dll
+E:\新建文件夹\SCADA\Program\ClientDriver\bin\Debug\ClientDriver.pdb
+E:\新建文件夹\SCADA\Program\ClientDriver\bin\Debug\DataService.dll
+E:\新建文件夹\SCADA\Program\ClientDriver\bin\Debug\DataService.pdb
+E:\新建文件夹\SCADA\Program\ClientDriver\obj\Debug\ClientDriver.csprojResolveAssemblyReference.cache
+E:\新建文件夹\SCADA\Program\ClientDriver\obj\Debug\ClientDriver.dll
+E:\新建文件夹\SCADA\Program\ClientDriver\obj\Debug\ClientDriver.pdb
diff --git a/SCADA/Program/ClientDriver/obj/Debug/ClientDriver.dll b/SCADA/Program/ClientDriver/obj/Debug/ClientDriver.dll
new file mode 100644
index 0000000..0078ad8
Binary files /dev/null and b/SCADA/Program/ClientDriver/obj/Debug/ClientDriver.dll differ
diff --git a/SCADA/Program/ClientDriver/obj/Release/ClientDriver.csproj.FileListAbsolute.txt b/SCADA/Program/ClientDriver/obj/Release/ClientDriver.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..78f3c60
--- /dev/null
+++ b/SCADA/Program/ClientDriver/obj/Release/ClientDriver.csproj.FileListAbsolute.txt
@@ -0,0 +1,105 @@
+D:\大成\大成0211new_20140302\大成0211\DataExchange\ClientDriver\bin\Release\ClientDriver.dll
+D:\大成\大成0211new_20140302\大成0211\DataExchange\ClientDriver\bin\Release\ClientDriver.pdb
+D:\大成\大成0211new_20140302\大成0211\DataExchange\ClientDriver\bin\Release\DataService.dll
+D:\大成\大成0211new_20140302\大成0211\DataExchange\ClientDriver\bin\Release\DataService.pdb
+D:\大成\大成0211new_20140302\大成0211\DataExchange\ClientDriver\obj\Release\ClientDriver.csprojResolveAssemblyReference.cache
+D:\大成\大成0211new_20140302\大成0211\DataExchange\ClientDriver\obj\Release\ClientDriver.dll
+D:\大成\大成0211new_20140302\大成0211\DataExchange\ClientDriver\obj\Release\ClientDriver.pdb
+D:\大成0211new_20140302\大成0211\DataExchange\ClientDriver\bin\Release\ClientDriver.dll
+D:\大成0211new_20140302\大成0211\DataExchange\ClientDriver\bin\Release\ClientDriver.pdb
+D:\大成0211new_20140302\大成0211\DataExchange\ClientDriver\bin\Release\DataService.dll
+D:\大成0211new_20140302\大成0211\DataExchange\ClientDriver\bin\Release\DataService.pdb
+D:\大成0211new_20140302\大成0211\DataExchange\ClientDriver\obj\Release\ClientDriver.csprojResolveAssemblyReference.cache
+D:\大成0211new_20140302\大成0211\DataExchange\ClientDriver\obj\Release\ClientDriver.dll
+D:\大成0211new_20140302\大成0211\DataExchange\ClientDriver\obj\Release\ClientDriver.pdb
+D:\大成0211\DataExchange\ClientDriver\bin\Release\ClientDriver.dll
+D:\大成0211\DataExchange\ClientDriver\bin\Release\ClientDriver.pdb
+D:\大成0211\DataExchange\ClientDriver\bin\Release\DataService.dll
+D:\大成0211\DataExchange\ClientDriver\bin\Release\DataService.pdb
+D:\大成0211\DataExchange\ClientDriver\obj\Release\ClientDriver.csprojResolveAssemblyReference.cache
+D:\大成0211\DataExchange\ClientDriver\obj\Release\ClientDriver.dll
+D:\大成0211\DataExchange\ClientDriver\obj\Release\ClientDriver.pdb
+G:\大成0211\DataExchange\ClientDriver\bin\Release\ClientDriver.dll
+G:\大成0211\DataExchange\ClientDriver\bin\Release\ClientDriver.pdb
+G:\大成0211\DataExchange\ClientDriver\bin\Release\DataService.dll
+G:\大成0211\DataExchange\ClientDriver\bin\Release\DataService.pdb
+G:\大成0211\DataExchange\ClientDriver\obj\Release\ResolveAssemblyReference.cache
+G:\大成0211\DataExchange\ClientDriver\obj\Release\ClientDriver.dll
+G:\大成0211\DataExchange\ClientDriver\obj\Release\ClientDriver.pdb
+E:\双胞胎项目\大成0211\DataExchange\ClientDriver\bin\Release\ClientDriver.dll
+E:\双胞胎项目\大成0211\DataExchange\ClientDriver\bin\Release\ClientDriver.pdb
+E:\双胞胎项目\大成0211\DataExchange\ClientDriver\bin\Release\DataService.dll
+E:\双胞胎项目\大成0211\DataExchange\ClientDriver\bin\Release\DataService.pdb
+E:\双胞胎项目\大成0211\DataExchange\ClientDriver\obj\Release\ClientDriver.csprojResolveAssemblyReference.cache
+E:\双胞胎项目\大成0211\DataExchange\ClientDriver\obj\Release\ClientDriver.dll
+E:\双胞胎项目\大成0211\DataExchange\ClientDriver\obj\Release\ClientDriver.pdb
+E:\牧羊上位机\DataExchange\ClientDriver\bin\Release\ClientDriver.dll
+E:\牧羊上位机\DataExchange\ClientDriver\bin\Release\ClientDriver.pdb
+E:\牧羊上位机\DataExchange\ClientDriver\bin\Release\DataService.dll
+E:\牧羊上位机\DataExchange\ClientDriver\bin\Release\DataService.pdb
+E:\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.dll
+E:\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.pdb
+D:\牧羊上位机\DataExchange\ClientDriver\bin\Release\ClientDriver.dll
+D:\牧羊上位机\DataExchange\ClientDriver\bin\Release\ClientDriver.pdb
+D:\牧羊上位机\DataExchange\ClientDriver\bin\Release\DataService.dll
+D:\牧羊上位机\DataExchange\ClientDriver\bin\Release\DataService.pdb
+D:\牧羊上位机\DataExchange\ClientDriver\obj\Release\ResolveAssemblyReference.cache
+D:\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.dll
+D:\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.pdb
+E:\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.csprojResolveAssemblyReference.cache
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\ClientDriver\bin\Release\ClientDriver.dll
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\ClientDriver\bin\Release\ClientDriver.pdb
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\ClientDriver\bin\Release\DataService.dll
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\ClientDriver\bin\Release\DataService.pdb
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.csprojResolveAssemblyReference.cache
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.dll
+E:\双胞胎项目\长沙\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.pdb
+E:\南宁华港\华港\牧羊上位机\DataExchange\ClientDriver\bin\Release\ClientDriver.dll
+E:\南宁华港\华港\牧羊上位机\DataExchange\ClientDriver\bin\Release\ClientDriver.pdb
+E:\南宁华港\华港\牧羊上位机\DataExchange\ClientDriver\bin\Release\DataService.dll
+E:\南宁华港\华港\牧羊上位机\DataExchange\ClientDriver\bin\Release\DataService.pdb
+E:\南宁华港\华港\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.csprojResolveAssemblyReference.cache
+E:\南宁华港\华港\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.dll
+E:\南宁华港\华港\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.pdb
+F:\华港\牧羊上位机\DataExchange\ClientDriver\bin\Release\ClientDriver.dll
+F:\华港\牧羊上位机\DataExchange\ClientDriver\bin\Release\ClientDriver.pdb
+F:\华港\牧羊上位机\DataExchange\ClientDriver\bin\Release\DataService.dll
+F:\华港\牧羊上位机\DataExchange\ClientDriver\bin\Release\DataService.pdb
+F:\华港\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.csprojResolveAssemblyReference.cache
+F:\华港\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.dll
+F:\华港\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.pdb
+E:\南宁华港\牧羊上位机\DataExchange\ClientDriver\bin\Release\ClientDriver.dll
+E:\南宁华港\牧羊上位机\DataExchange\ClientDriver\bin\Release\ClientDriver.pdb
+E:\南宁华港\牧羊上位机\DataExchange\ClientDriver\bin\Release\DataService.dll
+E:\南宁华港\牧羊上位机\DataExchange\ClientDriver\bin\Release\DataService.pdb
+E:\南宁华港\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.csprojResolveAssemblyReference.cache
+E:\南宁华港\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.dll
+E:\南宁华港\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.pdb
+K:\华港\牧羊上位机\DataExchange\ClientDriver\bin\Release\ClientDriver.dll
+K:\华港\牧羊上位机\DataExchange\ClientDriver\bin\Release\ClientDriver.pdb
+K:\华港\牧羊上位机\DataExchange\ClientDriver\bin\Release\DataService.dll
+K:\华港\牧羊上位机\DataExchange\ClientDriver\bin\Release\DataService.pdb
+K:\华港\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.csprojResolveAssemblyReference.cache
+K:\华港\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.dll
+K:\华港\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.pdb
+E:\Project\牧羊上位机\DataExchange\ClientDriver\bin\Release\ClientDriver.dll
+E:\Project\牧羊上位机\DataExchange\ClientDriver\bin\Release\ClientDriver.pdb
+E:\Project\牧羊上位机\DataExchange\ClientDriver\bin\Release\DataService.dll
+E:\Project\牧羊上位机\DataExchange\ClientDriver\bin\Release\DataService.pdb
+E:\Project\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.csprojResolveAssemblyReference.cache
+E:\Project\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.dll
+E:\Project\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.pdb
+F:\牧羊上位机\DataExchange\ClientDriver\bin\Release\ClientDriver.dll
+F:\牧羊上位机\DataExchange\ClientDriver\bin\Release\ClientDriver.pdb
+F:\牧羊上位机\DataExchange\ClientDriver\bin\Release\DataService.dll
+F:\牧羊上位机\DataExchange\ClientDriver\bin\Release\DataService.pdb
+F:\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.csprojResolveAssemblyReference.cache
+F:\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.dll
+F:\牧羊上位机\DataExchange\ClientDriver\obj\Release\ClientDriver.pdb
+E:\SCADA\Program\ClientDriver\bin\Release\ClientDriver.dll
+E:\SCADA\Program\ClientDriver\bin\Release\ClientDriver.pdb
+E:\SCADA\Program\ClientDriver\bin\Release\DataService.dll
+E:\SCADA\Program\ClientDriver\bin\Release\DataService.pdb
+E:\SCADA\Program\ClientDriver\obj\Release\ClientDriver.csprojResolveAssemblyReference.cache
+E:\SCADA\Program\ClientDriver\obj\Release\ClientDriver.dll
+E:\SCADA\Program\ClientDriver\obj\Release\ClientDriver.pdb
diff --git a/SCADA/Program/ClientDriver/obj/Release/ClientDriver.dll b/SCADA/Program/ClientDriver/obj/Release/ClientDriver.dll
new file mode 100644
index 0000000..bc1aff4
Binary files /dev/null and b/SCADA/Program/ClientDriver/obj/Release/ClientDriver.dll differ
diff --git a/SCADA/Program/CoreTest/AlarmSet.xaml b/SCADA/Program/CoreTest/AlarmSet.xaml
new file mode 100644
index 0000000..3c755bb
--- /dev/null
+++ b/SCADA/Program/CoreTest/AlarmSet.xaml
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/CoreTest/AlarmSet.xaml.cs b/SCADA/Program/CoreTest/AlarmSet.xaml.cs
new file mode 100644
index 0000000..df2aeb6
--- /dev/null
+++ b/SCADA/Program/CoreTest/AlarmSet.xaml.cs
@@ -0,0 +1,128 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Data.SqlClient;
+using System.Windows;
+using System.Windows.Input;
+using System.Windows.Media;
+using DatabaseLib;
+using DataService;
+
+namespace CoreTest
+{
+ public partial class AlarmSet : Window
+ {
+ QueueCollection collection;//数据类型
+
+ public AlarmSet()
+ {
+ InitializeComponent();
+ this.SetWindowState();
+ //list2.Height = Math.Max(this.Height - 350, 200);
+ dtstart.Value = DateTime.Now.AddDays(-1);
+ dtend.Value = DateTime.Now;
+ this.CommandBindings.Add(new CommandBinding(MyCommands.Clear, (sender, e) =>
+ {
+ var tag = App.Server["_AlarmAck"];
+ if (tag != null)
+ {
+ tag.Write(true);
+ tag.Write(false);
+ }
+ collection.Clear();
+ }, (sender, e) =>
+ {
+ e.CanExecute = collection != null;
+ }));
+ this.CommandBindings.Add(new CommandBinding(MyCommands.Commit, (sender, e) =>
+ {
+ switch (e.Parameter.ToString())
+ {
+ case "0":
+ {
+ var cond = list0.SelectedItem as ICondition;
+ if (cond != null)
+ {
+ App.Server.AckConditions(cond);
+ }
+ //run1.Text = list0.Items.Count.ToString();
+ }
+ break;
+ case "1":
+ {
+ var conds = App.Server.ActivedConditionList;
+ var condarray = new ICondition[conds.Count];
+ conds.CopyTo(condarray, 0);
+ App.Server.AckConditions(condarray);
+ //run1.Text = "0";
+ }
+ break;
+ }
+
+ }, (sender, e) =>
+ {
+ e.CanExecute = list0.SelectedItem != null;
+ }));
+ this.CommandBindings.Add(new CommandBinding(MyCommands.Query, (sender, e) =>
+ {
+ List alist = new List();
+ using (var reader = DataHelper.ExecuteProcedureReader("GetAlarm", new SqlParameter("@StartTime", dtstart.Value.Value), new SqlParameter("@EndTime", dtend.Value.Value)))
+ {
+ if (reader != null)
+ {
+ while (reader.Read())
+ {
+ alist.Add(new AlarmItem(reader.GetDateTime(0), reader.GetNullableString(1), reader.GetValue(2), (SubAlarmType)reader.GetInt32(3),
+ (Severity)reader.GetInt32(4), reader.GetInt32(5), reader.GetString(6)));
+ }
+ }
+ }
+ list1.ItemsSource = alist;
+ //run2.Text = list1.Items.Count.ToString();
+ //exp1.IsExpanded = true;
+ //exp2.IsExpanded = false;
+ }, (sender, e) =>
+ {
+ e.CanExecute = true;
+ }));
+ }
+
+ private void Window_Loaded(object sender, RoutedEventArgs e)
+ {
+ collection = App.Server.AlarmList as QueueCollection;
+ if (collection != null)
+ {
+ list2.ItemsSource = collection;
+ collection.CollectionChanged += new NotifyCollectionChangedEventHandler(collection_CollectionChanged);
+ //run3.Text = list2.Items.Count.ToString();
+ }
+ list0.ItemsSource = App.Server.ActivedConditionList;
+ //run1.Text = list0.Items.Count.ToString();
+ list3.ItemsSource = App.Events;
+ var brush = Background as SolidColorBrush;
+ if (brush != null)
+ colorpicker.SelectedColor = brush.Color;
+ }
+
+ private void Window_Closed(object sender, System.EventArgs e)
+ {
+ this.SaveWindowState();
+ }
+
+ void collection_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
+ {
+ if (e.Action == NotifyCollectionChangedAction.Add)
+ {
+ list2.ScrollIntoView(e.NewItems[0]);
+ //run3.Text = list2.Items.Count.ToString();
+ }
+ //run1.Text = list0.Items.Count.ToString();
+ }
+
+ private void ColorPicker_SelectedColorChanged(object sender, RoutedPropertyChangedEventArgs e)
+ {
+ Background = new SolidColorBrush(e.NewValue);
+ }
+
+ }
+}
diff --git a/SCADA/Program/CoreTest/App.xaml b/SCADA/Program/CoreTest/App.xaml
new file mode 100644
index 0000000..c808418
--- /dev/null
+++ b/SCADA/Program/CoreTest/App.xaml
@@ -0,0 +1,317 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/CoreTest/App.xaml.cs b/SCADA/Program/CoreTest/App.xaml.cs
new file mode 100644
index 0000000..b4a7add
--- /dev/null
+++ b/SCADA/Program/CoreTest/App.xaml.cs
@@ -0,0 +1,200 @@
+using System;
+using System.Diagnostics;
+using System.Drawing;
+using System.Security.Principal;
+using System.Windows;
+using System.Windows.Forms;
+using System.Windows.Threading;
+
+namespace CoreTest
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : System.Windows.Application
+ {
+ const string MYCOSLOGSOURCE = "MyWEM Application";
+ const string MYCOSLOGNAME = "MyWEM";
+
+ static EventLog Log = new EventLog(MYCOSLOGNAME);
+ static readonly string machine = Environment.MachineName;
+ public static readonly DAServer Server = new DAServer();
+
+ static IPrincipal _princ;
+ public static IPrincipal Principal
+ {
+ get
+ {
+ return _princ;
+ }
+ set
+ {
+ _princ = value;
+ }
+ }
+
+ public static string LogSource
+ {
+ get
+ {
+ return machine + "\\" + (_princ == null ? null : _princ.Identity.Name);
+ }
+ }
+
+ static ReverseObservableQueue eventLog = new ReverseObservableQueue(300);
+ public static ReverseObservableQueue Events
+ {
+ get { return eventLog; }
+ }
+
+ static App()
+ {
+ var curr = Process.GetCurrentProcess();
+ foreach (var process in Process.GetProcessesByName(curr.ProcessName))
+ {
+ if (process.Id != curr.Id)
+ {
+ System.Windows.MessageBox.Show("程序已启动!");
+ Environment.Exit(0);
+ }
+ }
+ if (!EventLog.SourceExists(MYCOSLOGSOURCE))
+ EventLog.CreateEventSource(MYCOSLOGSOURCE, MYCOSLOGNAME);
+ }
+
+ public static void AddErrorLog(Exception e)
+ {
+ string err = "";
+ Exception exp = e;
+ while (exp != null)
+ {
+ err += string.Format("\n {0}", exp.Message);
+ exp = exp.InnerException;
+ }
+ err += string.Format("\n {0}", e.StackTrace);
+ Log.Source = MYCOSLOGSOURCE;
+ Log.WriteEntry(err, EventLogEntryType.Error);
+ }
+
+ protected override void OnStartup(StartupEventArgs e)
+ {
+ base.OnStartup(e);
+ MainWindow w1 = null, w2 = null, w3 = null, w4 = null;
+ Screen s1, s2, s3, s4;
+ Rectangle r1, r2, r3, r4;
+
+ Current.DispatcherUnhandledException += App_DispatcherUnhandledException;
+ base.OnStartup(e);
+
+ #region
+ if (Screen.AllScreens.Length == 1)//Server.SD.ScreenCount
+ {
+ w1 = new MainWindow();
+ w1.WindowStartupLocation = WindowStartupLocation.Manual;
+ s1 = Screen.AllScreens[0];
+ r1 = s1.WorkingArea;
+ w1.Top = r1.Top;
+ w1.Left = r1.Left;
+ w1.Show();
+ }
+ else if (Screen.AllScreens.Length == 2)
+ {
+ w1 = new MainWindow();
+ w1.WindowStartupLocation = WindowStartupLocation.Manual;
+ s1 = Screen.AllScreens[0];
+ r1 = s1.WorkingArea;
+ w1.Top = r1.Top;
+ w1.Left = r1.Left;
+ w1.Show();
+
+ w2 = new MainWindow();
+ w2.WindowStartupLocation = WindowStartupLocation.Manual;
+ s2 = Screen.AllScreens[1];
+ r2 = s2.WorkingArea;
+ w2.Top = r2.Top;
+ w2.Left = r2.Left;
+ w2.Show();
+ w2.Owner = w1;
+ }
+ else if (Screen.AllScreens.Length == 3)
+ {
+ w1 = new MainWindow();
+ w1.WindowStartupLocation = WindowStartupLocation.Manual;
+ s1 = Screen.AllScreens[0];
+ r1 = s1.WorkingArea;
+ w1.Top = r1.Top;
+ w1.Left = r1.Left;
+ w1.Show();
+
+ w2 = new MainWindow();
+ w2.WindowStartupLocation = WindowStartupLocation.Manual;
+ s2 = Screen.AllScreens[1];
+ r2 = s2.WorkingArea;
+ w2.Top = r2.Top;
+ w2.Left = r2.Left;
+ w2.Show();
+ w2.Owner = w1;
+
+ w3 = new MainWindow();
+ w3.WindowStartupLocation = WindowStartupLocation.Manual;
+ s3 = Screen.AllScreens[2];
+ r3 = s3.WorkingArea;
+ w3.Top = r3.Top;
+ w3.Left = r3.Left;
+ w3.Show();
+ w3.Owner = w1;
+ }
+ else if (Screen.AllScreens.Length == 4)
+ {
+ w1 = new MainWindow();
+ w1.WindowStartupLocation = WindowStartupLocation.Manual;
+ s1 = Screen.AllScreens[0];
+ r1 = s1.WorkingArea;
+ w1.Top = r1.Top;
+ w1.Left = r1.Left;
+ w1.Show();
+
+ w2 = new MainWindow();
+ w2.WindowStartupLocation = WindowStartupLocation.Manual;
+ s2 = Screen.AllScreens[1];
+ r2 = s2.WorkingArea;
+ w2.Top = r2.Top;
+ w2.Left = r2.Left;
+ w2.Show();
+ w2.Owner = w1;
+
+ w3 = new MainWindow();
+ w3.WindowStartupLocation = WindowStartupLocation.Manual;
+ s3 = Screen.AllScreens[2];
+ r3 = s3.WorkingArea;
+ w3.Top = r3.Top;
+ w3.Left = r3.Left;
+ w3.Show();
+ w3.Owner = w1;
+
+ w4 = new MainWindow();
+ w4.WindowStartupLocation = WindowStartupLocation.Manual;
+ s4 = Screen.AllScreens[3];
+ r4 = s3.WorkingArea;
+ w4.Top = r4.Top;
+ w4.Left = r4.Left;
+ w4.Show();
+ w4.Owner = w1;
+ }
+ #endregion
+ }
+
+ protected override void OnExit(ExitEventArgs e)
+ {
+ base.OnExit(e);
+ Server.Dispose();
+ ConfigCache.SaveConfig();
+ }
+
+ void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
+ {
+ AddErrorLog(e.Exception);
+ e.Handled = true;
+ }
+ }
+}
diff --git a/SCADA/Program/CoreTest/ClientService.cs b/SCADA/Program/CoreTest/ClientService.cs
new file mode 100644
index 0000000..b18111e
--- /dev/null
+++ b/SCADA/Program/CoreTest/ClientService.cs
@@ -0,0 +1,851 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Data.SqlClient;
+using System.Diagnostics;
+using System.Linq;
+using System.Threading;
+using ClientDriver;
+using DatabaseLib;
+using DataService;
+
+namespace CoreTest
+{
+ public sealed class DAServer : IDataServer, IAlarmServer, IHDAServer
+ {
+ int ALARMLIMIT = 1000;
+ int CYCLE = 60000;
+
+ const char SPLITCHAR = '.';
+ const string SERVICELOGSOURCE = "ClientService";
+ const string SERVICELOGNAME = "ClientService";
+
+
+ static EventLog Log;
+
+ public ITag this[short id]
+ {
+ get
+ {
+ int index = GetItemProperties(id);
+ if (index >= 0)
+ {
+ return this[_list[index].Name];
+ }
+ return null;
+ }
+ }
+
+ public ITag this[string name]
+ {
+ get
+ {
+ if (string.IsNullOrEmpty(name)) return null;
+ ITag dataItem;
+ _mapping.TryGetValue(name.ToUpper(), out dataItem);
+ return dataItem;
+ }
+ }
+
+ List _list;
+ public IList MetaDataList
+ {
+ get
+ {
+ return _list;
+ }
+ }
+
+ public IList ScalingList
+ {
+ get
+ {
+ return _scales;
+ }
+ }
+
+ object _syncRoot;
+ public object SyncRoot
+ {
+ get
+ {
+ if (this._syncRoot == null)
+ {
+ Interlocked.CompareExchange(ref this._syncRoot, new object(), null);
+ }
+ return this._syncRoot;
+ }
+ }
+
+ Timer timer;
+
+ Dictionary _mapping;
+
+ List _scales;
+
+ public IEnumerable Drivers
+ {
+ get { yield return reader; }
+ }
+
+ CompareCondBySource _compare;
+
+ ClientReader reader = null;
+ ClientGroup group = null;
+
+ ExpressionEval reval;
+ public ExpressionEval Eval
+ {
+ get
+ {
+ return reval;
+ }
+ }
+
+ public DAServer()
+ {
+ /*hda = new HDAQueue(MAXHDACAP);历史数据均保存于服务器;本机如需查询,需复制历史数据文件到指定文件夹。
+ * 历史数据在服务器上分包(1024字节)发送,客户端每接收一条记录,异步附加或yield return*/
+ if (!EventLog.SourceExists(SERVICELOGSOURCE))
+ {
+ EventLog.CreateEventSource(SERVICELOGSOURCE, SERVICELOGNAME);
+ }
+ Log = new EventLog(SERVICELOGNAME);
+ Log.Source = SERVICELOGSOURCE;
+ ALARMLIMIT = ConfigCache.AlarmLimit;
+ CYCLE = ConfigCache.Cycle;
+ _scales = new List();
+ _linkedList = new QueueCollection(ALARMLIMIT + 10);
+ reval = new ExpressionEval(this);
+ InitClient();
+ InitServerByDatabase();
+ InitConnection();
+ }
+
+ void InitClient()
+ {
+ string sLine = DataHelper.HostName;
+ AddDriver(1, "Client1", string.IsNullOrEmpty(sLine) ? Environment.MachineName : sLine, 20000, null, null, null, null);
+ }
+
+ void InitConnection()
+ {
+ reader.OnClose += new ShutdownRequestEventHandler(reader_OnClose);
+ if (reader.IsClosed)
+ {
+ reader.Connect();
+ }
+ if (group != null)
+ {
+ group.IsActive = true;
+ timer = new Timer(OnTimer, null, CYCLE, CYCLE);
+ }
+ }
+
+ void OnTimer(object o)
+ {
+ if (reader.IsClosed)
+ {
+ reader.Connect();
+ group.IsActive = true;
+ }
+ }
+
+ void InitServerByDatabase()
+ {
+ try
+ {
+ using (var dataReader = DataHelper.ExecuteProcedureReader("InitServer", new SqlParameter("@TYPE", 1)))
+ {
+ if (dataReader == null) Environment.Exit(0);
+ //dataReader.Read();
+ dataReader.Read();
+ int count = dataReader.GetInt32(0);
+ _list = new List(count);
+ _mapping = new Dictionary(count);
+ dataReader.NextResult();
+ while (dataReader.Read())
+ {
+ _list.Add(new TagMetaData(dataReader.GetInt16(0), dataReader.GetInt16(1), dataReader.GetString(2), dataReader.GetString(3), (DataType)dataReader.GetByte(4),
+ (ushort)dataReader.GetInt16(5), dataReader.GetBoolean(6), dataReader.GetFloat(7), dataReader.GetFloat(8), dataReader.GetInt32(9)));
+ //_list[i].Description = dataReader.GetSqlString(6).Value;
+ }
+ _list.Sort();
+ if (reader != null && group == null)
+ {
+ group = reader.AddGroup("Group1", 1, 0, 0, true) as ClientGroup;
+ group.AddItems(_list);
+ }
+ dataReader.NextResult();
+ _conditions = new List();
+ _conditionList = new ObservableCollection();
+ while (dataReader.Read())
+ {
+ int id = dataReader.GetInt32(0);
+ AlarmType type = (AlarmType)dataReader.GetInt32(2);
+ ICondition cond;
+ string source = dataReader.GetString(1);
+ if (_conditions.Count > 0)
+ {
+ cond = _conditions[_conditions.Count - 1];
+ if (cond.ID == id)
+ {
+ cond.AddSubCondition(new SubCondition((SubAlarmType)dataReader.GetInt32(9), dataReader.GetFloat(10),
+ (Severity)dataReader.GetByte(11), dataReader.GetString(12), dataReader.GetBoolean(13)));
+ continue;
+ }
+ }
+ switch (type)
+ {
+ case AlarmType.Complex:
+ cond = new ComplexCondition(id, source, dataReader.GetString(6), dataReader.GetFloat(7), dataReader.GetInt32(8));
+ break;
+ case AlarmType.Level:
+ cond = new LevelAlarm(id, source, dataReader.GetString(6), dataReader.GetFloat(7), dataReader.GetInt32(8));
+ break;
+ case AlarmType.Dev:
+ cond = new DevAlarm(id, (ConditionType)dataReader.GetByte(4), source, dataReader.GetString(6),
+ dataReader.GetFloat(5), dataReader.GetFloat(7), dataReader.GetInt32(8));
+ break;
+ case AlarmType.ROC:
+ cond = new ROCAlarm(id, source, dataReader.GetString(6), dataReader.GetFloat(7), dataReader.GetInt32(8));
+ break;
+ case AlarmType.Quality:
+ cond = new QualitiesAlarm(id, source, dataReader.GetString(6));
+ break;
+ default:
+ cond = new DigitAlarm(id, source, dataReader.GetString(6), dataReader.GetInt32(8));
+ break;
+ }
+ cond.AddSubCondition(new SubCondition((SubAlarmType)dataReader.GetInt32(9), dataReader.GetFloat(10),
+ (Severity)dataReader.GetByte(11), dataReader.GetString(12), dataReader.GetBoolean(13)));
+
+ cond.IsEnabled = dataReader.GetBoolean(3);
+ var simpcond = cond as SimpleCondition;
+ if (simpcond != null)
+ {
+ simpcond.Tag = this[source];
+ }
+ else
+ {
+ var complexcond = cond as ComplexCondition;
+ if (complexcond != null)
+ {
+ var action = complexcond.SetFunction(reval.Eval(source));
+ if (action != null)
+ {
+ ValueChangedEventHandler handle = (s1, e1) => { action(); };
+ foreach (ITag tag in reval.TagList)
+ {
+ tag.ValueChanged += handle;// tag.Refresh();
+ }
+ }
+ }
+ }
+ cond.AlarmActive += new AlarmEventHandler(cond_SendAlarm);
+ cond.AlarmAck += new EventHandler(cond_AckAlarm);
+ //_conditions.Add(cond);// UpdateCondition(cond);
+ _conditions.Add(cond);
+ }
+ dataReader.NextResult();
+ while (dataReader.Read())
+ {
+ _scales.Add(new Scaling(dataReader.GetInt16(0), (ScaleType)dataReader.GetByte(1),
+ dataReader.GetFloat(2), dataReader.GetFloat(3), dataReader.GetFloat(4), dataReader.GetFloat(5)));
+ }
+ }
+ reval.Clear();
+ _scales.Sort();
+ _compare = new CompareCondBySource();
+ _conditions.Sort(_compare);
+ }
+ catch (Exception e)
+ {
+ App.AddErrorLog(e);
+ Environment.Exit(0);
+ }
+ }
+
+ public HistoryData[] BatchRead(DataSource source, bool sync, params ITag[] itemArray)
+ {
+ if (group == null) return null;
+ return group.BatchRead(source, sync, itemArray);
+ }
+
+ public int BatchWrite(Dictionary tags, bool sync)
+ {
+ if (group == null) return -1;
+ SortedDictionary dict = new SortedDictionary();
+ foreach (var item in tags)
+ {
+ var tag = this[item.Key];
+ if (tag != null)
+ dict.Add(tag, item.Value);
+ }
+ return group.BatchWrite(dict, sync);
+ }
+
+ public IDriver AddDriver(short id, string name, string server, int timeOut,
+ string assembly, string className, string spare1, string spare2)
+ {
+ if (reader == null)
+ {
+ reader = new ClientReader(this, id, name, server, timeOut);//server应为远程主机名/IP,从本地字符串解析获取
+ }
+ return reader;
+ }
+
+ public bool RemoveDriver(IDriver device)
+ {
+ lock (SyncRoot)
+ {
+ if (device == reader)
+ {
+ device.Dispose();
+ device = null;
+ return true;
+ }
+ return false;
+ }
+ }
+
+ void reader_OnClose(object sender, ShutdownRequestEventArgs e)
+ {
+ App.AddErrorLog(new Exception((e.shutdownReason)));
+ //AddErrorLog(new Exception(e.shutdownReason));
+ }
+
+ public bool AddItemIndex(string key, ITag value)
+ {
+ key = key.ToUpper();
+ if (_mapping.ContainsKey(key))
+ return false;
+ _mapping.Add(key, value);
+ return true;
+ }
+
+ public bool RemoveItemIndex(string key)
+ {
+ return _mapping.Remove(key.ToUpper());
+ }
+
+ object _asyncAlarm = new object();
+ void cond_SendAlarm(object sender, AlarmItem e)
+ {
+ lock (_asyncAlarm)
+ {
+ int index2 = _conditions.BinarySearch(new DigitAlarm(0, e.Source), _compare);
+ if (index2 > -1)
+ {
+ var cond = _conditions[index2];
+ if (_conditionList.Contains(cond) && App.Current != null)
+ {
+ App.Current.Dispatcher.BeginInvoke(new Action(delegate
+ {
+ try
+ {
+ _conditionList.Remove(cond);
+ }
+ catch (Exception err) { }
+ }));
+ }
+ if (e.SubAlarmType != SubAlarmType.None && App.Current != null)
+ {
+ App.Current.Dispatcher.BeginInvoke(new Action(delegate
+ {
+ try
+ {
+ _conditionList.Add(cond);
+ }
+ catch (Exception err) { }
+ }));
+ }
+ }
+ if (_linkedList.Count < ALARMLIMIT)
+ {
+ _linkedList.Enqueue(e);
+ }
+ else
+ {
+ _linkedList.Dequeue();
+ _linkedList.Enqueue(e);
+ }
+ }
+ }
+
+ void cond_AckAlarm(object sender, EventArgs e)
+ {
+ SystemLog.AddLog(new SystemLog(EventType.Simple, DateTime.Now, App.LogSource, "报警应答"));
+ }
+
+ string[] itemList = null;
+ public IEnumerable BrowseItems(BrowseType browseType, string tagName, DataType dataType)
+ {
+ lock (SyncRoot)
+ {
+ if (_list.Count == 0) yield break;
+ int len = _list.Count;
+ if (itemList == null)
+ {
+ itemList = new string[len];
+ for (int i = 0; i < len; i++)
+ {
+ itemList[i] = _list[i].Name;
+ }
+ Array.Sort(itemList);
+ }
+ int ii = 0;
+ bool hasTag = !string.IsNullOrEmpty(tagName);
+ bool first = true;
+ string str = hasTag ? tagName + SPLITCHAR : string.Empty;
+ if (hasTag)
+ {
+ ii = Array.BinarySearch(itemList, tagName);
+ if (ii < 0) first = false;
+ //int strLen = str.Length;
+ ii = Array.BinarySearch(itemList, str);
+ if (ii < 0) ii = ~ii;
+ }
+ //while (++i < len && temp.Length >= strLen && temp.Substring(0, strLen) == str)
+ do
+ {
+ if (first && hasTag)
+ {
+ first = false;
+ yield return tagName;
+ }
+ string temp = itemList[ii];
+ if (hasTag && !temp.StartsWith(str, StringComparison.Ordinal))
+ break;
+ if (dataType == DataType.NONE || _mapping[temp].Address.VarType == dataType)
+ {
+ bool b3 = true;
+ if (browseType != BrowseType.Flat)
+ {
+ string curr = temp + SPLITCHAR;
+ int index = Array.BinarySearch(itemList, ii, len - ii, curr);
+ if (index < 0) index = ~index;
+ b3 = itemList[index].StartsWith(curr, StringComparison.Ordinal);
+ if (browseType == BrowseType.Leaf)
+ b3 = !b3;
+ }
+ if (b3)
+ yield return temp;
+ }
+ } while (++ii < len);
+ }
+ }
+
+ public int GetScaleByID(short Id)
+ {
+ if (_scales == null || _scales.Count == 0) return -1;
+ return _scales.BinarySearch(new Scaling { ID = Id });
+ }
+
+ public IGroup GetGroupByName(string name)
+ {
+ return group;
+ }
+
+ public void ActiveItem(bool active, params ITag[] items)
+ {
+ Dictionary> dict = new Dictionary>();
+ for (int i = 0; i < items.Length; i++)
+ {
+ List list = null;
+ ITag item = items[i];
+ dict.TryGetValue(item.Parent, out list);
+ if (list != null)
+ {
+ list.Add(item.ID);
+ }
+ else
+ dict.Add(item.Parent, new List { item.ID });
+
+ }
+ foreach (var grp in dict)
+ {
+ grp.Key.SetActiveState(active, grp.Value.ToArray());
+ }
+ }
+
+ public int GetItemProperties(short id)
+ {
+ return _list.BinarySearch(new TagMetaData { ID = id });
+ }
+
+ public IEnumerable ReadAtTime(params DateTime[] timeStamps)
+ {
+ return null;//待定
+ }
+
+ public IEnumerable ReadAtTime(short ID, params DateTime[] timeStamps)
+ {
+ return null;//待定
+ }
+
+ //考虑用异步Socket从服务器获取历史数据,命令包含起始时间和ID,以数组返回(要拆包)
+ //对日期、时间如何分割?可返回任意时间段;合并;对于历史数据,如本地文件夹存在,则从本地读取;没有则当日从服务器读取,历史数据分离处理
+ public IEnumerable ReadRaw(DateTime start, DateTime end)
+ {
+ if (end < start) return null;
+ try
+ {
+ if (HDAIOHelper.FindFile(end) && (DateTime.Today > end.Date))
+ {
+ return ReadFromFile(start, end);
+ }
+ return group.SendHdaRequest(start, end);
+ }
+ catch (Exception exp)
+ {
+ App.AddErrorLog(exp);
+ return null;
+ }
+ }
+
+ public IEnumerable ReadRaw(DateTime start, DateTime end, short ID)
+ {
+ if (end < start) return null;
+ try
+ {
+ if (HDAIOHelper.FindFile(end) && (DateTime.Today > end.Date))
+ {
+ return ReadFromFile(start, end, ID);
+ }
+ return group.SendHdaRequest(start, end, ID);
+ }
+ catch (Exception exp)
+ {
+ App.AddErrorLog(exp);
+ return null;
+ }
+ }
+
+ private IEnumerable ReadFromFile(DateTime start, DateTime end, short ID)
+ {
+ int eyear = end.Year;
+ int syear = start.Year;
+ int emonth = end.Month;
+ int smonth = start.Month;
+ int year = syear;
+ while (year <= eyear)
+ {
+ int month = (year == syear ? smonth : 1);
+ while (month <= (year == eyear ? emonth : 12))
+ {
+ var result = HDAIOHelper.LoadFromFile((year == syear && month == smonth ? start : new DateTime(year, month, 1)),
+ (year == eyear && month == emonth ? end : new DateTime(year, month, 1).AddMonths(1).AddMilliseconds(-2)), ID);//考虑按月遍历
+ if (result != null)
+ {
+ foreach (var data in result)
+ yield return data;
+ }
+ month++;
+ }
+ year++;
+ }
+ }
+
+ private IEnumerable ReadFromFile(DateTime start, DateTime end)
+ {
+ int eyear = end.Year;
+ int syear = start.Year;
+ int emonth = end.Month;
+ int smonth = start.Month;
+ int year = syear;
+ while (year <= eyear)
+ {
+ int month = (year == syear ? smonth : 1);
+ while (month <= (year == eyear ? emonth : 12))
+ {
+ var result = HDAIOHelper.LoadFromFile((year == syear && month == smonth ? start : new DateTime(year, month, 1)),
+ (year == eyear && month == emonth ? end : new DateTime(year, month, 1).AddMonths(1).AddMilliseconds(-2)));//考虑按月遍历
+ if (result != null)
+ {
+ foreach (var data in result)
+ yield return data;
+ }
+ month++;
+ }
+ year++;
+ }
+ }
+
+ public int SendAlarmRequest(DateTime? start, DateTime? end)
+ {
+ return group.SendAlarmRequest(start, end);
+ }
+
+ public void Dispose()
+ {
+ lock (this)
+ {
+ if (timer != null)
+ timer.Dispose();
+ group.SendResetRequest();
+ reader.OnClose -= this.reader_OnClose;
+ reader.Dispose();
+ if (_conditionList != null)
+ {
+ foreach (var condition in _conditionList)
+ {
+ if (condition != null)
+ condition.AlarmActive -= cond_SendAlarm;
+ }
+ }
+ reval.Dispose();
+ }
+ }
+
+ List _conditions;
+ ObservableCollection _conditionList;
+
+ QueueCollection _linkedList;
+ public IEnumerable AlarmList
+ {
+ get
+ {
+ return _linkedList;
+ }
+ }
+
+ public IList ActivedConditionList
+ {
+ get
+ {
+ return _conditionList;
+ }
+ }
+
+ public IList ConditionList
+ {
+ get
+ {
+ return _conditions;
+ }
+ }
+
+ public ICondition GetCondition(string tagName, AlarmType type)
+ {
+ ITag tag = this[tagName];
+ if (tag == null) return null;
+ short id = tag.ID;
+ int index = _conditions.BinarySearch(new DigitAlarm(0, tagName));
+ if (index < 0) return null;
+ int ind1 = index - 1;
+ ICondition cond = _conditions[index];
+ while (index < _conditions.Count && cond.Source == tagName)
+ {
+ cond = _conditions[index++];
+ if (cond.AlarmType == type)
+ {
+ return cond;
+ }
+ }
+ while (ind1 >= 0 && cond.Source == tagName)
+ {
+ cond = _conditions[ind1--];
+ if (cond.AlarmType == type)
+ {
+ return cond;
+ }
+ }
+ return null;
+ }
+
+ public IList QueryConditions(string sourceName)
+ {
+ if (_conditions == null || sourceName == null) return null;
+ ITag tag = this[sourceName];
+ if (tag == null) return null;
+ int index = _conditions.BinarySearch(new DigitAlarm(0, sourceName));
+ if (index < 0) return null;
+ List condList = new List();
+ ICondition cond = _conditions[index];
+ int ind1 = index - 1;
+ while (cond.Source == sourceName)
+ {
+ condList.Add(cond);
+ if (++index < _conditions.Count)
+ cond = _conditions[index];
+ else
+ break;
+ }
+ while (ind1 >= 0)
+ {
+ if (cond.Source == sourceName)
+ condList.Add(cond);
+ }
+ return condList;
+ }
+
+ public int DisableCondition(string sourceName, AlarmType type)
+ {
+ var cond = GetCondition(sourceName, type);
+ if (cond != null)
+ {
+ cond.IsEnabled = false;
+ return 1;
+ }
+ return -1;
+ }
+
+ public int EnableCondition(string sourceName, AlarmType type)
+ {
+ var cond = GetCondition(sourceName, type);
+ if (cond != null)
+ {
+ cond.IsEnabled = true;
+ return 1;
+ }
+ return -1;
+ }
+
+ public int RemoveConditon(string sourceName, AlarmType type)
+ {
+ var cond = GetCondition(sourceName, type);
+ if (cond != null)
+ {
+ _conditions.Remove(cond);
+ return 1;
+ }
+ return -1;
+ }
+
+ public int RemoveConditons(string sourceName)
+ {
+ ITag tag = this[sourceName];
+ if (_conditions == null || tag == null) return -1;
+ int index = _conditions.BinarySearch(new DigitAlarm(0, sourceName));
+ if (index < 0) return index;
+ int ind1 = index - 1;
+ ICondition cond = _conditions[index];
+ List li = new List();
+ while (cond.Source == sourceName)
+ {
+ li.Add(index);
+ if (++index < _conditions.Count)
+ cond = _conditions[index];
+ else
+ break;
+ }
+ while (ind1 >= 0)
+ {
+ cond = _conditions[ind1--];
+ if (cond.Source == sourceName)
+ li.Add(ind1);
+ }
+ if (li.Count == 0) return -1;
+ for (int i = li.Count - 1; i >= 0; i--)
+ {
+ _conditions.RemoveAt(i);
+ }
+ return 1;
+ }
+
+ public int AckConditions(params ICondition[] conditions)
+ {
+ if (conditions == null || conditions.Length == 0) return -1;
+ lock (_asyncAlarm)
+ {
+ foreach (ICondition cond in conditions)
+ {
+ cond.IsAcked = true;
+ if (_conditionList.Contains(cond))
+ _conditionList.Remove(cond);
+ }
+ }
+ return 1;
+ }
+
+ public int IgnoreConditions(params ICondition[] conditions)
+ {
+ if (conditions == null || conditions.Length == 0) return -1;
+ lock (_asyncAlarm)
+ {
+ foreach (ICondition cond in conditions)
+ {
+ if (_conditionList.Contains(cond))
+ _conditionList.Remove(cond);
+ }
+ }
+ return 1;
+ }
+
+ Dictionary _archiveList = null;
+ public Dictionary ArchiveList
+ {
+ get
+ {
+ if (_archiveList == null)
+ {
+ var list = MetaDataList.Where(x => x.Archive).Select(y => y.ID);//&& x.DataType != DataType.BOOL
+ if (list != null && list.Count() > 0)
+ {
+ string sql = "SELECT TAGID,DESCRIPTION FROM META_TAG WHERE TAGID IN(" + string.Join(",", list) + ");";
+ using (var reader = DataHelper.ExecuteReader(sql))
+ {
+ if (reader != null)
+ {
+ _archiveList = new Dictionary();
+ while (reader.Read())
+ {
+ _archiveList.Add(reader.GetInt16(0), reader.GetNullableString(1));
+ }
+ }
+ }
+ }
+ }
+ return _archiveList;
+ }
+ }
+
+ public void GetMinMax(short id, out float max, out float min)
+ {
+ int index = GetItemProperties(id);
+ if (index >= 0)
+ {
+ var metadata = MetaDataList[index];
+ if (metadata.Maximum == metadata.Minimum && metadata.Maximum == 0)
+ {
+ switch (metadata.DataType)
+ {
+ case DataType.BOOL:
+ max = 1; min = 0;
+ break;
+ case DataType.BYTE:
+ max = byte.MaxValue; min = byte.MinValue;
+ break;
+ case DataType.WORD:
+ max = ushort.MaxValue; min = ushort.MinValue;
+ break;
+ case DataType.SHORT:
+ max = short.MaxValue; min = short.MinValue;
+ break;
+ case DataType.TIME:
+ max = uint.MaxValue; min = 0;
+ break;
+ case DataType.INT:
+ max = 100000; min = -100000;
+ break;
+ case DataType.FLOAT:
+ max = 100000; min = -100000;
+ break;
+ default:
+ max = min = 0f;
+ break;
+ }
+ }
+ else
+ {
+ max = metadata.Maximum; min = metadata.Minimum;
+ }
+ }
+ else
+ {
+ max = 100000; min = 0;
+ }
+ }
+ }
+}
diff --git a/SCADA/Program/CoreTest/ConfigCache.cs b/SCADA/Program/CoreTest/ConfigCache.cs
new file mode 100644
index 0000000..fa3570a
--- /dev/null
+++ b/SCADA/Program/CoreTest/ConfigCache.cs
@@ -0,0 +1,277 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Windows;
+using System.Windows.Media;
+using System.Xml;
+
+namespace CoreTest
+{
+ public sealed class ConfigCache
+ {
+ public const string PATH = @"C:\DataConfig\client.xml";
+
+ static ConfigCache()
+ {
+ _windows = new Dictionary();
+ string path = PATH;
+ if (File.Exists(path))
+ {
+ try
+ {
+ using (var reader = XmlTextReader.Create(path))
+ {
+ while (reader.Read())
+ {
+ if (reader.NodeType == XmlNodeType.Element)
+ {
+ switch (reader.Name)
+ {
+ case "Server":
+ {
+ if (reader.MoveToAttribute("AlarmLimit"))
+ int.TryParse(reader.Value, out _alarmLimit);
+ if (reader.MoveToAttribute("Cycle"))
+ int.TryParse(reader.Value, out _cycle);
+ }
+ break;
+ case "RecipeDisplay":
+ {
+ if (reader.MoveToAttribute("Row"))
+ int.TryParse(reader.Value, out _row);
+ if (reader.MoveToAttribute("RowByCount"))
+ int.TryParse(reader.Value, out _rowbycount);
+ if (reader.MoveToAttribute("RowHeight"))
+ int.TryParse(reader.Value, out _rowheight);
+ if (reader.MoveToAttribute("ColWidth"))
+ int.TryParse(reader.Value, out _colwidth);
+ }
+ break;
+ case "DataDisplay":
+ {
+ if (reader.MoveToAttribute("HdaLargeTick"))
+ int.TryParse(reader.Value, out _hda_l_tick);
+ if (reader.MoveToAttribute("HdaSmallTick"))
+ int.TryParse(reader.Value, out _hda_s_tick);
+ if (reader.MoveToAttribute("RtWaitTick"))
+ int.TryParse(reader.Value, out _rtWaitTick);
+ if (reader.MoveToAttribute("RtCap"))
+ int.TryParse(reader.Value, out _rtCap);
+ }
+ break;
+ case "WindowSet":
+ {
+ if (reader.MoveToAttribute("Background"))
+ _background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(reader.Value));
+ }
+ break;
+ case "Window":
+ {
+ string name = null;
+ double left, top, width, height; left = top = width = height = 0;
+ if (reader.MoveToAttribute("Name"))
+ name = reader.Value;
+ if (reader.MoveToAttribute("Left"))
+ double.TryParse(reader.Value, out left);
+ if (reader.MoveToAttribute("Top"))
+ double.TryParse(reader.Value, out top);
+ if (reader.MoveToAttribute("Width"))
+ double.TryParse(reader.Value, out width);
+ if (reader.MoveToAttribute("Height"))
+ double.TryParse(reader.Value, out height);
+ if (!string.IsNullOrEmpty(name))
+ {
+ if (double.IsInfinity(left) || double.IsInfinity(top) || double.IsInfinity(width) || double.IsInfinity(height))
+ _windows.Add(name, new Rect());
+ else
+ _windows.Add(name, new Rect(left, top, width, height));
+ }
+ }
+ break;
+ }
+ }
+ }
+ }
+ }
+ catch (Exception err)
+ {
+ App.AddErrorLog(err);
+ }
+ }
+ }
+
+ public static void SaveConfig()
+ {
+ try
+ {
+ using (var writer = XmlTextWriter.Create(PATH))
+ {
+ writer.WriteStartDocument();
+ writer.WriteStartElement("Client");
+ writer.WriteStartElement("Server");
+ if (ConfigCache.AlarmLimit > 0)
+ writer.WriteAttributeString("AlarmLimit", ConfigCache.AlarmLimit.ToString());
+ if (ConfigCache.Cycle > 0)
+ writer.WriteAttributeString("Cycle", ConfigCache.Cycle.ToString());
+ writer.WriteEndElement();
+ writer.WriteStartElement("RecipeDisplay");
+ if (ConfigCache.Row > 0)
+ writer.WriteAttributeString("Row", ConfigCache.Row.ToString());
+ if (ConfigCache.RowByCount > 0)
+ writer.WriteAttributeString("RowByCount", ConfigCache.RowByCount.ToString());
+ if (ConfigCache.RowHeight > 0)
+ writer.WriteAttributeString("RowHeight", ConfigCache.RowHeight.ToString());
+ if (ConfigCache.ColWidth > 0)
+ writer.WriteAttributeString("ColWidth", ConfigCache.ColWidth.ToString());
+ writer.WriteEndElement();
+ writer.WriteStartElement("DataDisplay");
+ if (ConfigCache.HdaLargeTick > 0)
+ writer.WriteAttributeString("HdaLargeTick", ConfigCache.HdaLargeTick.ToString());
+ if (ConfigCache.HdaLargeTick > 0)
+ writer.WriteAttributeString("HdaSmallTick", ConfigCache.HdaSmallTick.ToString());
+ if (ConfigCache.HdaLargeTick > 0)
+ writer.WriteAttributeString("RtWaitTick", ConfigCache.RtWaitTick.ToString());
+ if (ConfigCache.HdaLargeTick > 0)
+ writer.WriteAttributeString("RtCap", ConfigCache.RtCap.ToString());
+ writer.WriteEndElement();
+ writer.WriteStartElement("WindowSet");
+ var background = ConfigCache.Background;
+ if (background != null)
+ writer.WriteAttributeString("Background", background.ToString());
+ foreach (var item in ConfigCache.Windows)
+ {
+ writer.WriteStartElement("Window");
+ Rect rec = item.Value;
+ if (double.IsInfinity(rec.Width) || double.IsInfinity(rec.Height) || double.IsInfinity(rec.Top) || double.IsInfinity(rec.Left))
+ rec = new Rect();
+ writer.WriteAttributeString("Name", item.Key);
+ writer.WriteAttributeString("Left", rec.Left.ToString());
+ writer.WriteAttributeString("Top", rec.Top.ToString());
+ writer.WriteAttributeString("Width", rec.Width.ToString());
+ writer.WriteAttributeString("Height", rec.Height.ToString());
+ writer.WriteEndElement();
+ }
+ writer.WriteEndElement();
+ writer.WriteEndElement();
+ }
+ }
+ catch (Exception err)
+ {
+ App.AddErrorLog(err);
+ }
+ }
+
+ private static SolidColorBrush _background = Brushes.DarkSlateGray;
+ public static SolidColorBrush Background
+ {
+ get
+ {
+ return _background;
+ }
+ set
+ {
+ _background = value;
+ }
+ }
+
+ private static int _hda_l_tick = 60;
+ public static int HdaLargeTick
+ {
+ get
+ {
+ return _hda_l_tick;
+ }
+ }
+
+ private static int _hda_s_tick = 10;
+ public static int HdaSmallTick
+ {
+ get
+ {
+ return _hda_s_tick;
+ }
+ }
+
+ private static int _rtWaitTick = 5000;
+ public static int RtWaitTick
+ {
+ get
+ {
+ return _rtWaitTick;
+ }
+ }
+
+ private static int _rtCap = 200;
+ public static int RtCap
+ {
+ get
+ {
+ return _rtCap;
+ }
+ }
+
+ private static int _alarmLimit = 1000;
+ public static int AlarmLimit
+ {
+ get
+ {
+ return _alarmLimit;
+ }
+ }
+
+ private static int _cycle = 60000;
+ public static int Cycle
+ {
+ get
+ {
+ return _cycle;
+ }
+ }
+
+ private static int _row = 5;
+ public static int Row
+ {
+ get
+ {
+ return _row;
+ }
+ }
+
+ private static int _rowbycount = 15;
+ public static int RowByCount
+ {
+ get
+ {
+ return _rowbycount;
+ }
+ }
+
+ private static int _rowheight = 40;
+ public static int RowHeight
+ {
+ get
+ {
+ return _rowheight;
+ }
+ }
+
+ private static int _colwidth = 150;
+ public static int ColWidth
+ {
+ get
+ {
+ return _colwidth;
+ }
+ }
+
+ private static Dictionary _windows;
+ public static Dictionary Windows
+ {
+ get
+ {
+ return _windows;
+ }
+ }
+ }
+}
+
diff --git a/SCADA/Program/CoreTest/Example.csproj b/SCADA/Program/CoreTest/Example.csproj
new file mode 100644
index 0000000..acfe045
--- /dev/null
+++ b/SCADA/Program/CoreTest/Example.csproj
@@ -0,0 +1,320 @@
+
+
+
+ Debug
+ x86
+ 8.0.30703
+ 2.0
+ {31CE7714-DDF1-4FB2-A479-9818B1B8D9B2}
+ WinExe
+ Properties
+ CoreTest
+ CoreTest
+ v4.0
+ Client
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+
+
+ x86
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ x86
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+ Volume.ico
+
+
+
+ ..\..\dll\DynamicDataDisplay.dll
+
+
+ False
+ bin\Microsoft.Expression.Controls.dll
+
+
+ False
+ bin\Microsoft.Expression.Drawing.dll
+
+
+ False
+ bin\Microsoft.Expression.Interactions.dll
+
+
+
+
+
+
+ False
+ bin\System.Windows.Interactivity.dll
+
+
+
+
+ 4.0
+
+
+
+
+
+
+ ..\..\dll\WPFToolkit.Extended.dll
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ AlarmSet.xaml
+
+
+
+
+ Guage.xaml
+
+
+ Login.xaml
+
+
+ MainWindow.xaml
+ Code
+
+
+ MaterialRecivingLine.xaml
+
+
+
+
+
+
+ RuntimeChart.xaml
+
+
+ SiloProductLine.xaml
+
+
+ StartDevice.xaml
+
+
+
+ TagMonitor.xaml
+
+
+ Trend.xaml
+
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ App.xaml
+ Code
+
+
+ Designer
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+ {6DF53968-152D-4CA9-B62F-FF1C27069C4D}
+ ClientDriver
+
+
+ {755c5459-bca4-4729-a93c-0c73a41bdf3c}
+ DataHelper
+
+
+ {8965e389-6466-4b30-bd43-83c909044637}
+ DataService
+
+
+ {F9F0BFA7-0C4A-4C8C-B81C-2A0477CBF637}
+ HMIControl
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SCADA/Program/CoreTest/Guage.xaml b/SCADA/Program/CoreTest/Guage.xaml
new file mode 100644
index 0000000..0e0182f
--- /dev/null
+++ b/SCADA/Program/CoreTest/Guage.xaml
@@ -0,0 +1,19 @@
+
+
+
diff --git a/SCADA/Program/CoreTest/Guage.xaml.cs b/SCADA/Program/CoreTest/Guage.xaml.cs
new file mode 100644
index 0000000..319cfd1
--- /dev/null
+++ b/SCADA/Program/CoreTest/Guage.xaml.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace CoreTest
+{
+ ///
+ /// Interaction logic for Guage.xaml
+ ///
+ public partial class Guage : Window
+ {
+ public Guage()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/SCADA/Program/CoreTest/Login.xaml b/SCADA/Program/CoreTest/Login.xaml
new file mode 100644
index 0000000..de6bc71
--- /dev/null
+++ b/SCADA/Program/CoreTest/Login.xaml
@@ -0,0 +1,22 @@
+
+
+
+
diff --git a/SCADA/Program/CoreTest/Login.xaml.cs b/SCADA/Program/CoreTest/Login.xaml.cs
new file mode 100644
index 0000000..ceacb08
--- /dev/null
+++ b/SCADA/Program/CoreTest/Login.xaml.cs
@@ -0,0 +1,79 @@
+using System.Windows;
+
+namespace CoreTest
+{
+ ///
+ /// Interaction logic for Login.xaml
+ ///
+ public partial class Login : Window
+ {
+ MemberIdentity identity;
+ public static bool IsOpen = false;
+
+ public Login()
+ {
+ IsOpen = true;
+ InitializeComponent();
+ }
+
+ private void button1_Click(object sender, RoutedEventArgs e)
+ {
+ string user = txtUser.Text;
+ if (string.IsNullOrEmpty(user) || user.Length > 10)
+ {
+ txterr.Text = "用户名不正确!字符数应在0-10之间";
+ return;
+ }
+ //if (string.IsNullOrEmpty(txtring1.Text) || string.IsNullOrEmpty(txtring2.Text))
+ //{
+ // txterr.Text = "必须输入两台制粒机的当前环模号!";
+ // return;
+ //}
+ identity = new MemberIdentity(user);
+ int rs = identity.Authenticate(txtPassword.Password);
+ switch (rs)
+ {
+ case 0:
+ App.Principal = new MemberPrincipal(identity);
+ //SystemLog.AddLog(new SystemLog(EventType.Simple, DateTime.Now, App.LogSource, "登录"));
+ //App.Server["P1_DIE"].Write(txtring1.Text);
+ //App.Server["P2_DIE"].Write(txtring2.Text);
+ this.Close();
+ return;
+ case -1:
+ txterr.Text = "密码不正确!默认用户:op 默认密码:1";
+ break;
+ case -2:
+ txterr.Text = "用户名不正确!默认用户:op 默认密码:1";
+ break;
+ case -3:
+ txterr.Text = "用户名不正确!默认用户:op 默认密码:1";
+ break;
+ default:
+ txterr.Text = "数据库连接失败!请检查";
+ break;
+ }
+ }
+
+ private void button2_Click(object sender, RoutedEventArgs e)
+ {
+ this.Close();
+ App.Current.Shutdown();
+ }
+
+ private void Window_Loaded(object sender, RoutedEventArgs e)
+ {
+ //DateTime start, end; string team;
+ //WindowHelper.GetWorkInfo(DateTime.Now, out start, out end, out team);
+ //var tag1 = App.Server["P1_DIE"];
+ //txtring1.Text = tag1.ToString();
+ //txtring2.Text = App.Server["P2_DIE"].ToString();
+ }
+
+ private void button3_Click(object sender, RoutedEventArgs e)
+ {
+ //EditUser frm = new EditUser();
+ //frm.ShowDialog();
+ }
+ }
+}
diff --git a/SCADA/Program/CoreTest/MainWindow.xaml b/SCADA/Program/CoreTest/MainWindow.xaml
new file mode 100644
index 0000000..f9382b7
--- /dev/null
+++ b/SCADA/Program/CoreTest/MainWindow.xaml
@@ -0,0 +1,133 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/CoreTest/MainWindow.xaml.cs b/SCADA/Program/CoreTest/MainWindow.xaml.cs
new file mode 100644
index 0000000..1ea059a
--- /dev/null
+++ b/SCADA/Program/CoreTest/MainWindow.xaml.cs
@@ -0,0 +1,249 @@
+using DataService;
+using HMIControl;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
+using System.Linq;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Threading;
+
+namespace CoreTest
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ public MainWindow()
+ {
+ InitializeComponent();
+ }
+
+ List _valueChangedList;
+ private void Window_Loaded(object sender, RoutedEventArgs e)
+ {
+ if (!Login.IsOpen)
+ {
+ Login frm1 = new Login();
+ frm1.ShowDialog();
+ }
+ if (App.Principal != null)
+ {
+ txtuser.Text = string.Format("当前用户:{0} 权限{1}", App.Principal.Identity.Name, App.Principal.ToString());
+ //确定中控员权限
+ }
+ #region 显示缺省界面
+ if (Tag != null && !string.IsNullOrEmpty(Tag.ToString()))
+ {
+ var Wintypes = Tag.ToString().TrimEnd(';');
+ ContentControl Ctrl = Activator.CreateInstance(Type.GetType(Wintypes)) as ContentControl;
+ if (Ctrl != null)
+ {
+ Ctrl.Loaded += new RoutedEventHandler(ctrl_Loaded);
+ Ctrl.Unloaded += new RoutedEventHandler(ctrl_Unloaded);
+ dict[Wintypes] = Ctrl;
+ cvs1.Child = Ctrl;
+ this.Title = Wintypes;
+ }
+ }
+ #endregion
+ #region 显示状态栏时间、显示PLC连接状态、与PLC看门狗通讯
+ DispatcherTimer ShowTimer = new DispatcherTimer();
+ ShowTimer.Interval = new TimeSpan(0, 0, 1);
+ ShowTimer.Tick += (s, e1) =>
+ {
+ txttime.InvokeAsynchronously(delegate { txttime.Text = DateTime.Now.ToString(); });
+ p1_lamp1.Fill = App.Server.Drivers.Any(x => x.IsClosed) ? Brushes.Red : Brushes.Green;
+ };
+ ShowTimer.Start();
+ #endregion
+ #region 绑定到Server
+ lock (this)
+ {
+ _valueChangedList = this.BindingToServer(App.Server);
+ }
+ BindingTagWindow(this);
+ CommandBindings.AddRange(BindingCommandHandler());
+ var condlist = App.Server.ActivedConditionList as ObservableCollection;
+ if (condlist != null)
+ {
+ condlist.CollectionChanged += new NotifyCollectionChangedEventHandler(condlist_CollectionChanged);
+ }
+ var tag = App.Server["__CoreEvent"];
+ if (tag != null)
+ {
+ tag.ValueChanged += (s, e1) =>
+ {
+ if (tag != null)
+ {
+ App.Events.ReverseEnqueue(string.Format("{0} {1} {2}", tag.GetTagName(), DateTime.Now, tag.ToString()));
+ if (tag.ToString().Contains("错误:"))
+ MessageBox.Show(tag.ToString(), "错误!", MessageBoxButton.OK, MessageBoxImage.Error);
+ }
+ };
+ }
+
+ #endregion
+ }
+
+ void condlist_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
+ {
+ var condlist = sender as ObservableCollection;
+ AlarmConverter convert = new AlarmConverter();
+ txtAlarm.Inlines.Clear();
+ for (int i = 0; i < condlist.Count; i++)
+ {
+ txtAlarm.Inlines.Add(new Run(string.Concat(i.ToString(), ":", condlist[i].Message, " ")) { Foreground = convert.Convert(condlist[i].Severity, null, null, null) as Brush });
+ }
+ if (e.Action == NotifyCollectionChangedAction.Add)
+ {
+ foreach (ICondition cond in e.NewItems)
+ {
+ if (cond.Severity == Severity.Error)
+ {
+ var tag = App.Server["Sys_Alarm"];
+ tag.Write(true);
+ MessageBox.Show(cond.Message, "警告!", MessageBoxButton.OK, MessageBoxImage.Error);//发生致命错误,需要在系统服务内根据错误类型挂起相应Order;由客户端手动解挂。
+ }
+ }
+ }
+ }
+
+ Dictionary dict = new Dictionary();
+
+ void BindingTagWindow(DependencyObject container)
+ {
+ if (container == null) return;
+ foreach (var item in container.FindChildren())
+ {
+ if (!string.IsNullOrEmpty(item.TagWindowText))
+ {
+ UIElement element = item as UIElement;
+ element.AddHandler(UIElement.MouseLeftButtonUpEvent,
+ new MouseButtonEventHandler(item_MouseLeftButtonUp));
+ }
+ }
+ }
+
+ private void ShowContent(ITagWindow tagwindow)
+ {
+ if (tagwindow == null || string.IsNullOrEmpty(tagwindow.TagWindowText)) return;
+ var windows = tagwindow.TagWindowText.TrimEnd(';').Split(';');
+ foreach (string txt in windows)
+ {
+ if (dict.ContainsKey(txt))
+ {
+ if (dict[txt].Tag.ToString() != "YES")
+ {
+ cvs1.Child = dict[txt];
+ }
+ continue;
+ }
+ if (tagwindow.IsUnique)
+ {
+ foreach (var win in App.Current.Windows)
+ {
+ if (win.ToString() == txt)
+ goto lab1;
+ }
+ }
+ try
+ {
+ ContentControl ctrl = Activator.CreateInstance(Type.GetType(txt)) as ContentControl;
+ if (ctrl != null)
+ {
+ ctrl.Loaded += new RoutedEventHandler(ctrl_Loaded);
+ ctrl.Unloaded += new RoutedEventHandler(ctrl_Unloaded);
+ var win = ctrl as Window;
+ if (win != null)
+ {
+ win.Owner = this;
+ win.ShowInTaskbar = false;
+ if (tagwindow.IsModel)
+ win.ShowDialog();
+ else
+ win.Show();
+ }
+ else
+ {
+ dict[txt] = ctrl;
+ cvs1.Child = ctrl;
+ this.Title = txt;
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ App.AddErrorLog(e);
+ }
+ lab1:
+ continue;
+ }
+ }
+
+ void ctrl_Unloaded(object sender, RoutedEventArgs e)
+ {
+ ContentControl uie = sender as ContentControl;
+ if (uie != null)
+ {
+ uie.Tag = "NO";
+ var windows = uie.FindChildren();
+ foreach (ITagWindow item in windows)
+ {
+ if (!string.IsNullOrEmpty(item.TagWindowText))
+ {
+ ((UIElement)item).RemoveHandler(UIElement.MouseLeftButtonUpEvent, new MouseButtonEventHandler(item_MouseLeftButtonUp));
+ }
+ }
+ }
+ }
+
+ void ctrl_Loaded(object sender, RoutedEventArgs e)
+ {
+ ContentControl uie = sender as ContentControl;
+ if (uie != null)
+ {
+ uie.Tag = "YES";
+ BindingTagWindow(uie);
+ }
+ }
+
+ void item_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+ {
+ ShowContent(sender as ITagWindow);
+ e.Handled = true;
+ }
+
+ private void hMIButton7_Click(object sender, RoutedEventArgs e)
+ {
+ var result = MessageBox.Show("确定退出系统?", "警告", MessageBoxButton.OKCancel);
+ if (result == MessageBoxResult.Cancel) return;
+ //SystemLog.AddLog(new SystemLog(EventType.Simple, DateTime.Now, App.LogSource, "退出"));
+ App.Current.Shutdown();
+ e.Handled = true;
+ }
+
+ private void btnStart_Click(object sender, RoutedEventArgs e)
+ {
+ if (cvs3.Visibility == Visibility.Hidden)
+ cvs3.Visibility = Visibility.Visible;
+ else if (cvs3.Visibility == Visibility.Visible)
+ cvs3.Visibility = Visibility.Hidden;
+ }
+
+
+ CommandBindingCollection BindingCommandHandler()
+ {
+ var srv = App.Server;
+ CommandBindingCollection CommandBindings = new CommandBindingCollection();
+
+ return CommandBindings;
+ }
+ }
+}
+
diff --git a/SCADA/Program/CoreTest/MaterialRecivingLine.xaml b/SCADA/Program/CoreTest/MaterialRecivingLine.xaml
new file mode 100644
index 0000000..e9670e0
--- /dev/null
+++ b/SCADA/Program/CoreTest/MaterialRecivingLine.xaml
@@ -0,0 +1,154 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/CoreTest/MaterialRecivingLine.xaml.cs b/SCADA/Program/CoreTest/MaterialRecivingLine.xaml.cs
new file mode 100644
index 0000000..48796e9
--- /dev/null
+++ b/SCADA/Program/CoreTest/MaterialRecivingLine.xaml.cs
@@ -0,0 +1,35 @@
+using System.Collections.Generic;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace CoreTest
+{
+ ///
+ /// Batching_SBT.xaml 的交互逻辑
+ ///
+ public partial class MaterialRecivingLine : UserControl
+ {
+ List _valueChangedList;
+
+ public MaterialRecivingLine()
+ {
+ InitializeComponent();
+ }
+
+ private void HMI_Loaded(object sender, RoutedEventArgs e)
+ {
+ lock (this)
+ {
+ _valueChangedList = cvs1.BindingToServer(App.Server);
+ }
+ }
+
+ private void HMI_Unloaded(object sender, RoutedEventArgs e)
+ {
+ lock (this)
+ {
+ App.Server.RemoveHandles(_valueChangedList);
+ }
+ }
+ }
+}
diff --git a/SCADA/Program/CoreTest/MemberPrincipal.cs b/SCADA/Program/CoreTest/MemberPrincipal.cs
new file mode 100644
index 0000000..2039fce
--- /dev/null
+++ b/SCADA/Program/CoreTest/MemberPrincipal.cs
@@ -0,0 +1,222 @@
+using System;
+using System.Collections.Generic;
+using System.Security.Cryptography;
+using System.Security.Principal;
+using System.Text;
+using DatabaseLib;
+
+namespace CoreTest
+{
+ [Flags]
+ public enum RoleType
+ {
+ NONE = 0,
+ OP = 1,
+ Electrician = 2,
+ QA = 4,
+ Admin = 8
+ }
+
+ public class MemberPrincipal : IPrincipal
+ {
+ RoleType _roles = RoleType.NONE;
+ SortedList _roleDict = new SortedList()
+ {
+ {"一般用户",RoleType.NONE},{"操作员",RoleType.OP}, {"中控员",RoleType.Electrician}, {"质检员",RoleType.QA}, {"管理员",RoleType.Admin},
+ {"超级管理员",RoleType.NONE|RoleType.OP|RoleType.Electrician|RoleType.QA|RoleType.Admin}
+ };
+
+ MemberIdentity _identity;
+ public IIdentity Identity
+ {
+ get { return _identity; }
+ }
+
+ public MemberPrincipal(MemberIdentity identity)
+ {
+ _identity = identity;
+ using (var reader = DataHelper.ExecuteReader("SELECT ROLE FROM Membership WHERE UserName='" +
+ _identity.Name + "'"))
+ {
+ if (reader != null)
+ {
+ while (reader.Read())
+ {
+ _roles = (RoleType)reader.GetInt16(0);
+ }
+ }
+ }
+ }
+
+ public bool IsInRole(string roleName)
+ {
+ RoleType role;
+ if (_roleDict.TryGetValue(roleName, out role))
+ {
+ return _roles.HasFlag(role);
+ }
+ return false;
+ }
+
+ public override string ToString()
+ {
+ return _roles.ToString();
+ }
+ }
+
+ public class MemberIdentity : IIdentity
+ {
+ const int LIMIT = 3;
+ int _count;
+
+ public MemberIdentity()
+ {
+ _authenticationType = "UserID_Password";
+ }
+
+ public MemberIdentity(string name)
+ {
+ _name = name;
+ _authenticationType = "UserID_Password";
+ }
+
+ public MemberIdentity(string name, string type)
+ {
+ _name = name;
+ _authenticationType = type;
+ }
+
+ public int Authenticate(string password)
+ {
+ if (password == null || password.Length > 10)
+ return -1;
+ if (IsExceeded) return -4;
+ string sql = "SELECT Password FROM dbo.Membership WHERE Username='" + _name + "'";
+ using (var reader = DataHelper.ExecuteReader(sql))
+ {
+ if (reader != null)
+ {
+ if (reader.HasRows)
+ {
+ while (reader.Read())
+ {
+ string pass = reader.GetString(0);
+ if (pass == EncodePassword(password))
+ {
+ _isAuthenticated = true;
+ return 0;
+ }
+ else
+ {
+ _count++;
+ return -1;
+ }
+ }
+ }
+ else
+ return -2;
+
+ }
+ else
+ return -3;
+ }
+ return -5;
+ }
+
+ public static string EncodePassword(string input)
+ {
+ if (input == null) return null;
+ using (MD5CryptoServiceProvider md5Hasher = new MD5CryptoServiceProvider())
+ {
+ byte[] data = md5Hasher.ComputeHash(Encoding.ASCII.GetBytes(input));
+ StringBuilder sBuilder = new StringBuilder();
+ for (int i = 0; i < data.Length; i++)
+ {
+ sBuilder.Append(data[i].ToString("x2"));
+ }
+ return sBuilder.ToString();
+ }
+ }
+
+ public static int CreateUser(string name, string password, RoleType role)
+ {
+ string sql = string.Format("DELETE FROM dbo.Membership WHERE UserName='{0}';"
+ + "INSERT INTO dbo.Membership(UserName,Password,ROLE) VALUES('{0}','{1}',{2})",
+ name, EncodePassword(password), (int)role);
+ return DataHelper.ExecuteNonQuery(sql);
+ }
+
+ public void ChangeUser(string newName)
+ {
+ if (_name != newName)
+ {
+ _name = newName;
+ _count = 0;
+ _isAuthenticated = false;
+ }
+ }
+
+ public int UpdatePassword(string oldPassword, string newPassword)
+ {
+ if (oldPassword == null || newPassword == null)
+ return -8;
+ if (newPassword.Length > 10) return -7;
+ int result = 0;
+ string sql = "SELECT Password FROM dbo.Membership WHERE Username='" + _name + "'";
+ using (var reader = DataHelper.ExecuteReader(sql))
+ {
+ if (reader != null)
+ {
+ if (reader.HasRows)
+ {
+ while (reader.Read())
+ {
+ string pass = reader.GetString(0);
+ if (pass == EncodePassword(oldPassword))
+ {
+ sql = "UPDATE dbo.Membership SET Password='" + EncodePassword(newPassword) +
+ "' WHERE Username='" + _name + "'";
+ result = DataHelper.ExecuteNonQuery(sql);
+ if (result >= 0) result = 0;
+ }
+ else
+ result = -1;
+ }
+ }
+ else
+ result = -2;
+
+ }
+ else
+ result = -3;
+ }
+ return result;
+ }
+
+ public bool IsExceeded
+ {
+ get
+ {
+ return _count >= LIMIT;
+ }
+ }
+
+ string _authenticationType;
+ public string AuthenticationType
+ {
+ get { return _authenticationType; }
+ }
+
+ bool _isAuthenticated;
+ public bool IsAuthenticated
+ {
+ get { return _isAuthenticated; }
+ }
+
+ string _name;
+ public string Name
+ {
+ get { return _name; }
+ }
+ }
+}
diff --git a/SCADA/Program/CoreTest/MyCollection.cs b/SCADA/Program/CoreTest/MyCollection.cs
new file mode 100644
index 0000000..d047948
--- /dev/null
+++ b/SCADA/Program/CoreTest/MyCollection.cs
@@ -0,0 +1,463 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.Linq;
+using System.Windows;
+using System.Windows.Threading;
+using Microsoft.Research.DynamicDataDisplay.DataSources;
+
+namespace CoreTest
+{
+ public class QueueCollection : IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged
+ {
+ Queue _queue;
+
+ public int Count
+ {
+ get
+ {
+ return _queue.Count;
+ }
+ }
+
+ public QueueCollection()
+ {
+ this._queue = new Queue();
+ }
+
+ public QueueCollection(Queue queue)
+ {
+ this._queue = queue;
+ }
+
+ public QueueCollection(int capacity)
+ {
+ this._queue = new Queue(capacity);
+ }
+
+ public T Dequeue()
+ {
+ var value = _queue.Dequeue();
+ this.OnPropertyChanged("Count");
+ this.OnPropertyChanged("Item[]");
+ this.OnCollectionChanged(NotifyCollectionChangedAction.Remove, value, 0);
+ return value;
+ }
+
+ public void Enqueue(T value)
+ {
+ _queue.Enqueue(value);
+ this.OnPropertyChanged("Count");
+ this.OnPropertyChanged("Item[]");
+ this.OnCollectionChanged(NotifyCollectionChangedAction.Add, value, _queue.Count);
+ }
+
+
+ public void Clear()
+ {
+ _queue.Clear();
+ this.OnPropertyChanged("Count");
+ this.OnPropertyChanged("Item[]");
+ this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
+ }
+
+ private void OnPropertyChanged(string propertyName)
+ {
+ if (this.PropertyChanged != null)
+ {
+ this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+
+
+ protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
+ {
+ if (this.CollectionChanged != null)
+ {
+ try
+ {
+ // Walk thru invocation list
+ foreach (NotifyCollectionChangedEventHandler handler in CollectionChanged.GetInvocationList())
+ {
+ DispatcherObject dispatcherObject = handler.Target as DispatcherObject;
+ // If the subscriber is a DispatcherObject and different thread
+ if (dispatcherObject != null && !dispatcherObject.CheckAccess())
+ {
+ // Invoke handler in the target dispatcher's thread
+ dispatcherObject.Dispatcher.BeginInvoke(DispatcherPriority.DataBind, handler, this, e);
+ }
+ else // Execute handler as is
+ handler(this, e);
+ }
+ }
+ catch (Exception err) { }
+ }
+ }
+
+ private void OnCollectionChanged(NotifyCollectionChangedAction action, object item, int index)
+ {
+ this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(action, item, index));
+ }
+
+
+ #region INotifyCollectionChanged Members
+
+ public event NotifyCollectionChangedEventHandler CollectionChanged;
+
+ #endregion
+
+ #region INotifyPropertyChanged Members
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ #endregion
+
+ #region IEnumerable Members
+
+ public IEnumerator GetEnumerator()
+ {
+ return _queue.GetEnumerator();
+ }
+
+ #endregion
+
+ #region IEnumerable Members
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return _queue.GetEnumerator();
+ }
+
+ #endregion
+ }
+
+ public class QueueListSource : IPointDataSource
+ {
+ private class QueueListIterator : IPointEnumerator, IDisposable
+ {
+ private readonly QueueListSource dataSource;
+ private readonly IEnumerator enumerator;
+
+ public QueueListIterator(QueueListSource dataSource)
+ {
+ this.dataSource = dataSource;
+ this.enumerator = dataSource.collection.GetEnumerator();
+ }
+ public bool MoveNext()
+ {
+ return this.enumerator.MoveNext();
+ }
+ public void GetCurrent(ref Point p)
+ {
+ this.dataSource.FillPoint(this.enumerator.Current, ref p);
+ }
+ public void ApplyMappings(DependencyObject target)
+ {
+ this.dataSource.ApplyMappings(target, this.enumerator.Current);
+ }
+ public void Dispose()
+ {
+ this.enumerator.Dispose();
+ GC.SuppressFinalize(this);
+ }
+ }
+ private bool collectionChanged;
+ private bool updatesEnabled = true;
+ private int _capacity;
+ private readonly QueueCollection collection;
+ private readonly List> mappings = new List>();
+ private Func xMapping;
+ private Func yMapping;
+ private Func xyMapping;
+ private FIFOHandler handle;
+ public event EventHandler DataChanged;
+ public QueueCollection Collection
+ {
+ get
+ {
+ return this.collection;
+ }
+ }
+ public QueueListSource(int capacity)
+ {
+ _capacity = capacity;
+ collection = new QueueCollection(capacity);
+ this.collection.CollectionChanged += new NotifyCollectionChangedEventHandler(this.OnCollectionChanged);
+ handle = new FIFOHandler(FIFO);
+ if (typeof(T) == typeof(Point))
+ {
+ this.xyMapping = ((T t) => (Point)((object)t));
+ }
+ }
+ public QueueListSource(IEnumerable data)
+ : this(data.Count())
+ {
+ if (data == null)
+ {
+ throw new ArgumentNullException("data");
+ }
+ foreach (T current in data)
+ {
+ this.collection.Enqueue(current);
+ }
+ }
+ public void SuspendUpdate()
+ {
+ this.updatesEnabled = false;
+ }
+ public void ResumeUpdate()
+ {
+ this.updatesEnabled = true;
+ if (this.collectionChanged)
+ {
+ this.collectionChanged = false;
+ this.RaiseDataChanged();
+ }
+ }
+ private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
+ {
+ if (this.updatesEnabled)
+ {
+ this.RaiseDataChanged();
+ return;
+ }
+ this.collectionChanged = true;
+ }
+ public void AppendMany(IEnumerable data)
+ {
+ if (data == null)
+ {
+ throw new ArgumentNullException("data");
+ }
+ this.updatesEnabled = false;
+ foreach (T current in data)
+ {
+ this.collection.Enqueue(current);
+ }
+ this.updatesEnabled = true;
+ this.RaiseDataChanged();
+ }
+ //已重写
+ public void AppendAsync(Dispatcher dispatcher, T item)
+ {
+ dispatcher.Invoke(handle, DispatcherPriority.Normal, item);
+ }
+
+ public void SetXMapping(Func mapping)
+ {
+ if (mapping == null)
+ {
+ throw new ArgumentNullException("mapping");
+ }
+ this.xMapping = mapping;
+ }
+ public void SetYMapping(Func mapping)
+ {
+ if (mapping == null)
+ {
+ throw new ArgumentNullException("mapping");
+ }
+ this.yMapping = mapping;
+ }
+ public void SetXYMapping(Func mapping)
+ {
+ if (mapping == null)
+ {
+ throw new ArgumentNullException("mapping");
+ }
+ this.xyMapping = mapping;
+ }
+
+ private void FIFO(T item)
+ {
+ if (this.collection.Count >= _capacity)
+ {
+ this.collection.Dequeue();
+ }
+ this.collection.Enqueue(item);
+ this.RaiseDataChanged();
+ }
+ private void FillPoint(T elem, ref Point point)
+ {
+ if (this.xyMapping != null)
+ {
+ point = this.xyMapping(elem);
+ return;
+ }
+ if (this.xMapping != null)
+ {
+ point.X = this.xMapping(elem);
+ }
+ if (this.yMapping != null)
+ {
+ point.Y = this.yMapping(elem);
+ }
+ }
+ private void ApplyMappings(DependencyObject target, T elem)
+ {
+ if (target != null)
+ {
+ foreach (Mapping current in this.mappings)
+ {
+ target.SetValue(current.Property, current.F(elem));
+ }
+ }
+ }
+ public IPointEnumerator GetEnumerator(DependencyObject context)
+ {
+ return new QueueListSource.QueueListIterator(this);
+ }
+ private void RaiseDataChanged()
+ {
+ if (this.DataChanged != null)
+ {
+ this.DataChanged(this, EventArgs.Empty);
+ }
+ }
+
+ public delegate void FIFOHandler(T item);
+ }
+
+
+ internal sealed class Mapping
+ {
+ internal DependencyProperty Property
+ {
+ get;
+ set;
+ }
+ internal Func F
+ {
+ get;
+ set;
+ }
+ }
+
+ public sealed class ReverseObservableQueue : List, INotifyCollectionChanged, INotifyPropertyChanged
+ {
+ public ReverseObservableQueue(int capacity)
+ : base(capacity)
+ {
+ this.capacity = capacity;
+ }
+
+ int capacity;
+ object async = new object();
+
+ public void ReverseEnqueue(T item)
+ {
+ lock (async)
+ {
+ while (Count >= capacity) RemoveAt(Count - 1);
+ Insert(0, item);
+ this.OnPropertyChanged("Count");
+ this.OnPropertyChanged("Item[]");
+ OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item, 0));
+ }
+ }
+
+ public T ReverseDequeue()
+ {
+ lock (async)
+ {
+ if (base.Count > 1)
+ {
+ T item = this[Count - 1];
+ Remove(item);
+ this.OnPropertyChanged("Count");
+ this.OnPropertyChanged("Item[]");
+ OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, item, Count - 1));
+ return item;
+ }
+ return default(T);
+ }
+ }
+
+ public new void Clear()
+ {
+ lock (async)
+ {
+ base.Clear();
+ this.OnPropertyChanged("Count");
+ this.OnPropertyChanged("Item[]");
+ OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
+ }
+ }
+
+ private void OnPropertyChanged(string propertyName)
+ {
+ if (this.PropertyChanged != null)
+ {
+ this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+
+ private void OnCollectionChanged(NotifyCollectionChangedAction action, object item, int index)
+ {
+ this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(action, item, index));
+ }
+
+ private void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
+ {
+ if (this.CollectionChanged != null)
+ {
+ try
+ {
+ var Handlers = CollectionChanged.GetInvocationList();
+ foreach (NotifyCollectionChangedEventHandler handler in Handlers)
+ {
+ DispatcherObject dispatcherObject = handler.Target as DispatcherObject;
+ // If the subscriber is a DispatcherObject and different thread
+ if (dispatcherObject != null && !dispatcherObject.CheckAccess())
+ {
+ // Invoke handler in the target dispatcher's thread
+ dispatcherObject.Dispatcher.BeginInvoke(DispatcherPriority.DataBind, handler, this, e);
+ }
+ else // Execute handler as is
+ handler(this, e);
+ }
+ }
+ catch (Exception err) { }
+ }
+ }
+
+ public event NotifyCollectionChangedEventHandler CollectionChanged;
+
+ public event PropertyChangedEventHandler PropertyChanged;
+ }
+
+ public class ObservableCollectionEx : ObservableCollection
+ {
+ // Override the event so this class can access it
+ public override event NotifyCollectionChangedEventHandler CollectionChanged;
+
+ protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
+ {
+ // Be nice - use BlockReentrancy like MSDN said
+ using (BlockReentrancy())
+ {
+ NotifyCollectionChangedEventHandler eventHandler = CollectionChanged;
+ if (eventHandler == null)
+ return;
+
+ Delegate[] delegates = eventHandler.GetInvocationList();
+ // Walk thru invocation list
+ foreach (NotifyCollectionChangedEventHandler handler in delegates)
+ {
+ DispatcherObject dispatcherObject = handler.Target as DispatcherObject;
+ // If the subscriber is a DispatcherObject and different thread
+ if (dispatcherObject != null && dispatcherObject.CheckAccess() == false)
+ {
+ // Invoke handler in the target dispatcher's thread
+ dispatcherObject.Dispatcher.Invoke(DispatcherPriority.DataBind, handler, this, e);
+ }
+ else // Execute handler as is
+ handler(this, e);
+ }
+ }
+ }
+ }
+}
diff --git a/SCADA/Program/CoreTest/MyCommand.cs b/SCADA/Program/CoreTest/MyCommand.cs
new file mode 100644
index 0000000..875b268
--- /dev/null
+++ b/SCADA/Program/CoreTest/MyCommand.cs
@@ -0,0 +1,86 @@
+using System.Windows.Input;
+
+namespace CoreTest
+{
+ public static class MyCommands
+ {
+ public static RoutedCommand StartPowerOff = new RoutedCommand("StartPowerOff", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.P, ModifierKeys.Alt) });
+
+ public static RoutedCommand Save = new RoutedCommand("Save", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.P, ModifierKeys.Alt) });
+
+ public static RoutedCommand ComeBack = new RoutedCommand("ComeBack", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.P, ModifierKeys.Alt) });
+
+ public static RoutedCommand Release = new RoutedCommand("Release", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.P, ModifierKeys.Alt) });
+
+ public static RoutedCommand Previous = new RoutedCommand("Previous", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.P, ModifierKeys.Alt) });
+
+ public static RoutedCommand Next = new RoutedCommand("Next", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.N, ModifierKeys.Alt) });
+
+ public static RoutedCommand First = new RoutedCommand("First", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.F, ModifierKeys.Alt) });
+
+ public static RoutedCommand Last = new RoutedCommand("Last", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.L, ModifierKeys.Alt) });
+
+ public static RoutedCommand MoveUp = new RoutedCommand("MoveUp", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.U, ModifierKeys.Alt) });
+
+ public static RoutedCommand MoveDown = new RoutedCommand("MoveDown", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.M, ModifierKeys.Alt) });
+
+ public static RoutedCommand Select = new RoutedCommand("Select", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.S, ModifierKeys.Alt) });
+
+ public static RoutedCommand Query = new RoutedCommand("Query", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.Q, ModifierKeys.Alt) });
+
+ public static RoutedCommand Search = new RoutedCommand("Search", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.F, ModifierKeys.Alt) });
+
+ public static RoutedCommand ExpandAll = new RoutedCommand("ExpandAll", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.Z, ModifierKeys.Alt) });
+
+ public static RoutedCommand CollapseAll = new RoutedCommand("CollapseAll", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.C, ModifierKeys.Alt) });
+
+ public static RoutedCommand Add = new RoutedCommand("Add", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.A, ModifierKeys.Control) });
+
+ public static RoutedCommand Delete = new RoutedCommand("Delete", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.Delete) });
+
+ public static RoutedCommand Edit = new RoutedCommand("Edit", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.E, ModifierKeys.Control) });
+
+ public static RoutedCommand Clear = new RoutedCommand("Clear", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.X, ModifierKeys.Control) });
+
+ public static RoutedCommand Commit = new RoutedCommand("Commit", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.C, ModifierKeys.Control) });
+
+ public static RoutedCommand Insert = new RoutedCommand("Insert", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.I, ModifierKeys.Control) });
+
+ public static RoutedCommand InsertAt = new RoutedCommand("InsertAt", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.Z, ModifierKeys.Control) });
+
+ public static RoutedCommand Pause = new RoutedCommand("Pause", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.P, ModifierKeys.Control) });
+
+ public static RoutedCommand Resume = new RoutedCommand("Resume", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.R, ModifierKeys.Control) });
+
+ public static RoutedCommand Stop = new RoutedCommand("Stop", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.S, ModifierKeys.Control) });
+
+ public static RoutedCommand Option = new RoutedCommand("Option", typeof(MyCommands),
+ new InputGestureCollection { new KeyGesture(Key.F10) });
+ }
+
+}
diff --git a/SCADA/Program/CoreTest/MyConvert.cs b/SCADA/Program/CoreTest/MyConvert.cs
new file mode 100644
index 0000000..b145a48
--- /dev/null
+++ b/SCADA/Program/CoreTest/MyConvert.cs
@@ -0,0 +1,57 @@
+using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Media;
+using DataService;
+namespace CoreTest
+{
+ public class AlarmConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null || value is DBNull)
+ return Brushes.White;
+ switch ((Severity)value)
+ {
+ case Severity.Error:
+ return Brushes.Red;
+ case Severity.High:
+ return Brushes.OrangeRed;
+ case Severity.Information:
+ return Brushes.Blue;
+ case Severity.Low:
+ return Brushes.LightBlue;
+ case Severity.Medium:
+ return Brushes.Yellow;
+ case Severity.MediumHigh:
+ return Brushes.Orange;
+ case Severity.MediumLow:
+ return Brushes.LightYellow;
+ case Severity.Normal:
+ return Brushes.Green;
+ default:
+ return Brushes.White;
+ }
+
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+ }
+
+ [ValueConversion(typeof(double), typeof(double))]
+ public class NegativeConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return -(double)value;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+ }
+}
diff --git a/SCADA/Program/CoreTest/Properties/AssemblyInfo.cs b/SCADA/Program/CoreTest/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..22de4a7
--- /dev/null
+++ b/SCADA/Program/CoreTest/Properties/AssemblyInfo.cs
@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("CoreTest")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("CoreTest")]
+[assembly: AssemblyCopyright("Copyright © 2014")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+//In order to begin building localizable applications, set
+//CultureYouAreCodingWith in your .csproj file
+//inside a . For example, if you are using US english
+//in your source files, set the to en-US. Then uncomment
+//the NeutralResourceLanguage attribute below. Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
+
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/SCADA/Program/CoreTest/Properties/DataSources/ReporterScale.datasource b/SCADA/Program/CoreTest/Properties/DataSources/ReporterScale.datasource
new file mode 100644
index 0000000..66bd813
--- /dev/null
+++ b/SCADA/Program/CoreTest/Properties/DataSources/ReporterScale.datasource
@@ -0,0 +1,10 @@
+
+
+
+ CoreTest.ReporterScale, CoreTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+
\ No newline at end of file
diff --git a/SCADA/Program/CoreTest/Properties/Resources.Designer.cs b/SCADA/Program/CoreTest/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..6846010
--- /dev/null
+++ b/SCADA/Program/CoreTest/Properties/Resources.Designer.cs
@@ -0,0 +1,393 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18052
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace CoreTest.Properties {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CoreTest.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon _19 {
+ get {
+ object obj = ResourceManager.GetObject("_19", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon _275 {
+ get {
+ object obj = ResourceManager.GetObject("_275", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon _281 {
+ get {
+ object obj = ResourceManager.GetObject("_281", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon _3 {
+ get {
+ object obj = ResourceManager.GetObject("_3", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon _555 {
+ get {
+ object obj = ResourceManager.GetObject("_555", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon _6523 {
+ get {
+ object obj = ResourceManager.GetObject("_6523", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon Copy {
+ get {
+ object obj = ResourceManager.GetObject("Copy", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon Cross {
+ get {
+ object obj = ResourceManager.GetObject("Cross", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon Cut {
+ get {
+ object obj = ResourceManager.GetObject("Cut", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon Database_Add {
+ get {
+ object obj = ResourceManager.GetObject("Database_Add", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon Design {
+ get {
+ object obj = ResourceManager.GetObject("Design", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon Help {
+ get {
+ object obj = ResourceManager.GetObject("Help", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon Key {
+ get {
+ object obj = ResourceManager.GetObject("Key", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Login1 {
+ get {
+ object obj = ResourceManager.GetObject("Login1", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon mm_Eject {
+ get {
+ object obj = ResourceManager.GetObject("mm_Eject", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon mm_Fast_Forward {
+ get {
+ object obj = ResourceManager.GetObject("mm_Fast_Forward", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon mm_First {
+ get {
+ object obj = ResourceManager.GetObject("mm_First", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon mm_Last {
+ get {
+ object obj = ResourceManager.GetObject("mm_Last", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon mm_Pause {
+ get {
+ object obj = ResourceManager.GetObject("mm_Pause", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon mm_Play {
+ get {
+ object obj = ResourceManager.GetObject("mm_Play", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon mm_Rewind {
+ get {
+ object obj = ResourceManager.GetObject("mm_Rewind", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon mm_Stop {
+ get {
+ object obj = ResourceManager.GetObject("mm_Stop", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon Permission {
+ get {
+ object obj = ResourceManager.GetObject("Permission", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon Plus {
+ get {
+ object obj = ResourceManager.GetObject("Plus", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon Redo {
+ get {
+ object obj = ResourceManager.GetObject("Redo", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon Save {
+ get {
+ object obj = ResourceManager.GetObject("Save", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon Script {
+ get {
+ object obj = ResourceManager.GetObject("Script", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon Search {
+ get {
+ object obj = ResourceManager.GetObject("Search", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon Select_All {
+ get {
+ object obj = ResourceManager.GetObject("Select_All", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon Tools {
+ get {
+ object obj = ResourceManager.GetObject("Tools", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon Tree_View {
+ get {
+ object obj = ResourceManager.GetObject("Tree_View", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon Unlock {
+ get {
+ object obj = ResourceManager.GetObject("Unlock", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon Warning {
+ get {
+ object obj = ResourceManager.GetObject("Warning", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+ }
+}
diff --git a/SCADA/Program/CoreTest/Properties/Resources.resx b/SCADA/Program/CoreTest/Properties/Resources.resx
new file mode 100644
index 0000000..e12045b
--- /dev/null
+++ b/SCADA/Program/CoreTest/Properties/Resources.resx
@@ -0,0 +1,220 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+ ..\Resources\Copy.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Cross.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Cut.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Database-Add.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Design.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Help.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Key.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Login1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\mm-Eject.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\mm-Fast Forward.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\mm-First.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\mm-Last.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\mm-Pause.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\mm-Play.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\mm-Rewind.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\mm-Stop.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Permission.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Plus.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Redo.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Save.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Script.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Search.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Select All.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Tools.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Tree View.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Unlock.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Warning.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\19.ICO;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\275.ICO;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\281.ICO;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\3.ICO;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\555.ICO;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\6523.ICO;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
\ No newline at end of file
diff --git a/SCADA/Program/CoreTest/Properties/Settings.Designer.cs b/SCADA/Program/CoreTest/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..89b8c4f
--- /dev/null
+++ b/SCADA/Program/CoreTest/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18052
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace CoreTest.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/SCADA/Program/CoreTest/Properties/Settings.settings b/SCADA/Program/CoreTest/Properties/Settings.settings
new file mode 100644
index 0000000..033d7a5
--- /dev/null
+++ b/SCADA/Program/CoreTest/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SCADA/Program/CoreTest/Resources/19.ICO b/SCADA/Program/CoreTest/Resources/19.ICO
new file mode 100644
index 0000000..894c877
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/19.ICO differ
diff --git a/SCADA/Program/CoreTest/Resources/275.ICO b/SCADA/Program/CoreTest/Resources/275.ICO
new file mode 100644
index 0000000..ba0ba6c
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/275.ICO differ
diff --git a/SCADA/Program/CoreTest/Resources/281.ICO b/SCADA/Program/CoreTest/Resources/281.ICO
new file mode 100644
index 0000000..0dd17d3
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/281.ICO differ
diff --git a/SCADA/Program/CoreTest/Resources/3.ICO b/SCADA/Program/CoreTest/Resources/3.ICO
new file mode 100644
index 0000000..522f704
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/3.ICO differ
diff --git a/SCADA/Program/CoreTest/Resources/555.ICO b/SCADA/Program/CoreTest/Resources/555.ICO
new file mode 100644
index 0000000..0c4ff9b
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/555.ICO differ
diff --git a/SCADA/Program/CoreTest/Resources/6523.ICO b/SCADA/Program/CoreTest/Resources/6523.ICO
new file mode 100644
index 0000000..fb6f2a1
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/6523.ICO differ
diff --git a/SCADA/Program/CoreTest/Resources/Copy.ico b/SCADA/Program/CoreTest/Resources/Copy.ico
new file mode 100644
index 0000000..d6d038e
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/Copy.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/Cross.ico b/SCADA/Program/CoreTest/Resources/Cross.ico
new file mode 100644
index 0000000..83327cc
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/Cross.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/Cut.ico b/SCADA/Program/CoreTest/Resources/Cut.ico
new file mode 100644
index 0000000..e207e17
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/Cut.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/Database-Add.ico b/SCADA/Program/CoreTest/Resources/Database-Add.ico
new file mode 100644
index 0000000..e0004d9
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/Database-Add.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/Design.ico b/SCADA/Program/CoreTest/Resources/Design.ico
new file mode 100644
index 0000000..c688f7e
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/Design.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/Help.ico b/SCADA/Program/CoreTest/Resources/Help.ico
new file mode 100644
index 0000000..02d7910
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/Help.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/Key.ico b/SCADA/Program/CoreTest/Resources/Key.ico
new file mode 100644
index 0000000..0b6eeeb
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/Key.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/Login1.png b/SCADA/Program/CoreTest/Resources/Login1.png
new file mode 100644
index 0000000..c1cc5af
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/Login1.png differ
diff --git a/SCADA/Program/CoreTest/Resources/Permission.ico b/SCADA/Program/CoreTest/Resources/Permission.ico
new file mode 100644
index 0000000..7409b7e
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/Permission.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/Plus.ico b/SCADA/Program/CoreTest/Resources/Plus.ico
new file mode 100644
index 0000000..ac630ee
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/Plus.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/Redo.ico b/SCADA/Program/CoreTest/Resources/Redo.ico
new file mode 100644
index 0000000..ec5a5b0
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/Redo.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/Save.ico b/SCADA/Program/CoreTest/Resources/Save.ico
new file mode 100644
index 0000000..f8a2f9f
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/Save.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/Script.ico b/SCADA/Program/CoreTest/Resources/Script.ico
new file mode 100644
index 0000000..b212cb2
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/Script.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/Search.ico b/SCADA/Program/CoreTest/Resources/Search.ico
new file mode 100644
index 0000000..dc60b4a
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/Search.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/Select All.ico b/SCADA/Program/CoreTest/Resources/Select All.ico
new file mode 100644
index 0000000..11f2418
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/Select All.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/Tools.ico b/SCADA/Program/CoreTest/Resources/Tools.ico
new file mode 100644
index 0000000..e5ecdbf
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/Tools.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/Tree View.ico b/SCADA/Program/CoreTest/Resources/Tree View.ico
new file mode 100644
index 0000000..b5acc18
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/Tree View.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/Unlock.ico b/SCADA/Program/CoreTest/Resources/Unlock.ico
new file mode 100644
index 0000000..5dd2bcc
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/Unlock.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/Warning.ico b/SCADA/Program/CoreTest/Resources/Warning.ico
new file mode 100644
index 0000000..606b0d7
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/Warning.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/mm-Eject.ico b/SCADA/Program/CoreTest/Resources/mm-Eject.ico
new file mode 100644
index 0000000..5b792de
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/mm-Eject.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/mm-Fast Forward.ico b/SCADA/Program/CoreTest/Resources/mm-Fast Forward.ico
new file mode 100644
index 0000000..844e80a
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/mm-Fast Forward.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/mm-First.ico b/SCADA/Program/CoreTest/Resources/mm-First.ico
new file mode 100644
index 0000000..3c6980b
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/mm-First.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/mm-Last.ico b/SCADA/Program/CoreTest/Resources/mm-Last.ico
new file mode 100644
index 0000000..cab533a
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/mm-Last.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/mm-Pause.ico b/SCADA/Program/CoreTest/Resources/mm-Pause.ico
new file mode 100644
index 0000000..8ce84df
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/mm-Pause.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/mm-Play.ico b/SCADA/Program/CoreTest/Resources/mm-Play.ico
new file mode 100644
index 0000000..4136fd3
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/mm-Play.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/mm-Rewind.ico b/SCADA/Program/CoreTest/Resources/mm-Rewind.ico
new file mode 100644
index 0000000..956602b
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/mm-Rewind.ico differ
diff --git a/SCADA/Program/CoreTest/Resources/mm-Stop.ico b/SCADA/Program/CoreTest/Resources/mm-Stop.ico
new file mode 100644
index 0000000..bda5966
Binary files /dev/null and b/SCADA/Program/CoreTest/Resources/mm-Stop.ico differ
diff --git a/SCADA/Program/CoreTest/RuntimeChart.xaml b/SCADA/Program/CoreTest/RuntimeChart.xaml
new file mode 100644
index 0000000..822dfb4
--- /dev/null
+++ b/SCADA/Program/CoreTest/RuntimeChart.xaml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/CoreTest/RuntimeChart.xaml.cs b/SCADA/Program/CoreTest/RuntimeChart.xaml.cs
new file mode 100644
index 0000000..a995709
--- /dev/null
+++ b/SCADA/Program/CoreTest/RuntimeChart.xaml.cs
@@ -0,0 +1,123 @@
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Windows;
+using System.Windows.Media;
+using DataService;
+using Microsoft.Research.DynamicDataDisplay;
+
+namespace CoreTest
+{
+ ///
+ /// Interaction logic for RuntimeChart.xaml
+ ///
+ ///
+ /// Interaction logic for RuntimeChart.xaml
+ ///
+ public partial class RuntimeChart : Window
+ {
+ int TICK = 5000;
+ ITag currentTag;
+ Timer timer;
+ bool writelock;
+ DateTime timestamp = DateTime.Now;
+ QueueListSource source1 = new QueueListSource(ConfigCache.RtCap);
+ public RuntimeChart()
+ {
+ InitializeComponent();
+ this.SetWindowState();
+ var brush = chartPlotter1.Background as SolidColorBrush;
+ if (brush != null)
+ colorpicker.SelectedColor = brush.Color;
+ TICK = ConfigCache.RtWaitTick;
+ }
+
+ private void Window_Loaded(object sender, RoutedEventArgs e)
+ {
+ comb1.ItemsSource = App.Server.ArchiveList;
+ source1.SetXMapping(X => hTimeSpanAxis.ConvertToDouble(X.TimeStamp));
+
+ graph = chartPlotter1.AddLineGraph(source1, 2, "");
+ IGroup grp = App.Server.GetGroupByName(null);
+ if (grp != null)
+ {
+ grp.DataChange += new DataChangeEventHandler(grp_DataChange);
+ }
+ timer = new Timer(onTimer, null, 0, TICK);
+ }
+
+ void grp_DataChange(object sender, DataChangeEventArgs e)
+ {
+ writelock = true;
+ var arr = e.Values;
+ if (arr != null && currentTag != null)
+ {
+ foreach (HistoryData data in arr)
+ {
+ if (data.ID == currentTag.ID)
+ {
+ source1.AppendAsync(Dispatcher, data);
+ timestamp = DateTime.Now;
+ }
+ }
+ }
+ writelock = false;
+ }
+
+ void onTimer(object state)
+ {
+ if (!writelock && (DateTime.Now - timestamp).TotalMilliseconds > TICK)
+ {
+ HistoryData data = HistoryData.Empty;
+ if (currentTag != null)
+ {
+ data.Value = currentTag.Value;
+ data.TimeStamp = DateTime.Now;
+ source1.AppendAsync(Dispatcher, data);
+ }
+ }
+ }
+
+ private void Window_Closed(object sender, System.EventArgs e)
+ {
+ IGroup grp = App.Server.GetGroupByName(null);
+ if (grp != null)
+ {
+ grp.DataChange -= new DataChangeEventHandler(grp_DataChange);
+ }
+ timer.Dispose();
+ this.SaveWindowState();
+ }
+
+ LineGraph graph;
+ private void comb1_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
+ {
+ if (e.AddedItems.Count > 0)
+ {
+ currentTag = null;
+ source1.Collection.Clear();
+ var str = (KeyValuePair)e.AddedItems[0];
+ graph.Description = new PenDescription(str.Value ?? "");
+ currentTag = App.Server[str.Key];
+ int index = App.Server.GetItemProperties(str.Key);
+ if (index >= 0)
+ {
+ hilevel.Value = App.Server.MetaDataList[index].Maximum;
+ lolevel.Value = App.Server.MetaDataList[index].Minimum;
+ }
+ if (hilevel.Value == lolevel.Value)
+ {
+ hilevel.Value = 100000;
+ lolevel.Value = -100000;
+ }
+ source1.SetSourceMapping(currentTag);
+ chartPlotter1.FitToView();
+ }
+ }
+
+ private void ColorPicker_SelectedColorChanged(object sender, RoutedPropertyChangedEventArgs e)
+ {
+ chartPlotter1.Background = new SolidColorBrush(e.NewValue);
+ }
+ }
+}
diff --git a/SCADA/Program/CoreTest/SiloProductLine.xaml b/SCADA/Program/CoreTest/SiloProductLine.xaml
new file mode 100644
index 0000000..6a92627
--- /dev/null
+++ b/SCADA/Program/CoreTest/SiloProductLine.xaml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/CoreTest/SiloProductLine.xaml.cs b/SCADA/Program/CoreTest/SiloProductLine.xaml.cs
new file mode 100644
index 0000000..10a27f5
--- /dev/null
+++ b/SCADA/Program/CoreTest/SiloProductLine.xaml.cs
@@ -0,0 +1,35 @@
+using System.Collections.Generic;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace CoreTest
+{
+ ///
+ /// Batching_SBT.xaml 的交互逻辑
+ ///
+ public partial class SiloProductLine : UserControl
+ {
+ List _valueChangedList;
+
+ public SiloProductLine()
+ {
+ InitializeComponent();
+ }
+
+ private void HMI_Loaded(object sender, RoutedEventArgs e)
+ {
+ lock (this)
+ {
+ _valueChangedList = cvs1.BindingToServer(App.Server);
+ }
+ }
+
+ private void HMI_Unloaded(object sender, RoutedEventArgs e)
+ {
+ lock (this)
+ {
+ App.Server.RemoveHandles(_valueChangedList);
+ }
+ }
+ }
+}
diff --git a/SCADA/Program/CoreTest/StartDevice.xaml b/SCADA/Program/CoreTest/StartDevice.xaml
new file mode 100644
index 0000000..f4e5ca6
--- /dev/null
+++ b/SCADA/Program/CoreTest/StartDevice.xaml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/CoreTest/StartDevice.xaml.cs b/SCADA/Program/CoreTest/StartDevice.xaml.cs
new file mode 100644
index 0000000..e9e8b61
--- /dev/null
+++ b/SCADA/Program/CoreTest/StartDevice.xaml.cs
@@ -0,0 +1,45 @@
+using System.Windows;
+
+namespace CoreTest
+{
+ ///
+ /// Interaction logic for StartDevice.xaml
+ ///
+ public partial class StartDevice : Window
+ {
+ const int COLS = 4;
+ const int ROWHEIGHT = 30;
+
+ public StartDevice(string dev, Point p)
+ {
+ InitializeComponent();
+ devicename.Text += ":" + dev;
+ this.SizeToContent = SizeToContent.WidthAndHeight;
+ grd.Width = 240;
+ grd.Height = 70;
+
+ btnStart.Click += new RoutedEventHandler((s, e) =>
+ {
+ var tag = App.Server[dev + "_Manu"];
+ if (tag != null) tag.Write(1);
+ this.Close();
+ });
+ btnStop.Click += new RoutedEventHandler((s, e) =>
+ {
+ var tag = App.Server[dev + "_Manu"];
+ if (tag != null) tag.Write(2);
+ this.Close();
+ });
+
+ this.Left = p.X - grd.Width / 2;
+ this.Top = p.Y - grd.Height / 2 + 40;
+ if (this.Left < 0) this.Left = 0;
+ if (this.Top < 0) this.Top = 0;
+ }
+
+ private void btnExit_Click(object sender, RoutedEventArgs e)
+ {
+ this.Close();
+ }
+ }
+}
diff --git a/SCADA/Program/CoreTest/SystemLog.cs b/SCADA/Program/CoreTest/SystemLog.cs
new file mode 100644
index 0000000..7289ee4
--- /dev/null
+++ b/SCADA/Program/CoreTest/SystemLog.cs
@@ -0,0 +1,154 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using DatabaseLib;
+using DataService;
+
+namespace CoreTest
+{
+ public class SystemLog : IEvent
+ {
+ public bool IsEnabled
+ {
+ get;
+ set;
+ }
+
+ public bool IsAcked
+ {
+ get;
+ set;
+ }
+
+ public bool IsActived
+ {
+ get;
+ set;
+ }
+
+ Severity _severity;
+ public Severity Severity
+ {
+ get { return _severity; }
+ }
+
+ EventType _eventtype;
+ public EventType EventType
+ {
+ get { return EventType.Simple; }
+ }
+
+ DateTime _time;
+ public DateTime LastActive
+ {
+ get { return _time; }
+ set { _time = value; }
+ }
+
+ string _comment;
+ public string Comment
+ {
+ get { return _comment; }
+ }
+
+ string _source;
+ public string Source
+ {
+ get { return _source; }
+ }
+
+ public SystemLog(EventType eventtype, DateTime time, string source = null, string comment = null, Severity severity = Severity.Normal)
+ {
+ _eventtype = eventtype;
+ _time = time;
+ _severity = severity;
+ _source = source;
+ _comment = comment;
+ }
+
+ public int Save()
+ {
+ return AddLog(this);
+ }
+
+ public static int AddLog(SystemLog log)
+ {
+ string sql = string.Format("INSERT INTO dbo.LOG_EVENT(EVENTTYPE,SEVERITY,ACTIVETIME,SOURCE,COMMENT) VALUES({0},{1},'{2}','{3}','{4}');",
+ (int)log._eventtype, (int)log._severity, log._time, log._source, log._comment);
+ return DataHelper.ExecuteNonQuery(sql);
+ }
+
+ public static SystemLog FindFirstEvent(EventType eventtype, DateTime? firsttime = null, string source = null)
+ {
+ string cond1 = firsttime == null ? "" : " AND ACTIVETIME>='" + firsttime + "'";
+ string cond2 = string.IsNullOrEmpty(source) ? "" : " AND SOURCE='" + source + "'";
+ string sql = string.Format("SELECT TOP 1 SEVERITY,ACTIVETIME,COMMENT FROM dbo.LOG_EVENT WHERE EVENTTYPE={0} {1} {2} ORDER BY ACTIVETIME",
+ (int)eventtype, cond1, cond2);
+ using (var reader = DataHelper.ExecuteReader(sql))
+ {
+ while (reader.Read())
+ {
+ return new SystemLog(eventtype, reader.GetDateTime(1), source, reader.GetNullableString(2), (Severity)reader.GetInt32(0));
+ }
+ }
+ return null;
+ }
+
+ public static SystemLog FindLastEvent(EventType eventtype, DateTime? lasttime = null, string source = null)
+ {
+ string cond1 = lasttime == null ? "" : " AND ACTIVETIME<='" + lasttime + "'";
+ string cond2 = string.IsNullOrEmpty(source) ? "" : " AND SOURCE='" + source + "'";
+ string sql = string.Format("SELECT TOP 1 SEVERITY,ACTIVETIME,COMMENT FROM dbo.LOG_EVENT WHERE EVENTTYPE={0} {1} {2} ORDER BY ACTIVETIME DESC",
+ (int)eventtype, cond1, cond2);
+ using (var reader = DataHelper.ExecuteReader(sql))
+ {
+ while (reader.Read())
+ {
+ return new SystemLog(eventtype, reader.GetDateTime(1), source, reader.GetNullableString(2), (Severity)reader.GetInt32(0));
+ }
+ }
+ return null;
+ }
+
+ public static List FindEvents(EventType eventtype, string source = null, DateTime? startime = null, DateTime? endtime = null)
+ {
+ List list = new List();
+ string cond1 = string.IsNullOrEmpty(source) ? "" : " AND SOURCE='" + source + "'";
+ string cond2 = startime == null ? "" : " AND ACTIVETIME>='" + startime + "'";
+ string cond3 = endtime == null ? "" : " AND ACTIVETIME<='" + endtime + "'";
+ string sql = string.Format("SELECT SEVERITY,ACTIVETIME,COMMENT FROM dbo.LOG_EVENT WHERE EVENTTYPE={0} {1} {2} {3} ORDER BY ACTIVETIME",
+ (int)eventtype, cond1, cond2, cond3);
+ using (var reader = DataHelper.ExecuteReader(sql))
+ {
+ while (reader.Read())
+ {
+ list.Add(new SystemLog(eventtype, reader.GetDateTime(1), source, reader.GetNullableString(2), (Severity)reader.GetInt32(0)));
+ }
+ }
+ return list;
+ }
+
+ public static void GetEventTime(EventType eventtype, string source, string comment, out DateTime? startime, out DateTime? endtime)
+ {
+ var parm1 = new SqlParameter("@STARTTIME", SqlDbType.DateTime) { Direction = ParameterDirection.Output };
+ var parm2 = new SqlParameter("@ENDTIME", SqlDbType.DateTime) { Direction = ParameterDirection.Output };
+ if (DataHelper.ExecuteStoredProcedure("GetEventTime",
+ new SqlParameter("@EVENTTYPE", SqlDbType.Int) { SqlValue = (int)eventtype },
+ new SqlParameter("@SOURCE", SqlDbType.NVarChar, 50) { SqlValue = source },
+ new SqlParameter("@COMMENT", SqlDbType.NVarChar, 50) { SqlValue = comment },
+ parm1, parm2) >= 0)
+ {
+ if (parm1.Value == DBNull.Value)
+ startime = null;
+ else startime = (DateTime)parm1.Value;
+ if (parm2.Value == DBNull.Value)
+ endtime = DateTime.Now;
+ else endtime = (DateTime)parm2.Value;
+ }
+ else
+ startime = endtime = null;
+ }
+ }
+}
+
diff --git a/SCADA/Program/CoreTest/TagMonitor.xaml b/SCADA/Program/CoreTest/TagMonitor.xaml
new file mode 100644
index 0000000..679643c
--- /dev/null
+++ b/SCADA/Program/CoreTest/TagMonitor.xaml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/CoreTest/TagMonitor.xaml.cs b/SCADA/Program/CoreTest/TagMonitor.xaml.cs
new file mode 100644
index 0000000..e8025ee
--- /dev/null
+++ b/SCADA/Program/CoreTest/TagMonitor.xaml.cs
@@ -0,0 +1,168 @@
+using System;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Windows;
+using System.Windows.Input;
+using DataService;
+
+namespace CoreTest
+{
+ ///
+ /// Interaction logic for TagMonitor.xaml
+ ///
+ public partial class TagMonitor : Window
+ {
+ bool _isSim = false;
+ ObservableCollection list = new ObservableCollection();
+ public TagMonitor()
+ {
+ InitializeComponent();
+ this.SetWindowState();
+ this.CommandBindings.Add(new CommandBinding(MyCommands.Edit, (sender, e) =>
+ {
+ _isSim = e.Parameter.Equals("1");
+ textBox1.Focus();
+ childWindow1.Show();
+ }, (sender, e) =>
+ {
+ e.CanExecute = list1.SelectedItem != null;
+ }));
+ }
+
+ private void Window_Loaded(object sender, RoutedEventArgs e)
+ {
+ var metalist = App.Server.MetaDataList;
+ for (int i = 0; i < metalist.Count; i++)
+ {
+ list.Add(new TagItem(metalist[i]));
+ }
+ list1.ItemsSource = list;
+ }
+
+ private void Window_Closed(object sender, EventArgs e)
+ {
+ foreach (var tag in list)
+ {
+ tag.Dispose();
+ }
+ this.SaveWindowState();
+ }
+
+ private void Button_Click(object sender, RoutedEventArgs e)
+ {
+ TagItem tag = list1.SelectedItem as TagItem;
+ if (tag != null)
+ {
+ if (_isSim) tag.SimWrite(textBox1.Text); else tag.Write(textBox1.Text);
+ }
+ childWindow1.Close();
+ }
+ }
+
+ public class TagItem : INotifyPropertyChanged, IDisposable
+ {
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ protected virtual void OnPropertyChanged(string propertyName)
+ {
+ if (this.PropertyChanged != null)
+ this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+ }
+
+ ITag _tag;
+
+ string _tagname;
+ public string TagName
+ {
+ get { return _tagname; }
+ set { _tagname = value; }
+ }
+
+ string _addr;
+ public string Address
+ {
+ get { return _addr; }
+ set { _addr = value; }
+ }
+
+ string _tagValue;
+ public string TagValue
+ {
+ get { return _tagValue; }
+ set
+ {
+ if (_tagValue != value)
+ {
+ _tagValue = value;
+ OnPropertyChanged("TagValue");
+ }
+ }
+ }
+
+ DateTime _timestamp;
+ public DateTime TimeStamp
+ {
+ get { return _timestamp; }
+ set
+ {
+ if (_timestamp != value)
+ {
+ _timestamp = value;
+ OnPropertyChanged("TimeStamp");
+ }
+ }
+ }
+
+ public TagItem(TagMetaData metadata)
+ {
+ _tagname = metadata.Name;
+ _addr = metadata.Address;
+ _tag = App.Server[_tagname];
+ if (_tag != null)
+ {
+ _tagValue = _tag.ToString();
+ _timestamp = _tag.TimeStamp;
+ _tag.ValueChanged += new ValueChangedEventHandler(TagValueChanged);
+ }
+ }
+
+ private void TagValueChanged(object sender, ValueChangedEventArgs args)
+ {
+ TagValue = _tag.ToString();
+ TimeStamp = _tag.TimeStamp;
+ }
+
+ public int Write(string value)
+ {
+ if (string.IsNullOrEmpty(value)) return -1;
+ return _tag.Write(value);
+ }
+
+ public void SimWrite(string value)
+ {
+ if (string.IsNullOrEmpty(value)) return;
+ Storage stor = Storage.Empty;
+ try
+ {
+ if (_tag.Address.VarType == DataType.STR)
+ {
+ ((StringTag)_tag).String = value;
+ }
+ else
+ {
+ stor = _tag.ToStorage(value);
+ }
+ _tag.Update(stor, DateTime.Now, QUALITIES.QUALITY_GOOD);
+ }
+ catch { }
+ }
+
+ public void Dispose()
+ {
+ if (_tag != null)
+ {
+ _tag.ValueChanged -= new ValueChangedEventHandler(TagValueChanged);
+ }
+ }
+ }
+}
diff --git a/SCADA/Program/CoreTest/Trend.xaml b/SCADA/Program/CoreTest/Trend.xaml
new file mode 100644
index 0000000..a7789bb
--- /dev/null
+++ b/SCADA/Program/CoreTest/Trend.xaml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 显示十字光标
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCADA/Program/CoreTest/Trend.xaml.cs b/SCADA/Program/CoreTest/Trend.xaml.cs
new file mode 100644
index 0000000..85d7d3a
--- /dev/null
+++ b/SCADA/Program/CoreTest/Trend.xaml.cs
@@ -0,0 +1,216 @@
+using System;
+using System.Collections.Generic;
+using System.Windows;
+using System.Windows.Input;
+using System.Windows.Media;
+using DataService;
+using Microsoft.Research.DynamicDataDisplay;
+using Microsoft.Research.DynamicDataDisplay.Charts;
+using Microsoft.Research.DynamicDataDisplay.DataSources;
+
+namespace CoreTest
+{
+ ///
+ /// Interaction logic for DynamicChart.xaml
+ ///
+ public partial class Trend : Window
+ {
+ int SMALLTICK = 10;
+ int LARGETICK = 60;
+ SortedList> sortlist = new SortedList>();
+ SortedList plotterlist = new SortedList();
+
+ public Trend()
+ {
+ InitializeComponent();
+ this.SetWindowState();
+ LARGETICK = ConfigCache.HdaLargeTick;
+ SMALLTICK = ConfigCache.HdaSmallTick;
+ this.CommandBindings.Add(new CommandBinding(MyCommands.First, (sender, e) =>
+ {
+ dtstart.Value -= TimeSpan.FromMinutes(LARGETICK);
+ dtend.Value -= TimeSpan.FromMinutes(LARGETICK);
+ BindingData();
+ }, CmdCanExecute));
+ this.CommandBindings.Add(new CommandBinding(MyCommands.Previous, (sender, e) =>
+ {
+ dtstart.Value -= TimeSpan.FromMinutes(SMALLTICK);
+ dtend.Value -= TimeSpan.FromMinutes(SMALLTICK);
+ BindingData();
+ }, CmdCanExecute));
+ this.CommandBindings.Add(new CommandBinding(MyCommands.Next, (sender, e) =>
+ {
+ dtstart.Value += TimeSpan.FromMinutes(SMALLTICK);
+ dtend.Value += TimeSpan.FromMinutes(SMALLTICK);
+ BindingData();
+ }, CmdCanExecute));
+ this.CommandBindings.Add(new CommandBinding(MyCommands.Last, (sender, e) =>
+ {
+ dtstart.Value += TimeSpan.FromMinutes(LARGETICK);
+ dtend.Value += TimeSpan.FromMinutes(LARGETICK);
+ BindingData();
+ }, CmdCanExecute));
+ this.CommandBindings.Add(new CommandBinding(MyCommands.Query, (sender, e) =>
+ {
+ BindingData();
+ }, CmdCanExecute));
+ dtstart.Value = DateTime.Now.AddMinutes(-LARGETICK);
+ dtend.Value = DateTime.Now;
+ chklist.ItemsSource = App.Server.ArchiveList;
+ var brush = chartPlotter1.Background as SolidColorBrush;
+ if (brush != null)
+ colorpicker.SelectedColor = brush.Color;
+ cursor.XTextMapping = x => hTimeSpanAxis.ConvertFromDouble(x).ToString();
+ }
+
+ void BindingData()
+ {
+ if (!dtstart.Value.HasValue || !dtend.Value.HasValue) return;
+ DateTime start = dtstart.Value.Value;
+ DateTime end = dtend.Value.Value;
+ if ((end - start).Days > 7)
+ {
+ end = start.AddDays(7);
+ dtend.Value = end;
+ }
+ else if (start >= end)
+ {
+ end = start.AddDays(1);
+ dtend.Value = end;
+ }
+ HashSet hash = new HashSet();
+ foreach (var item in sortlist)
+ {
+ item.Value.Collection.Clear();
+ hash.Add(item.Key);
+ }
+
+ foreach (KeyValuePair item in chklist.SelectedItems)
+ {
+ ObservableDataSource source;
+ if (!sortlist.TryGetValue(item.Key, out source))
+ {
+ source = new ObservableDataSource();
+ source.SetXMapping(X => hTimeSpanAxis.ConvertToDouble(X.TimeStamp));
+ source.SetSourceMapping(App.Server[item.Key]);
+ if (comodel.SelectedIndex == 0
+ || (comodel.SelectedIndex == 1 && sortlist.Count == 0))
+ //|| (comodel.SelectedIndex == 2 && (sortlist.Count == 0 || chklist.SelectedItems.Count == 1)))
+ {
+ plotterlist[item.Key] = chartPlotter1.AddLineGraph(source, 2, item.Value);
+ }
+ else
+ {
+ var innerPlotter = new InjectedPlotter() { SetViewportBinding = false };
+ var axis = new HorizontalDateTimeAxis();
+ innerPlotter.Children.Add(axis);
+ innerPlotter.MainHorizontalAxis = axis;
+ innerPlotter.Children.Add(new VerticalAxis() { Placement = AxisPlacement.Right });
+ innerPlotter.Children.Add(new VerticalAxisTitle() { Content = item.Value, Placement = AxisPlacement.Right });
+ chartPlotter1.Children.Add(innerPlotter);
+ innerPlotter.AddLineGraph(source, 2, item.Value);
+ plotterlist.Add(item.Key, innerPlotter);
+ }
+ sortlist.Add(item.Key, source);
+ }
+ hash.Remove(item.Key);
+ var data = App.Server.ReadRaw(start, end, item.Key);
+ if (data != null)
+ {
+ bool first = true;
+ var temp = new HistoryData(item.Key, QUALITIES.QUALITY_GOOD, Storage.Empty, start);
+ source.SuspendUpdate();
+ foreach (var p in data)
+ {
+ if (first)
+ {
+ temp.Value = p.Value;
+ source.Collection.Add(temp);
+ first = false;
+ }
+ source.Collection.Add(p);
+ }
+ if (source.Collection.Count == 0)
+ source.Collection.Add(temp);
+ temp = source.Collection[source.Collection.Count - 1];
+ temp.TimeStamp = end;
+ source.Collection.Add(temp);
+ source.ResumeUpdate();
+ }
+ chartPlotter1.FitToView();
+ }
+ foreach (short id in hash)
+ {
+ sortlist.Remove(id);
+ IPlotterElement plotter;
+ if (plotterlist.TryGetValue(id, out plotter))
+ {
+ var chart = plotter as Plotter;
+ if (chart != null)
+ {
+ for (int i = chart.Children.Count - 1; i >= 0; i--)
+ {
+ chart.Children[i].RemoveFromPlotter();
+ }
+ }
+ plotter.RemoveFromPlotter();
+ plotterlist.Remove(id);
+ }
+ }
+ }
+
+ void CmdCanExecute(object target, CanExecuteRoutedEventArgs e)
+ {
+ e.CanExecute = dtstart.Value.HasValue && dtend.Value.HasValue;
+ //e.CanExecute = App.Principal.IsInRole("中控员");
+ }
+
+ private void Window_Closed(object sender, EventArgs e)
+ {
+ this.SaveWindowState();
+ }
+
+ private void ColorPicker_SelectedColorChanged(object sender, RoutedPropertyChangedEventArgs e)
+ {
+ chartPlotter1.Background = new SolidColorBrush(e.NewValue);
+ }
+
+ private void comodel_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
+ {
+ foreach (var source in sortlist.Values)
+ {
+ source.Collection.Clear();
+ }
+ foreach (var plotter in plotterlist.Values)
+ {
+ var chart = plotter as Plotter;
+ if (chart != null)
+ {
+ for (int i = chart.Children.Count - 1; i >= 0; i--)
+ {
+ chart.Children[i].RemoveFromPlotter();
+ }
+ }
+ plotter.RemoveFromPlotter();
+ }
+ sortlist.Clear();
+ plotterlist.Clear();
+ BindingData();
+ }
+
+ private void chkshow_Click(object sender, RoutedEventArgs e)
+ {
+ if (chkshow.IsChecked == true)
+ {
+ cursor.Visibility = Visibility.Visible;
+ axiscuror.ShowHorizontalLine = true; axiscuror.ShowVerticalLine = true;
+ }
+ else
+ {
+ cursor.Visibility = Visibility.Collapsed;
+ axiscuror.ShowHorizontalLine = false; axiscuror.ShowVerticalLine = false;
+ }
+ }
+ }
+}
+
diff --git a/SCADA/Program/CoreTest/Volume.ico b/SCADA/Program/CoreTest/Volume.ico
new file mode 100644
index 0000000..4531227
Binary files /dev/null and b/SCADA/Program/CoreTest/Volume.ico differ
diff --git a/SCADA/Program/CoreTest/WindowHelper.cs b/SCADA/Program/CoreTest/WindowHelper.cs
new file mode 100644
index 0000000..5e99814
--- /dev/null
+++ b/SCADA/Program/CoreTest/WindowHelper.cs
@@ -0,0 +1,806 @@
+using System;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Windows;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using DataService;
+using HMIControl;
+using Microsoft.Research.DynamicDataDisplay.DataSources;
+using FORMS = System.Windows.Forms;
+
+namespace CoreTest
+{
+ public static class WindowHelper
+ {
+ //绑定到DAServer,采用递归
+ public static List BindingToServer(this DependencyObject panel, IDataServer _srv)
+ {
+ if (_srv == null) return null;
+ ExpressionEval eval = _srv.Eval;
+ List valueChangedList = new List();
+ var items = panel.FindTagControls();
+ if (items != null)
+ {
+ foreach (var element in items)
+ {
+ BindingControl(element, valueChangedList, eval);
+ }
+ }
+ eval.Clear();
+ valueChangedList.Sort();
+ return valueChangedList;
+ }
+
+ private static void BindingControl(ITagLink taglink, List valueChangedList, ExpressionEval eval)
+ {
+ var ctrl = taglink as UIElement;
+ if (ctrl == null) return;
+ var complex = taglink as ITagReader;
+ if (complex != null)
+ {
+ string txt = complex.TagReadText;
+ if (!string.IsNullOrEmpty(txt))
+ {
+ foreach (var v in txt.GetListFromText())
+ {
+ ITagLink tagConn = complex;
+ string[] strs = v.Key.Split('.');
+ if (strs.Length > 1)
+ {
+ for (int i = 0; i < strs.Length - 1; i++)
+ {
+ var c = tagConn as ITagReader;
+ if (c == null || c.Children == null) break;
+ foreach (var item in c.Children)
+ {
+ if (item.Node == strs[i])
+ {
+ tagConn = item;
+ break;
+ }
+ }
+ }
+ }
+ var r = tagConn as ITagReader;
+ var key = strs[strs.Length - 1];
+ try
+ {
+ var action = r.SetTagReader(key, eval.Eval(v.Value));
+ if (action != null)
+ {
+ action();
+ ValueChangedEventHandler handle = (s1, e1) =>
+ {
+ ctrl.InvokeAsynchronously(action);
+ };
+ foreach (ITag tag in eval.TagList)
+ {
+ valueChangedList.Add(new TagNodeHandle(tag.ID, key, tagConn, handle));
+ tag.ValueChanged += handle;
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ App.AddErrorLog(e);
+ MessageBox.Show(string.Format("设备'{0}'属性'{1}'的值'{2}'转化出错!", string.IsNullOrEmpty(r.Node) ? r.GetType().ToString() : r.Node, key, v.Value));
+ }
+ if (Attribute.IsDefined(tagConn.GetType(), typeof(StartableAttribute), false))
+ {
+ FrameworkElement element = tagConn as FrameworkElement;
+ element.Cursor = Cursors.UpArrow;
+ element.AddHandler(UIElement.MouseEnterEvent, new MouseEventHandler(element_MouseEnter));
+ element.AddHandler(UIElement.MouseLeaveEvent, new MouseEventHandler(element_MouseLeave));
+ element.AddHandler(UIElement.MouseLeftButtonDownEvent, new MouseButtonEventHandler(element_MouseLeftButtonDown));
+ }
+ var hmi = tagConn as HMIControlBase;
+ if (hmi != null && hmi.ShowCaption && !string.IsNullOrEmpty(hmi.Caption))
+ {
+ AdornerLayer lay = AdornerLayer.GetAdornerLayer(hmi);
+ if (lay != null)
+ {
+ TextAdorner frame = new TextAdorner(hmi);
+ frame.Text = hmi.Caption;
+ lay.Add(frame);
+ }
+ }
+ }
+ }
+ }
+ var writer = taglink as ITagWriter;
+ if (writer != null && !string.IsNullOrEmpty(writer.TagWriteText))
+ {
+ var delgts = new List();
+ foreach (var item in writer.TagWriteText.GetListFromText())
+ {
+ try
+ {
+ if (!string.IsNullOrEmpty(item.Value))
+ delgts.Add(eval.WriteEval(item.Key, item.Value));
+ else
+ delgts.Add(eval.WriteEval(item.Key));
+ }
+ catch (Exception e)
+ {
+ App.AddErrorLog(e);
+ MessageBox.Show(string.Format("设备{0}变量{1}写入PLC公式转换失败", taglink.Node, item.Key) + "\n" + e.Message);
+ }
+ writer.SetTagWriter(delgts);
+ }
+ }
+ }
+
+ static AnimationTimeline animaEnter = new DoubleAnimationUsingKeyFrames
+ {
+ KeyFrames = new DoubleKeyFrameCollection { new DiscreteDoubleKeyFrame(1.05, KeyTime.FromPercent(0)) }
+ };
+
+ static AnimationTimeline animaLeave = new DoubleAnimationUsingKeyFrames
+ {
+ KeyFrames = new DoubleKeyFrameCollection { new DiscreteDoubleKeyFrame(1, KeyTime.FromPercent(0)) }
+ };
+
+ static ScaleTransform GetScaleTransform(UIElement element)
+ {
+ var group = element.RenderTransform as TransformGroup;
+ ScaleTransform scale = null;
+ if (group == null)
+ {
+ scale = new ScaleTransform();
+ element.RenderTransform = new TransformGroup { Children = new TransformCollection { element.RenderTransform, scale } };
+ }
+ else
+ {
+ if (group.IsFrozen)
+ group = group.Clone();
+ foreach (var transform in group.Children)
+ {
+ scale = transform as ScaleTransform;
+ if (scale != null)
+ break;
+ }
+ if (scale == null)
+ {
+ scale = new ScaleTransform();
+ group.Children.Add(scale);
+ }
+ element.RenderTransform = group;
+ }
+ return scale;
+ }
+
+ static void element_MouseEnter(object sender, MouseEventArgs e)
+ {
+ UIElement element = sender as UIElement;
+ //ScaleTransform scale = GetScaleTransform(element);
+ //scale.BeginAnimation(ScaleTransform.ScaleXProperty, animaEnter);
+ //scale.BeginAnimation(ScaleTransform.ScaleYProperty, animaEnter);
+ AdornerLayer lay = AdornerLayer.GetAdornerLayer(element);
+ if (lay != null)
+ {
+ FrameAdorner frame = new FrameAdorner(element);
+ lay.Add(frame);
+ }
+ }
+
+ static void element_MouseLeave(object sender, MouseEventArgs e)
+ {
+ UIElement element = sender as UIElement;
+ //var scale = GetScaleTransform(element);
+ //scale.BeginAnimation(ScaleTransform.ScaleXProperty, animaLeave);
+ //scale.BeginAnimation(ScaleTransform.ScaleYProperty, animaLeave);
+ AdornerLayer lay = AdornerLayer.GetAdornerLayer(element);
+ if (lay != null)
+ {
+ var adorners = lay.GetAdorners(element);
+ if (adorners != null)
+ {
+ FrameAdorner frame = null;
+ for (int i = 0; i < adorners.Length; i++)
+ {
+ frame = adorners[i] as FrameAdorner;
+ if (frame != null)
+ {
+ lay.Remove(frame);
+ return;
+ }
+ }
+ }
+ }
+ }
+ static StartDevice frm1 = null;
+ static void element_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ HMIControlBase ui = sender as HMIControlBase;
+ if (ui != null && !string.IsNullOrEmpty(ui.DeviceName))
+ {
+ if (frm1 != null)
+ frm1.Close();
+ frm1 = new StartDevice(ui.DeviceName, ui.PointToScreen(new Point(ui.ActualWidth / 2, ui.ActualHeight / 2)));
+ frm1.Show();
+ }
+ e.Handled = true;
+ }
+
+ static ITagLink FindElement(ITagLink tag, string key)
+ {
+ ITagLink tagConn = tag;
+ string[] strs = key.Split('.');
+ for (int i = 0; i < strs.Length; i++)
+ {
+ var c = tagConn as ITagReader;
+ if (c == null || c.Children == null) break;
+ foreach (var item in c.Children)
+ {
+ if (item.Node == strs[i])
+ {
+ tagConn = item;
+ break;
+ }
+ }
+ }
+ return tagConn;
+ }
+
+ public static IEnumerable FindVisualChildren(this DependencyObject parent)
+ {
+ var count = VisualTreeHelper.GetChildrenCount(parent);
+ if (count > 0)
+ {
+ for (var i = 0; i < count; i++)
+ {
+ var child = VisualTreeHelper.GetChild(parent, i);
+ yield return child;
+
+ var children = FindVisualChildren(child);
+ foreach (var item in children)
+ yield return item;
+ }
+ }
+ }
+
+ public static IEnumerable FindChildren(this DependencyObject parent) where T : class
+ {
+ var count = VisualTreeHelper.GetChildrenCount(parent);
+ if (count > 0)
+ {
+ for (var i = 0; i < count; i++)
+ {
+ var child = VisualTreeHelper.GetChild(parent, i);
+ var t = child as T;
+ if (t != null)
+ yield return t;
+
+ var children = FindChildren(child);
+ foreach (var item in children)
+ yield return item;
+ }
+ }
+ }
+
+ public static IEnumerable