|
@@ -82,7 +82,7 @@ uint8_t bd1_1_status = 0;
|
|
|
uint8_t bd1_2_status = 0;
|
|
|
|
|
|
char *fwVersion = "V2.08.00.0000.00"; // Phihong version
|
|
|
-char* DebugVersion = "v2.08.00"; // Software debug version
|
|
|
+char* DebugVersion = "v2.08.03"; // Software debug version
|
|
|
//sqlite3 *localDb;
|
|
|
bool isDb_ready;
|
|
|
|
|
@@ -1492,18 +1492,32 @@ void _SelfTestTimeout(void)
|
|
|
|
|
|
void _AuthorizedTimeout(void)
|
|
|
{
|
|
|
+ int i;
|
|
|
//if (IsAuthorizingMode()) {
|
|
|
log_info("*********** _AuthorizedTimeout *********** ");
|
|
|
StopSystemTimeoutDet();
|
|
|
//isCardScan = false;
|
|
|
SetIsCardScan(false);
|
|
|
|
|
|
- pSysInfo->SystemPage = _PAGE_SELECT_GUN;
|
|
|
+ //StopSystemTimeoutDet();
|
|
|
+ StopGunInfoTimeoutDet(pSysInfo->CurGunSelected);
|
|
|
+ ShmDcCommonData->TradeCancel = TRUE;
|
|
|
ShmDcCommonData->PreAuth_Config = _CREDITCARD_CANCEL;
|
|
|
ShmDcCommonData->PreAuth_Result = 0;
|
|
|
- //ChangeLcmByIndex(_LCM_AUTHORIZ_FAIL);
|
|
|
- strcpy((char *)pSysConfig->UserId, "");
|
|
|
+ pSysInfo->SystemPage = _PAGE_SENSING;
|
|
|
+ StartSystemTimeoutDet(Timeout_TradeCancel);
|
|
|
+ for (i = 0; i <= 30; i++) {
|
|
|
+ if (ShmDcCommonData->PreAuth_Config == _CREDITCARD_IDLE)
|
|
|
+ break;
|
|
|
+ sleep(1);
|
|
|
+ }
|
|
|
+ ShmDcCommonData->PreAuth_Result = 0;
|
|
|
+
|
|
|
+ StopSystemTimeoutDet();
|
|
|
+ ClearDetectPluginFlag();
|
|
|
+ strcpy((char*)pSysConfig->UserId, "");
|
|
|
ClearAuthorizedFlag();
|
|
|
+ setChargerMode(pSysInfo->CurGunSelected, S_IDLE);
|
|
|
// StartSystemTimeoutDet(Timeout_ReturnViewPage);
|
|
|
//}
|
|
|
}
|
|
@@ -1515,11 +1529,13 @@ void _DetectPlugInTimeout(uint8_t gunIndex)
|
|
|
strcpy((char *)pSysConfig->UserId, "");
|
|
|
//StopSystemTimeoutDet();
|
|
|
StopGunInfoTimeoutDet(gunIndex);
|
|
|
-
|
|
|
+ ShmDcCommonData->TradeCancel = TRUE;
|
|
|
ShmDcCommonData->PreAuth_Config = _CREDITCARD_CANCEL;
|
|
|
ShmDcCommonData->PreAuth_Result = 0;
|
|
|
+ pSysInfo->SystemPage = _PAGE_SENSING;
|
|
|
+ StartSystemTimeoutDet(Timeout_TradeCancel);
|
|
|
for(i=0;i<=30;i++) {
|
|
|
- if(ShmDcCommonData->PreAuth_Result == _CREDITCARD_IDLE)
|
|
|
+ if(ShmDcCommonData->PreAuth_Config == _CREDITCARD_IDLE)
|
|
|
break;
|
|
|
sleep(1);
|
|
|
}
|
|
@@ -1527,6 +1543,7 @@ void _DetectPlugInTimeout(uint8_t gunIndex)
|
|
|
|
|
|
if (pSysInfo->CurGunSelected == gunIndex)
|
|
|
pSysInfo->SystemPage = _PAGE_IDLE;
|
|
|
+ StopSystemTimeoutDet();
|
|
|
ClearDetectPluginFlag();
|
|
|
strcpy((char *)pSysConfig->UserId, "");
|
|
|
setChargerMode(gunIndex, S_IDLE);
|
|
@@ -1753,16 +1770,16 @@ void ReleaseAlarmCode(uint8_t gunIndex)
|
|
|
void ChargingTerminalProcess(uint8_t gunIndex)
|
|
|
{
|
|
|
pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(gunIndex);
|
|
|
- if (pDcChargingInfo->SystemStatus == S_CHARGING)
|
|
|
- ShmDcCommonData->StopCharge[gunIndex] = TRUE;
|
|
|
+ //if (pDcChargingInfo->SystemStatus == S_CHARGING)
|
|
|
+ ShmDcCommonData->StopCharge[gunIndex] = TRUE;
|
|
|
setChargerMode(gunIndex, MODE_TERMINATING);
|
|
|
}
|
|
|
|
|
|
void ChargingAlarmProcess(uint8_t gunIndex)
|
|
|
{
|
|
|
pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(gunIndex);
|
|
|
- if (pDcChargingInfo->SystemStatus == S_CHARGING)
|
|
|
- ShmDcCommonData->StopCharge[gunIndex] = TRUE;
|
|
|
+ //if (pDcChargingInfo->SystemStatus == S_CHARGING)
|
|
|
+ ShmDcCommonData->StopCharge[gunIndex] = TRUE;
|
|
|
UpdateErrorCodeToOcpp(gunIndex);
|
|
|
setChargerMode(gunIndex, MODE_ALARM);
|
|
|
}
|
|
@@ -2510,12 +2527,13 @@ void CreateTimeoutFork(void)
|
|
|
break;
|
|
|
case Timeout_Authorizing:
|
|
|
if (GetClockTimeoutValue(pSysInfo->SystemTimeoutTimer) / uSEC_VAL >= AUTHORIZE_TIMEOUT) {
|
|
|
- //log_error("Authorizing Timeout");
|
|
|
+ log_error("Authorizing Timeout");
|
|
|
_AuthorizedTimeout();
|
|
|
if (ShmSelectGunInfo->AuthorStateFromCabinet[pSysInfo->CurGunSelected] == YES) { //DoComm no ask cabinet balance
|
|
|
ShmSelectGunInfo->AuthorStateFromCabinet[pSysInfo->CurGunSelected] = NO;
|
|
|
pAlarmCode->AlarmEvents.bits.DisconnectedFromDo = ABNORMAL;
|
|
|
log_error("Author timeout restart DoComm");
|
|
|
+ system("killall Module_DoComm");
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
@@ -2534,6 +2552,7 @@ void CreateTimeoutFork(void)
|
|
|
case Timeout_VerifyFail:
|
|
|
|
|
|
if (GetClockTimeoutValue(pSysInfo->SystemTimeoutTimer) / uSEC_VAL >= AUTHORIZE_FAIL_TIMEOUT) {
|
|
|
+ log_info("Timeout_VerifyFail");
|
|
|
/*if (pSysInfo->SystemPage ==_LCM_START_AUTHORIZE_FAIL ) {
|
|
|
StopSystemTimeoutDet();
|
|
|
_AutoReturnTimeout();
|
|
@@ -2579,6 +2598,7 @@ void CreateTimeoutFork(void)
|
|
|
|
|
|
case Timeout_AuthorizingForStop:
|
|
|
if (GetClockTimeoutValue(pSysInfo->SystemTimeoutTimer) / uSEC_VAL >= AUTHORIZE_STOP_TIMEOUT) {
|
|
|
+ log_info("Timeout_AuthorizingForStop");
|
|
|
strcpy((char *)pSysConfig->UserId, "");
|
|
|
ClearAuthorizedFlag();
|
|
|
StopSystemTimeoutDet();
|
|
@@ -2587,6 +2607,7 @@ void CreateTimeoutFork(void)
|
|
|
break;
|
|
|
case Timeout_ScanCard:
|
|
|
if (GetClockTimeoutValue(pSysInfo->SystemTimeoutTimer) / uSEC_VAL >= TCC_SCANCARD_TIMEOUT) {
|
|
|
+ log_info("Timeout_ScanCard");
|
|
|
strcpy((char *)pSysConfig->UserId, "");
|
|
|
ClearAuthorizedFlag();
|
|
|
StopSystemTimeoutDet();
|
|
@@ -2606,6 +2627,7 @@ void CreateTimeoutFork(void)
|
|
|
break;
|
|
|
case Timeout_AddLine:
|
|
|
if (GetClockTimeoutValue(pSysInfo->SystemTimeoutTimer) / uSEC_VAL >= TCC_ADDLINE_TIMEOUT) {
|
|
|
+ log_info("Timeout_AddLine");
|
|
|
StopSystemTimeoutDet();
|
|
|
pSysInfo->SystemPage = _PAGE_SELECT_GUN;
|
|
|
ShmDcCommonData->OperateIDLE[pSysInfo->CurGunSelected] = 1;
|
|
@@ -2614,12 +2636,14 @@ void CreateTimeoutFork(void)
|
|
|
|
|
|
case Timeout_DonateComfirm:
|
|
|
if (GetClockTimeoutValue(pSysInfo->SystemTimeoutTimer) / uSEC_VAL >= TCC_DONATECOMFIRM_TIMEOUT) {
|
|
|
+ log_info("Timeout_DonateComfirm");
|
|
|
StopSystemTimeoutDet();
|
|
|
pSysInfo->SystemPage = _PAGE_SELECT_GUN;
|
|
|
}
|
|
|
break;
|
|
|
case Timeout_SelectPayMode:
|
|
|
if (GetClockTimeoutValue(pSysInfo->SystemTimeoutTimer) / uSEC_VAL >= TCC_SELECTPAY_TIMEOUT) {
|
|
|
+ log_info("Timeout_SelectPayMode");
|
|
|
StopSystemTimeoutDet();
|
|
|
pSysInfo->SystemPage = _PAGE_SELECT_GUN;
|
|
|
ShmDcCommonData->OperateIDLE[pSysInfo->CurGunSelected] = 1;
|
|
@@ -2627,6 +2651,7 @@ void CreateTimeoutFork(void)
|
|
|
break;
|
|
|
case Timeout_TradeCancel:
|
|
|
if (GetClockTimeoutValue(pSysInfo->SystemTimeoutTimer) / uSEC_VAL >= TCC_TRADECANCEL_TIMEOUT) {
|
|
|
+ log_info("Timeout_TradeCancel");
|
|
|
StopSystemTimeoutDet();
|
|
|
pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(pSysInfo->CurGunSelected);
|
|
|
setChargerMode(pSysInfo->CurGunSelected, MODE_IDLE);
|
|
@@ -2703,6 +2728,7 @@ void CreateTimeoutFork(void)
|
|
|
break;
|
|
|
case Timeout_PlugOutGun:
|
|
|
if (GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL >= PLUGOUTGUN_TIMEOUT) {
|
|
|
+ log_info("Gun[%d] Timeout_PlugOutGun",gunIndex);
|
|
|
setChargerMode(gunIndex, MODE_IDLE);
|
|
|
destroySelGun(gunIndex); //Jerry add
|
|
|
StopGunInfoTimeoutDet(gunIndex);
|
|
@@ -2711,6 +2737,7 @@ void CreateTimeoutFork(void)
|
|
|
break;
|
|
|
case Timeout_FinalCost:
|
|
|
if (GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL >= TCC_FINALCOST_TIMEOUT) {
|
|
|
+ log_info("Gun[%d] Timeout_FinalCost",gunIndex);
|
|
|
StopGunInfoTimeoutDet(gunIndex);
|
|
|
if (ShmDcCommonData->finalcost_flag[gunIndex] == FALSE) {
|
|
|
ShmDcCommonData->TransactionInfo[gunIndex].Amount = pDcChargingInfo->PresentChargedEnergy * ShmDcCommonData->ChargingRate;
|
|
@@ -2720,12 +2747,22 @@ void CreateTimeoutFork(void)
|
|
|
break;
|
|
|
case Timeout_LineReigster:
|
|
|
if (GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL >= TCC_LINEREGISTER_TIMEOUT) {
|
|
|
+ log_info("Gun[%d] Timeout_LineReigster",gunIndex);
|
|
|
StopGunInfoTimeoutDet(gunIndex);
|
|
|
pSysInfo->SystemPage = _PAGE_SELECT_GUN;
|
|
|
ShmDcCommonData->TransactionInfo[gunIndex].IsDonateInvoice = FALSE;
|
|
|
ShmDcCommonData->OperateIDLE[gunIndex] = 1;
|
|
|
}
|
|
|
break;
|
|
|
+ case Timeout_ExitPage:
|
|
|
+ if (GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL >= TCC_EXITPAGE_TIMEOUT) {
|
|
|
+ log_info("Gun[%d] Timeout_ExitPage", gunIndex);
|
|
|
+ StopGunInfoTimeoutDet(gunIndex);
|
|
|
+ ShmDcCommonData->is_exit[gunIndex] = TRUE;
|
|
|
+ pSysInfo->SystemPage = _PAGE_EXIT;
|
|
|
+ StartGunInfoTimeoutDet(gunIndex, Timeout_PlugOutGun);
|
|
|
+ }
|
|
|
+ break;
|
|
|
/*
|
|
|
case Timeout_SelectGun: //Jerry add
|
|
|
if (GetTimeoutValue(pDcChargingInfo->TimeoutTimer) / uSEC_VAL >= SEL_GUN_TIMEOUT) {
|
|
@@ -3889,6 +3926,8 @@ void ResetIdleData(uint8_t gunIndex)
|
|
|
ShmDcCommonData->OperateIDLE[gunIndex] = 1;
|
|
|
ShmDcCommonData->is_RemoteStart[gunIndex] = FALSE;
|
|
|
ShmDcCommonData->is_AutoStart[gunIndex] = FALSE;
|
|
|
+ ShmDcCommonData->is_exit[gunIndex] = FALSE;
|
|
|
+ ShmDcCommonData->StopCharge[gunIndex] = FALSE;
|
|
|
|
|
|
ShmSelectGunInfo->PricesInfo[gunIndex].Balance = FAIL_BALANCE_PRICES;
|
|
|
destroySelGun(gunIndex);
|
|
@@ -4010,7 +4049,7 @@ int main(void)
|
|
|
log_info(" ********************************************************");
|
|
|
log_info(" ****************** Project:DD360Tcc *****************");
|
|
|
log_info(" ********************************************************");
|
|
|
- int is_plugout[2];
|
|
|
+
|
|
|
if (!InitialSystemDefaultConfig()) {
|
|
|
log_error("InitialSystemDefaultConfig NG ");
|
|
|
//StopProcessingLoop();
|
|
@@ -4181,7 +4220,6 @@ int main(void)
|
|
|
if (isModeChange(gunIndex)) {
|
|
|
log_info("============================= S_IDLE(%x) ============================= ", gunIndex);
|
|
|
ResetIdleData(gunIndex);
|
|
|
- is_plugout[gunIndex] = FALSE;
|
|
|
}
|
|
|
isChargingAverageState();
|
|
|
// For RemoteStart Using
|
|
@@ -4195,7 +4233,8 @@ int main(void)
|
|
|
autoStartCharging(gunIndex);
|
|
|
cancelcount = 0;
|
|
|
// 讀卡邏輯
|
|
|
- ScannerCardProcess();
|
|
|
+ if (!ShmDcCommonData->TradeCancel)
|
|
|
+ ScannerCardProcess();
|
|
|
if (pSysInfo->SystemPage == _PAGE_SELECT_GUN) {
|
|
|
ShmDcCommonData->LineStatus[gunIndex] = 0;
|
|
|
StopGunInfoTimeoutDet(gunIndex);
|
|
@@ -4488,7 +4527,7 @@ CheckStatus:
|
|
|
// 切換 D+ Relay to Precharge Relay
|
|
|
if (pDcChargingInfo->RelayK1K2Status == YES || pDcChargingInfo->PantographFlag == YES) {
|
|
|
pDcChargingInfo->PrechargeStatus = PRECHARGE_READY;
|
|
|
- pSysInfo->CurGunSelected = gunIndex;
|
|
|
+ // pSysInfo->CurGunSelected = gunIndex;
|
|
|
setChargerMode(gunIndex, MODE_CHARGING);
|
|
|
}
|
|
|
if (pSysInfo->CurGunSelected == gunIndex) {
|
|
@@ -4505,7 +4544,6 @@ CheckStatus:
|
|
|
ChangeStartOrStopDateTime(YES, gunIndex);
|
|
|
pDcChargingInfo->Replug_flag = FALSE;
|
|
|
ShmDcCommonData->finalcost_flag[gunIndex] = FALSE;
|
|
|
- ShmDcCommonData->StopCharge[gunIndex] = FALSE;
|
|
|
ShmDcCommonData->TransactionInfo[gunIndex].isIntoCharge = TRUE;
|
|
|
ShmDcCommonData->RecordEnergyTime[gunIndex] = time((time_t*)NULL);
|
|
|
UpdateDeductInfoStatus(gunIndex, &ShmDcCommonData->TransactionInfo[gunIndex]);
|
|
@@ -4549,8 +4587,15 @@ CheckStatus:
|
|
|
StopGunInfoTimeoutDet(gunIndex);
|
|
|
StartGunInfoTimeoutDet(gunIndex, Timeout_FinalCost);
|
|
|
StartSystemTimeoutDet(Timeout_Terminating);
|
|
|
- pSysInfo->CurGunSelected = gunIndex;
|
|
|
- pSysInfo->SystemPage = _PAGE_PAYING;
|
|
|
+ //pSysInfo->CurGunSelected = gunIndex;
|
|
|
+ /*
|
|
|
+ if (pDcChargingInfo->Replug_flag == TRUE) {
|
|
|
+ ShmDcCommonData->TradeCancel = TRUE;
|
|
|
+ StartSystemTimeoutDet(Timeout_TradeCancel);
|
|
|
+ ShmDcCommonData->PreAuth_Config = _CREDITCARD_CANCEL;
|
|
|
+ ShmDcCommonData->PreAuth_Result = 0;
|
|
|
+ pSysInfo->SystemPage = _PAGE_SENSING;
|
|
|
+ }*/
|
|
|
}
|
|
|
// For Precharging timeout
|
|
|
|
|
@@ -4578,12 +4623,16 @@ CheckStatus:
|
|
|
if (pSysInfo->SystemPage == _PAGE_MAINTAIN) {
|
|
|
break;
|
|
|
}
|
|
|
- if (pSysInfo->CurGunSelected == gunIndex && pSysInfo->SystemPage != _PAGE_PAYING &&
|
|
|
- ShmDcCommonData->finalcost_flag[gunIndex]) {
|
|
|
- if (ShmDcCommonData->PayPass_flag[pSysInfo->CurGunSelected] == TRUE)
|
|
|
- pSysInfo->SystemPage = _PAGE_COMPLETE;
|
|
|
- else
|
|
|
- pSysInfo->SystemPage = _PAGE_PAYFAIL;
|
|
|
+ if (pSysInfo->CurGunSelected == gunIndex &&
|
|
|
+ pSysInfo->SystemPage != _PAGE_PAYING && pSysInfo->SystemPage != _PAGE_SENSING) {
|
|
|
+ if (pDcChargingInfo->Replug_flag == TRUE)
|
|
|
+ pSysInfo->SystemPage = _PAGE_PLUGOUT;
|
|
|
+ else {
|
|
|
+ if (ShmDcCommonData->PayPass_flag[pSysInfo->CurGunSelected] == TRUE)
|
|
|
+ pSysInfo->SystemPage = _PAGE_COMPLETE;
|
|
|
+ else
|
|
|
+ pSysInfo->SystemPage = _PAGE_PAYFAIL;
|
|
|
+ }
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -4594,35 +4643,43 @@ CheckStatus:
|
|
|
OcppStopTransation(gunIndex);
|
|
|
}
|
|
|
TheEndCharging(gunIndex);
|
|
|
- StopSystemTimeoutDet();
|
|
|
+ if (pDcChargingInfo->Replug_flag != TRUE && pSysInfo->SystemPage != _PAGE_PLUGOUT)
|
|
|
+ StopSystemTimeoutDet();
|
|
|
if (ShmDcCommonData->is_AutoStart[gunIndex] == TRUE && pSysInfo->CurGunSelected == gunIndex)
|
|
|
pSysInfo->SystemPage = _PAGE_COMPLETE;
|
|
|
}
|
|
|
-
|
|
|
+ /*
|
|
|
+ if (ShmDcCommonData->PreAuth_Config == _CREDITCARD_CANCEL &&
|
|
|
+ ShmDcCommonData->PreAuth_Result != 0 && cancelcount < 30) {
|
|
|
+ sleep(1);
|
|
|
+ cancelcount++;
|
|
|
+ log_info("Cancel Not Complete yet");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ */
|
|
|
//if (pSysInfo->SystemPage == _LCM_ERROR) {
|
|
|
if (pSysInfo->SystemPage == _PAGE_MAINTAIN) {
|
|
|
break;
|
|
|
}
|
|
|
- if (pSysInfo->CurGunSelected == gunIndex && is_plugout[gunIndex] == TRUE) {
|
|
|
- StartGunInfoTimeoutDet(gunIndex, Timeout_PlugOutGun);
|
|
|
+ if (pSysInfo->CurGunSelected == gunIndex && ShmDcCommonData->is_exit[gunIndex]) {
|
|
|
pSysInfo->SystemPage = _PAGE_EXIT;
|
|
|
break;
|
|
|
}
|
|
|
- if (pSysInfo->CurGunSelected == gunIndex && pDcChargingInfo->ConnectorPlugIn == NO) {
|
|
|
- is_plugout[gunIndex] = TRUE;
|
|
|
- StartGunInfoTimeoutDet(gunIndex, Timeout_PlugOutGun);
|
|
|
- if (pSysInfo->CurGunSelected == gunIndex) {
|
|
|
- sleep(10);
|
|
|
- pSysInfo->SystemPage = _PAGE_EXIT;
|
|
|
- break;
|
|
|
- }
|
|
|
+ if (pSysInfo->CurGunSelected == gunIndex && pDcChargingInfo->ConnectorPlugIn == NO &&
|
|
|
+ (pSysInfo->SystemPage != _PAGE_PAYING || pSysInfo->SystemPage != _PAGE_SENSING)) {
|
|
|
+ StartGunInfoTimeoutDet(gunIndex, Timeout_ExitPage);
|
|
|
}
|
|
|
|
|
|
- if (pSysInfo->CurGunSelected == gunIndex && pSysInfo->SystemPage != _PAGE_PAYING ) {
|
|
|
- if (ShmDcCommonData->PayPass_flag[pSysInfo->CurGunSelected] == TRUE)
|
|
|
- pSysInfo->SystemPage = _PAGE_COMPLETE;
|
|
|
- else
|
|
|
- pSysInfo->SystemPage = _PAGE_PAYFAIL;
|
|
|
+ if (pSysInfo->CurGunSelected == gunIndex &&
|
|
|
+ pSysInfo->SystemPage != _PAGE_PAYING && pSysInfo->SystemPage != _PAGE_SENSING) {
|
|
|
+ if (pDcChargingInfo->Replug_flag == TRUE)
|
|
|
+ pSysInfo->SystemPage = _PAGE_PLUGOUT;
|
|
|
+ else {
|
|
|
+ if (ShmDcCommonData->PayPass_flag[pSysInfo->CurGunSelected] == TRUE)
|
|
|
+ pSysInfo->SystemPage = _PAGE_COMPLETE;
|
|
|
+ else
|
|
|
+ pSysInfo->SystemPage = _PAGE_PAYFAIL;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
break;
|
|
@@ -4639,17 +4696,23 @@ CheckStatus:
|
|
|
}
|
|
|
TheEndCharging(gunIndex);
|
|
|
StopGunInfoTimeoutDet(gunIndex);
|
|
|
- StartGunInfoTimeoutDet(gunIndex, Timeout_FinalCost);
|
|
|
+
|
|
|
if (pDcChargingInfo->Replug_flag == TRUE) {
|
|
|
+ /*
|
|
|
+ ShmDcCommonData->TradeCancel = TRUE;
|
|
|
+ StartSystemTimeoutDet(Timeout_TradeCancel);
|
|
|
ShmDcCommonData->PreAuth_Config = _CREDITCARD_CANCEL;
|
|
|
ShmDcCommonData->PreAuth_Result = 0;
|
|
|
- pSysInfo->SystemPage = _PAGE_PLUGOUT;
|
|
|
+ pSysInfo->SystemPage = _PAGE_SENSING;
|
|
|
+ */
|
|
|
} else {
|
|
|
+ StartGunInfoTimeoutDet(gunIndex, Timeout_FinalCost);
|
|
|
if(ShmDcCommonData->finalcost_flag[gunIndex] == FALSE) {
|
|
|
pSysInfo->SystemPage = _PAGE_PAYING;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ /*
|
|
|
if (ShmDcCommonData->PreAuth_Config == _CREDITCARD_CANCEL &&
|
|
|
ShmDcCommonData->PreAuth_Result != 0 && cancelcount < 30) {
|
|
|
sleep(1);
|
|
@@ -4657,30 +4720,21 @@ CheckStatus:
|
|
|
//log_info("Cancel Not Complete yet");
|
|
|
break;
|
|
|
}
|
|
|
+ */
|
|
|
if (pSysWarning->Level == WARN_LV_ER) {
|
|
|
pSysInfo->SystemPage = _PAGE_MAINTAIN;
|
|
|
|
|
|
continue;
|
|
|
}
|
|
|
- if (pSysInfo->CurGunSelected == gunIndex && is_plugout[gunIndex] == TRUE) {
|
|
|
- StartGunInfoTimeoutDet(gunIndex, Timeout_PlugOutGun);
|
|
|
- pSysInfo->SystemPage = _PAGE_EXIT;
|
|
|
- break;
|
|
|
+ if (pSysInfo->CurGunSelected == gunIndex && ShmDcCommonData->is_exit[gunIndex]) {
|
|
|
+ pSysInfo->SystemPage = _PAGE_EXIT;
|
|
|
+ break;
|
|
|
}
|
|
|
|
|
|
- if (pSysInfo->CurGunSelected == gunIndex && pDcChargingInfo->ConnectorPlugIn == NO) {
|
|
|
- is_plugout[gunIndex] = TRUE;
|
|
|
- if (pDcChargingInfo->Replug_flag == TRUE) {
|
|
|
- pSysInfo->SystemPage = _PAGE_SELECT_GUN;
|
|
|
- pDcChargingInfo->SystemStatus = S_IDLE;
|
|
|
- } else {
|
|
|
- StartGunInfoTimeoutDet(gunIndex, Timeout_PlugOutGun);
|
|
|
- pSysInfo->SystemPage = _PAGE_EXIT;
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
- //if (pSysInfo->SystemPage == _PAGE_PAYING)
|
|
|
- // break;
|
|
|
+ if (pSysInfo->CurGunSelected == gunIndex && pDcChargingInfo->ConnectorPlugIn == NO &&
|
|
|
+ (pSysInfo->SystemPage != _PAGE_PAYING || pSysInfo->SystemPage != _PAGE_SENSING)) {
|
|
|
+ StartGunInfoTimeoutDet(gunIndex, Timeout_ExitPage);
|
|
|
+ }
|
|
|
|
|
|
if (pSysInfo->CurGunSelected == gunIndex && pSysInfo->SystemPage != _PAGE_PAYING ) {
|
|
|
if (pDcChargingInfo->Replug_flag == TRUE)
|
|
@@ -4700,11 +4754,10 @@ CheckStatus:
|
|
|
pSysInfo->SystemPage = _PAGE_MAINTAIN;
|
|
|
continue;
|
|
|
}
|
|
|
-
|
|
|
- if (pSysInfo->CurGunSelected == gunIndex) {
|
|
|
- pSysInfo->SystemPage = _PAGE_MAINTAIN;
|
|
|
+ if (ShmDcCommonData->RoutineSettlement == TRUE) {
|
|
|
+ pSysInfo->SystemPage = _PAGE_MAINTAIN;
|
|
|
+ continue;
|
|
|
}
|
|
|
-
|
|
|
if (pDcChargingInfo->IsAvailable == NO )
|
|
|
break;
|
|
|
|
|
@@ -4726,7 +4779,18 @@ CheckStatus:
|
|
|
if (pSysInfo->SelfTestSeq == _STEST_FAIL)
|
|
|
StopProcessingLoop();
|
|
|
}
|
|
|
-
|
|
|
+ /*
|
|
|
+ if (pDcChargingInfo->IsAvailable == TRUE) {
|
|
|
+ log_info("Gun[%d] set Available",gunIndex);
|
|
|
+ setChargerMode(gunIndex, MODE_IDLE);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ */
|
|
|
+ if (pSysInfo->CurGunSelected == gunIndex) {
|
|
|
+ StopSystemTimeoutDet();
|
|
|
+ StopGunInfoTimeoutDet(gunIndex);
|
|
|
+ pSysInfo->SystemPage = _PAGE_MAINTAIN;
|
|
|
+ }
|
|
|
|
|
|
break;
|
|
|
case S_UPDATE:
|