Ver Fonte

2022-03-29 / Simon Xue

Action:
1. [add] show warming code on LCM

Files
As the following commit files

Image Version: v2.04.XX.XXXX.XX
Simon Xue há 3 anos atrás
pai
commit
2c47739437

+ 1 - 1
EVSE/Projects/DD360UCar/Apps/CSU/main.c

@@ -83,7 +83,7 @@ uint8_t bd1_1_status = 0;
 uint8_t bd1_2_status = 0;
 
 char *fwVersion = "V2.04.00.0000.00"; // Phihong version
-char* DebugVersion = "v2.04.02";      // Software debug version
+char* DebugVersion = "v2.04.03";      // Software debug version
 //sqlite3 *localDb;
 bool isDb_ready;
 

+ 62 - 9
EVSE/Projects/DD360UCar/Apps/ModuleLcmCtrl/Module_LcmControl.c

@@ -444,17 +444,16 @@ void ShowViewChargingSoc(uint8_t gunIndex,int soc)
 }
 void ShowViewChargingTime(uint8_t gunIndex,int time)
 {
-    uint8_t value[10] = {0};
     int min,sec;
+    int ShowTime;
     min = time/60;
     sec = time % 60;
+    ShowTime = min * 100 + sec;
     //sprintf((char *)value,"%d:%02d",min,sec);
     if (gunIndex == LEFT_GUN_NUM) {
-        ChangeDisplay2Value(_LeftGun_time_min, min);
-        ChangeDisplay2Value(_LeftGun_time_sec, sec);
+        ChangeDisplay2Value(_LeftGun_info_time, (short)ShowTime);
     } else {
-        ChangeDisplay2Value(_RightGun_time_min, min);
-        ChangeDisplay2Value(_RightGun_time_sec, sec);
+        ChangeDisplay2Value(_RightGun_info_time, (short)ShowTime);
     }
 }
 void ShowViewChargingEngery(uint8_t gunIndex, float energy)
@@ -941,7 +940,7 @@ void DemoFunction()
         case __VIEW_ALL_CHARGE_:
             for(i=0;i<=100;i++) {
                 ShowViewChargingSoc(LEFT_GUN_NUM,i);
-                ShowViewChargingTime(LEFT_GUN_NUM,i*60);
+                ShowViewChargingTime(LEFT_GUN_NUM,i);
                 ShowViewCharingMoney(LEFT_GUN_NUM,i);
                 ShowViewChargingPower(LEFT_GUN_NUM,i);
                 ShowViewChargingEngery(LEFT_GUN_NUM, i/10);
@@ -1208,7 +1207,40 @@ void InformationShow()
         ShowDispenserVersion();
     }
 }
+void ChangeWarningFunc()
+{
+    uint8_t cmd[7] = { 0 };
+    uint8_t i = 0;
+    //uint8_t j = 0;
+    //log_info("ChangeWarningFunc ");
+    // 最多一次五筆
+    //log_info("LCM PageIndex = %d ", pSysWarning->PageIndex);
+    //log_info("WarningCount = %d ", pSysWarning->WarningCount);
+//#if !defined DD360 && !defined DD360Audi && !defined DD360ComBox
+    for (i = 0; (i + pSysWarning->PageIndex * 5) < pSysWarning->WarningCount; i++) {
+        //log_info("Warming Code[%d]:%s", i, &pSysWarning->WarningCode[i][0]);
+        memset(cmd, 0x00, sizeof(cmd));
+        if ((i) >= 5) {
+            break;
+        }
+
+        //error code
+        string2ByteArray(&pSysWarning->WarningCode[i + pSysWarning->PageIndex * 5][0], cmd);
+        DisplayValueToLcm(_Text_Warming0 + ((i) * 0x10), cmd, sizeof(cmd));
+        //警告標示
+        memset(cmd, 0x00, sizeof(cmd));
+
+        cmd[0] = 0x00;
+        cmd[1] = 1;
+        DisplayValueToLcm(_Icon_Warming0 + ((i) * 2), cmd, 2);
+    }
 
+    memset(cmd, 0x00, sizeof(cmd));
+    for (; i < 5; i++) {
+        DisplayValueToLcm(_Text_Warming0 + ((i) * 0x10), cmd, sizeof(cmd));
+        DisplayValueToLcm(_Icon_Warming0 + ((i) * 2), cmd, 2);
+    }
+}
 int main(void)
 {
     bool defaulttext = false;
@@ -1233,11 +1265,13 @@ int main(void)
     ChangeBackLight(true);
     _totalCount = pSysConfig->TotalConnectorCount;
     _everyPageRollChange = 0;
+    uint8_t curWarningCount = 255;
+    uint8_t changeWarningPriority = 0;
     //Initialization();
     //printf("_LCM_COMPLETE ");
     //ChangeToOtherPage(_LCM_COMPLETE);
     //return 0;
-    uint8_t index = 1;
+    uint8_t index = 35;
     ShmDcCommonData->PSU_Number = 12;
     while (_port != -1) {
         if (strcmp((char *)pSysInfo->LcmHwRev, moduleName) != 0x00) {
@@ -1274,12 +1308,31 @@ int main(void)
                         ChargeMaxPower_1 = pDcChargingInfo_1->PresentChargingPower;
                 }
             }
+            // Warming處理
+            if (curWarningCount != pSysWarning->WarningCount) {
+                changeWarningPriority = 0;
+                pSysWarning->PageIndex = 0;
+                curWarningCount = pSysWarning->WarningCount;
+                ChangeWarningFunc();
+            } else if (pSysWarning->WarningCount > 5 && changeWarningPriority == 0) {
+                // 當有兩頁 Warning 則每隔三秒改變一次
+                if (pSysWarning->PageIndex == 0) {
+                    pSysWarning->PageIndex = 1;
+                } else {
+                    pSysWarning->PageIndex = 0;
+                }
 
+                ChangeWarningFunc();
+            }
             // 頁面資訊處理
+            ///*
             ProcessPageInfo();
             // 換頁處理
             GetCurrentPage(); //DS60-120 add
             ChangeCurPage();
+
+            changeWarningPriority >= 30 ? changeWarningPriority = 0 : changeWarningPriority++;
+            //*/
             /*
             if (pSysConfig->ShowInformation == YES && pSysInfo->SystemPage == _LCM_VIEW) {
                 InformationShow();
@@ -1298,8 +1351,8 @@ int main(void)
             ChangeToOtherPage(index);
             GetCurrentPage();
             DemoFunction();
-            index >= 34 ? index = 1 : index++;
-            */
+            index >= 36 ? index = 1 : index++;
+            //*/
             usleep(1000000);
 
         }

+ 12 - 4
EVSE/Projects/DD360UCar/Apps/ModuleLcmCtrl/Module_LcmControl.h

@@ -95,14 +95,17 @@
 #define _LeftGun_ConnectorId        0x003F
 #define _RightGun_ConnectorId       0x0041
 
-#define _LeftGun_time_min           0x0043
-#define _LeftGun_time_sec           0x0045
+#define _LeftGun_info_time          0x0043
 #define _LeftGun_info_cap           0x0047
 #define _LeftGun_info_money         0x0049
-#define _RightGun_time_min          0x004B
-#define _RightGun_time_sec          0x004E
+#define _RightGun_info_time         0x004B
 #define _RightGun_info_cap          0x0051
 #define _RightGun_info_money        0x0053
+#define _Icon_Warming0              0x0055
+#define _Icon_Warming1              0x0057
+#define _Icon_Warming2              0x0059
+#define _Icon_Warming3              0x005B
+#define _Icon_Warming4              0x005D
 
 // String Map Address
 #define _LeftGun_location           0x0100
@@ -134,6 +137,11 @@
 #define _Summary_cal_Settlement     0x04B0
 #define _Summary_duration_sec       0x04C0
 #define _QR_CODE_AUTHORIZE          0x04D0
+#define _Text_Warming0              0x1100
+#define _Text_Warming1              0x1110
+#define _Text_Warming2              0x1120
+#define _Text_Warming3              0x1130
+#define _Text_Warming4              0x1140
 
 enum _ICON_LIST_ {
     _ICON_Empty,

BIN
EVSE/Projects/DD360UCar/Images/ramdisk.gz


BIN
EVSE/Projects/DD360UCar/output/Module_LcmControl


BIN
EVSE/Projects/DD360UCar/output/main