Bläddra i källkod

此修改只是临时版本,后面需要撤销

git-svn-id: http://10.4.3.168:50001/svn/Furnace@32 dbcde07d-dcf5-c148-8a84-ac3097b7778e
Xiongbing 5 månader sedan
förälder
incheckning
9f1bb72881
1 ändrade filer med 10 tillägg och 10 borttagningar
  1. 10 10
      Branch/NTP02/Furnace/FurnaceRT/Equipments/Systems/ModbusTCP.cs

+ 10 - 10
Branch/NTP02/Furnace/FurnaceRT/Equipments/Systems/ModbusTCP.cs

@@ -65,7 +65,7 @@ namespace FurnaceRT.Equipments.Systems
 
             _enableLog = SC.GetValue<bool>($"System.ModbusCommunicationEnableLogMessage");
             OP.Subscribe($"Sysytem.{Name}.ModbusPLC", InvokeReset);
-            if (SC.GetValue<bool>("System.IsSimulatorMode"))
+            if (!SC.GetValue<bool>("System.IsSimulatorMode"))
             {
                 _wcfPlc = new WcfPlc("System", Name, $"WcfPlc_{Name}");
                 _wcfPlc.Initialize();
@@ -244,7 +244,7 @@ namespace FurnaceRT.Equipments.Systems
 
             if (!_trigConnected.M)
             {
-                if (!SC.GetValue<bool>("System.IsSimulatorMode"))
+                if (SC.GetValue<bool>("System.IsSimulatorMode"))
                 {
                     Close();
                     Open();
@@ -267,7 +267,7 @@ namespace FurnaceRT.Equipments.Systems
         protected override bool[] ReadDi(int offset, int size)
         {
 
-            if (SC.GetValue<bool>("System.IsSimulatorMode"))
+            if (!SC.GetValue<bool>("System.IsSimulatorMode"))
             {
                 int address = offset + _aiStartAddress;
                 var ret = _wcfPlc.ReadBool(address.ToString(), out bool[] data, size, out _);
@@ -356,7 +356,7 @@ namespace FurnaceRT.Equipments.Systems
 
         protected override float[] ReadAiFloat(int offset, int size)
         {
-            if (SC.GetValue<bool>("System.IsSimulatorMode"))
+            if (!SC.GetValue<bool>("System.IsSimulatorMode"))
             {
                 int address = offset + _aiStartAddress;
                 var ret = _wcfPlc.ReadFloat(address.ToString(), out float[] data, size, out _);
@@ -435,7 +435,7 @@ namespace FurnaceRT.Equipments.Systems
         protected bool[] ReadDo(int offset, int size)
         {
 
-            if (SC.GetValue<bool>("System.IsSimulatorMode"))
+            if (!SC.GetValue<bool>("System.IsSimulatorMode"))
             {
                 return null;
             }
@@ -501,7 +501,7 @@ namespace FurnaceRT.Equipments.Systems
         protected override short[] ReadAi(int offset, int size)
         {
 
-            if (SC.GetValue<bool>("System.IsSimulatorMode"))
+            if (!SC.GetValue<bool>("System.IsSimulatorMode"))
             {
                 int address = offset + _aiStartAddress;
                 var ret = _wcfPlc.ReadInt16(address.ToString(), out short[] data, size, out _);
@@ -580,7 +580,7 @@ namespace FurnaceRT.Equipments.Systems
         protected float[] ReadAoFloat(int offset, int size)
         {
 
-            if (SC.GetValue<bool>("System.IsSimulatorMode"))
+            if (!SC.GetValue<bool>("System.IsSimulatorMode"))
             {
                 return null;
             }
@@ -653,7 +653,7 @@ namespace FurnaceRT.Equipments.Systems
 
         protected short[] ReadAo(int offset, int size)
         {
-            if (SC.GetValue<bool>("System.IsSimulatorMode"))
+            if (!SC.GetValue<bool>("System.IsSimulatorMode"))
             {
                 return null;
             }
@@ -726,7 +726,7 @@ namespace FurnaceRT.Equipments.Systems
 
         public override bool SetValueFloat(AOAccessor aoItem, float value)
         {
-            if (SC.GetValue<bool>("System.IsSimulatorMode"))
+            if (!SC.GetValue<bool>("System.IsSimulatorMode"))
                 return true;
 
             if (!_trigConnected.M)
@@ -760,7 +760,7 @@ namespace FurnaceRT.Equipments.Systems
 
         public override bool SetValue(DOAccessor doItem, bool value)
         {
-            if (SC.GetValue<bool>("System.IsSimulatorMode"))
+            if (!SC.GetValue<bool>("System.IsSimulatorMode"))
                 return true;
 
             if (!_trigConnected.M)