diff --git a/SCADA/Program/BatchCoreService/BatchCoreService.csproj.user b/SCADA/Program/BatchCoreService/BatchCoreService.csproj.user
new file mode 100644
index 0000000..6cbe588
--- /dev/null
+++ b/SCADA/Program/BatchCoreService/BatchCoreService.csproj.user
@@ -0,0 +1,6 @@
+
+
+
+ ProjectFiles
+
+
\ No newline at end of file
diff --git a/SCADA/Program/BatchCoreService/obj/x86/Debug/BatchCoreService.csprojAssemblyReference.cache b/SCADA/Program/BatchCoreService/obj/x86/Debug/BatchCoreService.csprojAssemblyReference.cache
index de35cd6..27504a6 100644
Binary files a/SCADA/Program/BatchCoreService/obj/x86/Debug/BatchCoreService.csprojAssemblyReference.cache and b/SCADA/Program/BatchCoreService/obj/x86/Debug/BatchCoreService.csprojAssemblyReference.cache differ
diff --git a/SCADA/Program/ClientDriver/obj/Debug/ClientDriver.csprojAssemblyReference.cache b/SCADA/Program/ClientDriver/obj/Debug/ClientDriver.csprojAssemblyReference.cache
index add0c38..c728f8d 100644
Binary files a/SCADA/Program/ClientDriver/obj/Debug/ClientDriver.csprojAssemblyReference.cache and b/SCADA/Program/ClientDriver/obj/Debug/ClientDriver.csprojAssemblyReference.cache differ
diff --git a/SCADA/Program/CoreTest/SystemLog.cs b/SCADA/Program/CoreTest/SystemLog.cs
index 6ea430b..e3845d4 100644
--- a/SCADA/Program/CoreTest/SystemLog.cs
+++ b/SCADA/Program/CoreTest/SystemLog.cs
@@ -21,7 +21,7 @@ namespace CoreTest
set;
}
- public bool IsActived
+ public bool IsActivated
{
get;
set;
diff --git a/SCADA/Program/CoreTest/obj/x86/Debug/Example.csprojAssemblyReference.cache b/SCADA/Program/CoreTest/obj/x86/Debug/Example.csprojAssemblyReference.cache
index 8552832..657ad16 100644
Binary files a/SCADA/Program/CoreTest/obj/x86/Debug/Example.csprojAssemblyReference.cache and b/SCADA/Program/CoreTest/obj/x86/Debug/Example.csprojAssemblyReference.cache differ
diff --git a/SCADA/Program/DataHelper/obj/x86/Debug/DataHelper.csprojAssemblyReference.cache b/SCADA/Program/DataHelper/obj/x86/Debug/DataHelper.csprojAssemblyReference.cache
index 852e79e..0e564c3 100644
Binary files a/SCADA/Program/DataHelper/obj/x86/Debug/DataHelper.csprojAssemblyReference.cache and b/SCADA/Program/DataHelper/obj/x86/Debug/DataHelper.csprojAssemblyReference.cache differ
diff --git a/SCADA/Program/DataService/Alarm.cs b/SCADA/Program/DataService/Alarm.cs
index 523fadc..6015d78 100644
--- a/SCADA/Program/DataService/Alarm.cs
+++ b/SCADA/Program/DataService/Alarm.cs
@@ -1,121 +1,66 @@
using System;
using System.ComponentModel;
-namespace DataService
-{
-
- public class AlarmItem : IComparable, INotifyPropertyChanged
- {
+namespace DataService {
+ public class AlarmItem : IComparable, INotifyPropertyChanged {
int _condiId;
-
+
Severity _severity;
SubAlarmType _alarmType;
DateTime _startTime;
- TimeSpan _duration;
+ TimeSpan _duration;
object _alarmValue;
string _alarmText;
string _source;
- public SubAlarmType SubAlarmType
- {
- get
- {
- return _alarmType;
- }
- set
- {
- _alarmType = value;
- }
+ public SubAlarmType SubAlarmType {
+ get { return _alarmType; }
+ set { _alarmType = value; }
}
- public Severity Severity
- {
- get
- {
- return _severity;
- }
- set
- {
- _severity = value;
- }
+ public Severity Severity {
+ get { return _severity; }
+ set { _severity = value; }
}
- public DateTime StartTime
- {
- get
- {
- return _startTime;
- }
- set
- {
- _startTime = value;
- }
+ public DateTime StartTime {
+ get { return _startTime; }
+ set { _startTime = value; }
}
- public int ConditionId
- {
- get
- {
- return _condiId;
- }
- set
- {
- _condiId = value;
- }
+ public int ConditionId {
+ get { return _condiId; }
+ set { _condiId = value; }
}
- public TimeSpan Duration
- {
- get
- {
+ public TimeSpan Duration {
+ get {
//return _endTime-_startTime;
return _duration;
}
- set
- {
+ set {
_duration = value;
OnPropertyChanged("Duration");
}
}
- public object AlarmValue
- {
- get
- {
- return _alarmValue;
- }
- set
- {
- _alarmValue = value;
- }
+ public object AlarmValue {
+ get { return _alarmValue; }
+ set { _alarmValue = value; }
}
- public string AlarmText
- {
- get
- {
- return _alarmText;
- }
- set
- {
- _alarmText = value;
- }
+ public string AlarmText {
+ get { return _alarmText; }
+ set { _alarmText = value; }
}
- public string Source
- {
- get
- {
- return _source;
- }
- set
- {
- _source = value;
- }
+ public string Source {
+ get { return _source; }
+ set { _source = value; }
}
- public AlarmItem(DateTime time, string alarmText, object alarmValue, SubAlarmType type, Severity severity, int condId, string source)
- {
+ public AlarmItem(DateTime time, string alarmText, object alarmValue, SubAlarmType type, Severity severity,
+ int condId, string source) {
this._startTime = time;
this._alarmType = type;
this._alarmText = alarmText;
@@ -125,8 +70,7 @@ namespace DataService
this._source = source;
}
- public AlarmItem()
- {
+ public AlarmItem() {
this._startTime = DateTime.Now;
this._alarmType = SubAlarmType.None;
this._alarmText = string.Empty;
@@ -137,8 +81,7 @@ namespace DataService
#region IComparable Members
- public int CompareTo(AlarmItem other)
- {
+ public int CompareTo(AlarmItem other) {
return this._startTime.CompareTo(other._startTime);
}
@@ -146,20 +89,15 @@ namespace DataService
public event PropertyChangedEventHandler PropertyChanged;
- private void OnPropertyChanged(string propertyName)
- {
- if (this.PropertyChanged != null)
- {
-
+ private void OnPropertyChanged(string propertyName) {
+ if (this.PropertyChanged != null) {
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
-
}
[Flags]
- public enum AlarmType
- {
+ public enum AlarmType {
None = 0,
Level = 1,
Dev = 2,
@@ -171,8 +109,7 @@ namespace DataService
}
[Flags]
- public enum SubAlarmType
- {
+ public enum SubAlarmType {
None = 0,
LoLo = 1,
Low = 2,
@@ -187,8 +124,7 @@ namespace DataService
MinROC = 512
}
- public enum Severity
- {
+ public enum Severity {
Error = 7,
High = 6,
MediumHigh = 5,
@@ -200,24 +136,20 @@ namespace DataService
}
[Flags]
- public enum ConditionState : byte
- {
+ public enum ConditionState : byte {
Acked = 4,
Actived = 2,
Enabled = 1
}
- public enum EventType : byte
- {
+ public enum EventType : byte {
Simple = 1,
TraceEvent = 2,
ConditionEvent = 4,
}
- public enum ConditionType : byte
- {
+ public enum ConditionType : byte {
Absolute = 0,
Percent = 1
}
-
-}
+}
\ No newline at end of file
diff --git a/SCADA/Program/DataService/CacheReader.cs b/SCADA/Program/DataService/CacheReader.cs
index 45819d9..c8d4d2f 100644
--- a/SCADA/Program/DataService/CacheReader.cs
+++ b/SCADA/Program/DataService/CacheReader.cs
@@ -3,908 +3,762 @@ using System.Net;
using System.Runtime.InteropServices;
using System.Text;
-namespace DataService
-{
- public sealed class ByteCacheReader : ICache
- {
+namespace DataService {
+ public sealed class ByteCacheReader : ICache {
byte[] _cache;
- public Array Cache { get { return _cache; } }
- public int ByteCount
- {
+ public Array Cache {
+ get { return _cache; }
+ }
+
+ public int ByteCount {
get { return 1; }
}
int _size;
- public int Size
- {
+
+ public int Size {
get { return _size; }
- set { _size = value; this._cache = new byte[_size]; }
+ set {
+ _size = value;
+ _cache = new byte[_size];
+ }
}
public ByteCacheReader() { }
- public ByteCacheReader(int size)
- {
+ public ByteCacheReader(int size) {
this.Size = size;
}
- public int GetOffset(DeviceAddress start, DeviceAddress end)
- {
+ public int GetOffset(DeviceAddress start, DeviceAddress end) {
return start.Area == end.Area && start.DBNumber == end.DBNumber ? start.Start - end.Start : ushort.MaxValue;
}
- public ItemData ReadInt32(DeviceAddress address)
- {
+ public ItemData ReadInt32(DeviceAddress address) {
return new ItemData(BitConverter.ToInt32(_cache, address.CacheIndex), 0, QUALITIES.QUALITY_GOOD);
}
- public ItemData ReadBit(DeviceAddress address)
- {
- return new ItemData((_cache[address.CacheIndex] & (1 << address.Bit)) != 0, 0, QUALITIES.QUALITY_GOOD);
+ public ItemData ReadBit(DeviceAddress address) {
+ return new ItemData((_cache[address.CacheIndex] & (1 << address.Bit)) != 0, 0,
+ QUALITIES.QUALITY_GOOD);
}
- public ItemData ReadInt16(DeviceAddress address)
- {
+ public ItemData ReadInt16(DeviceAddress address) {
return new ItemData(BitConverter.ToInt16(_cache, address.CacheIndex), 0, QUALITIES.QUALITY_GOOD);
}
- public ItemData ReadByte(DeviceAddress address)
- {
+ public ItemData ReadByte(DeviceAddress address) {
return new ItemData(_cache[address.CacheIndex], 0, QUALITIES.QUALITY_GOOD);
}
- public ItemData ReadString(DeviceAddress address, ushort size = 0xFF)
- {
- return new ItemData(Encoding.ASCII.GetString(_cache, address.CacheIndex, size), 0, QUALITIES.QUALITY_GOOD);
+ public ItemData ReadString(DeviceAddress address, ushort size = 0xFF) {
+ return new ItemData(Encoding.ASCII.GetString(_cache, address.CacheIndex, size), 0,
+ QUALITIES.QUALITY_GOOD);
}
- public ItemData ReadFloat(DeviceAddress address)
- {
+ public ItemData ReadFloat(DeviceAddress address) {
return new ItemData(BitConverter.ToSingle(_cache, address.CacheIndex), 0, QUALITIES.QUALITY_GOOD);
}
- public ItemData