|
@@ -84,7 +84,7 @@ uint8_t bd1_1_status = 0;
|
|
|
uint8_t bd1_2_status = 0;
|
|
|
|
|
|
char *fwVersion = "V1.21.00.0000.00"; // "V0.16.00.0000.00";
|
|
|
-char* DebugVersion = "v1.21.0";
|
|
|
+char* DebugVersion = "v1.21.5";
|
|
|
//sqlite3 *localDb;
|
|
|
bool isDb_ready;
|
|
|
|
|
@@ -404,52 +404,105 @@ static void checkGunOTPState(uint8_t gunIndex)
|
|
|
//log_info("OTP:%d OTPR%d",pSysInfo->OTPTemp,pSysInfo->OTPTempR);
|
|
|
//水冷機溫度檢測
|
|
|
if (((ShmDcCommonData->ChillerValve.MultiChillerGun & 0x80) >> 7) == YES) {
|
|
|
- if (pDcChargingInfo->ChillerTemp != UNDEFINED_TEMP) {
|
|
|
- if (pDcChargingInfo->ChillerTemp >= pSysInfo->OTPTemp ) {
|
|
|
- if (((gunIndex == 0) &&
|
|
|
- ((strncmp((char *)&pSysConfig->ModelName[7], "V", 1) == 0) ||
|
|
|
- (strncmp((char *)&pSysConfig->ModelName[7], "F", 1) == 0)))
|
|
|
- ||
|
|
|
- ((gunIndex == 1) &&
|
|
|
- ((strncmp((char *)&pSysConfig->ModelName[9], "V", 1) == 0) ||
|
|
|
- (strncmp((char *)&pSysConfig->ModelName[9], "F", 1) == 0)))
|
|
|
- ) {
|
|
|
- RecordAlarmCode(gunIndex, "012323");
|
|
|
+ if ((ShmDcCommonData->ChillerValve.MultiChillerGun & 0x7F) == 1) {
|
|
|
+ // 單水冷機
|
|
|
+ // Chiller OTP
|
|
|
+ if (ShmDcCommonData->SystemTemp[0] == UNDEFINED_TEMP || ShmDcCommonData->SystemTemp[1] == UNDEFINED_TEMP) {
|
|
|
+ // 溫度為255時判斷Sensor fail
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerOTP = NO;
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerTempSensorFail = YES;
|
|
|
+ } else {
|
|
|
+ //判斷OTP
|
|
|
+ if (ShmDcCommonData->SystemTemp[0] >= pSysInfo->OTPTemp || ShmDcCommonData->SystemTemp[1] >= pSysInfo->OTPTemp) {
|
|
|
ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerOTP = YES;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
+ RecordAlarmCode(gunIndex, "012323");
|
|
|
+ } else if (ShmDcCommonData->SystemTemp[0] != 0 && ShmDcCommonData->SystemTemp[0] < pSysInfo->OTPTempR &&
|
|
|
+ ShmDcCommonData->SystemTemp[1] != 0 && ShmDcCommonData->SystemTemp[1] < pSysInfo->OTPTempR) {
|
|
|
ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerOTP = NO;
|
|
|
}
|
|
|
- } else if (pDcChargingInfo->ChillerTemp != 0 &&
|
|
|
- pDcChargingInfo->ChillerTemp < pSysInfo->OTPTempR) {
|
|
|
- //ResetChargerAlarmCode(gunIndex, "012323");
|
|
|
- ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerOTP = NO;
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerTempSensorFail = NO;
|
|
|
}
|
|
|
- ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerTempSensorFail = NO;
|
|
|
- } else {
|
|
|
- // 沒接上 Sensor or 異常
|
|
|
- //RecordAlarmCode(gunIndex, "011038");
|
|
|
- //ResetChargerAlarmCode(gunIndex, "012323");
|
|
|
- ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerOTP = NO;
|
|
|
- if (((gunIndex == 0) &&
|
|
|
- ((strncmp((char *)&pSysConfig->ModelName[7], "V", 1) == 0) ||
|
|
|
- (strncmp((char *)&pSysConfig->ModelName[7], "F", 1) == 0)))
|
|
|
- ||
|
|
|
- ((gunIndex == 1) &&
|
|
|
- ((strncmp((char *)&pSysConfig->ModelName[9], "V", 1) == 0) ||
|
|
|
- (strncmp((char *)&pSysConfig->ModelName[9], "F", 1) == 0)))
|
|
|
- ) {
|
|
|
+ // Chiller Tube OTP
|
|
|
+ if (ShmDcCommonData->SystemTemp[2] == UNDEFINED_TEMP || ShmDcCommonData->SystemTemp[3] == UNDEFINED_TEMP) {
|
|
|
+ // 溫度為255時判斷Sensor fail
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerTubeOTP = NO;
|
|
|
ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerTempSensorFail = YES;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
+ } else {
|
|
|
+ //判斷OTP
|
|
|
+ if (ShmDcCommonData->SystemTemp[2] >= pSysInfo->OTPTemp || ShmDcCommonData->SystemTemp[3] >= pSysInfo->OTPTemp) {
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerTubeOTP = YES;
|
|
|
+ RecordAlarmCode(gunIndex, "012332");
|
|
|
+ } else if (ShmDcCommonData->SystemTemp[2] != 0 && ShmDcCommonData->SystemTemp[2] < pSysInfo->OTPTempR &&
|
|
|
+ ShmDcCommonData->SystemTemp[3] != 0 && ShmDcCommonData->SystemTemp[3] < pSysInfo->OTPTempR) {
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerTubeOTP = NO;
|
|
|
+ }
|
|
|
ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerTempSensorFail = NO;
|
|
|
}
|
|
|
+ } else {
|
|
|
+ // 雙水冷機
|
|
|
+ if (gunIndex == LEFT_GUN_NUM) {
|
|
|
+ if (ShmDcCommonData->SystemTemp[0] == UNDEFINED_TEMP) {
|
|
|
+ // 溫度為255時判斷Sensor fail
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerOTP = NO;
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerTempSensorFail = YES;
|
|
|
+ } else {
|
|
|
+ //判斷OTP
|
|
|
+ if (ShmDcCommonData->SystemTemp[0] >= pSysInfo->OTPTemp) {
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerOTP = YES;
|
|
|
+ RecordAlarmCode(gunIndex, "012323");
|
|
|
+ } else if (ShmDcCommonData->SystemTemp[0] != 0 && ShmDcCommonData->SystemTemp[0] < pSysInfo->OTPTempR) {
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerOTP = NO;
|
|
|
+ }
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerTempSensorFail = NO;
|
|
|
+ }
|
|
|
+ if (ShmDcCommonData->SystemTemp[1] == UNDEFINED_TEMP) {
|
|
|
+ // 溫度為255時判斷Sensor fail
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerTubeOTP = NO;
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerTempSensorFail = YES;
|
|
|
+ } else {
|
|
|
+ //判斷OTP
|
|
|
+ if (ShmDcCommonData->SystemTemp[1] >= pSysInfo->OTPTemp) {
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerTubeOTP = YES;
|
|
|
+ RecordAlarmCode(gunIndex, "012332");
|
|
|
+ } else if (ShmDcCommonData->SystemTemp[1] != 0 && ShmDcCommonData->SystemTemp[1] < pSysInfo->OTPTempR) {
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerTubeOTP = NO;
|
|
|
+ }
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerTempSensorFail = NO;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (ShmDcCommonData->SystemTemp[2] == UNDEFINED_TEMP) {
|
|
|
+ // 溫度為255時判斷Sensor fail
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerOTP = NO;
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerTempSensorFail = YES;
|
|
|
+ } else {
|
|
|
+ //判斷OTP
|
|
|
+ if (ShmDcCommonData->SystemTemp[2] >= pSysInfo->OTPTemp) {
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerOTP = YES;
|
|
|
+ RecordAlarmCode(gunIndex, "012323");
|
|
|
+ } else if (ShmDcCommonData->SystemTemp[2] != 0 && ShmDcCommonData->SystemTemp[2] < pSysInfo->OTPTempR) {
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerOTP = NO;
|
|
|
+ }
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerTempSensorFail = NO;
|
|
|
+ }
|
|
|
+ if (ShmDcCommonData->SystemTemp[3] == UNDEFINED_TEMP) {
|
|
|
+ // 溫度為255時判斷Sensor fail
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerTubeOTP = NO;
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerTempSensorFail = YES;
|
|
|
+ } else {
|
|
|
+ //判斷OTP
|
|
|
+ if (ShmDcCommonData->SystemTemp[3] >= pSysInfo->OTPTemp) {
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerTubeOTP = YES;
|
|
|
+ RecordAlarmCode(gunIndex, "012332");
|
|
|
+
|
|
|
+ } else if (ShmDcCommonData->SystemTemp[2] != 0 && ShmDcCommonData->SystemTemp[3] < pSysInfo->OTPTempR) {
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerTubeOTP = NO;
|
|
|
+ }
|
|
|
+ ShmDcCommonData->ChillerTempErr[gunIndex].StatusBit.ChillerTempSensorFail = NO;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- if(pFaultCode->FaultEvents.bits.CcsLiquidChillerWaterLevelFault == YES)
|
|
|
- {
|
|
|
+ if (pFaultCode->FaultEvents.bits.CcsLiquidChillerWaterLevelFault == YES) {
|
|
|
RecordAlarmCode(gunIndex, "011037");
|
|
|
}
|
|
|
}
|
|
@@ -1554,11 +1607,7 @@ uint8_t isPrechargeStatus_ccs(uint8_t gunIndex)
|
|
|
uint8_t result = 0x00;
|
|
|
pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(gunIndex);
|
|
|
|
|
|
- if (ShmCcsData->CommProtocol == _CCS_COMM_V2GMessage_DIN70121) {
|
|
|
- result = ShmCcsData->V2GMessage_DIN70121[pDcChargingInfo->type_index].PresentMsgFlowStatus;
|
|
|
- }
|
|
|
-
|
|
|
- return result;
|
|
|
+ return ShmCcsData->V2GMessage_DIN70121[pDcChargingInfo->type_index].PresentMsgFlowStatus;;
|
|
|
}
|
|
|
|
|
|
bool isEvStopCharging_ccs(uint8_t gunIndex)
|
|
@@ -1658,7 +1707,7 @@ void _DetectPlugInTimeout(void)
|
|
|
//pSysInfo->SystemPage = _LCM_COMPLETE;
|
|
|
setChargerMode(pSysInfo->CurGunSelected, S_TERMINATING);
|
|
|
#elif DD360 || DD360Combox
|
|
|
- setChargerMode(pSysInfo->CurGunSelected, S_COMPLETE);
|
|
|
+ setChargerMode(pSysInfo->CurGunSelected, S_IDLE);
|
|
|
#endif
|
|
|
systemPageRestoreInit();
|
|
|
}
|
|
@@ -4128,9 +4177,7 @@ static void checkPileEndGfdResult(uint8_t gunIndex, uint8_t gunType, uint8_t sys
|
|
|
case _Type_Chademo:
|
|
|
// 檢查樁端的 GFD 結果
|
|
|
if (sysStatus == S_PREPARING_FOR_EVSE &&
|
|
|
- isPrechargeStatus_chademo(gunIndex) > 6 &&
|
|
|
- isPrechargeStatus_chademo(gunIndex) < 8
|
|
|
- ) {
|
|
|
+ isPrechargeStatus_chademo(gunIndex) >= 6) {
|
|
|
// 當前操作的槍號,進入 Charging
|
|
|
setChargerMode(gunIndex, MODE_CHARGING);
|
|
|
}
|
|
@@ -4177,8 +4224,7 @@ static void checkPileEndGfdResult(uint8_t gunIndex, uint8_t gunType, uint8_t sys
|
|
|
case _Type_GB:
|
|
|
// 檢查樁端的 GFD 結果
|
|
|
//if (isPrechargeStatus_gb(gunIndex) > 5 && isPrechargeStatus_gb(gunIndex) < 9) {
|
|
|
- if (sysStatus == S_PREPARING_FOR_EVSE &&
|
|
|
- isPrechargeStatus_gb(gunIndex) > 6) {
|
|
|
+ if (sysStatus == S_PREPARING_FOR_EVSE && isPrechargeStatus_gb(gunIndex) >= 6) {
|
|
|
setChargerMode(gunIndex, MODE_CHARGING);
|
|
|
}
|
|
|
|
|
@@ -4472,6 +4518,9 @@ int main(void)
|
|
|
pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(_index);
|
|
|
|
|
|
pDcChargingInfo->IsAvailable = DB_Get_Operactive(_index);
|
|
|
+ if (!DB_Get_PowerConsumption(_index)) {
|
|
|
+ DB_Insert_PowerConsumption(_index, 0);
|
|
|
+ }
|
|
|
}
|
|
|
DB_Reboot_Record();
|
|
|
}
|
|
@@ -4502,6 +4551,9 @@ int main(void)
|
|
|
|
|
|
pSysInfo->OTPTemp = GUN_OTP_VALUE;
|
|
|
pSysInfo->OTPTempR = GUN_OTP_RECOVERY;
|
|
|
+
|
|
|
+ time_t ShowEVStatusTimer[2] = { 0 };
|
|
|
+
|
|
|
for (;;) {
|
|
|
|
|
|
CheckOcppStatus();
|
|
@@ -4600,9 +4652,6 @@ int main(void)
|
|
|
CheckSmartChargeProfile(gunIndex);
|
|
|
}
|
|
|
|
|
|
- //log_info("index = %d, ErrorCode = %s",
|
|
|
- // gunIndex,
|
|
|
- // ShmOCPP16Data->StatusNotification[gunIndex].ErrorCode);
|
|
|
switch (pDcChargingInfo->SystemStatus) {
|
|
|
case S_IDLE:
|
|
|
case S_RESERVATION:
|
|
@@ -4625,6 +4674,7 @@ int main(void)
|
|
|
//Jerry add
|
|
|
memset(&ShmSelectGunInfo->PricesInfo[gunIndex], 0, sizeof(PricesInfo));
|
|
|
memset(&ShmDcCommonData->pGunInfo[gunIndex], 0, sizeof(GunInfo));
|
|
|
+ DB_Get_PowerConsumption(gunIndex);
|
|
|
ShmSelectGunInfo->PricesInfo[gunIndex].Balance = FAIL_BALANCE_PRICES;
|
|
|
destroySelGun(gunIndex);
|
|
|
ResetDetAlarmStatus(gunIndex); //recovery OVP status code
|
|
@@ -4882,7 +4932,7 @@ int main(void)
|
|
|
|
|
|
if (ShmPsuData->SystemPresentPsuQuantity > 0 &&
|
|
|
ShmPsuData->SystemAvailablePower > 10 &&
|
|
|
- GetTimeoutValue(pDcChargingInfo->TimeoutTimer) >= 5000000) {
|
|
|
+ GetTimeoutValue(pDcChargingInfo->TimeoutTimer) >= 1000000) {
|
|
|
setChargerMode(gunIndex, MODE_PREPARE_FOR_EV);
|
|
|
}
|
|
|
|
|
@@ -4953,52 +5003,7 @@ int main(void)
|
|
|
}
|
|
|
|
|
|
checkPileEndGfdResult(gunIndex, pDcChargingInfo->Type, pDcChargingInfo->SystemStatus);
|
|
|
-#if 0
|
|
|
- if (pDcChargingInfo->Type == _Type_Chademo) {
|
|
|
- // 檢查樁端的 GFD 結果
|
|
|
- if (isPrechargeStatus_chademo(gunIndex) > 5 &&
|
|
|
- isPrechargeStatus_chademo(gunIndex) < 8) {
|
|
|
- // 當前操作的槍號,進入 Charging
|
|
|
- setChargerMode(gunIndex, MODE_CHARGING);
|
|
|
- }
|
|
|
-
|
|
|
- if (pDcChargingInfo->GroundFaultStatus == GFD_FAIL) {
|
|
|
- // GFD 錯誤停止
|
|
|
- RecordAlarmCode(gunIndex, "012234");
|
|
|
- } else if (pDcChargingInfo->GroundFaultStatus == GFD_WARNING) {
|
|
|
- // GFD 警告
|
|
|
- RecordAlarmCode(gunIndex, "012296");
|
|
|
- }
|
|
|
- } else if (pDcChargingInfo->Type == _Type_GB) {
|
|
|
- // 檢查樁端的 GFD 結果
|
|
|
- //if (isPrechargeStatus_gb(gunIndex) > 5 && isPrechargeStatus_gb(gunIndex) < 9) {
|
|
|
- if (isPrechargeStatus_gb(gunIndex) > 9) {
|
|
|
- setChargerMode(gunIndex, MODE_CHARGING);
|
|
|
- }
|
|
|
-
|
|
|
- if (pDcChargingInfo->GroundFaultStatus == GFD_FAIL) {
|
|
|
- // GFD 錯誤停止
|
|
|
- RecordAlarmCode(gunIndex, "012236");
|
|
|
- } else if (pDcChargingInfo->GroundFaultStatus == GFD_WARNING) {
|
|
|
- // GFD 警告
|
|
|
- RecordAlarmCode(gunIndex, "012298");
|
|
|
- }
|
|
|
- } else if (pDcChargingInfo->Type == _Type_CCS_2) {
|
|
|
- // 檢查樁端的 GFD 結果
|
|
|
- if ((pDcChargingInfo->GroundFaultStatus == GFD_PASS ||
|
|
|
- pDcChargingInfo->GroundFaultStatus == GFD_WARNING)) {
|
|
|
- setChargerMode(gunIndex, MODE_CCS_PRECHARGE_STEP0);
|
|
|
- }
|
|
|
|
|
|
- if (pDcChargingInfo->GroundFaultStatus == GFD_FAIL) {
|
|
|
- // GFD 錯誤停止
|
|
|
- RecordAlarmCode(gunIndex, "012235");
|
|
|
- } else if (pDcChargingInfo->GroundFaultStatus == GFD_WARNING) {
|
|
|
- // GFD 警告
|
|
|
- RecordAlarmCode(gunIndex, "012297");
|
|
|
- }
|
|
|
- }
|
|
|
-#endif //0
|
|
|
checkEvBoardReqStop(pDcChargingInfo->SystemStatus, gunIndex);
|
|
|
|
|
|
// LCM => Pre-charging
|
|
@@ -5025,64 +5030,12 @@ int main(void)
|
|
|
pDcChargingInfo->PresentChargedDuration = DiffTimeb(startChargingTime[gunIndex], endChargingTime[gunIndex]);
|
|
|
|
|
|
checkPileEndGfdResult(gunIndex, pDcChargingInfo->Type, pDcChargingInfo->SystemStatus);
|
|
|
-#if 0
|
|
|
- if (pDcChargingInfo->Type == _Type_Chademo) {
|
|
|
- if (pDcChargingInfo->GroundFaultStatus == GFD_FAIL) {
|
|
|
- // GFD 錯誤停止
|
|
|
- RecordAlarmCode(gunIndex, "012234");
|
|
|
- }
|
|
|
- //else if (((pDcChargingInfo->EvBatterytargetVoltage * 10) > 0 &&
|
|
|
- // pDcChargingInfo->EvBatterytargetVoltage < SYSTEM_MIN_VOL) ||
|
|
|
- // (pDcChargingInfo->PresentChargedDuration >= 10 &&
|
|
|
- // pDcChargingInfo->PresentChargingVoltage < SYSTEM_MIN_VOL)
|
|
|
- // ) {
|
|
|
- // // UVP
|
|
|
- // RecordAlarmCode(gunIndex, "012289");
|
|
|
- // ChargingTerminalProcess(gunIndex);
|
|
|
- //}
|
|
|
- else if (pDcChargingInfo->GroundFaultStatus == GFD_WARNING) {
|
|
|
- // GFD 警告
|
|
|
- RecordAlarmCode(gunIndex, "012296");
|
|
|
- }
|
|
|
- } else if (pDcChargingInfo->Type == _Type_GB) {
|
|
|
- if (pDcChargingInfo->GroundFaultStatus == GFD_FAIL) {
|
|
|
- // GFD 錯誤停止
|
|
|
- RecordAlarmCode(gunIndex, "012236");
|
|
|
- }
|
|
|
- //else if (isPrechargeStatus_gb(gunIndex) == 10 &&
|
|
|
- // (((pDcChargingInfo->EvBatterytargetVoltage * 10) > 0 &&
|
|
|
- // pDcChargingInfo->EvBatterytargetVoltage < SYSTEM_MIN_VOL) ||
|
|
|
- // (pDcChargingInfo->PresentChargedDuration >= 10 &&
|
|
|
- // pDcChargingInfo->PresentChargingVoltage < SYSTEM_MIN_VOL))
|
|
|
- // ) {
|
|
|
- // // UVP
|
|
|
- // RecordAlarmCode(gunIndex, "012290");
|
|
|
- // ChargingTerminalProcess(gunIndex);
|
|
|
- //}
|
|
|
- else if (pDcChargingInfo->GroundFaultStatus == GFD_WARNING) {
|
|
|
- // GFD 警告
|
|
|
- RecordAlarmCode(gunIndex, "012298");
|
|
|
- }
|
|
|
- } else if (pDcChargingInfo->Type == _Type_CCS_2) {
|
|
|
- if (pDcChargingInfo->GroundFaultStatus == GFD_FAIL) {
|
|
|
- // GFD 錯誤停止
|
|
|
- RecordAlarmCode(gunIndex, "012235");
|
|
|
- }
|
|
|
- //else if (((pDcChargingInfo->EvBatterytargetVoltage * 10) > 0 &&
|
|
|
- // pDcChargingInfo->EvBatterytargetVoltage < SYSTEM_MIN_VOL) ||
|
|
|
- // (pDcChargingInfo->PresentChargedDuration >= 10 &&
|
|
|
- // pDcChargingInfo->PresentChargingVoltage < SYSTEM_MIN_VOL)
|
|
|
- // ) {
|
|
|
- // // UVP
|
|
|
- // RecordAlarmCode(gunIndex, "012288");
|
|
|
- // ChargingTerminalProcess(gunIndex);
|
|
|
- //}
|
|
|
- else if (pDcChargingInfo->GroundFaultStatus == GFD_WARNING) {
|
|
|
- // GFD 警告
|
|
|
- RecordAlarmCode(gunIndex, "012297");
|
|
|
- }
|
|
|
+
|
|
|
+ if ((time((time_t*)NULL) - ShmDcCommonData->pGunInfo[gunIndex].RecordEnergyTime) >= 5) {
|
|
|
+ ShmDcCommonData->pGunInfo[gunIndex].RecordEnergyTime = time((time_t*)NULL);
|
|
|
+ if (ShmDcCommonData->pGunInfo[gunIndex].PowerConsumption != 0)
|
|
|
+ DB_Update_PowerConsumption(gunIndex, ShmDcCommonData->pGunInfo[gunIndex].PowerConsumption);
|
|
|
}
|
|
|
-#endif //0
|
|
|
|
|
|
if ((evBoardStopState = isEvBoardStopChargeFlag(gunIndex)) > 0) {
|
|
|
// 板端要求停止 (錯誤)
|
|
@@ -5144,82 +5097,13 @@ int main(void)
|
|
|
|
|
|
//log_info ("terminating......................... %x ", gunIndex);
|
|
|
StopGunInfoTimeoutDet(gunIndex);
|
|
|
+ ShmDcCommonData->pGunInfo[gunIndex].RecordEnergyTime = time((time_t*)NULL);
|
|
|
+ if (ShmDcCommonData->pGunInfo[gunIndex].PowerConsumption != 0)
|
|
|
+ DB_Update_PowerConsumption(gunIndex, ShmDcCommonData->pGunInfo[gunIndex].PowerConsumption);
|
|
|
}
|
|
|
|
|
|
//checkPileEndGfdResult(gunIndex, pDcChargingInfo->Type, pDcChargingInfo->SystemStatus);
|
|
|
-#if 0
|
|
|
- if (pDcChargingInfo->Type == _Type_Chademo) {
|
|
|
- // 非車端的停止 : 需等待小板送出停止指令,讓車端解除槍
|
|
|
- //if (isEvStopCharging_chademo(gunIndex) == YES) {
|
|
|
- // /*+++ 20200908, vern, disable it for DD360 +++*/
|
|
|
- // /*if (strcmp((char *)ShmOCPP16Data->StopTransaction[gunIndex].StopReason, "") == EQUAL)
|
|
|
- // strcpy((char *)ShmOCPP16Data->StopTransaction[gunIndex].StopReason, "Local");*/
|
|
|
- // /*--- 20200908, vern, disable it for DD360 ---*/
|
|
|
- //}
|
|
|
-
|
|
|
- if (pDcChargingInfo->GroundFaultStatus == GFD_FAIL) {
|
|
|
- // GFD 錯誤停止
|
|
|
- RecordAlarmCode(gunIndex, "012234");
|
|
|
- } else if (pDcChargingInfo->GroundFaultStatus == GFD_WARNING) {
|
|
|
- // GFD 警告
|
|
|
- RecordAlarmCode(gunIndex, "012296");
|
|
|
- }
|
|
|
|
|
|
- //if (isEvStopCharging_chademo(gunIndex) == YES ||
|
|
|
- // isPrechargeStatus_chademo(gunIndex) <= 0) {
|
|
|
- // setChargerMode(gunIndex, MODE_COMPLETE);
|
|
|
- //}
|
|
|
- } else if (pDcChargingInfo->Type == _Type_GB) {
|
|
|
- //log_info("************ GB lock Status = %d, status = %d ",
|
|
|
- // isEvStopCharging_gb(gunIndex),
|
|
|
- // isPrechargeStatus_gb(gunIndex));
|
|
|
-
|
|
|
- // 非車端的停止 : 需等待小板送出停止指令,讓車端解除槍
|
|
|
- //if (isEvStopCharging_chademo(gunIndex) == YES) {
|
|
|
- // /*+++ 20200908, vern, disable it for DD360 +++*/
|
|
|
- // /*if (strcmp((char *)ShmOCPP16Data->StopTransaction[gunIndex].StopReason, "") == EQUAL)
|
|
|
- // strcpy((char *)ShmOCPP16Data->StopTransaction[gunIndex].StopReason, "Local");*/
|
|
|
- // /*--- 20200908, vern, disable it for DD360 ---*/
|
|
|
- //}
|
|
|
-
|
|
|
- if (pDcChargingInfo->GroundFaultStatus == GFD_FAIL) {
|
|
|
- // GFD 錯誤停止
|
|
|
- RecordAlarmCode(gunIndex, "012236");
|
|
|
- } else if (pDcChargingInfo->GroundFaultStatus == GFD_WARNING) {
|
|
|
- // GFD 警告
|
|
|
- RecordAlarmCode(gunIndex, "012298");
|
|
|
- }
|
|
|
-
|
|
|
- //if (isEvStopCharging_gb(gunIndex) == YES ||
|
|
|
- // isPrechargeStatus_gb(gunIndex) <= 0) {
|
|
|
- // setChargerMode(gunIndex, MODE_COMPLETE);
|
|
|
- //}
|
|
|
- } else if (pDcChargingInfo->Type == _Type_CCS_2) {
|
|
|
- // 非車端的停止 : 需等待小板送出停止指令,讓車端解除槍
|
|
|
- //if (isEvStopCharging_chademo(gunIndex) == YES) {
|
|
|
- // /*+++ 20200908, vern, disable it for DD360 +++*/
|
|
|
- // /*if (strcmp((char *)ShmOCPP16Data->StopTransaction[gunIndex].StopReason, "") == EQUAL)
|
|
|
- // strcpy((char *)ShmOCPP16Data->StopTransaction[gunIndex].StopReason, "Local");*/
|
|
|
- // /*--- 20200908, vern, disable it for DD360 ---*/
|
|
|
- //}
|
|
|
-
|
|
|
- if (pDcChargingInfo->GroundFaultStatus == GFD_FAIL) {
|
|
|
- // GFD 錯誤停止
|
|
|
- RecordAlarmCode(gunIndex, "012235");
|
|
|
- } else if (pDcChargingInfo->GroundFaultStatus == GFD_WARNING) {
|
|
|
- // GFD 警告
|
|
|
- RecordAlarmCode(gunIndex, "012297");
|
|
|
- }
|
|
|
-
|
|
|
- //if (isEvStopCharging_ccs(gunIndex) == YES &&
|
|
|
- // (isPrechargeStatus_ccs(gunIndex) >= 53 ||
|
|
|
- // isPrechargeStatus_ccs(gunIndex) == 0 ||
|
|
|
- // isPrechargeStatus_ccs(gunIndex) == 13 ||
|
|
|
- // isPrechargeStatus_ccs(gunIndex) == 14)) {
|
|
|
- // setChargerMode(gunIndex, MODE_COMPLETE);
|
|
|
- //}
|
|
|
- }
|
|
|
-#endif //0
|
|
|
if (pDcChargingInfo->SystemStatus == S_ALARM) {
|
|
|
if (pDcChargingInfo->ConnectorPlugIn == NO &&
|
|
|
GetTimeoutValue(pDcChargingInfo->TimeoutTimer) >= 10000000) {
|