mengshunguo il y a 2 semaines
Parent
commit
994488dc89
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      SCADA_DAQ/Customer/Models/ProcessData.cs

+ 1 - 1
SCADA_DAQ/Customer/Models/ProcessData.cs

@@ -105,7 +105,7 @@ namespace SCADA_DAQ.Customer.Models
         {
             Voltage = ((data[startIndex] << 8) + data[startIndex + 1]) / 100.0m;
             Amps = ((data[startIndex + 2] << 8) + data[startIndex + 3]) / 1000.0m;
-            Power = ((data[startIndex + 4] << 8) + data[startIndex + 5]) / 10.0m < 0 ?
+            Power = ((data[startIndex + 4] << 8) + data[startIndex + 5]) / 10.0m <= 1 ?
                 Voltage * Amps : ((data[startIndex + 4] << 8) + data[startIndex + 5]) / 10.0m;
         }