Browse Source

change error code
v 1.5.3

Robert 3 năm trước cách đây
mục cha
commit
28c22e04fc

+ 1 - 1
GitVersion.yml

@@ -1,6 +1,6 @@
 assembly-versioning-scheme: MajorMinorPatch
 assembly-informational-format: '{ShortSha}'
-next-version: 1.5.2
+next-version: 1.5.3
 branches: {}
 ignore:
   sha: []

+ 0 - 43
MesAdaptor/MesErrorCode.cs

@@ -26,47 +26,4 @@ namespace MesAdaptor
         BlueButtonTestFail,
         FactoryResetFail,
     }
-
-    public static class MesErrorCodeExt
-    {
-        public static string ToMesCodeString(this MesErrorCode mesError)
-        {
-            switch(mesError)
-            {
-                case MesErrorCode.ChargerConnectFail:
-                    return "EC001";
-                case MesErrorCode.ModelNameUpadateFail:
-                    return "EC002";
-                case MesErrorCode.SerilaNumberUpadateFail:
-                    return "EC003";
-                case MesErrorCode.UtcDatetimeUpdateFail:
-                    return "EC004";
-                case MesErrorCode.FourthGenModelVersionMismatch:
-                    return "EC005";
-                case MesErrorCode.FourthGenSimInstartionMismatch:
-                    return "EC006";
-                case MesErrorCode.FourthGenSimInfoMismatch:
-                    return "EC007";
-                case MesErrorCode.WifiModeNotClient:
-                    return "EC008";
-                case MesErrorCode.WifiRssiLow:
-                    return "EC009";
-                case MesErrorCode.FirmwareUploadFail:
-                    return "EC0010";
-                case MesErrorCode.FirmwareUpdateTimeout:
-                    return "EC0011";
-                case MesErrorCode.FirmwareVersionCheckFail:
-                    return "EC0012";
-                case MesErrorCode.EmergencyButtonTestFail:
-                    return "EC0013";
-                case MesErrorCode.GreenButtonTestFail:
-                    return "EC0014";
-                case MesErrorCode.BlueButtonTestFail:
-                    return "EC0015";
-                case MesErrorCode.FactoryResetFail:
-                    return "EC0016";
-            }
-            return "EC001";
-        }
-    }
 }

+ 41 - 1
MesAdaptor/SajectConnectSajet2.cs

@@ -142,7 +142,7 @@ namespace MesAdaptor
             if (string.IsNullOrEmpty(msg))
                 return false;
 
-            msg += $"{errorCode};";  //E114
+            msg += $"{GetMesCodeString(errorCode)};";  //E114
 
 #if DEBUG
             return true;
@@ -234,5 +234,45 @@ namespace MesAdaptor
         {
             return SajetConnectAdapter.SajetTransData((int)command, ref data);
         }
+
+        private string GetMesCodeString(MesErrorCode mesError)
+        {
+            switch (mesError)
+            {
+                case MesErrorCode.ChargerConnectFail:
+                    return "A081";
+                case MesErrorCode.ModelNameUpadateFail:
+                    return "A082";
+                case MesErrorCode.SerilaNumberUpadateFail:
+                    return "A083";
+                case MesErrorCode.UtcDatetimeUpdateFail:
+                    return "A084";
+                case MesErrorCode.FourthGenModelVersionMismatch:
+                    return "A085";
+                case MesErrorCode.FourthGenSimInstartionMismatch:
+                    return "A086";
+                case MesErrorCode.FourthGenSimInfoMismatch:
+                    return "A087";
+                case MesErrorCode.WifiModeNotClient:
+                    return "A088";
+                case MesErrorCode.WifiRssiLow:
+                    return "A089";
+                case MesErrorCode.FirmwareUploadFail:
+                    return "A090";
+                case MesErrorCode.FirmwareUpdateTimeout:
+                    return "A091";
+                case MesErrorCode.FirmwareVersionCheckFail:
+                    return "A092";
+                case MesErrorCode.EmergencyButtonTestFail:
+                    return "A093";
+                case MesErrorCode.GreenButtonTestFail:
+                    return "A094";
+                case MesErrorCode.BlueButtonTestFail:
+                    return "A095";
+                case MesErrorCode.FactoryResetFail:
+                    return "A096";
+            }
+            return "A081";
+        }
     }
 }

+ 41 - 1
MesAdaptor/SajetConnectShinewave.cs

@@ -132,7 +132,7 @@ namespace MesAdaptor
             if (string.IsNullOrEmpty(msg))
                 return false;
 
-            msg += "NG," + errorCode + ",";
+            msg += "NG," + GetMesCodeString(errorCode) + ",";
 
 #if DEBUG
             return true;
@@ -249,5 +249,45 @@ namespace MesAdaptor
             msg += WorkOrder + ",";
             return msg;
         }
+
+        private string GetMesCodeString(MesErrorCode mesError)
+        {
+            switch (mesError)
+            {
+                case MesErrorCode.ChargerConnectFail:
+                    return "EC001";
+                case MesErrorCode.ModelNameUpadateFail:
+                    return "EC002";
+                case MesErrorCode.SerilaNumberUpadateFail:
+                    return "EC003";
+                case MesErrorCode.UtcDatetimeUpdateFail:
+                    return "EC004";
+                case MesErrorCode.FourthGenModelVersionMismatch:
+                    return "EC005";
+                case MesErrorCode.FourthGenSimInstartionMismatch:
+                    return "EC006";
+                case MesErrorCode.FourthGenSimInfoMismatch:
+                    return "EC007";
+                case MesErrorCode.WifiModeNotClient:
+                    return "EC008";
+                case MesErrorCode.WifiRssiLow:
+                    return "EC009";
+                case MesErrorCode.FirmwareUploadFail:
+                    return "EC0010";
+                case MesErrorCode.FirmwareUpdateTimeout:
+                    return "EC0011";
+                case MesErrorCode.FirmwareVersionCheckFail:
+                    return "EC0012";
+                case MesErrorCode.EmergencyButtonTestFail:
+                    return "EC0013";
+                case MesErrorCode.GreenButtonTestFail:
+                    return "EC0014";
+                case MesErrorCode.BlueButtonTestFail:
+                    return "EC0015";
+                case MesErrorCode.FactoryResetFail:
+                    return "EC0016";
+            }
+            return "EC001";
+        }
     }
 }