|
@@ -260,6 +260,25 @@ void getDateTimeString(char* result)
|
|
|
sprintf(result, "%04d/%02d/%02d %02d:%02d", tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min);
|
|
|
}
|
|
|
|
|
|
+//======================================================
|
|
|
+// OCPP routine
|
|
|
+//======================================================
|
|
|
+uint8_t ocpp_get_isRemoteStartWait()
|
|
|
+{
|
|
|
+ uint8_t result = OFF;
|
|
|
+
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ {
|
|
|
+ result = ShmOCPP16Data->MsMsg.bits.isRemoteStartWaitReq;
|
|
|
+ }
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ {
|
|
|
+ result = ShmOCPP20Data->MsMsg.bits.isRemoteStartWaitReq;
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
//=======================================
|
|
|
// Function to page routine
|
|
|
//=======================================
|
|
@@ -276,42 +295,50 @@ void page_booting()
|
|
|
|
|
|
void page_idle(uint8_t gun_index, uint8_t system_mode)
|
|
|
{
|
|
|
- if(ShmCharger->gun_info[gun_index].isSleepOn == YES)
|
|
|
+ if(ocpp_get_isRemoteStartWait())
|
|
|
{
|
|
|
- if((getCurrentPage() != SYSTEM_SCREEN_SLEEP))
|
|
|
- {
|
|
|
- setCurrentPage(SYSTEM_SCREEN_SLEEP);
|
|
|
- }
|
|
|
- else
|
|
|
- {}
|
|
|
+ setCurrentPage(SYSTEM_SCREEN_PREPARING);
|
|
|
+ DEBUG_INFO("Setting page to preparing.\n");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if(ShmCharger->gun_info[gun_index].isCheckPowerConsumption == YES)
|
|
|
+ if(ShmCharger->gun_info[gun_index].isSleepOn == YES)
|
|
|
{
|
|
|
- setCurrentPage(SYSTEM_SCREEN_POWER_CONSUMPTION);
|
|
|
- setDisplayValue(ICON_POWER_CONSUMPTION, APPEAR);
|
|
|
- setPresentPowerConsumption(gun_index);
|
|
|
+ if((getCurrentPage() != SYSTEM_SCREEN_SLEEP))
|
|
|
+ {
|
|
|
+ setCurrentPage(SYSTEM_SCREEN_SLEEP);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if((getCurrentPage() != SYSTEM_SCREEN_IDLE) && (ShmCharger->gun_info[gun_index].resultAuthorization != VALIDATED_RFID))
|
|
|
+ if(ShmCharger->gun_info[gun_index].isCheckPowerConsumption == YES)
|
|
|
{
|
|
|
- setCurrentPage(SYSTEM_SCREEN_IDLE);
|
|
|
- setDefaultValue(gun_index, system_mode);
|
|
|
- DEBUG_INFO("Setting page to idle.\n");
|
|
|
+ setCurrentPage(SYSTEM_SCREEN_POWER_CONSUMPTION);
|
|
|
+ setDisplayValue(ICON_POWER_CONSUMPTION, APPEAR);
|
|
|
+ setPresentPowerConsumption(gun_index);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- setRfidIcon();
|
|
|
- setQRCodeIcon();
|
|
|
-
|
|
|
- if(isEmulator == YES)
|
|
|
+ if((getCurrentPage() != SYSTEM_SCREEN_IDLE) && (ShmCharger->gun_info[gun_index].resultAuthorization != VALIDATED_RFID))
|
|
|
{
|
|
|
- //if(isCharging == YES)
|
|
|
- //PERCENTAGE = 0;
|
|
|
- //else
|
|
|
- //PERCENTAGE = 100;
|
|
|
+ setCurrentPage(SYSTEM_SCREEN_IDLE);
|
|
|
+ setDefaultValue(gun_index, system_mode);
|
|
|
+ DEBUG_INFO("Setting page to idle.\n");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ setRfidIcon();
|
|
|
+ setQRCodeIcon();
|
|
|
+
|
|
|
+ if(isEmulator == YES)
|
|
|
+ {
|
|
|
+ //if(isCharging == YES)
|
|
|
+ //PERCENTAGE = 0;
|
|
|
+ //else
|
|
|
+ //PERCENTAGE = 100;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|