|
@@ -31,229 +31,6 @@ static struct ChargingInfoData *pDcChargingInfo = NULL;
|
|
|
static struct ChargingInfoData *pAcChargingInfo = NULL;
|
|
|
static DcCommonInfo *ShmDcCommonData = NULL;
|
|
|
|
|
|
-bool needReloadQr = true;
|
|
|
-bool _saftydetect = false;
|
|
|
-bool _isShow = false; //DS60-120 add
|
|
|
-uint8_t _showInformIndex = 0; //DS60-120 add
|
|
|
-
|
|
|
-int _port;
|
|
|
-//char* pPortName = "/dev/ttyO2";
|
|
|
-char *pPortName = "/dev/ttyS3";
|
|
|
-char *moduleName = "DMT80480T070_09WT";
|
|
|
-uint8_t _totalCount;
|
|
|
-uint8_t acgunCount;
|
|
|
-//struct ChargingInfoData *_chargingInfoData[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
|
|
|
-//struct ChargingInfoData *ac_chargingInfo[AC_QUANTITY];
|
|
|
-
|
|
|
-uint8_t ac_ani_battery_level = _BATTERY_LEVEL_FOR_MAP_LV5;
|
|
|
-uint8_t isDiffStatus = false;
|
|
|
-uint8_t isChangeBattMap = false;
|
|
|
-// 當前選擇的槍號
|
|
|
-#if defined DD360Audi
|
|
|
-short _currentPage = _LCM_SELECT_GUN;
|
|
|
-short _oldPage = _LCM_SELECT_GUN;
|
|
|
-#else
|
|
|
-short _currentPage = _LCM_NONE;
|
|
|
-short _oldPage = _LCM_NONE;
|
|
|
-#endif //defined DD360Audi
|
|
|
-uint8_t _gunIndex = 0;
|
|
|
-bool _wifi_conn_status = false;
|
|
|
-bool _battery_display_ani = false;
|
|
|
-uint8_t _curPage_index = 0;
|
|
|
-bool _page_reload = false;
|
|
|
-
|
|
|
-// LCM - HW
|
|
|
-uint8_t _everyPageRollChange = 0;
|
|
|
-short __logo = 0x0000;
|
|
|
-short __conn_status = 0x0030;
|
|
|
-short __ethernet_status = 0x0032;
|
|
|
-short __3G4G_status = 0x0036;
|
|
|
-short __3G4G_status1 = 0x0037;
|
|
|
-short __3G4G_move_status = 0x0038;
|
|
|
-short __wifi_status = 0x003C;
|
|
|
-
|
|
|
-short __sel_gun_btn = 0x0040;
|
|
|
-short __ret_home_btn = 0x0042;
|
|
|
-short __stop_method_btn = 0x0044;
|
|
|
-short __lcm_version = 0x004A;
|
|
|
-short __qr_code = 0x0250;
|
|
|
-short __main_rfid = 0x0052;
|
|
|
-short __main_qr = 0x0054;
|
|
|
-short __main_app = 0x0056;
|
|
|
-
|
|
|
-short __plug_in_arrow = 0x0060;
|
|
|
-
|
|
|
-short __conn_line = 0x0066;
|
|
|
-
|
|
|
-short __gun_type_index = 0x0070;
|
|
|
-short __cmp_gun_type_index = 0x0080; ////For Audi
|
|
|
-short __batt_map_empty = 0x0090; ////For Audi
|
|
|
-short __qr_code_pre = 0x0280;
|
|
|
-
|
|
|
-short __side_top = 0x0090;
|
|
|
-short __side_down = 0x0092;
|
|
|
-short __side_mid = 0x0094;
|
|
|
-
|
|
|
-short __conn_line_chag = 0x0096;
|
|
|
-short __batt_map = 0x0100;
|
|
|
-short __soc_value_charging = 0x0102;
|
|
|
-short __remain_time_map = 0x0106;
|
|
|
-short __power_map = 0x0108;
|
|
|
-short __energy_map = 0x010A;
|
|
|
-short __remain_time_tx = 0x0110;
|
|
|
-
|
|
|
-short __trp_remain_time_map = 0x0116;
|
|
|
-short __trp_power_map = 0x0118;
|
|
|
-short __trp_energy_map = 0x011A;
|
|
|
-
|
|
|
-short __output_eng_tx = 0x0120;
|
|
|
-short __total_out_eng_tx = 0x0130;
|
|
|
-short __conn_line_comp = 0x0140;
|
|
|
-short __charging_fee_map = 0x0146;
|
|
|
-short __charging_fee_tx = 0x0150;
|
|
|
-
|
|
|
-short __money_by_rate = 0x0200;
|
|
|
-short __money_rate = 0x0220;
|
|
|
-short __money_rate_map = 0x0230;
|
|
|
-
|
|
|
-//DS60-120 add
|
|
|
-short __csu_ver_string = 0x0300;
|
|
|
-short __csu_ver_value = 0x0310;
|
|
|
-short __fan_speed_string = 0x0390;
|
|
|
-short __fan_speed_value = 0x0400;
|
|
|
-
|
|
|
-short __dc1_ver_string = 0x0320;
|
|
|
-short __dc1_ver_value = 0x0330;
|
|
|
-short __dc2_ver_string = 0x0340;
|
|
|
-short __dc2_ver_value = 0x0350;
|
|
|
-short __eth0_ip_string = 0x0360;
|
|
|
-short __eth0_ip_value = 0x0370;
|
|
|
-short __sn_string = 0x0410;
|
|
|
-short __sn_value = 0x0420;
|
|
|
-
|
|
|
-//For Audi, for select gun
|
|
|
-short __left_gun_map = 0x0260;
|
|
|
-short __right_gun_map = 0x0262;
|
|
|
-short __add_chk_btn = 0x0264;
|
|
|
-//short __station_id = 0x0270;
|
|
|
-short __balance = 0x0270;
|
|
|
-short __remain_balance = 0x0280;
|
|
|
-short __custStationIdL1 = 0x0450;
|
|
|
-//short __custStationIdL2 = 0x0470;
|
|
|
-short _emergency_map = 0x011C;
|
|
|
-short __logo_cmp = 0x014A;
|
|
|
-// ICON ID
|
|
|
-uint8_t _disappear = 0;
|
|
|
-uint8_t _disconnect = 1;
|
|
|
-uint8_t _connect = 2;
|
|
|
-uint8_t _warning = 3;
|
|
|
-uint8_t _arrow_dark = 4;
|
|
|
-uint8_t _arrow_light = 5;
|
|
|
-uint8_t _3G4G_disconnect = 6;
|
|
|
-uint8_t __3G4G_connect = 7;
|
|
|
-uint8_t _wifi_disconnect = 8;
|
|
|
-uint8_t _wifi_connect = 9;
|
|
|
-uint8_t _logo = 10;
|
|
|
-uint8_t _conn_map1 = 11;
|
|
|
-uint8_t _conn_map2 = 12;
|
|
|
-uint8_t _sel_gun_btn = 13;
|
|
|
-uint8_t _back_home_btn = 14;
|
|
|
-uint8_t _stop_charging_btn = 15;
|
|
|
-uint8_t _stop_charging_btn_scan = 16;
|
|
|
-uint8_t _chademo_dark = 17;
|
|
|
-uint8_t _ccs_dark = 18;
|
|
|
-uint8_t _gbt_dark = 19;
|
|
|
-uint8_t _actype_dark = 20;
|
|
|
-uint8_t _chademo_light = 21;
|
|
|
-uint8_t _ccs_light = 22;
|
|
|
-uint8_t _gbt_light = 23;
|
|
|
-uint8_t _actype_light = 24;
|
|
|
-uint8_t _main_none_rfid = 25;
|
|
|
-uint8_t _main_rfid = 26;
|
|
|
-uint8_t _main_none_app = 27;
|
|
|
-uint8_t _main_app = 28;
|
|
|
-uint8_t _main_none_qr = 29;
|
|
|
-uint8_t _main_qr = 30;
|
|
|
-uint8_t _charging_map1 = 31;
|
|
|
-uint8_t _charging_map2 = 32;
|
|
|
-uint8_t _battery_empty = 33;
|
|
|
-uint8_t _battery_cap_20 = 34;
|
|
|
-uint8_t _battery_cap_40 = 35;
|
|
|
-uint8_t _battery_cap_60 = 36;
|
|
|
-uint8_t _battery_cap_80 = 37;
|
|
|
-uint8_t _battery_cap_100 = 38;
|
|
|
-uint8_t _battery_map = 39;
|
|
|
-uint8_t _power_map = 40;
|
|
|
-uint8_t _time_map = 41;
|
|
|
-uint8_t _complete_map = 42;
|
|
|
-uint8_t _battery_soc_20 = 43;
|
|
|
-uint8_t _battery_soc_40 = 44;
|
|
|
-uint8_t _battery_soc_60 = 45;
|
|
|
-uint8_t _battery_soc_80 = 46;
|
|
|
-uint8_t _battery_soc_100 = 47;
|
|
|
-uint8_t _battery_eng_map = 48;
|
|
|
-uint8_t _money_map = 49;
|
|
|
-uint8_t _elapse_time_map = 50;
|
|
|
-uint8_t _charging_money = 51;
|
|
|
-//uint8_t _side_none_rfid = 52;
|
|
|
-//uint8_t _side_rfid = 53;
|
|
|
-//uint8_t _side_none_app = 54;
|
|
|
-//uint8_t _side_app = 55;
|
|
|
-//uint8_t _side_none_qr = 56;
|
|
|
-//uint8_t _side_qr = 57;
|
|
|
-uint8_t _eth_disconnect = 52; //58;
|
|
|
-uint8_t _eth_connect = 53; //59;
|
|
|
-
|
|
|
-uint8_t _chademo_dark_cmp = 54;
|
|
|
-uint8_t _ccs_dark_cmp = 55;
|
|
|
-uint8_t _gbt_dark_cmp = 56;
|
|
|
-uint8_t _actype_dark_cmp = 57;
|
|
|
-uint8_t _chademo_light_cmp = 58;
|
|
|
-uint8_t _ccs_light_cmp = 59;
|
|
|
-uint8_t _gbt_light_cmp = 60;
|
|
|
-uint8_t _actype_light_cmp = 61;
|
|
|
-
|
|
|
-uint8_t _logo_cmp = 62;
|
|
|
-uint8_t _battery_eng_trp_map = 63;
|
|
|
-uint8_t _money_trp_map = 64;
|
|
|
-uint8_t _elapse_time_trp_map = 65;
|
|
|
-#if defined DD360Audi
|
|
|
-////For Audi
|
|
|
-uint8_t _left_gun_disable_map = 66;
|
|
|
-uint8_t _left_gun_enable_map = 67;
|
|
|
-uint8_t _right_gun_disable_map = 68;
|
|
|
-uint8_t _right_gun_enable_map = 69;
|
|
|
-uint8_t _select_gun_btn = 70;
|
|
|
-uint8_t _emergency_disable_map = 72;
|
|
|
-// For replug
|
|
|
-struct timespec showReplugStrTimer;
|
|
|
-struct timespec showFullTargetTimer;
|
|
|
-short __show_StatusString_value_1 = 0x0460;
|
|
|
-short __show_StatusString_value_2 = 0x0462;
|
|
|
-uint8_t _showfulltarget_1 = 73;
|
|
|
-uint8_t _showfulltarget_2 = 74;
|
|
|
-uint8_t _showReplugStr_1 = 75;
|
|
|
-uint8_t _showReplugStr_2 = 76;
|
|
|
-// Select Gun for Audi
|
|
|
-short __show_selectgun_value = 0x0464;
|
|
|
-uint8_t _showselectgun_left = 77;
|
|
|
-uint8_t _showselectgun_right = 78;
|
|
|
-// Wait for gun plugin Audi
|
|
|
-short __show_waitgunplug_value = 0x0468;
|
|
|
-uint8_t _showwaitgunplug_left = 80;
|
|
|
-uint8_t _showwaitgunplug_right = 81;
|
|
|
-#else
|
|
|
-short __show_handshark_value = 0x0464;
|
|
|
-short __show_GFD_value = 0x0466;
|
|
|
-short __show_precharge_value = 0x0468;
|
|
|
-
|
|
|
-uint8_t _show_handshark_dark = 67;
|
|
|
-uint8_t _show_handshark_light = 68;
|
|
|
-uint8_t _show_GFD_dark = 69;
|
|
|
-uint8_t _show_GFD_light = 70;
|
|
|
-uint8_t _show_precharge_dark = 71;
|
|
|
-uint8_t _show_precharge_light = 72;
|
|
|
-#endif
|
|
|
//#define log_info(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
|
|
|
//#define log_warn(format, args...) StoreLogMsg("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
|
|
|
//#define log_error(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
|
|
@@ -432,8 +209,8 @@ void ReadMsgFromLcm(uint8_t *msg, uint8_t readLen)
|
|
|
{
|
|
|
if(strcmp((char *)pSysInfo->LcmHwRev, "") != EQUAL)
|
|
|
strcpy((char *)pSysInfo->LcmHwRev, moduleName);
|
|
|
-
|
|
|
- ShmDcCommonData->LcmFwVersion = atoi((char *)(msg + 7));
|
|
|
+ if (atoi((char*)(msg + 7)) != 0)
|
|
|
+ ShmDcCommonData->LcmFwVersion = atoi((char*)(msg + 7));
|
|
|
//printf("msg = %d \n", ShmDcCommonData->LcmFwVersion);
|
|
|
// printf("msg = %x \n", *(msg + 7));
|
|
|
// printf("msg = %x \n", *(msg + 8));
|
|
@@ -521,7 +298,25 @@ void DisplayValueToLcm(short address, uint8_t *data, uint8_t len)
|
|
|
|
|
|
WriteCmdToLcm(cmd, cmd[2] + 3);
|
|
|
}
|
|
|
+void DisplayFeeValueToLcm(short address, uint8_t* data, uint8_t len)
|
|
|
+{
|
|
|
+ uint8_t cmd[256];
|
|
|
+ memset(cmd, 0x00, sizeof(cmd));
|
|
|
|
|
|
+ cmd[0] = CMD_TITLE_1;
|
|
|
+ cmd[1] = CMD_TITLE_2;
|
|
|
+ cmd[2] = 0x03 + len;
|
|
|
+ cmd[3] = CMD_MULTI_WRITE;
|
|
|
+ cmd[4] = address >> 8;
|
|
|
+ cmd[5] = address & 0x00FF;
|
|
|
+
|
|
|
+ for (uint8_t count = 0; count < len; count++)
|
|
|
+ {
|
|
|
+ cmd[12 + count] = *(data + count);
|
|
|
+ }
|
|
|
+
|
|
|
+ WriteCmdToLcm(cmd, cmd[2] + 3);
|
|
|
+}
|
|
|
void ChangeDisplay2Value(short address, short value)
|
|
|
{
|
|
|
uint8_t data[2];
|
|
@@ -579,7 +374,7 @@ void ChangeWarningFunc()
|
|
|
//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]);
|
|
|
+ //log_info("Warming Code[%d]:%s",i,&pSysWarning->WarningCode[i][0]);
|
|
|
memset(cmd, 0x00, sizeof(cmd));
|
|
|
if ((i) >= 5) {
|
|
|
break;
|
|
@@ -840,6 +635,7 @@ uint8_t demoCount = 0;
|
|
|
void DemoFunction()
|
|
|
{
|
|
|
if (demoCount == 0) {
|
|
|
+ /*
|
|
|
pSysWarning->WarningCount = 6;
|
|
|
memcpy(&pSysWarning->WarningCode[0][0], "000001", 7);
|
|
|
memcpy(&pSysWarning->WarningCode[1][0], "000002", 7);
|
|
@@ -847,24 +643,38 @@ void DemoFunction()
|
|
|
memcpy(&pSysWarning->WarningCode[3][0], "000004", 7);
|
|
|
memcpy(&pSysWarning->WarningCode[4][0], "000005", 7);
|
|
|
memcpy(&pSysWarning->WarningCode[5][0], "000006", 7);
|
|
|
+ */
|
|
|
} else {
|
|
|
if (demoCount == 20) {
|
|
|
pSysInfo->PageIndex = _LCM_IDLE;
|
|
|
- } else if (demoCount == 80) {
|
|
|
+ /*
|
|
|
+ } else if (demoCount == 60) {
|
|
|
pSysInfo->PageIndex = _LCM_AUTHORIZING;
|
|
|
- } else if (demoCount == 100) {
|
|
|
+ } else if (demoCount == 80) {
|
|
|
pSysInfo->PageIndex = _LCM_AUTHORIZ_COMP;
|
|
|
- } else if (demoCount == 120) {
|
|
|
+ } else if (demoCount == 100) {
|
|
|
pSysInfo->PageIndex = _LCM_AUTHORIZ_FAIL;
|
|
|
- } else if (demoCount == 140) {
|
|
|
+ */
|
|
|
+ } else if (demoCount == 60) {
|
|
|
pSysInfo->PageIndex = _LCM_PRE_CHARGE;
|
|
|
- } else if (demoCount == 180) {
|
|
|
+ } else if (demoCount == 100) {
|
|
|
pSysInfo->PageIndex = _LCM_CHARGING;
|
|
|
+ } else if (demoCount == 160) {
|
|
|
+ pSysInfo->PageIndex = _LCM_COMPLETE;
|
|
|
}
|
|
|
}
|
|
|
+ pSysInfo->CurGunSelected = LEFT_GUN_NUM;
|
|
|
+ sprintf((char*)ShmDcCommonData->QRCodeString, "%s", pSysConfig->SystemId);
|
|
|
|
|
|
- if (demoCount < 180) {
|
|
|
+ sprintf((char*)ShmDcCommonData->pGunInfo[LEFT_GUN_NUM].ReceiptInfo, "%s", pSysConfig->SystemId);
|
|
|
+ pSysConfig->BillingData.isBilling = 1;
|
|
|
+ sprintf((char*)ShmDcCommonData->DefaultPriceString, "AM10:~10:00:$ 2, AM10:00~PM05:00:$ 3, PM05:00~AM00:00:$ 2");
|
|
|
+
|
|
|
+
|
|
|
+ if (demoCount <= 200) {
|
|
|
demoCount++;
|
|
|
+ } else {
|
|
|
+ demoCount = 0;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1117,6 +927,7 @@ void ChangeRemainTime(int sec)
|
|
|
s = (sec - (3600 * h) - (m * 60));
|
|
|
sprintf((char *)value, "%02d:%02d:%02d", h, m, s);
|
|
|
string2ByteArray(value, cmd);
|
|
|
+
|
|
|
DisplayValueToLcm(__remain_time_tx, cmd, sizeof(cmd));
|
|
|
}
|
|
|
|
|
@@ -1126,12 +937,10 @@ void ChangeChargingEnergyValue(float energy)
|
|
|
uint8_t value[10];
|
|
|
|
|
|
memset(cmd, 0x00, sizeof(cmd));
|
|
|
- if (energy >= 0.05) {
|
|
|
- energy -= 0.05;
|
|
|
- }
|
|
|
- sprintf((char *) value, "%.1f kWh", energy);
|
|
|
+
|
|
|
+ sprintf((char*)value, "%.4f kWh", energy);
|
|
|
string2ByteArray(value, cmd);
|
|
|
- DisplayValueToLcm(__total_out_eng_tx, cmd, sizeof(cmd));
|
|
|
+ DisplayValueToLcm(__present_energy, cmd, sizeof(cmd));
|
|
|
}
|
|
|
|
|
|
void ChangeChargingPowerValue(float pow)
|
|
@@ -1146,7 +955,7 @@ void ChangeChargingPowerValue(float pow)
|
|
|
// pow = (max - min) * rand() / (RAND_MAX + 1.0) + min;
|
|
|
sprintf((char *) value, "%.1f kW", pow);
|
|
|
string2ByteArray(value, cmd);
|
|
|
- DisplayValueToLcm(__output_eng_tx, cmd, sizeof(cmd));
|
|
|
+ DisplayValueToLcm(__present_power, cmd, sizeof(cmd));
|
|
|
}
|
|
|
|
|
|
void ChangeChargingFeeValue(float fee)
|
|
@@ -1161,6 +970,62 @@ void ChangeChargingFeeValue(float fee)
|
|
|
DisplayValueToLcm(__charging_fee_tx, cmd, sizeof(cmd));
|
|
|
}
|
|
|
|
|
|
+void ChangeEnergyCostValue(float fee,int page)
|
|
|
+{
|
|
|
+ uint8_t cmd[10];
|
|
|
+ uint8_t value[10];
|
|
|
+
|
|
|
+ memset(cmd, 0x00, sizeof(cmd));
|
|
|
+ if (fee >= 0 )
|
|
|
+ sprintf((char*)value, "$ %.2f", fee);
|
|
|
+ else
|
|
|
+ sprintf((char*)value, "--");
|
|
|
+ string2ByteArray(value, cmd);
|
|
|
+ if (page == _LCM_CHARGING)
|
|
|
+ DisplayValueToLcm(__Charge_EnergyCost, cmd, sizeof(cmd));
|
|
|
+ else if (page == _LCM_COMPLETE)
|
|
|
+ DisplayValueToLcm(__Complete_EnergyCost, cmd, sizeof(cmd));
|
|
|
+ else if (page == _LCM_PRE_CHARGE)
|
|
|
+ DisplayValueToLcm(__Prepare_EnergyCost, cmd, sizeof(cmd));
|
|
|
+}
|
|
|
+void ChangeParkingFeeValue(float fee,int page)
|
|
|
+{
|
|
|
+ uint8_t cmd[10];
|
|
|
+ uint8_t value[10];
|
|
|
+
|
|
|
+ memset(cmd, 0x00, sizeof(cmd));
|
|
|
+
|
|
|
+ if (fee >= 0)
|
|
|
+ sprintf((char*)value, "$ %.2f", fee);
|
|
|
+ else
|
|
|
+ sprintf((char*)value, "--");
|
|
|
+ string2ByteArray(value, cmd);
|
|
|
+
|
|
|
+ if (page == _LCM_CHARGING)
|
|
|
+ DisplayValueToLcm(__Charge_ParkingFee, cmd, sizeof(cmd));
|
|
|
+ else if (page == _LCM_COMPLETE)
|
|
|
+ DisplayValueToLcm(__Complete_ParkingFee, cmd, sizeof(cmd));
|
|
|
+ else if (page == _LCM_PRE_CHARGE)
|
|
|
+ DisplayValueToLcm(__Prepare_ParkingFee, cmd, sizeof(cmd));
|
|
|
+}
|
|
|
+void ChangeTotalCostValue(float fee,int page)
|
|
|
+{
|
|
|
+ uint8_t cmd[10];
|
|
|
+ uint8_t value[10];
|
|
|
+
|
|
|
+ memset(cmd, 0x00, sizeof(cmd));
|
|
|
+
|
|
|
+ if (fee >= 0)
|
|
|
+ sprintf((char*)value, "$ %.2f", fee);
|
|
|
+ else
|
|
|
+ sprintf((char*)value, "--");
|
|
|
+
|
|
|
+ string2ByteArray(value, cmd);
|
|
|
+ if (page == _LCM_CHARGING)
|
|
|
+ DisplayValueToLcm(__Charge_TotalCost, cmd, sizeof(cmd));
|
|
|
+ else if (page == _LCM_COMPLETE)
|
|
|
+ DisplayValueToLcm(__Complete_TotalCost, cmd, sizeof(cmd));
|
|
|
+}
|
|
|
void DisplayMoneyRate(float money)
|
|
|
{
|
|
|
uint8_t cmd[8];
|
|
@@ -1186,6 +1051,13 @@ void DisplayMoneyCur(uint8_t *cur)
|
|
|
string2ByteArray(buf, cmd);
|
|
|
DisplayValueToLcm(__money_rate, cmd, sizeof(cmd));
|
|
|
}
|
|
|
+void DisplayReceipt(char* pString)
|
|
|
+{
|
|
|
+ char data[200];
|
|
|
+ memset(data, '\0', sizeof(data));
|
|
|
+ strcpy(data, pString);
|
|
|
+ DisplayValueToLcm(__Receipt_value, data, 200);
|
|
|
+}
|
|
|
|
|
|
void RefreshPageAnimation(uint8_t value)
|
|
|
{
|
|
@@ -1579,6 +1451,29 @@ void DisplayInfoEthIp(bool isShow, uint8_t *ip)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void DisplayInfoConsumption(bool isShow)
|
|
|
+{
|
|
|
+ float data = 0;
|
|
|
+ if (isShow) {
|
|
|
+ uint8_t value[20];
|
|
|
+
|
|
|
+ memset(value, 0x00, sizeof(value));
|
|
|
+ strcpy((char*)value, "CSPT >");
|
|
|
+ DisplayValueToLcm(__eth0_ip_string, value, sizeof(value));
|
|
|
+ memset(value, 0x00, sizeof(value));
|
|
|
+ data = ShmDcCommonData->pConsumption.Gun1_Consumption +
|
|
|
+ ShmDcCommonData->pConsumption.Gun2_Consumption +
|
|
|
+ ShmDcCommonData->pConsumption.Gun3_Consumption +
|
|
|
+ ShmDcCommonData->pConsumption.Gun4_Consumption;
|
|
|
+
|
|
|
+ sprintf((char*)value,"%.4f",data);
|
|
|
+
|
|
|
+ DisplayValueToLcm(__eth0_ip_value, value, sizeof(value));
|
|
|
+ } else {
|
|
|
+ ChangeDisplay2Value(__eth0_ip_string, _disappear);
|
|
|
+ ChangeDisplay2Value(__eth0_ip_value, _disappear);
|
|
|
+ }
|
|
|
+}
|
|
|
void Show4GRssi(bool isShow, int dbValue)
|
|
|
{
|
|
|
if (isShow) {
|
|
@@ -1745,8 +1640,7 @@ void InformationShow()
|
|
|
DisplayInfoCsuVer(show, pSysInfo->CsuRootFsFwRev);
|
|
|
DisplayInfoSpeed(show, pSysInfo->SystemFanRotaSpeed);
|
|
|
DisplayInfoSN(show, pSysConfig->SerialNumber);
|
|
|
-
|
|
|
- DisplayInfoEthIp(show, pSysConfig->Eth0Interface.EthIpAddress);
|
|
|
+ DisplayInfoConsumption(show);
|
|
|
DisplayInfoGun1Ver(show, pSysInfo->Connector1FwRev);
|
|
|
if (_totalCount > 1) {
|
|
|
DisplayInfoGun2Ver(show, pSysInfo->Connector2FwRev);
|
|
@@ -1808,14 +1702,59 @@ void ChangeTimeValue(uint8_t time)
|
|
|
string2ByteArray(value, cmd);
|
|
|
DisplayValueToLcm(0x1290, cmd, sizeof(cmd));
|
|
|
}
|
|
|
+void ShowDateTime()
|
|
|
+{
|
|
|
+ struct timeb SeqEndTime;
|
|
|
+ struct tm* tm;
|
|
|
+ char _date[20];
|
|
|
+ char _time[20];
|
|
|
+ char _am_pm[10];
|
|
|
|
|
|
+ ftime(&SeqEndTime);
|
|
|
+ SeqEndTime.time = time(NULL);
|
|
|
+
|
|
|
+ tm = localtime(&SeqEndTime.time);
|
|
|
+
|
|
|
+ sprintf(_date, "%04d/%02d/%02d",
|
|
|
+ tm->tm_year + 1900,
|
|
|
+ tm->tm_mon + 1,
|
|
|
+ tm->tm_mday);
|
|
|
+
|
|
|
+ if (tm->tm_hour >= 12) {
|
|
|
+ sprintf(_am_pm,"p.m.");
|
|
|
+ sprintf(_time, "%02d:%02d",
|
|
|
+ tm->tm_hour-12,
|
|
|
+ tm->tm_min);
|
|
|
+ } else {
|
|
|
+ sprintf(_am_pm, "a.m.");
|
|
|
+ sprintf(_time, "%02d:%02d",
|
|
|
+ tm->tm_hour,
|
|
|
+ tm->tm_min);
|
|
|
+ }
|
|
|
+ DisplayValueToLcm(__date_map, _date, strlen(_date)+1);
|
|
|
+ DisplayValueToLcm(__time_map, _time, strlen(_time)+1);
|
|
|
+ DisplayValueToLcm(__time_am_pm, _am_pm, strlen(_am_pm)+1);
|
|
|
+}
|
|
|
+uint8_t old_string[255];
|
|
|
+void ShowAnimationPrice(char* pString)
|
|
|
+{
|
|
|
+ uint8_t cmd[230];
|
|
|
+ memset(cmd, 0x00, sizeof(cmd));
|
|
|
+ string2ByteArray((uint8_t*)pString,cmd);
|
|
|
+ int len = strlen(pString);
|
|
|
+ if (len <= 0)
|
|
|
+ return;
|
|
|
+ if (strcmp((char*)old_string, pString) != EQUAL) {
|
|
|
+ strcpy((char*)old_string, pString);
|
|
|
+ DisplayFeeValueToLcm(__Animation_Price, cmd, sizeof(cmd));
|
|
|
+ }
|
|
|
+}
|
|
|
void ProcessPageInfo()
|
|
|
{
|
|
|
_page_reload = IsPageReloadChk();
|
|
|
pAcChargingInfo = (struct ChargingInfoData *)GetAcChargingInfoData(0);
|
|
|
struct InfoCodeData *pInfoCode = (struct InfoCodeData *)GetShmInfoCodeData();
|
|
|
struct AlarmCodeData *pAlarmCode = (struct AlarmCodeData *)GetShmAlarmCodeData();
|
|
|
- uint8_t i;
|
|
|
|
|
|
// 隨插即充 - 可省略該按鈕 //DS60-120 add
|
|
|
if (pSysConfig->AuthorisationMode == AUTH_MODE_ENABLE) {
|
|
@@ -1827,6 +1766,9 @@ void ProcessPageInfo()
|
|
|
}
|
|
|
}
|
|
|
showPhihongLogo(false);
|
|
|
+ // Show Time
|
|
|
+ ShowDateTime();
|
|
|
+
|
|
|
switch (_currentPage) {
|
|
|
#if defined DD360Audi
|
|
|
case _LCM_SELECT_GUN: ////For Audi
|
|
@@ -1842,7 +1784,7 @@ void ProcessPageInfo()
|
|
|
#endif //defined DD360Audi
|
|
|
|
|
|
case _LCM_IDLE: {
|
|
|
-
|
|
|
+ ChangeDisplayMoneyInfo();
|
|
|
if (pSysConfig->isRFID) {
|
|
|
ChangeDisplay2Value(__main_rfid, _main_rfid);
|
|
|
} else {
|
|
@@ -1871,6 +1813,8 @@ void ProcessPageInfo()
|
|
|
//if (FirstPageChanged() == YES || needReloadQr || _page_reload) {
|
|
|
if (pSysConfig->isQRCode) {
|
|
|
needReloadQr = false;
|
|
|
+ ChangeQrCode_Idle((char*)ShmDcCommonData->QRCodeString);
|
|
|
+ /*
|
|
|
if (pSysConfig->QRCodeMadeMode == NO) {
|
|
|
//uint8_t len = strlen((char *)pSysConfig->SystemId);
|
|
|
ChangeQrCode_Idle((char *)pSysConfig->SystemId);
|
|
@@ -1879,6 +1823,7 @@ void ProcessPageInfo()
|
|
|
ChangeQrCode_Idle((char *)pSysConfig->QRCodeContent);
|
|
|
}
|
|
|
//ChangeQrCode_Idle((char *)pSysConfig->SystemId);
|
|
|
+ */
|
|
|
}
|
|
|
//}
|
|
|
|
|
@@ -1979,7 +1924,7 @@ void ProcessPageInfo()
|
|
|
ChangeChargingPowerValue(0);
|
|
|
}
|
|
|
|
|
|
- if (pAcChargingInfo->PresentChargedEnergy >= 0.1 &&
|
|
|
+ if (pAcChargingInfo->PresentChargedEnergy > 0 &&
|
|
|
pAcChargingInfo->PresentChargedEnergy <= ENERGY_MAX_KWH) {
|
|
|
ChangeChargingEnergyValue(pAcChargingInfo->PresentChargedEnergy);
|
|
|
} else {
|
|
@@ -2008,7 +1953,7 @@ void ProcessPageInfo()
|
|
|
ChangeChargingPowerValue(0);
|
|
|
}
|
|
|
|
|
|
- if (pAcChargingInfo->PresentChargedEnergy >= 0.1 &&
|
|
|
+ if (pAcChargingInfo->PresentChargedEnergy > 0 &&
|
|
|
pAcChargingInfo->PresentChargedEnergy <= ENERGY_MAX_KWH) {
|
|
|
ChangeChargingEnergyValue(pAcChargingInfo->PresentChargedEnergy);
|
|
|
|
|
@@ -2047,6 +1992,8 @@ void ProcessPageInfo()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ ChangeDisplay2Value(__money_by_rate, _disappear);
|
|
|
+
|
|
|
gunTargetIndex = 0; //DS60-120 add
|
|
|
for (uint8_t i = 0; i < _totalCount; i++) {
|
|
|
if (_totalCount == 1 && acgunCount <= 0) { //DS60-120 add
|
|
@@ -2111,54 +2058,14 @@ void ProcessPageInfo()
|
|
|
if (_currentPage == _LCM_PRE_CHARGE && !isShowAc) {
|
|
|
if (pSysInfo->CurGunSelected == i) {
|
|
|
ChangeBattMapAndValue(_currentPage, pDcChargingInfo->EvBatterySoc);
|
|
|
- uint8_t precharg_time = (GetPreChargeTimeoutValue(pDcChargingInfo->PreChargeTimer)/1) / uSEC_VAL;
|
|
|
- if (precharg_time > PRECHARGING_TTIMEOUT)
|
|
|
- precharg_time = PRECHARGING_TTIMEOUT;
|
|
|
- ChangeTimeValue(PRECHARGING_TTIMEOUT- precharg_time);
|
|
|
-
|
|
|
- if (pDcChargingInfo->SystemStatus >= S_REASSIGN_CHECK &&
|
|
|
- pDcChargingInfo->SystemStatus <= S_PREPARING_FOR_EV) {
|
|
|
- pDcChargingInfo->_SaftyDetect = false;
|
|
|
- ChangeDisplay2Value(__show_handshark_value, _show_handshark_light);
|
|
|
- ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
|
|
|
- ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
|
|
|
-
|
|
|
- } else if (pDcChargingInfo->SystemStatus == S_PREPARING_FOR_EVSE) {
|
|
|
- if (pDcChargingInfo->Type == _Type_Chademo || pDcChargingInfo->Type == _Type_GB) {
|
|
|
- if (pDcChargingInfo->_SaftyDetect == false ) {
|
|
|
- ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
|
|
|
- ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
|
|
|
- ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
|
|
|
- if (pDcChargingInfo->EvBatterytargetVoltage == 0)
|
|
|
- pDcChargingInfo->_SaftyDetect = true;
|
|
|
- } else {
|
|
|
- ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
|
|
|
- ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
|
|
|
- ChangeDisplay2Value(__show_precharge_value, _show_precharge_light);
|
|
|
- }
|
|
|
- } else {
|
|
|
- ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
|
|
|
- ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
|
|
|
- ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
|
|
|
- }
|
|
|
- } else if (pDcChargingInfo->SystemStatus == S_CCS_PRECHARGE_ST0 ||
|
|
|
- pDcChargingInfo->SystemStatus == S_CCS_PRECHARGE_ST1) {
|
|
|
- if (pDcChargingInfo->_SaftyDetect == false ) {
|
|
|
- ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
|
|
|
- ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
|
|
|
- ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
|
|
|
- if (pDcChargingInfo->EvBatterytargetVoltage == 0)
|
|
|
- pDcChargingInfo->_SaftyDetect = true;
|
|
|
- } else {
|
|
|
- ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
|
|
|
- ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
|
|
|
- ChangeDisplay2Value(__show_precharge_value, _show_precharge_light);
|
|
|
- }
|
|
|
- } else {
|
|
|
- ChangeDisplay2Value(__show_handshark_value, _disappear);
|
|
|
- ChangeDisplay2Value(__show_GFD_value, _disappear);
|
|
|
- ChangeDisplay2Value(__show_precharge_value, _disappear);
|
|
|
- }
|
|
|
+ // EnergyCost
|
|
|
+ ChangeEnergyCostValue(ShmSelectGunInfo->PricesInfo[i].EnergyCost, _currentPage);
|
|
|
+ // Parking Fee
|
|
|
+ ChangeParkingFeeValue(ShmSelectGunInfo->PricesInfo[i].ParkingFee, _currentPage);
|
|
|
+ // Total Cost
|
|
|
+ ChangeTotalCostValue(pDcChargingInfo->ChargingFee, _currentPage);
|
|
|
+
|
|
|
+ ShowAnimationPrice(ShmDcCommonData->pGunInfo[i].UserPriceString);
|
|
|
}
|
|
|
} else if (_currentPage == _LCM_CHARGING && !isShowAc) {
|
|
|
if (pSysInfo->CurGunSelected == i) {
|
|
@@ -2177,7 +2084,7 @@ void ProcessPageInfo()
|
|
|
ChangeChargingPowerValue(0);
|
|
|
}
|
|
|
|
|
|
- if (pDcChargingInfo->PresentChargedEnergy >= 0.1 &&
|
|
|
+ if (pDcChargingInfo->PresentChargedEnergy > 0 &&
|
|
|
pDcChargingInfo->PresentChargedEnergy <= ENERGY_MAX_KWH) {
|
|
|
ChangeChargingEnergyValue(pDcChargingInfo->PresentChargedEnergy);
|
|
|
} else {
|
|
@@ -2190,6 +2097,17 @@ void ProcessPageInfo()
|
|
|
} else {
|
|
|
ChangeDisplay2Value(__stop_method_btn, _stop_charging_btn_scan);
|
|
|
}
|
|
|
+ /////////////////////// CTEP Add ///////////////////////
|
|
|
+ // EnergyCost
|
|
|
+ ChangeEnergyCostValue(ShmSelectGunInfo->PricesInfo[i].EnergyCost, _currentPage);
|
|
|
+ // Parking Fee
|
|
|
+ ChangeParkingFeeValue(ShmSelectGunInfo->PricesInfo[i].ParkingFee, _currentPage);
|
|
|
+ // Total Cost
|
|
|
+ if (pDcChargingInfo->ChargingFee > 0) {
|
|
|
+ ChangeTotalCostValue(pDcChargingInfo->ChargingFee, _currentPage);
|
|
|
+ }
|
|
|
+
|
|
|
+ ShowAnimationPrice(ShmDcCommonData->pGunInfo[i].UserPriceString);
|
|
|
}
|
|
|
} else if (_currentPage == _LCM_COMPLETE && !isShowAc) {
|
|
|
if (pSysInfo->CurGunSelected == i) {
|
|
@@ -2207,8 +2125,9 @@ void ProcessPageInfo()
|
|
|
} else {
|
|
|
ChangeChargingPowerValue(0);
|
|
|
}
|
|
|
+
|
|
|
#if 1
|
|
|
- if (pDcChargingInfo->PresentChargedEnergy >= 0.1 &&
|
|
|
+ if (pDcChargingInfo->PresentChargedEnergy > 0 &&
|
|
|
pDcChargingInfo->PresentChargedEnergy <= ENERGY_MAX_KWH) {
|
|
|
ChangeChargingEnergyValue(pDcChargingInfo->PresentChargedEnergy);
|
|
|
|
|
@@ -2224,6 +2143,23 @@ void ProcessPageInfo()
|
|
|
ChangeBalanceValue(__remain_balance, i);
|
|
|
}
|
|
|
}
|
|
|
+ /////////////////////// CTEP Add ///////////////////////
|
|
|
+ if (strlen((char*)ShmDcCommonData->pGunInfo[i].ReceiptInfo) > 0) {
|
|
|
+ DisplayReceipt(ShmDcCommonData->pGunInfo[i].ReceiptInfo);
|
|
|
+ ChangeDisplay2Value(__receipt_backgroud, _receipt_bk);
|
|
|
+ } else {
|
|
|
+ DisplayReceipt("");
|
|
|
+ ChangeDisplay2Value(__receipt_backgroud, _disappear);
|
|
|
+ }
|
|
|
+ // EnergyCost
|
|
|
+ ChangeEnergyCostValue(ShmSelectGunInfo->PricesInfo[i].EnergyCost, _currentPage);
|
|
|
+ // Parking Fee
|
|
|
+ ChangeParkingFeeValue(ShmSelectGunInfo->PricesInfo[i].ParkingFee, _currentPage);
|
|
|
+ // Total Cost
|
|
|
+ if (pDcChargingInfo->ChargingFee >= 0) {
|
|
|
+ ChangeTotalCostValue(pDcChargingInfo->ChargingFee, _currentPage);
|
|
|
+ }
|
|
|
+
|
|
|
#else
|
|
|
ChangeChargingEnergyValue(pDcChargingInfo->PresentChargedEnergy);
|
|
|
|
|
@@ -2274,6 +2210,8 @@ void ProcessPageInfo()
|
|
|
if (pSysConfig->isQRCode) {
|
|
|
needReloadQr = false;
|
|
|
//ChangeQrCode_Charge((char *)pSysConfig->SystemId); //DS60-120 remove
|
|
|
+ ChangeQrCode_Charge((char*)ShmDcCommonData->QRCodeString);
|
|
|
+ /*
|
|
|
if (pSysConfig->QRCodeMadeMode == NO) {
|
|
|
//uint8_t len = strlen((char *)pSysConfig->SystemId);
|
|
|
ChangeQrCode_Charge((char *)pSysConfig->SystemId);
|
|
@@ -2281,6 +2219,7 @@ void ProcessPageInfo()
|
|
|
//uint8_t len = strlen((char *)pSysConfig->QRCodeContent);
|
|
|
ChangeQrCode_Charge((char *)pSysConfig->QRCodeContent);
|
|
|
}
|
|
|
+ */
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -2302,6 +2241,11 @@ void ProcessPageInfo()
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+#else
|
|
|
+ if (ShmPrimaryMcuData->InputDet.bits.EmergencyButton == 1) {
|
|
|
+ ChangeToOtherPage(_LCM_EMERGENCY);
|
|
|
+ break;
|
|
|
+ }
|
|
|
#endif
|
|
|
|
|
|
break;
|
|
@@ -2325,10 +2269,11 @@ void ChangeDisplayMoneyInfo()
|
|
|
DisplayMoneyRate(ShmSelectGunInfo->PricesInfo[curGun].UserPrices);
|
|
|
} else {
|
|
|
#endif //defined DD360Audi
|
|
|
- if (tmCSU->tm_hour <= 23) {
|
|
|
- pSysConfig->BillingData.Cur_fee = pSysConfig->BillingData.Fee[tmCSU->tm_hour];
|
|
|
- DisplayMoneyRate(pSysConfig->BillingData.Cur_fee);
|
|
|
- }
|
|
|
+
|
|
|
+ pSysConfig->BillingData.Cur_fee = pSysConfig->BillingData.Fee[tmCSU->tm_hour];
|
|
|
+ ChangeDisplay2Value(__money_by_rate, _disappear);
|
|
|
+ ShowAnimationPrice(ShmDcCommonData->DefaultPriceString);
|
|
|
+
|
|
|
|
|
|
if (pSysConfig->BillingData.Currency <= 53) {
|
|
|
DisplayMoneyCur((uint8_t *)GetCurrency(pSysConfig->BillingData.Currency));
|
|
@@ -2390,6 +2335,7 @@ void DefaultIconStatus()
|
|
|
for (uint8_t i = 0; i < 3; i++) {
|
|
|
ChangeDisplay2Value(__gun_type_index + (i * 2), _disappear);
|
|
|
}
|
|
|
+ ChangeDisplay2Value(__sel_gun_btn, _disappear);
|
|
|
|
|
|
if (pSysInfo->IsAlternatvieConf == YES || _totalCount == 1) {
|
|
|
ChangeDisplay2Value(__sel_gun_btn, _disappear);
|
|
@@ -2429,7 +2375,7 @@ int main(void)
|
|
|
pSysConfig = (struct SysConfigData *)GetShmSysConfigData();
|
|
|
pSysInfo = (struct SysInfoData *)GetShmSysInfoData();
|
|
|
pSysWarning = (struct WARNING_CODE_INFO *)GetShmSysWarningInfo();
|
|
|
- ShmFanModuleData = (struct FanModuleData *)GetShmFanModuleData();;
|
|
|
+ ShmFanModuleData = (struct FanModuleData *)GetShmFanModuleData();
|
|
|
ShmPrimaryMcuData = (struct PrimaryMcuData *)GetShmPrimaryMcuData();
|
|
|
ShmSelectGunInfo = (SelectGunInfo *)GetShmSelectGunInfo();
|
|
|
struct StatusCodeData *ShmStatusCodeData = (struct StatusCodeData *)GetShmStatusCodeData();;
|
|
@@ -2438,6 +2384,7 @@ int main(void)
|
|
|
_port = CreateCommunicationLcmPort();
|
|
|
uint8_t changeWarningPriority = 0;
|
|
|
uint8_t curWarningCount = 255;
|
|
|
+ uint8_t changeInfoPriority = 0;
|
|
|
ChangeBackLight(true);
|
|
|
_totalCount = pSysConfig->TotalConnectorCount;
|
|
|
acgunCount = pSysConfig->AcConnectorCount;
|
|
@@ -2450,7 +2397,7 @@ int main(void)
|
|
|
ChangeDisplay2Value(__gun_type_index + (i * 2), _disappear);
|
|
|
}
|
|
|
|
|
|
- uint8_t _verShowCount = 3;
|
|
|
+ uint8_t _verShowCount = 5;
|
|
|
DefaultIconStatus(); //DS60-120 add
|
|
|
|
|
|
while (_port != -1) {
|
|
@@ -2501,10 +2448,13 @@ int main(void)
|
|
|
#if defined DD360Audi
|
|
|
ChangeDisplayMoneyInfo();
|
|
|
#else
|
|
|
- if (changeWarningPriority == 0) { ////For Audi
|
|
|
- ChangeDisplayMoneyInfo();
|
|
|
- InformationShow();
|
|
|
+ InformationShow();
|
|
|
+ /*
|
|
|
+ if (changeInfoPriority == 0) { ////For Audi
|
|
|
+ //ChangeDisplayMoneyInfo();
|
|
|
+
|
|
|
}
|
|
|
+ */
|
|
|
#endif //defined DD360Audi
|
|
|
|
|
|
changeWarningPriority >= 15 ? (_battery_display_ani = true) : (_battery_display_ani = false);
|