|
@@ -1,17 +1,2542 @@
|
|
|
-/*
|
|
|
- * Module_LcmItemList.c
|
|
|
- *
|
|
|
- * Created on: 2022/3/31
|
|
|
- * Author: folus
|
|
|
- */
|
|
|
-#include "Module_LcmControl_Wistron.h"
|
|
|
-
|
|
|
-void showbackground(Image_List* imageList, int idx)
|
|
|
-{
|
|
|
- imageList->imageviewIndex = idx;
|
|
|
- imageList->imgsrc_addr = _background;
|
|
|
- imageList->layout_x = 0;
|
|
|
- imageList->layout_y = 607;
|
|
|
- imageList->width = 1080;
|
|
|
- imageList->height = 1313;
|
|
|
-}
|
|
|
+/*
|
|
|
+ * Module_LcmItemList.c
|
|
|
+ *
|
|
|
+ * Created on: 2022/7/20
|
|
|
+ * Author: Simon
|
|
|
+ */
|
|
|
+#include "Module_LcmControl_Wistron.h"
|
|
|
+#include "../Log/log.h"
|
|
|
+#include "../Define/define.h"
|
|
|
+#include "../Config.h"
|
|
|
+#include "../SelectGun/SelectGun.h"
|
|
|
+#include "../timeout.h"
|
|
|
+#include "../CSU/main.h"
|
|
|
+
|
|
|
+#define DB_FILE "/root/Language.db"
|
|
|
+
|
|
|
+char* _lang_default_list[66] = { "","歡迎使用!" ,"請點選下方螢幕選擇槍種" ,"語言選擇" ,"左槍充電", "右槍充電","繁體中文","上一個","下一個","選擇","請選擇付款方式" ,
|
|
|
+ "啟動中,請下列方式擇一付款" ,"左槍", "右槍","請於下方靠卡感應","請於下方靠卡感應、刷卡、插入卡片","請掃描QR Code","取消","驗證中", "驗證完成",
|
|
|
+ "付款驗證完成", "驗證失敗", "付款驗證失敗", "首頁","返回","幫助","點選左側","進行充電","點選右側","左槍停止充電",
|
|
|
+ "右槍停止充電", "等待插槍","請於 秒內將左槍插入車端","請於 秒內將右槍插入車端","確認中! 請稍後...","充電中","充電瓦數","充電費用","充電時間","停車費用",
|
|
|
+ "總費用","餘額","停止充電","請拔除充電槍以完成充電","確認失敗","請拔除充電槍,回到首頁重新操作","錯誤代碼","1. 連線失敗,請重新操作", "2. 或掃描QR Code查詢錯誤原因","維修中",
|
|
|
+ "請聯絡管理員","逾時操作,請重新操作", "緊急停止", "旋轉紅色按鈕,回到操作畫面", "使用RFID", "請刷卡停止充電","使用APP","請使用APP停止充電", "1. 請檢察您的卡片是否失效","2. 請確認是否餘額充足",
|
|
|
+ "1. 請取槍並插入槍車充電端", "2. 若插完槍未進入下個步驟,請重新插槍","停止充電","請點選停止充電,將轉至APP、刷卡提醒或結束畫面","充電訊息","目前充電費率", };
|
|
|
+char* _lang_default = "zh_TW";
|
|
|
+
|
|
|
+char* _ALARMQRCODEURL = "https://evsc.phihong.com.tw/StatusCode";
|
|
|
+char* _phone = "08000000000";
|
|
|
+
|
|
|
+static struct mosquitto* mosq;
|
|
|
+static DcCommonInfo* ShmDcCommonData = NULL;
|
|
|
+static struct SysConfigData* pSysConfig = NULL;
|
|
|
+static struct SysInfoData* pSysInfo = NULL;
|
|
|
+
|
|
|
+int DB_Get_Language()
|
|
|
+{
|
|
|
+ static sqlite3* localDb;
|
|
|
+ int result = PASS;
|
|
|
+ char* errMsg = NULL;
|
|
|
+ char sqlStr[1024];
|
|
|
+ char** rs;
|
|
|
+ int rows, cols;
|
|
|
+ char dbstring[1024];
|
|
|
+ int idxRow;
|
|
|
+
|
|
|
+ ShmDcCommonData->language = 0;
|
|
|
+ if (sqlite3_open(DB_FILE, &localDb)) {
|
|
|
+ result = FAIL;
|
|
|
+ log_info("Can't open database: %s", sqlite3_errmsg(localDb));
|
|
|
+ sqlite3_close(localDb);
|
|
|
+ } else {
|
|
|
+
|
|
|
+ sqlite3_free_table(rs);
|
|
|
+
|
|
|
+ sprintf(sqlStr, "select * from SupportLanguage;");
|
|
|
+ sqlite3_get_table(localDb, sqlStr, &rs, &rows, &cols, &errMsg);
|
|
|
+ //log_info("SupportLanguage database open successfully rows:%d cols:%d", rows, cols);
|
|
|
+ if (rows > 0) {
|
|
|
+ for (idxRow = 1; idxRow <= rows; idxRow++) {
|
|
|
+ sprintf((char*)&_lang_List[idxRow - 1], (char*)rs[(idxRow * cols)+1]);
|
|
|
+ sprintf((char*)&_lang_Name[idxRow - 1], (char*)rs[(idxRow * cols) + 2]);
|
|
|
+ if (atoi(rs[(idxRow * cols) + 3]) == 1) {
|
|
|
+ ShmDcCommonData->language = idxRow - 1;
|
|
|
+ log_info("Get Default Language [%s]", _lang_List[idxRow - 1]);
|
|
|
+ } else {
|
|
|
+ //log_info("List[%d]: NULL", idxRow);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ log_info("Get Language List fail");
|
|
|
+ result = FAIL;
|
|
|
+ }
|
|
|
+ sqlite3_free_table(rs);
|
|
|
+ }
|
|
|
+ return ShmDcCommonData->language;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+int DB_Set_Language(int sel)
|
|
|
+{
|
|
|
+ static sqlite3* localDb;
|
|
|
+ int result = PASS;
|
|
|
+ char* errMsg = NULL;
|
|
|
+ char sqlStr[1024];
|
|
|
+ char** rs;
|
|
|
+ int rows, cols;
|
|
|
+ char dbstring[1024];
|
|
|
+ int idxRow;
|
|
|
+ char LangSelect[10];
|
|
|
+
|
|
|
+ if (sqlite3_open(DB_FILE, &localDb)) {
|
|
|
+ result = FAIL;
|
|
|
+ log_info("Can't open database: %s", sqlite3_errmsg(localDb));
|
|
|
+ sqlite3_close(localDb);
|
|
|
+ } else {
|
|
|
+ // 更新資料庫內選擇語系
|
|
|
+ sprintf(sqlStr, "update SupportLanguage set LanguageSet = '0' ;");
|
|
|
+
|
|
|
+ if (sqlite3_exec(localDb, sqlStr, 0, 0, &errMsg) != SQLITE_OK) {
|
|
|
+ result = FAIL;
|
|
|
+ log_info("update config error message: %s", errMsg);
|
|
|
+ }
|
|
|
+ sprintf(sqlStr, "update SupportLanguage set LanguageSet = '1' where LanguageIndex = '%d' ; " , sel +1 );
|
|
|
+ if (sqlite3_exec(localDb, sqlStr, 0, 0, &errMsg) != SQLITE_OK) {
|
|
|
+ result = FAIL;
|
|
|
+ log_info("update config error message: %s", errMsg);
|
|
|
+ }
|
|
|
+ //獲取各語系的字串資料
|
|
|
+ if (strlen(_lang_List[sel]) > 0) {
|
|
|
+ sprintf(sqlStr, "select * from %s;", _lang_List[sel]);
|
|
|
+ sqlite3_get_table(localDb, sqlStr, &rs, &rows, &cols, &errMsg);
|
|
|
+ log_info("%s database open successfully rows:%d cols:%d", _lang_List[sel], rows, cols);
|
|
|
+ if (rows > 0) {
|
|
|
+ for (idxRow = 1; idxRow <= rows; idxRow++) {
|
|
|
+ sprintf((char*)&_lang_String[idxRow], (char*)rs[(idxRow * cols) + 1]);
|
|
|
+ //log_info("Set %s String[%d]:[%s]", LangSelect, idxRow, _lang_String[idxRow]);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ log_info("Get Language List fail");
|
|
|
+ result = FAIL;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ result = FAIL;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ sqlite3_free_table(rs);
|
|
|
+ sqlite3_close(localDb);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (result == FAIL) {
|
|
|
+ log_info("Set Language as default Chinese");
|
|
|
+ ShmDcCommonData->language = 0;
|
|
|
+ sprintf((char*)&_lang_List[0], (char*)_lang_default);
|
|
|
+ for (idxRow = 0; idxRow < 66; idxRow++) {
|
|
|
+ sprintf((char*)&_lang_String[idxRow], (char*)_lang_default_list[idxRow]);
|
|
|
+ //log_info("List[%d]: [%s] [%s]", idxRow, _lang_String[idxRow], _lang_default_list[idxRow]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
+void ItemListGetMem(struct mosquitto* _mosq)
|
|
|
+{
|
|
|
+ if (_mosq == NULL) {
|
|
|
+ log_error("Not Get MQTT struct");
|
|
|
+ }
|
|
|
+ mosq = _mosq;
|
|
|
+ ShmDcCommonData = (DcCommonInfo*)GetShmDcCommonData();
|
|
|
+ pSysConfig = (struct SysConfigData*)GetShmSysConfigData();
|
|
|
+ pSysInfo = (struct SysInfoData*)GetShmSysInfoData();
|
|
|
+
|
|
|
+}
|
|
|
+bool is_chargingend(int status) {
|
|
|
+ if (status == S_TERMINATING || status == S_COMPLETE || status == S_ALARM) {
|
|
|
+ return TRUE;
|
|
|
+ }
|
|
|
+ return FALSE;
|
|
|
+}
|
|
|
+bool isPrecharging(uint8_t status)
|
|
|
+{
|
|
|
+ if ((status >= S_REASSIGN_CHECK && status <= S_PREPARING_FOR_EVSE) ||
|
|
|
+ status == S_CCS_PRECHARGE_ST0 || status == S_CCS_PRECHARGE_ST1) {
|
|
|
+ return TRUE;
|
|
|
+ } else {
|
|
|
+ return FALSE;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void showbackground()
|
|
|
+{
|
|
|
+ Image_List imageList;
|
|
|
+ imageList.imageviewIndex = _background;
|
|
|
+ imageList.imgsrc_addr = _background;
|
|
|
+ imageList.layout_x = 0;
|
|
|
+ imageList.layout_y = 606;
|
|
|
+ imageList.width = 1079;
|
|
|
+ imageList.height = 1313;
|
|
|
+ publish_imageview_add(mosq, &imageList, 1);
|
|
|
+ return;
|
|
|
+}
|
|
|
+
|
|
|
+void showTextWelcome()
|
|
|
+{
|
|
|
+ Text_List textList[2];
|
|
|
+ textList[0].textviewIndex = _text_systemTitle;
|
|
|
+ textList[0].layout_x = 0;
|
|
|
+ textList[0].layout_y = 807;
|
|
|
+ textList[0].color_r = 0;
|
|
|
+ textList[0].color_g = 85;
|
|
|
+ textList[0].color_b = 184;
|
|
|
+ textList[0].width = 1080;
|
|
|
+ textList[0].alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList[0].textString, _lang_String[_lang_allIdleTitle]);
|
|
|
+ sprintf(textList[0].textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList[0].textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList[0].textSize = 40;
|
|
|
+
|
|
|
+ textList[1].textviewIndex = _text_systemScript;
|
|
|
+ textList[1].layout_x = 0;
|
|
|
+ textList[1].layout_y = 887;
|
|
|
+ textList[1].color_r = 0;
|
|
|
+ textList[1].color_g = 0;
|
|
|
+ textList[1].color_b = 0;
|
|
|
+ textList[1].width = 1080;
|
|
|
+ textList[1].alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList[1].textString, _lang_String[_lang_allIdleScript]);
|
|
|
+
|
|
|
+ sprintf(textList[1].textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList[1].textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList[1].textSize = 30;
|
|
|
+ publish_textview_add(mosq, textList, ARRAY_SIZE(textList));
|
|
|
+}
|
|
|
+
|
|
|
+void showTextDefaultPrice(float price)
|
|
|
+{
|
|
|
+ TextScroll_List textscrollList[1];
|
|
|
+ textscrollList[0].textviewIndex = _text_Price;
|
|
|
+ textscrollList[0].layout_x = 106;
|
|
|
+ textscrollList[0].layout_y = 655;
|
|
|
+ textscrollList[0].color_r = 0;
|
|
|
+ textscrollList[0].color_g = 0;
|
|
|
+ textscrollList[0].color_b = 0;
|
|
|
+ textscrollList[0].width = 100;
|
|
|
+ textscrollList[0].direction = DIRECTION_LEFT;
|
|
|
+ sprintf(textscrollList[0].textString, "%.2f", price);
|
|
|
+ //sprintf(textList[0].textString, "Test");
|
|
|
+ sprintf(textscrollList[0].textFont, FONT_ARIAL);
|
|
|
+ sprintf(textscrollList[0].textStyle, FONT_STYLE_BOLD);
|
|
|
+ textscrollList[0].textSize = 18;
|
|
|
+ publish_textscroll_add(mosq, textscrollList, ARRAY_SIZE(textscrollList));
|
|
|
+
|
|
|
+ Text_List textList[1];
|
|
|
+ char* currency = (uint8_t*)GetCurrency(pSysConfig->BillingData.Currency);
|
|
|
+ char cur[20] = { 0 };
|
|
|
+ *(currency + 3) = '\0';
|
|
|
+ textList[0].textviewIndex = _text_currency;
|
|
|
+ textList[0].layout_x = 106;
|
|
|
+ textList[0].layout_y = 690;
|
|
|
+ textList[0].color_r = 0;
|
|
|
+ textList[0].color_g = 0;
|
|
|
+ textList[0].color_b = 0;
|
|
|
+ textList[0].width = 200;
|
|
|
+ textList[0].alignment = ALIGNMENT_LEFT;
|
|
|
+ sprintf(textList[0].textString, "%s/kWh", currency);
|
|
|
+ sprintf(textList[0].textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList[0].textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList[0].textSize = 10;
|
|
|
+
|
|
|
+ publish_textview_add(mosq, textList, ARRAY_SIZE(textList));
|
|
|
+}
|
|
|
+
|
|
|
+void showTextLeftBtn()
|
|
|
+{
|
|
|
+ struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(LEFT_GUN_NUM);
|
|
|
+ Text_List textList;
|
|
|
+ textList.textviewIndex = _text_leftbtn;
|
|
|
+ textList.layout_x = 110;
|
|
|
+ textList.layout_y = 1828;
|
|
|
+ textList.color_r = 255;
|
|
|
+ textList.color_g = 255;
|
|
|
+ textList.color_b = 255;
|
|
|
+ textList.width = 200;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList.textSize = 20;
|
|
|
+
|
|
|
+ switch (pSysInfo->SystemPage) {
|
|
|
+ case _PAGE_VIEW:
|
|
|
+ if ((ShmDcCommonData->pGunInfo[LEFT_GUN_NUM].WaitForPlugit && pDcChargingInfo->SystemStatus == S_AUTHORIZING) ||
|
|
|
+ ((pDcChargingInfo->SystemStatus >= S_AUTHORIZING && pDcChargingInfo->SystemStatus <= S_CHARGING) ||
|
|
|
+ (pDcChargingInfo->SystemStatus >= S_CCS_PRECHARGE_ST0 && pDcChargingInfo->SystemStatus <= S_CCS_PRECHARGE_ST1))) {
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_leftstop]);
|
|
|
+
|
|
|
+ } else if (pDcChargingInfo->SystemStatus == S_TERMINATING || pDcChargingInfo->SystemStatus == S_COMPLETE ||
|
|
|
+ pDcChargingInfo->SystemStatus == S_ALARM) {
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_bill]);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_leftgunCharge]);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case _PAGE_LANGUAGE:
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_previous]);
|
|
|
+ break;
|
|
|
+ case _PAGE_AUTHORIZE_FAIL:
|
|
|
+ case _PAGE_ALARM:
|
|
|
+ case _PAGE_PLUGIN_FAIL:
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_home]);
|
|
|
+ break;
|
|
|
+ case _PAGE_SUMMARY:
|
|
|
+ pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(pSysInfo->CurGunSelected);
|
|
|
+ if (pDcChargingInfo->ConnectorPlugIn) {
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_return]);
|
|
|
+ } else {
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_home]);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case _PAGE_STOP_CHARGING:
|
|
|
+ case _PAGE_HELP:
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_return]);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_leftgunCharge]);
|
|
|
+ }
|
|
|
+
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+}
|
|
|
+void showTextRightBtn()
|
|
|
+{
|
|
|
+ struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(RIGHT_GUN_NUM);
|
|
|
+ Text_List textList;
|
|
|
+ textList.textviewIndex = _text_rightbtn;
|
|
|
+ textList.layout_x = 765;
|
|
|
+ textList.layout_y = 1828;
|
|
|
+ textList.color_r = 255;
|
|
|
+ textList.color_g = 255;
|
|
|
+ textList.color_b = 255;
|
|
|
+ textList.width = 200;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList.textSize = 20;
|
|
|
+ switch (pSysInfo->SystemPage) {
|
|
|
+ case _PAGE_VIEW:
|
|
|
+ if ((ShmDcCommonData->pGunInfo[RIGHT_GUN_NUM].WaitForPlugit && pDcChargingInfo->SystemStatus == S_AUTHORIZING) ||
|
|
|
+ ((pDcChargingInfo->SystemStatus >= S_AUTHORIZING && pDcChargingInfo->SystemStatus <= S_CHARGING) ||
|
|
|
+ (pDcChargingInfo->SystemStatus >= S_CCS_PRECHARGE_ST0 && pDcChargingInfo->SystemStatus <= S_CCS_PRECHARGE_ST1))) {
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_rightstop]);
|
|
|
+
|
|
|
+ } else if (pDcChargingInfo->SystemStatus == S_TERMINATING || pDcChargingInfo->SystemStatus == S_COMPLETE ||
|
|
|
+ pDcChargingInfo->SystemStatus == S_ALARM) {
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_bill]);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_rightgunCharge]);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case _PAGE_LANGUAGE:
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_next]);
|
|
|
+ break;
|
|
|
+ case _PAGE_SELECT_PAY:
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_cancel]);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_rightgunCharge]);
|
|
|
+ }
|
|
|
+
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+}
|
|
|
+void showTextCenterBtn(int is_help)
|
|
|
+{
|
|
|
+
|
|
|
+ Text_List textList;
|
|
|
+ if (is_help) {
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_help]);
|
|
|
+ } else {
|
|
|
+ switch (pSysInfo->SystemPage) {
|
|
|
+ case _PAGE_VIEW:
|
|
|
+ case _PAGE_SELECT_PAY:
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_LanguageSelect]);
|
|
|
+ break;
|
|
|
+ case _PAGE_LANGUAGE:
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_confirm]);
|
|
|
+ break;
|
|
|
+ case _PAGE_AUTHORIZE_FAIL:
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_help]);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ textList.textviewIndex = _text_centerbtn;
|
|
|
+ textList.layout_x = 455;
|
|
|
+ textList.layout_y = 1828;
|
|
|
+ textList.color_r = 255;
|
|
|
+ textList.color_g = 255;
|
|
|
+ textList.color_b = 255;
|
|
|
+ textList.width = 200;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList.textSize = FONT_SIZE_24PX;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+}
|
|
|
+void showLeftBtn()
|
|
|
+{
|
|
|
+ struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(LEFT_GUN_NUM);
|
|
|
+ if (!pDcChargingInfo->IsAvailable)
|
|
|
+ return;
|
|
|
+ Image_List imageList;
|
|
|
+ switch (pSysInfo->SystemPage) {
|
|
|
+ case _PAGE_AUTHORIZE_FAIL:
|
|
|
+ case _PAGE_ALARM:
|
|
|
+ case _PAGE_PLUGIN_FAIL:
|
|
|
+ case _PAGE_SUMMARY:
|
|
|
+ imageList.imageviewIndex = _btn_left_gun;
|
|
|
+ imageList.imgsrc_addr = _btn_home;
|
|
|
+ break;
|
|
|
+ case _PAGE_VIEW:
|
|
|
+ if ((ShmDcCommonData->pGunInfo[LEFT_GUN_NUM].WaitForPlugit && pDcChargingInfo->SystemStatus == S_AUTHORIZING) ||
|
|
|
+ ((pDcChargingInfo->SystemStatus >= S_AUTHORIZING && pDcChargingInfo->SystemStatus <= S_CHARGING) ||
|
|
|
+ (pDcChargingInfo->SystemStatus >= S_CCS_PRECHARGE_ST0 && pDcChargingInfo->SystemStatus <= S_CCS_PRECHARGE_ST1))) {
|
|
|
+ imageList.imageviewIndex = _btn_left_gun;
|
|
|
+ imageList.imgsrc_addr = _btn_leftstop;
|
|
|
+ } else {
|
|
|
+ imageList.imageviewIndex = _btn_left_gun;
|
|
|
+ imageList.imgsrc_addr = _btn_left_gun;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case _PAGE_STOP_CHARGING:
|
|
|
+ case _PAGE_HELP:
|
|
|
+ imageList.imageviewIndex = _btn_left_gun;
|
|
|
+ imageList.imgsrc_addr = _btn_return;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ imageList.imageviewIndex = _btn_left_gun;
|
|
|
+ imageList.imgsrc_addr = _btn_left_gun;
|
|
|
+ }
|
|
|
+ imageList.layout_x = 0;
|
|
|
+ imageList.layout_y = 1784;
|
|
|
+ imageList.width = 352;
|
|
|
+ imageList.height = 136;
|
|
|
+ publish_imageview_add(mosq, &imageList, 1);
|
|
|
+ showTextLeftBtn();
|
|
|
+}
|
|
|
+
|
|
|
+void showRightBtn()
|
|
|
+{
|
|
|
+ struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(RIGHT_GUN_NUM);
|
|
|
+ if (!pDcChargingInfo->IsAvailable)
|
|
|
+ return;
|
|
|
+ Image_List imageList;
|
|
|
+ switch (pSysInfo->SystemPage) {
|
|
|
+ case _PAGE_SELECT_PAY:
|
|
|
+ imageList.imageviewIndex = _btn_right_gun;
|
|
|
+ imageList.imgsrc_addr = _btn_cancel;
|
|
|
+ break;
|
|
|
+ case _PAGE_VIEW:
|
|
|
+ if ((ShmDcCommonData->pGunInfo[RIGHT_GUN_NUM].WaitForPlugit && pDcChargingInfo->SystemStatus == S_AUTHORIZING) ||
|
|
|
+ ((pDcChargingInfo->SystemStatus >= S_AUTHORIZING && pDcChargingInfo->SystemStatus <= S_CHARGING) ||
|
|
|
+ (pDcChargingInfo->SystemStatus >= S_CCS_PRECHARGE_ST0 && pDcChargingInfo->SystemStatus <= S_CCS_PRECHARGE_ST1))) {
|
|
|
+ imageList.imageviewIndex = _btn_right_gun;
|
|
|
+ imageList.imgsrc_addr = _btn_rightstop;
|
|
|
+ } else {
|
|
|
+ imageList.imageviewIndex = _btn_right_gun;
|
|
|
+ imageList.imgsrc_addr = _btn_right_gun;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ imageList.imageviewIndex = _btn_right_gun;
|
|
|
+ imageList.imgsrc_addr = _btn_right_gun;
|
|
|
+ }
|
|
|
+
|
|
|
+ imageList.layout_x = 730;
|
|
|
+ imageList.layout_y = 1784;
|
|
|
+ imageList.width = 352;
|
|
|
+ imageList.height = 136;
|
|
|
+ publish_imageview_add(mosq, &imageList, 1);
|
|
|
+ showTextRightBtn();
|
|
|
+}
|
|
|
+
|
|
|
+void showCenterBtn(int is_help)
|
|
|
+{
|
|
|
+ Image_List imageList;
|
|
|
+ bool is_idle = TRUE;
|
|
|
+ struct ChargingInfoData* pDcChargingInfo;
|
|
|
+ for (int i = 0; i < pSysConfig->TotalConnectorCount; i++) {
|
|
|
+ pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(i);
|
|
|
+ if (pDcChargingInfo->SystemStatus != S_IDLE) {
|
|
|
+ is_idle = FALSE;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ((pSysInfo->SystemPage == _PAGE_VIEW && is_idle ) ||
|
|
|
+ pSysInfo->SystemPage == _PAGE_SELECT_PAY ){
|
|
|
+ imageList.imageviewIndex = _btn_center;
|
|
|
+ imageList.imgsrc_addr = _btn_language;
|
|
|
+ } else if (pSysInfo->SystemPage == _PAGE_LANGUAGE) {
|
|
|
+ imageList.imageviewIndex = _btn_center;
|
|
|
+ imageList.imgsrc_addr = _btn_select;
|
|
|
+ } else {
|
|
|
+ imageList.imageviewIndex = _btn_center;
|
|
|
+ imageList.imgsrc_addr = _btn_center;
|
|
|
+ }
|
|
|
+
|
|
|
+ imageList.layout_x = 365;
|
|
|
+ imageList.layout_y = 1784;
|
|
|
+ imageList.width = 350;
|
|
|
+ imageList.height = 136;
|
|
|
+ publish_imageview_add(mosq, &imageList, 1);
|
|
|
+ showTextCenterBtn(is_help);
|
|
|
+}
|
|
|
+
|
|
|
+void showIconType(int gunIndex)
|
|
|
+{
|
|
|
+ struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(gunIndex);
|
|
|
+ Text_List textList;
|
|
|
+ char GunType[30];
|
|
|
+ if (gunIndex == LEFT_GUN_NUM) {
|
|
|
+ textList.textviewIndex = _text_leftType;
|
|
|
+ textList.layout_x = 190;
|
|
|
+ } else {
|
|
|
+ textList.textviewIndex = _text_rightType;
|
|
|
+ textList.layout_x = 730;
|
|
|
+ }
|
|
|
+ textList.layout_y = 1115;
|
|
|
+ if (is_chargingend(pDcChargingInfo->SystemStatus)) {
|
|
|
+ textList.color_r = 255;
|
|
|
+ textList.color_g = 255;
|
|
|
+ textList.color_b = 255;
|
|
|
+ } else {
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 85;
|
|
|
+ textList.color_b = 184;
|
|
|
+ }
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ textList.width = 141;
|
|
|
+
|
|
|
+ switch (pDcChargingInfo->Type) {
|
|
|
+ case _Type_Chademo:
|
|
|
+ strcpy(GunType, "CHAdeMo");
|
|
|
+ break;
|
|
|
+ case _Type_CCS_2:
|
|
|
+ strcpy(GunType, (pDcChargingInfo->CCSGunType <= _TYPE_CCS1_Liquid) ? "CCS1" : "CCS2");
|
|
|
+ break;
|
|
|
+ case _Type_GB:
|
|
|
+ strcpy(GunType, "GBT");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ sprintf(textList.textString, "%s", GunType);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 15;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+}
|
|
|
+
|
|
|
+void showGunBattery(int gunIndex,int percent)
|
|
|
+{
|
|
|
+ struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(gunIndex);
|
|
|
+
|
|
|
+ Text_List textList[2];
|
|
|
+ char cmd[10];
|
|
|
+
|
|
|
+ int x_axis = 160;
|
|
|
+ int y_axis = 1180;
|
|
|
+ int x_shift = 237;
|
|
|
+ int y_shift = 45;
|
|
|
+ int idxShift = 0;
|
|
|
+ int gun_shift = 0;
|
|
|
+ if (gunIndex == RIGHT_GUN_NUM) {
|
|
|
+ idxShift = ICON_INDEX_SHIFT;
|
|
|
+ gun_shift = 540;
|
|
|
+ }
|
|
|
+
|
|
|
+ textList[0].textviewIndex = _text_leftBattery + idxShift;
|
|
|
+ textList[0].layout_x = x_axis+ gun_shift;
|
|
|
+
|
|
|
+ textList[0].layout_y = y_axis;
|
|
|
+ if (is_chargingend(pDcChargingInfo->SystemStatus)) {
|
|
|
+ textList[0].color_r = 255;
|
|
|
+ textList[0].color_g = 255;
|
|
|
+ textList[0].color_b = 255;
|
|
|
+ } else {
|
|
|
+ textList[0].color_r = 0;
|
|
|
+ textList[0].color_g = 85;
|
|
|
+ textList[0].color_b = 184;
|
|
|
+ }
|
|
|
+ textList[0].alignment = ALIGNMENT_CENTER;
|
|
|
+ textList[0].width = 200;
|
|
|
+ sprintf(cmd, "%d", percent);
|
|
|
+ sprintf(textList[0].textString, "%s", cmd);
|
|
|
+ sprintf(textList[0].textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList[0].textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList[0].textSize = 60;
|
|
|
+
|
|
|
+
|
|
|
+ textList[1].textviewIndex = _text_leftBattery_sig + idxShift;
|
|
|
+ textList[1].layout_x = x_axis + gun_shift;
|
|
|
+ textList[1].layout_y = y_axis + y_shift;
|
|
|
+ if (is_chargingend(pDcChargingInfo->SystemStatus)) {
|
|
|
+ textList[1].color_r = 255;
|
|
|
+ textList[1].color_g = 255;
|
|
|
+ textList[1].color_b = 255;
|
|
|
+ } else {
|
|
|
+ textList[1].color_r = 0;
|
|
|
+ textList[1].color_g = 85;
|
|
|
+ textList[1].color_b = 184;
|
|
|
+ }
|
|
|
+ textList[1].alignment = ALIGNMENT_RIGHT;
|
|
|
+ textList[1].width = 200;
|
|
|
+ sprintf(cmd, "%%");
|
|
|
+ sprintf(textList[1].textString, "%s", cmd);
|
|
|
+ sprintf(textList[1].textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList[1].textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList[1].textSize = 25;
|
|
|
+
|
|
|
+ publish_textview_add(mosq, textList, 2);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/*
|
|
|
+void showGunBattery(int gunIndex, int percent)
|
|
|
+{
|
|
|
+ struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(gunIndex);
|
|
|
+ int x_axis = 0;
|
|
|
+ if (gunIndex == LEFT_GUN_NUM)
|
|
|
+ x_axis = 20;
|
|
|
+ else
|
|
|
+ x_axis = 560;
|
|
|
+ int y_axis = 1015;
|
|
|
+ //
|
|
|
+ int y_shift = 360 - ((345 / 100) * percent);
|
|
|
+ Image_List imageList[2];
|
|
|
+ imageList[0].imageviewIndex = _icon_chargewave;
|
|
|
+ imageList[0].imgsrc_addr = _icon_chargewave;
|
|
|
+ imageList[0].layout_x = x_axis+50;
|
|
|
+ imageList[0].layout_y = y_axis + y_shift;// -(int)(64 / 380 * percent);
|
|
|
+ imageList[0].width = 400;
|
|
|
+ imageList[0].height = 400;
|
|
|
+
|
|
|
+ imageList[1].imageviewIndex = _icon_chargewave_bg;
|
|
|
+ imageList[1].imgsrc_addr = _icon_chargewave_bg;
|
|
|
+ imageList[1].layout_x = x_axis;
|
|
|
+ imageList[1].layout_y = y_axis;
|
|
|
+ imageList[1].width = 500;
|
|
|
+ imageList[1].height = 750;
|
|
|
+ publish_imageview_add(mosq, imageList, ARRAY_SIZE(imageList));
|
|
|
+
|
|
|
+ // 內容
|
|
|
+ Text_List textList[2];
|
|
|
+ char cmd[10];
|
|
|
+ if (gunIndex == LEFT_GUN_NUM) {
|
|
|
+ textList[0].textviewIndex = _text_leftBattery;
|
|
|
+ textList[0].layout_x = 178;
|
|
|
+ } else {
|
|
|
+ textList[0].textviewIndex = _text_rightBattery;
|
|
|
+ textList[0].layout_x = 675;
|
|
|
+ }
|
|
|
+ textList[0].layout_y = 1180;
|
|
|
+ if (is_chargingend(pDcChargingInfo->SystemStatus)) {
|
|
|
+ textList[0].color_r = 255;
|
|
|
+ textList[0].color_g = 255;
|
|
|
+ textList[0].color_b = 255;
|
|
|
+ } else if (pDcChargingInfo->SystemStatus == S_CHARGING) {
|
|
|
+ textList[0].color_r = 0;
|
|
|
+ textList[0].color_g = 0;
|
|
|
+ textList[0].color_b = 0;
|
|
|
+ } else {
|
|
|
+ textList[0].color_r = 0;
|
|
|
+ textList[0].color_g = 85;
|
|
|
+ textList[0].color_b = 184;
|
|
|
+ }
|
|
|
+ textList[0].alignment = ALIGNMENT_CENTER;
|
|
|
+ textList[0].width = 200;
|
|
|
+ sprintf(cmd, "%d", percent);
|
|
|
+ sprintf(textList[0].textString, "%s", cmd);
|
|
|
+ sprintf(textList[0].textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList[0].textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList[0].textSize = 50;
|
|
|
+
|
|
|
+ if (gunIndex == LEFT_GUN_NUM) {
|
|
|
+ textList[1].textviewIndex = _text_leftBattery_sig;
|
|
|
+ textList[1].layout_x = 178;
|
|
|
+ } else {
|
|
|
+ textList[1].textviewIndex = _text_rightBattery_sig;
|
|
|
+ textList[1].layout_x = 675;
|
|
|
+ }
|
|
|
+ textList[1].layout_y = 1215;
|
|
|
+ if (is_chargingend(pDcChargingInfo->SystemStatus)) {
|
|
|
+ textList[1].color_r = 255;
|
|
|
+ textList[1].color_g = 255;
|
|
|
+ textList[1].color_b = 255;
|
|
|
+ } else if (pDcChargingInfo->SystemStatus == S_CHARGING) {
|
|
|
+ textList[1].color_r = 0;
|
|
|
+ textList[1].color_g = 0;
|
|
|
+ textList[1].color_b = 0;
|
|
|
+ } else {
|
|
|
+ textList[1].color_r = 0;
|
|
|
+ textList[1].color_g = 85;
|
|
|
+ textList[1].color_b = 184;
|
|
|
+ }
|
|
|
+ textList[1].alignment = ALIGNMENT_RIGHT;
|
|
|
+ textList[1].width = 200;
|
|
|
+ sprintf(cmd, "%%");
|
|
|
+ sprintf(textList[1].textString, "%s", cmd);
|
|
|
+ sprintf(textList[1].textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList[1].textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList[1].textSize = 25;
|
|
|
+
|
|
|
+ publish_textview_add(mosq, textList, 2);
|
|
|
+}
|
|
|
+*/
|
|
|
+
|
|
|
+void showGunUserPrice(int gunIndex, float money)
|
|
|
+{
|
|
|
+ Text_List textList;
|
|
|
+ char cmd[10];
|
|
|
+
|
|
|
+ int x_axis = 232;
|
|
|
+ int y_axis = 955;
|
|
|
+ int x_shift = 86;
|
|
|
+ int y_shift = 15;
|
|
|
+ int idxShift = 0;
|
|
|
+ int gun_shift = 0;
|
|
|
+ if (gunIndex == RIGHT_GUN_NUM) {
|
|
|
+ idxShift = ICON_INDEX_SHIFT;
|
|
|
+ gun_shift = 540;
|
|
|
+ }
|
|
|
+
|
|
|
+ textList.textviewIndex = _text_leftUserPriceValue + idxShift;
|
|
|
+ textList.layout_x = x_axis + gun_shift;
|
|
|
+
|
|
|
+ textList.layout_y = y_axis;
|
|
|
+ textList.color_r = 255;
|
|
|
+ textList.color_g = 255;
|
|
|
+ textList.color_b = 255;
|
|
|
+ textList.alignment = ALIGNMENT_LEFT;
|
|
|
+ textList.width = 200;
|
|
|
+ sprintf(cmd, "%.02f", money);
|
|
|
+ sprintf(textList.textString, "%s", cmd);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 20;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+
|
|
|
+ char* currency = (uint8_t*)GetCurrency(pSysConfig->BillingData.Currency);
|
|
|
+ char cur[20] = { 0 };
|
|
|
+ *(currency + 3) = '\0';
|
|
|
+
|
|
|
+ textList.textviewIndex = _text_leftCurrency + idxShift;
|
|
|
+ textList.layout_x = x_axis + x_shift + gun_shift;
|
|
|
+
|
|
|
+ textList.layout_y = y_axis + y_shift;
|
|
|
+ textList.color_r = 255;
|
|
|
+ textList.color_g = 255;
|
|
|
+ textList.color_b = 255;
|
|
|
+ textList.width = 200;
|
|
|
+ textList.alignment = ALIGNMENT_LEFT;
|
|
|
+ sprintf(textList.textString, "%s/kWh", currency);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 10;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+}
|
|
|
+
|
|
|
+void showLeftGunIcon()
|
|
|
+{
|
|
|
+ struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(LEFT_GUN_NUM);
|
|
|
+ Image_List imageList;
|
|
|
+ if (pDcChargingInfo->SystemStatus == S_AUTHORIZING) {
|
|
|
+ imageList.imageviewIndex = _icon_plugin;
|
|
|
+ imageList.imgsrc_addr = _icon_plugin;
|
|
|
+ } else if (isPrecharging(pDcChargingInfo->SystemStatus)) {
|
|
|
+ imageList.imageviewIndex = _icon_prepare_bg;
|
|
|
+ imageList.imgsrc_addr = _icon_prepare_bg;
|
|
|
+ } else if (pDcChargingInfo->SystemStatus == S_CHARGING) {
|
|
|
+ imageList.imageviewIndex = _icon_charge_bg ;
|
|
|
+ imageList.imgsrc_addr = _icon_charge_bg;
|
|
|
+ } else if (pDcChargingInfo->SystemStatus >= S_TERMINATING && pDcChargingInfo->SystemStatus <= S_ALARM) {
|
|
|
+ if (pDcChargingInfo->ConnectorPlugIn) {
|
|
|
+ imageList.imageviewIndex = _icon_plugout;
|
|
|
+ imageList.imgsrc_addr = _icon_plugout;
|
|
|
+ } else {
|
|
|
+ imageList.imageviewIndex = _icon_endcharing_bg;
|
|
|
+ imageList.imgsrc_addr = _icon_endcharing_bg;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ switch (pDcChargingInfo->Type) {
|
|
|
+ case _Type_Chademo:
|
|
|
+ imageList.imageviewIndex = _icon_left_gun_CHAdeMo;
|
|
|
+ if (pDcChargingInfo->IsAvailable &&
|
|
|
+ (pDcChargingInfo->SystemStatus == S_IDLE || pDcChargingInfo->SystemStatus == S_RESERVATION))
|
|
|
+ imageList.imgsrc_addr = _icon_left_gun_CHAdeMo;
|
|
|
+ else
|
|
|
+ imageList.imgsrc_addr = _icon_left_gun_CHAdeMo_non;
|
|
|
+ break;
|
|
|
+ case _Type_CCS_2:
|
|
|
+ imageList.imageviewIndex = (pDcChargingInfo->CCSGunType <= _TYPE_CCS1_Liquid) ? _icon_left_gun_CCS1 : _icon_left_gun_CCS2;
|
|
|
+ if (pDcChargingInfo->IsAvailable &&
|
|
|
+ (pDcChargingInfo->SystemStatus == S_IDLE || pDcChargingInfo->SystemStatus == S_RESERVATION))
|
|
|
+ imageList.imgsrc_addr = (pDcChargingInfo->CCSGunType <= _TYPE_CCS1_Liquid) ? _icon_left_gun_CCS1 : _icon_left_gun_CCS2;
|
|
|
+ else
|
|
|
+ imageList.imgsrc_addr = (pDcChargingInfo->CCSGunType <= _TYPE_CCS1_Liquid) ? _icon_left_gun_CCS1_non : _icon_left_gun_CCS2_non;
|
|
|
+ break;
|
|
|
+ case _Type_GB:
|
|
|
+ imageList.imageviewIndex = _icon_left_gun_GBT;
|
|
|
+ if (pDcChargingInfo->IsAvailable &&
|
|
|
+ (pDcChargingInfo->SystemStatus == S_IDLE || pDcChargingInfo->SystemStatus == S_RESERVATION))
|
|
|
+ imageList.imgsrc_addr = _icon_left_gun_GBT;
|
|
|
+ else
|
|
|
+ imageList.imgsrc_addr = _icon_left_gun_GBT_non;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ imageList.layout_x = 70;
|
|
|
+ imageList.layout_y = 1015;
|
|
|
+ imageList.width = 400;
|
|
|
+ imageList.height = 400;
|
|
|
+ publish_imageview_add(mosq, &imageList, 1);
|
|
|
+ if (!isPrecharging(pDcChargingInfo->SystemStatus) &&
|
|
|
+ pDcChargingInfo->SystemStatus != S_CHARGING &&
|
|
|
+ pDcChargingInfo->SystemStatus != S_IDLE &&
|
|
|
+ pDcChargingInfo->SystemStatus != S_RESERVATION &&
|
|
|
+ pDcChargingInfo->SystemStatus != S_MAINTAIN &&
|
|
|
+ pDcChargingInfo->SystemStatus != S_FAULT) {
|
|
|
+ showIconType(LEFT_GUN_NUM);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void showRightGunIcon()
|
|
|
+{
|
|
|
+ struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(RIGHT_GUN_NUM);
|
|
|
+ Image_List imageList;
|
|
|
+ if (pDcChargingInfo->SystemStatus == S_AUTHORIZING) {
|
|
|
+ imageList.imageviewIndex = _icon_plugin + ICON_INDEX_SHIFT;
|
|
|
+ imageList.imgsrc_addr = _icon_plugin;
|
|
|
+ } else if (isPrecharging(pDcChargingInfo->SystemStatus)) {
|
|
|
+ imageList.imageviewIndex = _icon_prepare_bg + ICON_INDEX_SHIFT;
|
|
|
+ imageList.imgsrc_addr = _icon_prepare_bg;
|
|
|
+ } else if (pDcChargingInfo->SystemStatus == S_CHARGING) {
|
|
|
+ imageList.imageviewIndex = _icon_charge_bg+ ICON_INDEX_SHIFT;
|
|
|
+ imageList.imgsrc_addr = _icon_charge_bg;
|
|
|
+ } else if (pDcChargingInfo->SystemStatus >= S_TERMINATING && pDcChargingInfo->SystemStatus <= S_ALARM) {
|
|
|
+ if (pDcChargingInfo->ConnectorPlugIn) {
|
|
|
+ imageList.imageviewIndex = _icon_plugout+ ICON_INDEX_SHIFT;
|
|
|
+ imageList.imgsrc_addr = _icon_plugout;
|
|
|
+ } else {
|
|
|
+ imageList.imageviewIndex = _icon_endcharing_bg + ICON_INDEX_SHIFT;
|
|
|
+ imageList.imgsrc_addr = _icon_endcharing_bg;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ switch (pDcChargingInfo->Type) {
|
|
|
+ case _Type_Chademo:
|
|
|
+ imageList.imageviewIndex = _icon_right_gun_CHAdeMo;
|
|
|
+ if (pDcChargingInfo->IsAvailable &&
|
|
|
+ (pDcChargingInfo->SystemStatus == S_IDLE || pDcChargingInfo->SystemStatus == S_RESERVATION))
|
|
|
+ imageList.imgsrc_addr = _icon_right_gun_CHAdeMo;
|
|
|
+ else
|
|
|
+ imageList.imgsrc_addr = _icon_right_gun_CHAdeMo_non;
|
|
|
+ break;
|
|
|
+ case _Type_CCS_2:
|
|
|
+ imageList.imageviewIndex = (pDcChargingInfo->CCSGunType <= _TYPE_CCS1_Liquid) ? _icon_right_gun_CCS1 : _icon_right_gun_CCS2;
|
|
|
+ if (pDcChargingInfo->IsAvailable &&
|
|
|
+ (pDcChargingInfo->SystemStatus == S_IDLE || pDcChargingInfo->SystemStatus == S_RESERVATION))
|
|
|
+ imageList.imgsrc_addr = (pDcChargingInfo->CCSGunType <= _TYPE_CCS1_Liquid) ? _icon_right_gun_CCS1 : _icon_right_gun_CCS2;
|
|
|
+ else
|
|
|
+ imageList.imgsrc_addr = (pDcChargingInfo->CCSGunType <= _TYPE_CCS1_Liquid) ? _icon_right_gun_CCS1_non : _icon_right_gun_CCS2_non;
|
|
|
+ break;
|
|
|
+ case _Type_GB:
|
|
|
+ imageList.imageviewIndex = _icon_right_gun_CHAdeMo;
|
|
|
+ if (pDcChargingInfo->IsAvailable &&
|
|
|
+ (pDcChargingInfo->SystemStatus == S_IDLE || pDcChargingInfo->SystemStatus == S_RESERVATION))
|
|
|
+ imageList.imgsrc_addr = _icon_right_gun_GBT;
|
|
|
+ else
|
|
|
+ imageList.imgsrc_addr = _icon_right_gun_GBT_non;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ imageList.layout_x = 610;
|
|
|
+ imageList.layout_y = 1015;
|
|
|
+ imageList.width = 400;
|
|
|
+ imageList.height = 400;
|
|
|
+ publish_imageview_add(mosq, &imageList, 1);
|
|
|
+ if (!isPrecharging(pDcChargingInfo->SystemStatus) &&
|
|
|
+ pDcChargingInfo->SystemStatus != S_CHARGING &&
|
|
|
+ pDcChargingInfo->SystemStatus != S_IDLE &&
|
|
|
+ pDcChargingInfo->SystemStatus != S_RESERVATION &&
|
|
|
+ pDcChargingInfo->SystemStatus != S_MAINTAIN &&
|
|
|
+ pDcChargingInfo->SystemStatus != S_FAULT) {
|
|
|
+ showIconType(RIGHT_GUN_NUM);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void showMoneySymbolIcon()
|
|
|
+{
|
|
|
+ Image_List imageList;
|
|
|
+ imageList.imageviewIndex = _icon_money;
|
|
|
+ imageList.imgsrc_addr = _icon_money;
|
|
|
+ imageList.layout_x = 40;
|
|
|
+ imageList.layout_y = 665;
|
|
|
+ imageList.width = 60;
|
|
|
+ imageList.height = 40;
|
|
|
+ publish_imageview_add(mosq, &imageList, 1);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+void showSelectPayContect()
|
|
|
+{
|
|
|
+ Image_List imageList[7];
|
|
|
+ // RFID
|
|
|
+ imageList[0].imageviewIndex = _icon_sensing_symbol;
|
|
|
+ imageList[0].imgsrc_addr = _icon_sensing_symbol;
|
|
|
+ imageList[0].layout_x = 170;
|
|
|
+ imageList[0].layout_y = 1000;
|
|
|
+ imageList[0].width = 154;
|
|
|
+ imageList[0].height = 166;
|
|
|
+ imageList[1].imageviewIndex = _icon_RFID_ipass;
|
|
|
+ imageList[1].imgsrc_addr = _icon_RFID_ipass;
|
|
|
+ imageList[1].layout_x = 450;
|
|
|
+ imageList[1].layout_y = 1040;
|
|
|
+ imageList[1].width = 240;
|
|
|
+ imageList[1].height = 43;
|
|
|
+ // Credit Card
|
|
|
+ imageList[2].imageviewIndex = _icon_card_symbol;
|
|
|
+ imageList[2].imgsrc_addr = _icon_card_symbol;
|
|
|
+ imageList[2].layout_x = 170;
|
|
|
+ imageList[2].layout_y = 1260;
|
|
|
+ imageList[2].width = 174;
|
|
|
+ imageList[2].height = 157;
|
|
|
+ imageList[3].imageviewIndex = _icon_credit_card;
|
|
|
+ imageList[3].imgsrc_addr = _icon_credit_card;
|
|
|
+ imageList[3].layout_x = 450;
|
|
|
+ imageList[3].layout_y = 1300;
|
|
|
+ imageList[3].width = 482;
|
|
|
+ imageList[3].height = 42;
|
|
|
+ // QR Code
|
|
|
+ imageList[4].imageviewIndex = _icon_QR_code;
|
|
|
+ imageList[4].imgsrc_addr = _icon_QR_code;
|
|
|
+ imageList[4].layout_x = 170;
|
|
|
+ imageList[4].layout_y = 1530;
|
|
|
+ imageList[4].width = 170;
|
|
|
+ imageList[4].height = 171;
|
|
|
+ // Line Symbol
|
|
|
+ imageList[5].imageviewIndex = _icon_line_symbol - 1;
|
|
|
+ imageList[5].imgsrc_addr = _icon_line_symbol;
|
|
|
+ imageList[5].layout_x = 145;
|
|
|
+ imageList[5].layout_y = 1225;
|
|
|
+ imageList[5].width = 786;
|
|
|
+ imageList[5].height = 3;
|
|
|
+ imageList[6].imageviewIndex = _icon_line_symbol;
|
|
|
+ imageList[6].imgsrc_addr = _icon_line_symbol;
|
|
|
+ imageList[6].layout_x = 145;
|
|
|
+ imageList[6].layout_y = 1480;
|
|
|
+ imageList[6].width = 786;
|
|
|
+ imageList[6].height = 3;
|
|
|
+ publish_imageview_add(mosq, imageList, ARRAY_SIZE(imageList));
|
|
|
+
|
|
|
+ QrCode_List qrCodeList[1] = { 0 };
|
|
|
+
|
|
|
+ for (int idx = 0; idx < ARRAY_SIZE(qrCodeList); idx++)
|
|
|
+ {
|
|
|
+ qrCodeList[idx].qrCodeIndex = _icon_qr;
|
|
|
+ sprintf((char*)qrCodeList[idx].qrCodeContent, (char*)ShmDcCommonData->QRCodeString);
|
|
|
+ sprintf((char*)qrCodeList[idx].errorCorrection, "M");
|
|
|
+ qrCodeList[idx].layout_x = 180;//(rand()%800+100);
|
|
|
+ qrCodeList[idx].layout_y = 1540;//(rand()%800+100);
|
|
|
+ qrCodeList[idx].width = 150;
|
|
|
+ qrCodeList[idx].height = 150;
|
|
|
+ }
|
|
|
+
|
|
|
+ publish_qrcodeimage_add(mosq, qrCodeList, ARRAY_SIZE(qrCodeList));
|
|
|
+}
|
|
|
+
|
|
|
+// Authrozing Page
|
|
|
+void showIconAuthorizing()
|
|
|
+{
|
|
|
+ Image_List imageList;
|
|
|
+ imageList.imageviewIndex = _icon_authorizing;
|
|
|
+ imageList.imgsrc_addr = _icon_authorizing;
|
|
|
+ imageList.layout_x = 290;
|
|
|
+ imageList.layout_y = 950;
|
|
|
+ imageList.width = 500;
|
|
|
+ imageList.height = 500;
|
|
|
+ publish_imageview_add(mosq, &imageList, 1);
|
|
|
+}
|
|
|
+void showTextAuthorizing()
|
|
|
+{
|
|
|
+ // Title
|
|
|
+ Text_List textList;
|
|
|
+ textList.textviewIndex = _text_systemTitle;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 807;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 85;
|
|
|
+ textList.color_b = 184;
|
|
|
+ textList.width = 1080;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_authingTitle]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 30;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+ // Script
|
|
|
+ textList.textviewIndex = _text_systemScript;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 867;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 0;
|
|
|
+ textList.color_b = 0;
|
|
|
+ textList.width = 1080;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_authingScript]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList.textSize = 20;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+}
|
|
|
+
|
|
|
+// Authrozing Complete Page
|
|
|
+void showIconAuthorizeComplete()
|
|
|
+{
|
|
|
+ Image_List imageList;
|
|
|
+ imageList.imageviewIndex = _icon_authComplete;
|
|
|
+ imageList.imgsrc_addr = _icon_authComplete;
|
|
|
+ imageList.layout_x = 290;
|
|
|
+ imageList.layout_y = 950;
|
|
|
+ imageList.width = 500;
|
|
|
+ imageList.height = 500;
|
|
|
+ publish_imageview_add(mosq, &imageList, 1);
|
|
|
+}
|
|
|
+void showTextAuthorizeComplete()
|
|
|
+{
|
|
|
+ // Title
|
|
|
+ Text_List textList;
|
|
|
+ textList.textviewIndex = _text_systemTitle;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 807;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 85;
|
|
|
+ textList.color_b = 184;
|
|
|
+ textList.width = 1080;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_authcompleteTitle]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 30;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+ // Script
|
|
|
+ textList.textviewIndex = _text_systemScript;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 867;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 0;
|
|
|
+ textList.color_b = 0;
|
|
|
+ textList.width = 1080;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_authcompleteScript]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList.textSize = 20;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+}
|
|
|
+
|
|
|
+// Authrozing Fail Page
|
|
|
+void showIconAuthorizeFail()
|
|
|
+{
|
|
|
+ Image_List imageList;
|
|
|
+ imageList.imageviewIndex = _icon_authFail;
|
|
|
+ imageList.imgsrc_addr = _icon_authFail;
|
|
|
+ imageList.layout_x = 290;
|
|
|
+ imageList.layout_y = 950;
|
|
|
+ imageList.width = 500;
|
|
|
+ imageList.height = 500;
|
|
|
+ publish_imageview_add(mosq, &imageList, 1);
|
|
|
+}
|
|
|
+void showTextAuthorizeFail()
|
|
|
+{
|
|
|
+ // Title
|
|
|
+ Text_List textList;
|
|
|
+ textList.textviewIndex = _text_systemTitle;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 807;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 85;
|
|
|
+ textList.color_b = 184;
|
|
|
+ textList.width = 1080;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_authFailTitle]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 30;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+ // Script
|
|
|
+ textList.textviewIndex = _text_systemScript;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 867;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 0;
|
|
|
+ textList.color_b = 0;
|
|
|
+ textList.width = 1080;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_authFailScript]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList.textSize = 20;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+}
|
|
|
+// Select Language Page
|
|
|
+void showLanguageFrame(int sel)
|
|
|
+{
|
|
|
+ Image_List imageList[10] = {0};
|
|
|
+ for (int i = 0; i < 10; i++) {
|
|
|
+ if (strlen(_lang_List[i]) > 0) {
|
|
|
+ imageList[i].imageviewIndex = _icon_lang_select + i;
|
|
|
+ if (i == sel) {
|
|
|
+ imageList[i].imgsrc_addr = _icon_lang_select;
|
|
|
+ } else {
|
|
|
+ imageList[i].imgsrc_addr = _icon_lang_nonselect;
|
|
|
+ }
|
|
|
+ imageList[i].layout_x = 30 + (i % 3) * 354;
|
|
|
+ imageList[i].layout_y = 769 + (i / 3) * 246;
|
|
|
+ imageList[i].width = 313;
|
|
|
+ imageList[i].height = 212;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ publish_imageview_add(mosq, imageList, ARRAY_SIZE(imageList));
|
|
|
+ showTextLanguageItem(sel);
|
|
|
+}
|
|
|
+void showTextLanguageItem(int sel)
|
|
|
+{
|
|
|
+ Text_List textList[10];
|
|
|
+ for (int i = 0; i < 10; i++) {
|
|
|
+ if (strlen(_lang_List[i]) > 0) {
|
|
|
+ textList[i].textviewIndex = _text_language0 + i;
|
|
|
+ textList[i].layout_x = 30 + (i % 3) * 354;
|
|
|
+ textList[i].layout_y = 857 + (i / 3) * 246;
|
|
|
+ if (i == sel) {
|
|
|
+ textList[i].color_r = 255;
|
|
|
+ textList[i].color_g = 255;
|
|
|
+ textList[i].color_b = 255;
|
|
|
+ } else {
|
|
|
+ textList[i].color_r = 0;
|
|
|
+ textList[i].color_g = 85;
|
|
|
+ textList[i].color_b = 184;
|
|
|
+ }
|
|
|
+ textList[i].width = 313;
|
|
|
+ textList[i].alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList[i].textString, _lang_Name[i]);
|
|
|
+ sprintf(textList[i].textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList[i].textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList[i].textSize = FONT_SIZE_24PX;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ publish_textview_add(mosq, textList, ARRAY_SIZE(textList));
|
|
|
+}
|
|
|
+void showTextSelectPay()
|
|
|
+{
|
|
|
+ // Title
|
|
|
+ Text_List textList[5];
|
|
|
+ textList[0].textviewIndex = _text_systemTitle;
|
|
|
+ textList[0].layout_x = 0;
|
|
|
+ textList[0].layout_y = 807;
|
|
|
+ textList[0].color_r = 0;
|
|
|
+ textList[0].color_g = 85;
|
|
|
+ textList[0].color_b = 184;
|
|
|
+ textList[0].width = 1080;
|
|
|
+ textList[0].alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList[0].textString, _lang_String[_lang_selectpayTitle]);
|
|
|
+ sprintf(textList[0].textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList[0].textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList[0].textSize = 30;
|
|
|
+
|
|
|
+ // Script
|
|
|
+ textList[1].textviewIndex = _text_systemScript;
|
|
|
+ textList[1].layout_x = 0;
|
|
|
+ textList[1].layout_y = 867;
|
|
|
+ textList[1].color_r = 0;
|
|
|
+ textList[1].color_g = 0;
|
|
|
+ textList[1].color_b = 0;
|
|
|
+ textList[1].width = 1080;
|
|
|
+ textList[1].alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList[1].textString, _lang_String[_lang_selectpayScript]);
|
|
|
+ sprintf(textList[1].textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList[1].textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList[1].textSize = 20;
|
|
|
+
|
|
|
+ // RFID
|
|
|
+ textList[2].textviewIndex = _text_selectpayrfid;
|
|
|
+ textList[2].layout_x = 450;
|
|
|
+ textList[2].layout_y = 1100;
|
|
|
+ textList[2].color_r = 0;
|
|
|
+ textList[2].color_g = 0;
|
|
|
+ textList[2].color_b = 0;
|
|
|
+ textList[2].width = 1080;
|
|
|
+ textList[2].alignment = ALIGNMENT_LEFT;
|
|
|
+ sprintf(textList[2].textString, _lang_String[_lang_selectpayrfid]);
|
|
|
+ sprintf(textList[2].textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList[2].textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList[2].textSize = 20;
|
|
|
+ // Credit Card
|
|
|
+ textList[3].textviewIndex = _text_selectpaycreditcard;
|
|
|
+ textList[3].layout_x = 450;
|
|
|
+ textList[3].layout_y = 1360;
|
|
|
+ textList[3].color_r = 0;
|
|
|
+ textList[3].color_g = 0;
|
|
|
+ textList[3].color_b = 0;
|
|
|
+ textList[3].width = 1080;
|
|
|
+ textList[3].alignment = ALIGNMENT_LEFT;
|
|
|
+ sprintf(textList[3].textString, _lang_String[_lang_selectpaycreditcard]);
|
|
|
+ sprintf(textList[3].textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList[3].textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList[3].textSize = 20;
|
|
|
+ // QR Code
|
|
|
+ textList[4].textviewIndex = _text_QRCode;
|
|
|
+ textList[4].layout_x = 450;
|
|
|
+ textList[4].layout_y = 1590;
|
|
|
+ textList[4].color_r = 0;
|
|
|
+ textList[4].color_g = 0;
|
|
|
+ textList[4].color_b = 0;
|
|
|
+ textList[4].width = 1080;
|
|
|
+ textList[4].alignment = ALIGNMENT_LEFT;
|
|
|
+ sprintf(textList[4].textString, _lang_String[_lang_selectpayqrcode]);
|
|
|
+ sprintf(textList[4].textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList[4].textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList[4].textSize = 20;
|
|
|
+ publish_textview_add(mosq, textList, ARRAY_SIZE(textList));
|
|
|
+}
|
|
|
+void showTextAuthSelectGun()
|
|
|
+{
|
|
|
+ struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(pSysInfo->CurGunSelected);
|
|
|
+ Text_List textList;
|
|
|
+ char GunType[30];
|
|
|
+ textList.textviewIndex = _text_selectpaygun;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 867;
|
|
|
+ textList.color_r = 42;
|
|
|
+ textList.color_g = 161;
|
|
|
+ textList.color_b = 252;
|
|
|
+
|
|
|
+ textList.alignment = ALIGNMENT_RIGHT;
|
|
|
+ switch (pSysInfo->SystemPage) {
|
|
|
+ case _PAGE_SELECT_PAY:
|
|
|
+ textList.width = 350;
|
|
|
+ break;
|
|
|
+ case _PAGE_AUTHORIZING:
|
|
|
+ textList.width = 450;
|
|
|
+ break;
|
|
|
+ case _PAGE_AUTHORIZE_COMPLETE:
|
|
|
+ case _PAGE_AUTHORIZE_FAIL:
|
|
|
+ textList.width = 510;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ strcpy(GunType, pSysInfo->CurGunSelected == LEFT_GUN_NUM ? _lang_String[_lang_leftGun] : _lang_String[_lang_rightGun]);
|
|
|
+ switch (pDcChargingInfo->Type) {
|
|
|
+ case _Type_Chademo:
|
|
|
+ strcat(GunType, "CHAdeMo ");
|
|
|
+ break;
|
|
|
+ case _Type_CCS_2:
|
|
|
+ strcat(GunType, (pDcChargingInfo->CCSGunType <= _TYPE_CCS1_Liquid) ? "CCS1 " : "CCS2 ");
|
|
|
+ break;
|
|
|
+ case _Type_GB:
|
|
|
+ strcat(GunType, "GBT ");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ sprintf(textList.textString, "%s",GunType);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList.textSize = 20;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+}
|
|
|
+void showTextLeftGunIdle()
|
|
|
+{
|
|
|
+ struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(LEFT_GUN_NUM);
|
|
|
+ if (!pDcChargingInfo->IsAvailable)
|
|
|
+ return;
|
|
|
+ Text_List textList;
|
|
|
+ char GunType[30];
|
|
|
+ textList.textviewIndex = _text_leftTitle;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 789;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 85;
|
|
|
+ textList.color_b = 184;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ textList.width = 540;
|
|
|
+ strcpy(GunType, _lang_String[_lang_leftidleTitle]);
|
|
|
+ /*
|
|
|
+ switch (pDcChargingInfo->Type) {
|
|
|
+ case _Type_Chademo:
|
|
|
+ strcat(GunType, "CHAdeMo");
|
|
|
+ break;
|
|
|
+ case _Type_CCS_2:
|
|
|
+ strcat(GunType, (pDcChargingInfo->CCSGunType <= _TYPE_CCS1_Liquid) ? "CCS1" : "CCS2");
|
|
|
+ break;
|
|
|
+ case _Type_GB:
|
|
|
+ strcat(GunType, "GBT");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ */
|
|
|
+ sprintf(textList.textString, "%s", GunType);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 25;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+ /*
|
|
|
+ // Script
|
|
|
+ textList.textviewIndex = _text_leftScript;
|
|
|
+ textList.layout_x = 188;
|
|
|
+ textList.layout_y = 850;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 85;
|
|
|
+ textList.color_b = 184;
|
|
|
+ textList.width = 200;
|
|
|
+ textList.alignment = ALIGNMENT_LEFT;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_idleScript]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 25;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+ */
|
|
|
+}
|
|
|
+void showTextRightGunIdle()
|
|
|
+{
|
|
|
+ struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(RIGHT_GUN_NUM);
|
|
|
+ if (!pDcChargingInfo->IsAvailable)
|
|
|
+ return;
|
|
|
+ Text_List textList;
|
|
|
+ char GunType[30];
|
|
|
+ textList.textviewIndex = _text_rightTitle;
|
|
|
+ textList.layout_x = 540;
|
|
|
+ textList.layout_y = 789;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 85;
|
|
|
+ textList.color_b = 184;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ textList.width = 540;
|
|
|
+ strcpy(GunType, _lang_String[_lang_rightidleTitle]);
|
|
|
+ /*
|
|
|
+ switch (pDcChargingInfo->Type) {
|
|
|
+ case _Type_Chademo:
|
|
|
+ strcat(GunType, "CHAdeMo");
|
|
|
+ break;
|
|
|
+ case _Type_CCS_2:
|
|
|
+ strcat(GunType, (pDcChargingInfo->CCSGunType <= _TYPE_CCS1_Liquid) ? "CCS1" : "CCS2");
|
|
|
+ break;
|
|
|
+ case _Type_GB:
|
|
|
+ strcat(GunType, "GBT");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ */
|
|
|
+ sprintf(textList.textString, "%s", GunType);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 25;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+ /*
|
|
|
+ // Script
|
|
|
+ textList.textviewIndex = _text_rightScript;
|
|
|
+ textList.layout_x = 726;
|
|
|
+ textList.layout_y = 850;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 85;
|
|
|
+ textList.color_b = 184;
|
|
|
+ textList.width = 200;
|
|
|
+ textList.alignment = ALIGNMENT_LEFT;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_idleScript]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 25;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+ */
|
|
|
+}
|
|
|
+
|
|
|
+void showTextLeftGunPlugin()
|
|
|
+{
|
|
|
+ struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(LEFT_GUN_NUM);
|
|
|
+ Text_List textList;
|
|
|
+ char GunType[30];
|
|
|
+ textList.textviewIndex = _text_leftTitle;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 809;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 85;
|
|
|
+ textList.color_b = 184;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ textList.width = 540;
|
|
|
+ /*
|
|
|
+ strcpy(GunType, _lang_String[_lang_leftGun]);
|
|
|
+ switch (pDcChargingInfo->Type) {
|
|
|
+ case _Type_Chademo:
|
|
|
+ strcat(GunType, "CHAdeMo");
|
|
|
+ break;
|
|
|
+ case _Type_CCS_2:
|
|
|
+ strcat(GunType, (pDcChargingInfo->CCSGunType <= _TYPE_CCS1_Liquid) ? "CCS1" : "CCS2");
|
|
|
+ break;
|
|
|
+ case _Type_GB:
|
|
|
+ strcat(GunType, "GBT");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ */
|
|
|
+ strcpy(GunType, _lang_String[_lang_pluginTitle]);
|
|
|
+ sprintf(textList.textString, "%s", GunType);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 25;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+
|
|
|
+ // Script
|
|
|
+ textList.textviewIndex = _text_leftScript;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 870;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 0;
|
|
|
+ textList.color_b = 0;
|
|
|
+ textList.width = 540;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_leftpluginScript]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 20;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+}
|
|
|
+
|
|
|
+void CheckConnectionTimeout(void)
|
|
|
+{
|
|
|
+ SelectGunInfo* ShmSelectGunInfo = (SelectGunInfo*)GetShmSelectGunInfo();
|
|
|
+ if (ShmSelectGunInfo->RemoteSetup.ConnectionTimeout != 0) { //Jerry add
|
|
|
+ _connectionTimeout = ShmSelectGunInfo->RemoteSetup.ConnectionTimeout;
|
|
|
+ } else {
|
|
|
+ _connectionTimeout = CONN_PLUG_TIMEOUT;
|
|
|
+ }
|
|
|
+ return;
|
|
|
+}
|
|
|
+
|
|
|
+void showTextPluginCntDown(int gunIndex,int cntdown)
|
|
|
+{
|
|
|
+ CheckConnectionTimeout();
|
|
|
+ cntdown = _connectionTimeout - cntdown;
|
|
|
+ // CountDown
|
|
|
+ Text_List textList;
|
|
|
+ if (gunIndex == LEFT_GUN_NUM) {
|
|
|
+ textList.textviewIndex = _text_leftplugincntdown;
|
|
|
+ textList.layout_x = 129;
|
|
|
+ } else {
|
|
|
+ textList.textviewIndex = _text_rightplugincntdown;
|
|
|
+ textList.layout_x = 665;
|
|
|
+ }
|
|
|
+ textList.layout_y = 862;
|
|
|
+ textList.color_r = 42;
|
|
|
+ textList.color_g = 161;
|
|
|
+ textList.color_b = 252;
|
|
|
+ textList.width = 75;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textString, "%d", cntdown);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 28;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+}
|
|
|
+
|
|
|
+void showTextRightGunPlugin()
|
|
|
+{
|
|
|
+ struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(RIGHT_GUN_NUM);
|
|
|
+ Text_List textList;
|
|
|
+ char GunType[30];
|
|
|
+ textList.textviewIndex = _text_rightTitle;
|
|
|
+ textList.layout_x = 540;
|
|
|
+ textList.layout_y = 809;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 85;
|
|
|
+ textList.color_b = 184;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ textList.width = 540;
|
|
|
+ /*
|
|
|
+ strcpy(GunType, _lang_String[_lang_rightGun]);
|
|
|
+ switch (pDcChargingInfo->Type) {
|
|
|
+ case _Type_Chademo:
|
|
|
+ strcat(GunType, "CHAdeMo");
|
|
|
+ break;
|
|
|
+ case _Type_CCS_2:
|
|
|
+ strcat(GunType, (pDcChargingInfo->CCSGunType <= _TYPE_CCS1_Liquid) ? "CCS1" : "CCS2");
|
|
|
+ break;
|
|
|
+ case _Type_GB:
|
|
|
+ strcat(GunType, "GBT");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ */
|
|
|
+ strcpy(GunType, _lang_String[_lang_pluginTitle]);
|
|
|
+ sprintf(textList.textString, "%s", GunType);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 25;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+
|
|
|
+ // Script
|
|
|
+ textList.textviewIndex = _text_rightScript;
|
|
|
+ textList.layout_x = 540;
|
|
|
+ textList.layout_y = 870;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 0;
|
|
|
+ textList.color_b = 0;
|
|
|
+ textList.width = 540;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_rightpluginScript]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 20;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+void showGunChargeInfo(int gunIndex)
|
|
|
+{
|
|
|
+ struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(gunIndex);
|
|
|
+ int x_axis = 100;
|
|
|
+ int y_axis = 1405;
|
|
|
+ int x_shift = 155;
|
|
|
+ int y_shift = 98;
|
|
|
+ int idxShift = 0;
|
|
|
+ int gun_shift = 0;
|
|
|
+ if (gunIndex == RIGHT_GUN_NUM) {
|
|
|
+ idxShift = ICON_INDEX_SHIFT;
|
|
|
+ gun_shift = 540;
|
|
|
+ }
|
|
|
+ Image_List imageList[5] = { 0 };
|
|
|
+ imageList[0].imageviewIndex = _icon_chargingLine + idxShift;
|
|
|
+
|
|
|
+ imageList[0].imgsrc_addr = _icon_chargingLine;
|
|
|
+
|
|
|
+ imageList[0].layout_x = x_axis + gun_shift+ 55;
|
|
|
+ imageList[0].layout_y = y_axis + 45;
|
|
|
+ imageList[0].width = 311;
|
|
|
+ imageList[0].height = 283;
|
|
|
+
|
|
|
+ for (int i = 1; i <= 3; i++) {
|
|
|
+ switch (i) {
|
|
|
+ case 1:
|
|
|
+ imageList[i].imageviewIndex = _icon_summary_engergy + idxShift;
|
|
|
+ imageList[i].imgsrc_addr = _icon_summary_engergy;
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ imageList[i].imageviewIndex = _icon_summary_time + idxShift;
|
|
|
+ imageList[i].imgsrc_addr = _icon_summary_time;
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ imageList[i].imageviewIndex = _icon_summary_money + idxShift;
|
|
|
+ imageList[i].imgsrc_addr = _icon_summary_money;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ imageList[i].layout_x = x_axis + gun_shift;
|
|
|
+ imageList[i].layout_y = y_axis + ((i-1) % 3) * y_shift;
|
|
|
+ imageList[i].width = 40;
|
|
|
+ imageList[i].height = 40;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (pDcChargingInfo->SystemStatus != S_AUTHORIZING &&
|
|
|
+ !is_chargingend(pDcChargingInfo->SystemStatus)) {
|
|
|
+ imageList[4].imageviewIndex = _icon_userprice_bg + idxShift;
|
|
|
+
|
|
|
+ imageList[4].imgsrc_addr = _icon_userprice_bg;
|
|
|
+
|
|
|
+ imageList[4].layout_x = x_axis + 72 + gun_shift;
|
|
|
+ imageList[4].layout_y = y_axis - 455;
|
|
|
+ imageList[4].width = 256;
|
|
|
+ imageList[4].height = 50;
|
|
|
+ }
|
|
|
+ publish_imageview_add(mosq, imageList, ARRAY_SIZE(imageList));
|
|
|
+
|
|
|
+ Text_List textList[6];
|
|
|
+ for (int i = 0; i < 3; i++) {
|
|
|
+ textList[i].textviewIndex = _text_leftEngergyScript + i + idxShift;
|
|
|
+ textList[i].layout_x = x_axis+ 55 + gun_shift;
|
|
|
+ textList[i].layout_y = y_axis + ((i % 3) * y_shift) - 20;
|
|
|
+ textList[i].color_r = 0;
|
|
|
+ textList[i].color_g = 0;
|
|
|
+ textList[i].color_b = 0;
|
|
|
+ textList[i].width = 200;
|
|
|
+ textList[i].alignment = ALIGNMENT_LEFT;
|
|
|
+ switch (i) {
|
|
|
+ case 0:
|
|
|
+ sprintf(textList[i].textString, _lang_String[_lang_engergy]);
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ sprintf(textList[i].textString, _lang_String[_lang_time]);
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ sprintf(textList[i].textString, _lang_String[_lang_ChargingFee]);
|
|
|
+ break;
|
|
|
+
|
|
|
+ }
|
|
|
+ sprintf(textList[i].textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList[i].textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList[i].textSize = 10;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < 3; i++) {
|
|
|
+ textList[i+3].textviewIndex = _text_leftParkingFeeScript + i + idxShift;
|
|
|
+ textList[i+3].layout_x = x_axis + (i % 3) * x_shift + gun_shift;
|
|
|
+ textList[i+3].layout_y = y_axis + y_shift*3 -20;
|
|
|
+ textList[i+3].color_r = 0;
|
|
|
+ textList[i+3].color_g = 0;
|
|
|
+ textList[i+3].color_b = 0;
|
|
|
+ textList[i+3].width = 200;
|
|
|
+ textList[i+3].alignment = ALIGNMENT_LEFT;
|
|
|
+ switch (i) {
|
|
|
+ case 0:
|
|
|
+ sprintf(textList[i+3].textString, _lang_String[_lang_ParkingFee]);
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ sprintf(textList[i+3].textString, _lang_String[_lang_TotalCost]);
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ sprintf(textList[i+3].textString, _lang_String[_lang_RemainAmount]);
|
|
|
+ break;
|
|
|
+
|
|
|
+ }
|
|
|
+ sprintf(textList[i+3].textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList[i+3].textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList[i+3].textSize = 10;
|
|
|
+ }
|
|
|
+
|
|
|
+ publish_textview_add(mosq, textList, ARRAY_SIZE(textList));
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void showSummaryChargeInfo()
|
|
|
+{
|
|
|
+ Image_List imageList[7];
|
|
|
+ for (int i = 0; i < 6; i++) {
|
|
|
+ imageList[i].imageviewIndex = _icon_summary_engergy + i;
|
|
|
+
|
|
|
+ imageList[i].imgsrc_addr = _icon_summary_engergy + i;;
|
|
|
+
|
|
|
+ imageList[i].layout_x = 441 + (i / 3) * 342;
|
|
|
+ imageList[i].layout_y = 1044 + (i % 3) * 120;
|
|
|
+ imageList[i].width = 65;
|
|
|
+ imageList[i].height = 65;
|
|
|
+ }
|
|
|
+ imageList[6].imageviewIndex = _icon_info_qr;
|
|
|
+ imageList[6].imgsrc_addr = _icon_info_qr;
|
|
|
+ imageList[6].layout_x = 70;
|
|
|
+ imageList[6].layout_y = 1052;
|
|
|
+ imageList[6].width = 268;
|
|
|
+ imageList[6].height = 268;
|
|
|
+
|
|
|
+ publish_imageview_add(mosq, imageList, ARRAY_SIZE(imageList));
|
|
|
+
|
|
|
+ Text_List textList[6];
|
|
|
+ for (int i = 0; i < 6; i++) {
|
|
|
+ textList[i].textviewIndex = _text_leftEngergyScript + i;
|
|
|
+ textList[i].layout_x = 531 + (i / 3) * 342;
|
|
|
+ textList[i].layout_y = 1049 + (i % 3) * 120;
|
|
|
+ textList[i].color_r = 0;
|
|
|
+ textList[i].color_g = 85;
|
|
|
+ textList[i].color_b = 184;
|
|
|
+ textList[i].width = 200;
|
|
|
+ textList[i].alignment = ALIGNMENT_LEFT;
|
|
|
+ switch (i) {
|
|
|
+ case 0:
|
|
|
+ sprintf(textList[i].textString, _lang_String[_lang_engergy]);
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ sprintf(textList[i].textString, _lang_String[_lang_ChargingFee]);
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ sprintf(textList[i].textString, _lang_String[_lang_time]);
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ sprintf(textList[i].textString, _lang_String[_lang_ParkingFee]);
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ sprintf(textList[i].textString, _lang_String[_lang_TotalCost]);
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ sprintf(textList[i].textString, _lang_String[_lang_RemainAmount]);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ sprintf(textList[i].textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList[i].textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList[i].textSize = 13;
|
|
|
+ }
|
|
|
+ publish_textview_add(mosq, textList, ARRAY_SIZE(textList));
|
|
|
+
|
|
|
+
|
|
|
+ struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(pSysInfo->CurGunSelected);
|
|
|
+ SelectGunInfo* ShmSelectGunInfo = (SelectGunInfo*)GetShmSelectGunInfo();
|
|
|
+
|
|
|
+ float energy = pDcChargingInfo->PresentChargedEnergy;
|
|
|
+ float chargingfee = ShmSelectGunInfo->PricesInfo[pSysInfo->CurGunSelected].EnergyCost;
|
|
|
+ int sec = pDcChargingInfo->PresentChargedDuration;
|
|
|
+ float parkingfee = ShmSelectGunInfo->PricesInfo[pSysInfo->CurGunSelected].ParkingFee;
|
|
|
+ float totalcost = pDcChargingInfo->ChargingFee;
|
|
|
+ float remainamount = ShmSelectGunInfo->PricesInfo[pSysInfo->CurGunSelected].RemainAmount;
|
|
|
+
|
|
|
+ /////////////////////////////////////////////////////////////
|
|
|
+ if (energy < 0)
|
|
|
+ energy = 0;
|
|
|
+ textList[0].textviewIndex = _text_leftEngergyValue;
|
|
|
+ textList[0].layout_x = 531;
|
|
|
+ textList[0].layout_y = 1075;
|
|
|
+ textList[0].color_r = 0;
|
|
|
+ textList[0].color_g = 85;
|
|
|
+ textList[0].color_b = 184;
|
|
|
+ sprintf(textList[0].textStyle, FONT_STYLE_BOLD);
|
|
|
+
|
|
|
+ textList[0].textSize = 15;
|
|
|
+ textList[0].width = 200;
|
|
|
+ textList[0].alignment = ALIGNMENT_LEFT;
|
|
|
+ sprintf(textList[0].textString, "%.4f", energy);
|
|
|
+ sprintf(textList[0].textFont, FONT_ARIAL);
|
|
|
+ /////////////////////////////////////////////////////////////
|
|
|
+ if (chargingfee < 0)
|
|
|
+ chargingfee = 0;
|
|
|
+
|
|
|
+ textList[1].textviewIndex = _text_leftChargingFeeValue;
|
|
|
+ textList[1].layout_x = 531;
|
|
|
+ textList[1].layout_y = 1075 + 120;
|
|
|
+ textList[1].color_r = 0;
|
|
|
+ textList[1].color_g = 85;
|
|
|
+ textList[1].color_b = 184;
|
|
|
+ sprintf(textList[1].textStyle, FONT_STYLE_BOLD);
|
|
|
+
|
|
|
+ textList[1].width = 200;
|
|
|
+ textList[1].alignment = ALIGNMENT_LEFT;
|
|
|
+ sprintf(textList[1].textString, "%.4f", chargingfee);
|
|
|
+ sprintf(textList[1].textFont, FONT_ARIAL);
|
|
|
+ textList[1].textSize = 15;
|
|
|
+ /////////////////////////////////////////////////////////////
|
|
|
+ if (sec < 0)
|
|
|
+ sec = 0;
|
|
|
+ char time[20] = { 0 };
|
|
|
+ sprintf(time, "%02d:%02d:%02d", sec / 3600, (sec % 3600) / 60, sec % 60);
|
|
|
+
|
|
|
+ textList[2].textviewIndex = _text_leftTimeValue;
|
|
|
+ textList[2].layout_x = 531;
|
|
|
+ textList[2].layout_y = 1075 + 120 * 2;
|
|
|
+ textList[2].color_r = 0;
|
|
|
+ textList[2].color_g = 85;
|
|
|
+ textList[2].color_b = 184;
|
|
|
+ sprintf(textList[2].textStyle, FONT_STYLE_BOLD);
|
|
|
+
|
|
|
+ textList[2].width = 200;
|
|
|
+ textList[2].alignment = ALIGNMENT_LEFT;
|
|
|
+ sprintf(textList[2].textString, time);
|
|
|
+ sprintf(textList[2].textFont, FONT_ARIAL);
|
|
|
+ textList[2].textSize = 15;
|
|
|
+ /////////////////////////////////////////////////////////////
|
|
|
+ if (parkingfee < 0)
|
|
|
+ parkingfee = 0;
|
|
|
+ textList[3].textviewIndex = _text_leftParkingFeeValue;
|
|
|
+ textList[3].layout_x = 531 + 342;
|
|
|
+ textList[3].layout_y = 1075;
|
|
|
+ textList[3].color_r = 0;
|
|
|
+ textList[3].color_g = 85;
|
|
|
+ textList[3].color_b = 184;
|
|
|
+ sprintf(textList[3].textString, "%.2f", parkingfee);
|
|
|
+ textList[3].textSize = 15;
|
|
|
+ sprintf(textList[3].textStyle, FONT_STYLE_BOLD);
|
|
|
+ /////////////////////////////////////////////////////////////
|
|
|
+ if (totalcost < 0)
|
|
|
+ totalcost = 0;
|
|
|
+
|
|
|
+ textList[4].textviewIndex = _text_leftTotalCostValue;
|
|
|
+ textList[4].layout_x = 531 + 342;
|
|
|
+ textList[4].layout_y = 1075 + 120;
|
|
|
+ textList[4].color_r = 0;
|
|
|
+ textList[4].color_g = 85;
|
|
|
+ textList[4].color_b = 184;
|
|
|
+ sprintf(textList[4].textStyle, FONT_STYLE_BOLD);
|
|
|
+
|
|
|
+ textList[4].width = 200;
|
|
|
+ textList[4].alignment = ALIGNMENT_LEFT;
|
|
|
+ sprintf(textList[4].textString, "%.2f", totalcost);
|
|
|
+ sprintf(textList[4].textFont, FONT_ARIAL);
|
|
|
+ textList[4].textSize = 15;
|
|
|
+ /////////////////////////////////////////////////////////////
|
|
|
+ if (remainamount < 0)
|
|
|
+ remainamount = 0;
|
|
|
+
|
|
|
+ textList[5].textviewIndex = _text_leftRemainAmountValue;
|
|
|
+ textList[5].layout_x = 531 + 342;
|
|
|
+ textList[5].layout_y = 1075 + 120 * 2;
|
|
|
+ textList[5].color_r = 0;
|
|
|
+ textList[5].color_g = 85;
|
|
|
+ textList[5].color_b = 184;
|
|
|
+ sprintf(textList[5].textStyle, FONT_STYLE_BOLD);
|
|
|
+
|
|
|
+ textList[5].width = 200;
|
|
|
+ textList[5].alignment = ALIGNMENT_LEFT;
|
|
|
+ sprintf(textList[5].textString, "%.2f", remainamount);
|
|
|
+ sprintf(textList[5].textFont, FONT_ARIAL);
|
|
|
+ textList[5].textSize = 15;
|
|
|
+
|
|
|
+ publish_textview_add(mosq, textList, ARRAY_SIZE(textList));
|
|
|
+
|
|
|
+ if (strcmp(ShmDcCommonData->pGunInfo[pSysInfo->CurGunSelected].ReceiptInfo, "") != EQUAL) {
|
|
|
+ QrCode_List qrCodeList = { 0 };
|
|
|
+
|
|
|
+ qrCodeList.qrCodeIndex = _icon_qr;
|
|
|
+ sprintf((char*)qrCodeList.qrCodeContent, (char*)ShmDcCommonData->pGunInfo[pSysInfo->CurGunSelected].ReceiptInfo);
|
|
|
+ sprintf((char*)qrCodeList.errorCorrection, "M");
|
|
|
+ qrCodeList.layout_x = 84;//(rand()%800+100);
|
|
|
+ qrCodeList.layout_y = 1066;//(rand()%800+100);
|
|
|
+ qrCodeList.width = 240;
|
|
|
+ qrCodeList.height = 240;
|
|
|
+
|
|
|
+ publish_qrcodeimage_add(mosq, &qrCodeList, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+void showTextChargingInfo(int gunIndex)
|
|
|
+{
|
|
|
+ struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(gunIndex);
|
|
|
+ SelectGunInfo* ShmSelectGunInfo = (SelectGunInfo*)GetShmSelectGunInfo();
|
|
|
+
|
|
|
+ float energy = pDcChargingInfo->PresentChargedEnergy;
|
|
|
+ float chargingfee = ShmSelectGunInfo->PricesInfo[gunIndex].EnergyCost;
|
|
|
+ int sec = pDcChargingInfo->PresentChargedDuration;
|
|
|
+ float parkingfee = ShmSelectGunInfo->PricesInfo[gunIndex].ParkingFee;
|
|
|
+ float totalcost = pDcChargingInfo->ChargingFee;
|
|
|
+ float remainamount = ShmSelectGunInfo->PricesInfo[gunIndex].RemainAmount;
|
|
|
+ float power = pDcChargingInfo->PresentChargingPower;
|
|
|
+
|
|
|
+ int x_axis = 100;
|
|
|
+ int y_axis = 1405;
|
|
|
+ int x_shift = 155;
|
|
|
+ int y_shift = 98;
|
|
|
+ int idxShift = 0;
|
|
|
+ int gun_shift = 0;
|
|
|
+ if (gunIndex == RIGHT_GUN_NUM) {
|
|
|
+ idxShift = ICON_INDEX_SHIFT;
|
|
|
+ gun_shift = 540;
|
|
|
+ }
|
|
|
+ /////////////////////////////////////////////////////////////
|
|
|
+ if (energy < 0)
|
|
|
+ energy = 0;
|
|
|
+ Text_List textList[7];
|
|
|
+
|
|
|
+ textList[0].textviewIndex = _text_leftEngergyValue + idxShift;
|
|
|
+ textList[0].layout_x = x_axis + 55 + gun_shift;
|
|
|
+ textList[0].layout_y = y_axis + (0 % 3) * y_shift;;
|
|
|
+ textList[0].color_r = 0;
|
|
|
+ textList[0].color_g = 85;
|
|
|
+ textList[0].color_b = 184;
|
|
|
+ sprintf(textList[0].textStyle, FONT_STYLE_NORMAL);
|
|
|
+
|
|
|
+ textList[0].textSize = 20;
|
|
|
+ textList[0].width = 200;
|
|
|
+ textList[0].alignment = ALIGNMENT_LEFT;
|
|
|
+ sprintf(textList[0].textString, "%.4f", energy);
|
|
|
+ sprintf(textList[0].textFont, FONT_ARIAL);
|
|
|
+ /////////////////////////////////////////////////////////////
|
|
|
+ if (chargingfee < 0)
|
|
|
+ chargingfee = 0;
|
|
|
+
|
|
|
+ textList[1].textviewIndex = _text_leftChargingFeeValue + idxShift;;
|
|
|
+ textList[1].layout_x = x_axis + 55 + gun_shift;
|
|
|
+ textList[1].layout_y = y_axis + (2 % 3) * y_shift;;
|
|
|
+
|
|
|
+ textList[1].color_r = 0;
|
|
|
+ textList[1].color_g = 85;
|
|
|
+ textList[1].color_b = 184;
|
|
|
+ sprintf(textList[1].textStyle, FONT_STYLE_NORMAL);
|
|
|
+
|
|
|
+ textList[1].width = 200;
|
|
|
+ textList[1].alignment = ALIGNMENT_LEFT;
|
|
|
+ sprintf(textList[1].textString, "%.4f", chargingfee);
|
|
|
+ sprintf(textList[1].textFont, FONT_ARIAL);
|
|
|
+ textList[1].textSize = 20;
|
|
|
+ /////////////////////////////////////////////////////////////
|
|
|
+ if (sec < 0)
|
|
|
+ sec = 0;
|
|
|
+ char time[20] = { 0 };
|
|
|
+ sprintf(time, "%02d:%02d:%02d", sec / 3600, (sec % 3600) / 60, sec % 60);
|
|
|
+
|
|
|
+ textList[2].textviewIndex = _text_leftTimeValue + idxShift;
|
|
|
+ textList[2].layout_x = x_axis + 55 + gun_shift;
|
|
|
+ textList[2].layout_y = y_axis + (1 % 3) * y_shift;;
|
|
|
+
|
|
|
+ textList[2].color_r = 0;
|
|
|
+ textList[2].color_g = 85;
|
|
|
+ textList[2].color_b = 184;
|
|
|
+ sprintf(textList[2].textStyle, FONT_STYLE_NORMAL);
|
|
|
+
|
|
|
+ textList[2].width = 200;
|
|
|
+ textList[2].alignment = ALIGNMENT_LEFT;
|
|
|
+ sprintf(textList[2].textString, time);
|
|
|
+ sprintf(textList[2].textFont, FONT_ARIAL);
|
|
|
+ textList[2].textSize = 20;
|
|
|
+ /////////////////////////////////////////////////////////////
|
|
|
+ if (parkingfee < 0)
|
|
|
+ parkingfee = 0;
|
|
|
+ textList[3].textviewIndex = _text_leftParkingFeeValue + idxShift;
|
|
|
+ textList[3].layout_x = x_axis + (3 % 3) * x_shift + gun_shift;
|
|
|
+ textList[3].layout_y = y_axis + y_shift * 3;
|
|
|
+ textList[3].color_r = 0;
|
|
|
+ textList[3].color_g = 85;
|
|
|
+ textList[3].color_b = 184;
|
|
|
+ sprintf(textList[3].textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList[3].width = 200;
|
|
|
+ textList[3].alignment = ALIGNMENT_LEFT;
|
|
|
+ sprintf(textList[3].textString, "%.2f", parkingfee);
|
|
|
+ sprintf(textList[3].textFont, FONT_ARIAL);
|
|
|
+ textList[3].textSize = 15;
|
|
|
+ /////////////////////////////////////////////////////////////
|
|
|
+ if (totalcost < 0)
|
|
|
+ totalcost = 0;
|
|
|
+
|
|
|
+ textList[4].textviewIndex = _text_leftTotalCostValue + idxShift;
|
|
|
+ textList[4].layout_x = x_axis + (4 % 3) * x_shift + gun_shift;
|
|
|
+ textList[4].layout_y = y_axis + y_shift * 3 ;
|
|
|
+ textList[4].color_r = 0;
|
|
|
+ textList[4].color_g = 85;
|
|
|
+ textList[4].color_b = 184;
|
|
|
+ sprintf(textList[4].textStyle, FONT_STYLE_NORMAL);
|
|
|
+
|
|
|
+ textList[4].width = 200;
|
|
|
+ textList[4].alignment = ALIGNMENT_LEFT;
|
|
|
+ sprintf(textList[4].textString, "%.2f", totalcost);
|
|
|
+ sprintf(textList[4].textFont, FONT_ARIAL);
|
|
|
+ textList[4].textSize = 15;
|
|
|
+ /////////////////////////////////////////////////////////////
|
|
|
+ if (remainamount < 0)
|
|
|
+ remainamount = 0;
|
|
|
+
|
|
|
+ textList[5].textviewIndex = _text_leftRemainAmountValue + idxShift;
|
|
|
+ textList[5].layout_x = x_axis + (5 % 3) * x_shift + gun_shift;
|
|
|
+ textList[5].layout_y = y_axis + y_shift * 3 ;
|
|
|
+
|
|
|
+ textList[5].color_r = 0;
|
|
|
+ textList[5].color_g = 85;
|
|
|
+ textList[5].color_b = 184;
|
|
|
+ sprintf(textList[5].textStyle, FONT_STYLE_NORMAL);
|
|
|
+
|
|
|
+ textList[5].width = 200;
|
|
|
+ textList[5].alignment = ALIGNMENT_LEFT;
|
|
|
+ sprintf(textList[5].textString, "%.2f", remainamount);
|
|
|
+ sprintf(textList[5].textFont, FONT_ARIAL);
|
|
|
+ textList[5].textSize = 15;
|
|
|
+
|
|
|
+ /////////////////////////////////////////////////////////////
|
|
|
+ if (power < 0)
|
|
|
+ power = 0;
|
|
|
+ if (pDcChargingInfo->SystemStatus == S_CHARGING) {
|
|
|
+ if (gunIndex == LEFT_GUN_NUM) {
|
|
|
+ textList[6].textviewIndex = _text_leftPowerValue;
|
|
|
+ textList[6].layout_x = 250;
|
|
|
+
|
|
|
+ } else {
|
|
|
+ textList[6].textviewIndex = _text_rightPowerValue;
|
|
|
+ textList[6].layout_x = 790;
|
|
|
+ }
|
|
|
+ textList[6].layout_y = 1140;
|
|
|
+ textList[6].color_r = 0;
|
|
|
+ textList[6].color_g = 85;
|
|
|
+ textList[6].color_b = 184;
|
|
|
+ sprintf(textList[6].textStyle, FONT_STYLE_NORMAL);
|
|
|
+ }
|
|
|
+ textList[6].width = 200;
|
|
|
+ textList[6].alignment = ALIGNMENT_LEFT;
|
|
|
+ if (power > 100)
|
|
|
+ sprintf(textList[6].textString, "%d kW", (int)power);
|
|
|
+ else if (power > 10)
|
|
|
+ sprintf(textList[6].textString, "%.1f kW", power);
|
|
|
+ else
|
|
|
+ sprintf(textList[6].textString, "%.2f kW", power);
|
|
|
+ sprintf(textList[6].textFont, FONT_ARIAL);
|
|
|
+ textList[6].textSize = 15;
|
|
|
+
|
|
|
+ publish_textview_add(mosq, textList, ARRAY_SIZE(textList));
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void showTextPrechargingTitle(int gunIndex)
|
|
|
+{
|
|
|
+ struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(gunIndex);
|
|
|
+ Text_List textList;
|
|
|
+ char GunType[30] = {0};
|
|
|
+ if (gunIndex == LEFT_GUN_NUM) {
|
|
|
+ textList.textviewIndex = _text_leftTitle;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ } else {
|
|
|
+ textList.textviewIndex = _text_rightTitle;
|
|
|
+ textList.layout_x = 540;
|
|
|
+ }
|
|
|
+ textList.layout_y = 809;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 85;
|
|
|
+ textList.color_b = 184;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ textList.width = 540;
|
|
|
+
|
|
|
+ strcat(GunType, _lang_String[_lang_prechargingTitle]);
|
|
|
+ sprintf(textList.textString, "%s", GunType);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 25;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+
|
|
|
+
|
|
|
+ if (gunIndex == LEFT_GUN_NUM) {
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.textviewIndex = _text_leftScript;
|
|
|
+ } else {
|
|
|
+ textList.layout_x = 540;
|
|
|
+
|
|
|
+ textList.textviewIndex = _text_rightScript;
|
|
|
+ }
|
|
|
+ textList.layout_y = 920;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 85;
|
|
|
+ textList.color_b = 184;
|
|
|
+ textList.width = 540;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_UserPriceScript]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 15;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+}
|
|
|
+
|
|
|
+void showTextChargingTitle(int gunIndex)
|
|
|
+{
|
|
|
+ struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(gunIndex);
|
|
|
+ Text_List textList;
|
|
|
+ char GunType[30];
|
|
|
+ if (gunIndex == LEFT_GUN_NUM) {
|
|
|
+ textList.textviewIndex = _text_leftTitle;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ } else {
|
|
|
+ textList.textviewIndex = _text_rightTitle;
|
|
|
+ textList.layout_x = 540;
|
|
|
+ }
|
|
|
+ textList.layout_y = 809;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 85;
|
|
|
+ textList.color_b = 184;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ textList.width = 540;
|
|
|
+ strcpy(GunType, gunIndex == LEFT_GUN_NUM ? _lang_String[_lang_leftGun] : _lang_String[_lang_rightGun]);
|
|
|
+ /*
|
|
|
+ switch (pDcChargingInfo->Type) {
|
|
|
+ case _Type_Chademo:
|
|
|
+ strcat(GunType, "CHAdeMo");
|
|
|
+ break;
|
|
|
+ case _Type_CCS_2:
|
|
|
+ strcat(GunType, (pDcChargingInfo->CCSGunType <= _TYPE_CCS1_Liquid) ? "CCS1" : "CCS2");
|
|
|
+ break;
|
|
|
+ case _Type_GB:
|
|
|
+ strcat(GunType, "GBT");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ */
|
|
|
+ strcat(GunType, _lang_String[_lang_chargingTitle]);
|
|
|
+ sprintf(textList.textString, "%s", GunType);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 25;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+
|
|
|
+
|
|
|
+ if (gunIndex == LEFT_GUN_NUM) {
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.textviewIndex = _text_leftScript;
|
|
|
+ } else {
|
|
|
+ textList.layout_x = 540;
|
|
|
+
|
|
|
+ textList.textviewIndex = _text_rightScript;
|
|
|
+ }
|
|
|
+ textList.layout_y = 920;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 85;
|
|
|
+ textList.color_b = 184;
|
|
|
+ textList.width = 540;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_UserPriceScript]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 15;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+}
|
|
|
+
|
|
|
+void showTextCompleteCharging(int gunIndex)
|
|
|
+{
|
|
|
+ struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(gunIndex);
|
|
|
+ Text_List textList;
|
|
|
+ char GunType[30];
|
|
|
+ if (gunIndex == LEFT_GUN_NUM) {
|
|
|
+ textList.textviewIndex = _text_leftTitle;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 809;
|
|
|
+ } else {
|
|
|
+ textList.textviewIndex = _text_rightTitle;
|
|
|
+ textList.layout_x = 540;
|
|
|
+ textList.layout_y = 809;
|
|
|
+ }
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 85;
|
|
|
+ textList.color_b = 184;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ textList.width = 540;
|
|
|
+ strcpy(GunType, gunIndex == LEFT_GUN_NUM ? _lang_String[_lang_leftGun] : _lang_String[_lang_rightGun]);
|
|
|
+ /*
|
|
|
+ switch (pDcChargingInfo->Type) {
|
|
|
+ case _Type_Chademo:
|
|
|
+ strcat(GunType, "CHAdeMo");
|
|
|
+ break;
|
|
|
+ case _Type_CCS_2:
|
|
|
+ strcat(GunType, (pDcChargingInfo->CCSGunType <= _TYPE_CCS1_Liquid) ? "CCS1" : "CCS2");
|
|
|
+ break;
|
|
|
+ case _Type_GB:
|
|
|
+ strcat(GunType, "GBT");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ */
|
|
|
+ strcat(GunType, _lang_String[_lang_StopChargingTitlte]);
|
|
|
+ sprintf(textList.textString, "%s", GunType);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 25;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+
|
|
|
+ // Script
|
|
|
+
|
|
|
+ if (gunIndex == LEFT_GUN_NUM) {
|
|
|
+ textList.textviewIndex = _text_leftScript;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 870;
|
|
|
+ } else {
|
|
|
+ textList.textviewIndex = _text_rightScript;
|
|
|
+ textList.layout_x = 540;
|
|
|
+ textList.layout_y = 870;
|
|
|
+ }
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 0;
|
|
|
+ textList.color_b = 0;
|
|
|
+ textList.width = 540;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_StopChargingScript]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList.textSize = 20;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+}
|
|
|
+
|
|
|
+void showTextReOperate(int gunIndex)
|
|
|
+{
|
|
|
+ struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(gunIndex);
|
|
|
+ Text_List textList;
|
|
|
+ char GunType[30];
|
|
|
+ if (gunIndex == LEFT_GUN_NUM) {
|
|
|
+ textList.textviewIndex = _text_leftTitle;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 809;
|
|
|
+ } else {
|
|
|
+ textList.textviewIndex = _text_rightTitle;
|
|
|
+ textList.layout_x = 540;
|
|
|
+ textList.layout_y = 809;
|
|
|
+ }
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 85;
|
|
|
+ textList.color_b = 184;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ textList.width = 540;
|
|
|
+ strcpy(GunType, _lang_String[_lang_ReOperateTitlte]);
|
|
|
+ sprintf(textList.textString, "%s", GunType);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 25;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+
|
|
|
+ // Script
|
|
|
+
|
|
|
+ if (gunIndex == LEFT_GUN_NUM) {
|
|
|
+ textList.textviewIndex = _text_leftScript;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 870;
|
|
|
+ } else {
|
|
|
+ textList.textviewIndex = _text_rightScript;
|
|
|
+ textList.layout_x = 540;
|
|
|
+ textList.layout_y = 870;
|
|
|
+ }
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 0;
|
|
|
+ textList.color_b = 0;
|
|
|
+ textList.width = 540;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_ReOperateScript]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList.textSize = 20;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+}
|
|
|
+
|
|
|
+void showAlarmCode_QRURL(int gunIndex)
|
|
|
+{
|
|
|
+ char cmd[30] = { 0 };
|
|
|
+ struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(gunIndex);
|
|
|
+
|
|
|
+ Image_List imageList[2];
|
|
|
+ imageList[0].imageviewIndex = _icon_alarm_bg;
|
|
|
+ imageList[0].imgsrc_addr = _icon_alarm_bg;
|
|
|
+ imageList[0].layout_x = 441;
|
|
|
+ imageList[0].layout_y = 1094;
|
|
|
+ imageList[0].width = 362;
|
|
|
+ imageList[0].height = 52;
|
|
|
+
|
|
|
+ imageList[1].imageviewIndex = _icon_info_qr;
|
|
|
+ imageList[1].imgsrc_addr = _icon_info_qr;
|
|
|
+ imageList[1].layout_x = 70;
|
|
|
+ imageList[1].layout_y = 1052;
|
|
|
+ imageList[1].width = 268;
|
|
|
+ imageList[1].height = 268;
|
|
|
+ publish_imageview_add(mosq, imageList, ARRAY_SIZE(imageList));
|
|
|
+
|
|
|
+ Text_List textList[3];
|
|
|
+ textList[0].textviewIndex = _text_alarmcode;
|
|
|
+ textList[0].layout_x = 441;
|
|
|
+ textList[0].layout_y = 1099;
|
|
|
+ textList[0].color_r = 255;
|
|
|
+ textList[0].color_g = 255;
|
|
|
+ textList[0].color_b = 255;
|
|
|
+ textList[0].width = 362;
|
|
|
+ textList[0].alignment = ALIGNMENT_CENTER;
|
|
|
+ strcpy(cmd, _lang_String[_lang_alarmcode]);
|
|
|
+ //sprintf(pDcChargingInfo->EvConnAlarmCode, "012304");
|
|
|
+ strcat(cmd, pDcChargingInfo->EvConnAlarmCode);
|
|
|
+ sprintf(textList[0].textString, "%s",cmd);
|
|
|
+ sprintf(textList[0].textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList[0].textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList[0].textSize = 20;
|
|
|
+
|
|
|
+ textList[1].textviewIndex = _text_systemTitle;
|
|
|
+ textList[1].layout_x = 450;
|
|
|
+ textList[1].layout_y = 1200;
|
|
|
+ textList[1].color_r = 0;
|
|
|
+ textList[1].color_g = 0;
|
|
|
+ textList[1].color_b = 0;
|
|
|
+ textList[1].width = 500;
|
|
|
+ textList[1].alignment = ALIGNMENT_LEFT;
|
|
|
+ strcpy(textList[1].textString, _lang_String[_lang_alarmTitle]);
|
|
|
+ sprintf(textList[1].textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList[1].textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList[1].textSize = 20;
|
|
|
+
|
|
|
+ textList[2].textviewIndex = _text_systemScript;
|
|
|
+ textList[2].layout_x = 450;
|
|
|
+ textList[2].layout_y = 1240;
|
|
|
+ textList[2].color_r = 0;
|
|
|
+ textList[2].color_g = 0;
|
|
|
+ textList[2].color_b = 0;
|
|
|
+ textList[2].width = 500;
|
|
|
+ textList[2].alignment = ALIGNMENT_LEFT;
|
|
|
+ strcpy(textList[2].textString, _lang_String[_lang_alarmScript]);
|
|
|
+ sprintf(textList[2].textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList[2].textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList[2].textSize = 20;
|
|
|
+ publish_textview_add(mosq, textList, ARRAY_SIZE(textList));
|
|
|
+
|
|
|
+ QrCode_List qrCodeList;
|
|
|
+ qrCodeList.qrCodeIndex = _icon_qr;
|
|
|
+ sprintf((char*)qrCodeList.qrCodeContent, _ALARMQRCODEURL);
|
|
|
+ sprintf((char*)qrCodeList.errorCorrection, "M");
|
|
|
+ qrCodeList.layout_x = 74;//(rand()%800+100);
|
|
|
+ qrCodeList.layout_y = 1056;//(rand()%800+100);
|
|
|
+ qrCodeList.width = 260;
|
|
|
+ qrCodeList.height = 260;
|
|
|
+
|
|
|
+ publish_qrcodeimage_add(mosq, &qrCodeList, 1);
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void showFixContect()
|
|
|
+{
|
|
|
+ Image_List imageList[2];
|
|
|
+ imageList[0].imageviewIndex = _icon_fix;
|
|
|
+ imageList[0].imgsrc_addr = _icon_fix;
|
|
|
+ imageList[0].layout_x = 392;
|
|
|
+ imageList[0].layout_y = 1094;
|
|
|
+ imageList[0].width = 296;
|
|
|
+ imageList[0].height = 267;
|
|
|
+
|
|
|
+ imageList[1].imageviewIndex = _icon_phone;
|
|
|
+ imageList[1].imgsrc_addr = _icon_phone;
|
|
|
+ imageList[1].layout_x = 455;
|
|
|
+ imageList[1].layout_y = 927;
|
|
|
+ imageList[1].width = 35;
|
|
|
+ imageList[1].height = 34;
|
|
|
+ publish_imageview_add(mosq, imageList, ARRAY_SIZE(imageList));
|
|
|
+
|
|
|
+ // Title
|
|
|
+ Text_List textList;
|
|
|
+ textList.textviewIndex = _text_systemTitle;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 807;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 85;
|
|
|
+ textList.color_b = 184;
|
|
|
+ textList.width = 1080;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_fixTitle]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 30;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+ // Script
|
|
|
+ textList.textviewIndex = _text_systemScript;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 867;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 0;
|
|
|
+ textList.color_b = 0;
|
|
|
+ textList.width = 1080;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_fixScript]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList.textSize = 20;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+
|
|
|
+ // Script
|
|
|
+ textList.textviewIndex = _text_fixphone;
|
|
|
+ textList.layout_x = 500;
|
|
|
+ textList.layout_y = 922;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 0;
|
|
|
+ textList.color_b = 0;
|
|
|
+ textList.width = 540;
|
|
|
+ textList.alignment = ALIGNMENT_LEFT;
|
|
|
+ sprintf(textList.textString, _phone);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList.textSize = 20;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+}
|
|
|
+
|
|
|
+void showPlugoutContect()
|
|
|
+{
|
|
|
+ Image_List imageList[1];
|
|
|
+ imageList[0].imageviewIndex = _icon_exclamation;
|
|
|
+ imageList[0].imgsrc_addr = _icon_exclamation;
|
|
|
+ imageList[0].layout_x = 392;
|
|
|
+ imageList[0].layout_y = 837;
|
|
|
+ imageList[0].width = 296;
|
|
|
+ imageList[0].height = 267;
|
|
|
+ publish_imageview_add(mosq, imageList, ARRAY_SIZE(imageList));
|
|
|
+
|
|
|
+ // Title
|
|
|
+ Text_List textList;
|
|
|
+ textList.textviewIndex = _text_systemTitle;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 1194;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 85;
|
|
|
+ textList.color_b = 184;
|
|
|
+ textList.width = 1080;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_plugout]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 30;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+
|
|
|
+}
|
|
|
+void showHelpContect()
|
|
|
+{
|
|
|
+ Image_List imageList[1];
|
|
|
+ imageList[0].imageviewIndex = _icon_help;
|
|
|
+ imageList[0].imgsrc_addr = _icon_help;
|
|
|
+ imageList[0].layout_x = 392;
|
|
|
+ imageList[0].layout_y = 837;
|
|
|
+ imageList[0].width = 296;
|
|
|
+ imageList[0].height = 267;
|
|
|
+ publish_imageview_add(mosq, imageList, ARRAY_SIZE(imageList));
|
|
|
+
|
|
|
+ // Title
|
|
|
+ Text_List textList[2];
|
|
|
+
|
|
|
+ textList[0].textviewIndex = _text_systemTitle;
|
|
|
+ textList[0].layout_x = 0;
|
|
|
+ textList[0].layout_y = 1194;
|
|
|
+ textList[0].color_r = 0;
|
|
|
+ textList[0].color_g = 0;
|
|
|
+ textList[0].color_b = 0;
|
|
|
+ textList[0].width = 1080;
|
|
|
+ textList[0].alignment = ALIGNMENT_CENTER;
|
|
|
+ if (ShmDcCommonData->previousPage == _PAGE_AUTHORIZE_FAIL) {
|
|
|
+ sprintf(textList[0].textString, _lang_String[_lang_HelpAuthFailTitle]);
|
|
|
+ } else {
|
|
|
+ if (ShmDcCommonData->pGunInfo[0].WaitForPlugit ||
|
|
|
+ ShmDcCommonData->pGunInfo[1].WaitForPlugit) {
|
|
|
+ sprintf(textList[0].textString, _lang_String[_lang_HelpPlugInTitle]);
|
|
|
+ } else {
|
|
|
+ sprintf(textList[0].textString, _lang_String[_lang_HelpChargingTitle]);
|
|
|
+ textList[0].color_r = 0;
|
|
|
+ textList[0].color_g = 85;
|
|
|
+ textList[0].color_b = 184;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ sprintf(textList[0].textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList[0].textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList[0].textSize = 20;
|
|
|
+
|
|
|
+
|
|
|
+ textList[1].textviewIndex = _text_systemScript;
|
|
|
+ textList[1].layout_x = 0;
|
|
|
+ textList[1].layout_y = 1244;
|
|
|
+ textList[1].color_r = 0;
|
|
|
+ textList[1].color_g = 0;
|
|
|
+ textList[1].color_b = 0;
|
|
|
+ textList[1].width = 1080;
|
|
|
+ textList[1].alignment = ALIGNMENT_CENTER;
|
|
|
+ if (ShmDcCommonData->previousPage == _PAGE_AUTHORIZE_FAIL) {
|
|
|
+ sprintf(textList[1].textString, _lang_String[_lang_HelpAuthFailScript]);
|
|
|
+ } else {
|
|
|
+ if (ShmDcCommonData->pGunInfo[0].WaitForPlugit ||
|
|
|
+ ShmDcCommonData->pGunInfo[1].WaitForPlugit) {
|
|
|
+ sprintf(textList[1].textString, _lang_String[_lang_HelpPlugInScript]);
|
|
|
+ } else {
|
|
|
+ sprintf(textList[1].textString, _lang_String[_lang_HelpChargingScript]);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ sprintf(textList[1].textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList[1].textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList[1].textSize = 20;
|
|
|
+ publish_textview_add(mosq, textList, ARRAY_SIZE(textList));
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+void showEMGContect()
|
|
|
+{
|
|
|
+ Image_List imageList;
|
|
|
+ imageList.imageviewIndex = _icon_EMG;
|
|
|
+ imageList.imgsrc_addr = _icon_EMG;
|
|
|
+ imageList.layout_x = 200;
|
|
|
+ imageList.layout_y = 1050;
|
|
|
+ imageList.width = 723;
|
|
|
+ imageList.height = 766;
|
|
|
+ publish_imageview_add(mosq, &imageList, 1);
|
|
|
+
|
|
|
+ // Title
|
|
|
+ Text_List textList;
|
|
|
+ textList.textviewIndex = _text_systemTitle;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 807;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 85;
|
|
|
+ textList.color_b = 184;
|
|
|
+ textList.width = 1080;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_EMGTitle]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 30;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+ // Script
|
|
|
+ textList.textviewIndex = _text_systemScript;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 867;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 0;
|
|
|
+ textList.color_b = 0;
|
|
|
+ textList.width = 1080;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_EMGScript]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList.textSize = 20;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void showStopChargingByRFID()
|
|
|
+{
|
|
|
+ Image_List imageList;
|
|
|
+ imageList.imageviewIndex = _icon_rfid_stop;
|
|
|
+ imageList.imgsrc_addr = _icon_rfid_stop;
|
|
|
+ imageList.layout_x = 397;
|
|
|
+ imageList.layout_y = 1050;
|
|
|
+ imageList.width = 323;
|
|
|
+ imageList.height = 259;
|
|
|
+ publish_imageview_add(mosq, &imageList, 1);
|
|
|
+
|
|
|
+ // Title
|
|
|
+ Text_List textList;
|
|
|
+ textList.textviewIndex = _text_systemTitle;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 807;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 85;
|
|
|
+ textList.color_b = 184;
|
|
|
+ textList.width = 1080;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_stoprfidTitle]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 30;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+ // Script
|
|
|
+ textList.textviewIndex = _text_systemScript;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 867;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 0;
|
|
|
+ textList.color_b = 0;
|
|
|
+ textList.width = 1080;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_stoprfidScript]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList.textSize = 20;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void showStopChargingByAPP()
|
|
|
+{
|
|
|
+ Image_List imageList;
|
|
|
+ imageList.imageviewIndex = _icon_app_stop;
|
|
|
+ imageList.imgsrc_addr = _icon_app_stop;
|
|
|
+ imageList.layout_x = 434;
|
|
|
+ imageList.layout_y = 1050;
|
|
|
+ imageList.width = 212;
|
|
|
+ imageList.height = 269;
|
|
|
+ publish_imageview_add(mosq, &imageList, 1);
|
|
|
+
|
|
|
+ // Title
|
|
|
+ Text_List textList;
|
|
|
+ textList.textviewIndex = _text_systemTitle;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 807;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 85;
|
|
|
+ textList.color_b = 184;
|
|
|
+ textList.width = 1080;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_stopappTitle]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_BOLD);
|
|
|
+ textList.textSize = 30;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+ // Script
|
|
|
+ textList.textviewIndex = _text_systemScript;
|
|
|
+ textList.layout_x = 0;
|
|
|
+ textList.layout_y = 867;
|
|
|
+ textList.color_r = 0;
|
|
|
+ textList.color_g = 0;
|
|
|
+ textList.color_b = 0;
|
|
|
+ textList.width = 1080;
|
|
|
+ textList.alignment = ALIGNMENT_CENTER;
|
|
|
+ sprintf(textList.textString, _lang_String[_lang_stopappScript]);
|
|
|
+ sprintf(textList.textFont, FONT_ARIAL);
|
|
|
+ sprintf(textList.textStyle, FONT_STYLE_NORMAL);
|
|
|
+ textList.textSize = 20;
|
|
|
+ publish_textview_add(mosq, &textList, 1);
|
|
|
+
|
|
|
+}
|