SGP: add page_show_error

This commit is contained in:
Pakin 2024-08-15 15:40:04 +07:00
parent 24251309bb
commit c7f8da0535
2 changed files with 371 additions and 1 deletions

View file

@ -0,0 +1,364 @@
<Page>
<X> 0 </X>
<Y> 608 </Y>
<Cache> "Enable" </Cache>
<Width> 1080 </Width>
<Height> 1312 </Height>
<Background> BackgroundColor </Background>
<Volume> SoundVolume </Volume>
<EventOpen>
Var countClick = 0
Var countClick2 = 0
DEBUGVAR MachineStage
DEBUGVAR stop_now
DEBUGVAR LanguageShow
;OpenInst 2 "/mnt/sdcard/coffeevending/taobin_project/xml/page_list.xml"
Var show_error_normal = "Invisible"
Var show_error_sp1 = "Enable"
StopLongPlay
If LEDSet = "true" Then
Else
LED LedDoorCup On 255 0 0 255
LED LedDoorLid Off 255 255 255 255
EndIf
Function 2
Var TimeOut = 0
Var textStep = 0
RootLayoutVisible 3 "show"
</EventOpen>
<Timeout> 1000 </Timeout>
<EventTimeout>
Var EmergencyStop = "-"
If EmergencyStop = "true" Then
If DoorCupPosition = "bottom" Then
; It normal
Var EmergencyStop = "false"
Else
Var MachineErrorDetailAll = "Emergency stop!"
EndIf
Else
Var MachineErrorDetailAll = MachineErrorDetailEng
If textStep > 3 Then
Var textStep = 0
Var MachineErrorDetailAll = MachineErrorDetailAll + " [ \ ]"
EndIf
If textStep = 3 Then
Var MachineErrorDetailAll = MachineErrorDetailAll + " [ - ]"
EndIf
If textStep = 2 Then
Var MachineErrorDetailAll = MachineErrorDetailAll + " [ / ]"
EndIf
If textStep = 1 Then
Var MachineErrorDetailAll = MachineErrorDetailAll + " [ | ]"
EndIf
Var textStep = textStep + 1
;DEBUGVAR MachineErrorDetailAll
;DEBUGVAR textStep
If NETCORE_LOST_CNT > 0 Then
Else
DEBUGVAR NCIC07_EVENT_CNT
DEBUGVAR NETCORE_EVENT_CNT_TMP
If NCIC07_EVENT_CNT = NETCORE_EVENT_CNT_TMP Then
Var NETCORE_LOST_COUNT_UP = NETCORE_LOST_COUNT_UP + 1
DEBUGVAR NETCORE_LOST_COUNT_UP
If NETCORE_LOST_COUNT_UP > 300 Then
If textStep > 3 Then
Var MachineErrorDetailAll = MachineErrorDetailAll + " !"
EndIf
If textStep = 3 Then
Var MachineErrorDetailAll = MachineErrorDetailAll + " !!"
EndIf
If textStep = 2 Then
Var MachineErrorDetailAll = MachineErrorDetailAll + " !!!"
EndIf
If textStep = 1 Then
Var MachineErrorDetailAll = MachineErrorDetailAll + " !!!!"
EndIf
EndIf
Else
If stop_now_from_netcore_event = 1 Then
Var stop_now = "false"
SAVELOG "stop_now_from_netcore_event is set"
Var stop_now_from_netcore_event = 0
EndIf
If stop_now_from_door_cup = 1 Then
Var stop_now = "false"
SAVELOG "stop_now_from_door_cup is set"
Var stop_now_from_door_cup = 0
EndIf
If MachineStage = "" Then
Var LEDSet = "false"
Open "ROOT/taobin_project/xml/page_board.xml"
EndIf
If MachineStage = "show-menu" Then
Var LEDSet = "false"
Open "ROOT/taobin_project/xml/page_board.xml"
EndIf
If MachineStage = "remove-cup" Then
Var LEDSet = "false"
Open "ROOT/taobin_project/xml/page_remove_cup.xml"
EndIf
If MachineStage = "drink-failed" Then
Var FirstOpen = 1
Var LEDSet = "true"
;Open "ROOT/taobin_project/inter/sgp/xml/page_show_error.lxml"
Refresh
EndIf
If FirstOpen = 1 Then
Var FirstOpen = 0
If MachineStage = "close-maintenance" Then
Var LEDSet = "true"
;Open "ROOT/taobin_project/inter/sgp/xml/page_show_error.lxml"
Refresh
EndIf
EndIf
EndIf
EndIf
EndIf
DEBUGVAR show_error_normal
DEBUGVAR show_error_sp1
DEBUGVAR TimeOut
Var TimeOut = TimeOut + 1
If TimeOut > 30 Then
Var TimeOut = 0
Open "ROOT/taobin_project/inter/sgp/xml/page_show_error.lxml"
EndIf
Refresh
TimerReset
Var LEDSet = "true"
;Open "ROOT/taobin_project/inter/sgp/xml/page_show_error.lxml"
</EventTimeout>
<EventLanguageOnChange>
DEBUGVAR LanguageShow
Var LanguageButtonEnable = "Enable"
Var ButtonLanguageCurrentXPosition = 990
Var ButtonLanguageCurrentYPosition = 648
Var ButtonLanguageListXPosition = 970
Var ButtonLanguageListYPosition = 640
OpenInst 3 "ROOT/taobin_project/xml/topview2.xml"
Function 2
Refresh
</EventLanguageOnChange>
<Function2>
DEBUGVAR MachineStage
DEBUGVAR stop_now
If show_eng = "true" Then
Var DirImage = "ROOT/taobin_project/image/vending_error_en/"
Else
Var DirImage = "ROOT/taobin_project/image/vending_error"
EndIf
If MachineStage = "mcu-upgrade" Then
;Var DirImage = CountryRootPath + "image/vending_error_en"
EndIf
If NeedUpgrade = "true" Then
;Var DirImage = CountryRootPath + "image/vending_error_en"
EndIf
DEBUGVAR MachineStage
If MachineStage = "close-maintenance" Then
DEBUGVAR stop_now
If stop_now = "true" Then
;Var DirImage = CountryRootPath + "image/vending_error_en"
Else
Var show_error_normal = "Enable"
Var show_error_sp1 = "Invisible"
;Var DirImage = CountryRootPath + "image/vending_error_en"
EndIf
EndIf
If MachineStage = "drink-failed" Then
If stop_now = "true" Then
;Var DirImage = CountryRootPath + "image/vending_error_en"
Else
Var show_error_normal = "Enable"
Var show_error_sp1 = "Invisible"
;Var DirImage = CountryRootPath + "image/vending_error_en"
EndIf
EndIf
If NETCORE_LOST_CNT > 0 Then
;Var DirImage = CountryRootPath + "image/vending_error_en"
EndIf
If NETCORE_EVENT_CNT_X >= 30 Then
Var NETCORE_EVENT_CNT_X = 0
;Var DirImage = CountryRootPath + "image/vending_error_en"
EndIf
Var MaintenanceCard = 20
Random MaintenanceCard
Var index = 1 + MaintenanceCard
If UsePepsiTheme = 1 Then
Var DirImage = "ROOT/taobin_project/inter/whatthecup/" + CountryShortName
Var DirImage = DirImage + "/image/vending_error_en"
EndIf
DEBUGVAR DirImage
Var RandomImage = "ROOT/taobin_project/image/close_en/Frame" + index
Var RandomImage = RandomImage + ".png"
If UsePepsiTheme = 1 Then
Var RandomImage = "ROOT/taobin_project/inter/whatthecup/" + CountryShortName
Var RandomImage = RandomImage + "/image/close_en/Frame"
Var RandomImage = RandomImage + index
Var RandomImage = RandomImage + ".png"
EndIf
DEBUGVAR RandomImage
DEBUGVAR Seeker
DEBUGVAR DoorCupPosition
DEBUGVAR DoorLidPosition
DEBUGVAR EmergencyStop
</Function2>
<Image>
<State> show_error_normal </State>
<X> 69 </X>
<Y> 642 </Y>
<Filename> Var(DirImage + "/img1.png") </Filename>
</Image>
<Image>
<State> show_error_sp1 </State>
<X> 69 </X>
<Y> 642 </Y>
<Filename> Var(DirImage + "/img_error_sgp.png") </Filename>
</Image>
;<Image>
;<State> show_error_sp1 </State>
;<X> 0 </X>
;<Y> 897 </Y>
;<Filename> Var(DirImage + "/img1.png") </Filename>
;</Image>
;
;<Image>
;<State> show_error_sp1 </State>
;<X> 0 </X>
;<Y> 694 </Y>
;<Filename> Var(DirImage + "/text1.png") </Filename>
;</Image>
;
;<Image>
;<State> show_error_sp1 </State>
;<X> 127 </X>
;<Y> 1685 </Y>
;<Filename> Var(DirImage + "/text2.png") </Filename>
;</Image>
<Button>
<X> 0 </X>
<Y> 1860 </Y>
<Width> 200 </Width>
<Height> 50 </Height>
<Sound> "/mnt/sdcard/coffeevending/wav/click.wav" </Sound>
<Volume> SoundVolume </Volume>
<EventClick>
Var countClick = countClick + 1
If countClick = 3 Then
EndIf
If countClick = 10 Then
Var countClick = 0
MainMenu
EndIf
Refresh
</EventClick>
</Button>
<Button>
<X> 870 </X>
<Y> 1860 </Y>
<Width> 200 </Width>
<Height> 50 </Height>
<Sound> "/mnt/sdcard/coffeevending/wav/click.wav" </Sound>
<Volume> SoundVolume </Volume>
<EventClick>
</EventClick>
</Button>
<Text>
<X> 5 </X>
<Y> 1868 </Y>
<Size> 24 </Size>
<Align> Center </Align>
<Width> 1080 </Width>
<Font> RobotoRegular </Font>
<Color> HeadlineColor </Color>
<Value> MachineErrorDetailAll </Value>
</Text>
</Page>

View file

@ -6,7 +6,13 @@ If InternationalEnable = 1 Then
If CountryName = "Australia" Then
Open "ROOT/taobin_project/inter/aus/xml/page_show_error.lxml"
Else
Open "ROOT/taobin_project/xml/page_show_error.lxml"
If CountryName = "Singapore" Then
Open "ROOT/taobin_project/inter/sgp/xml/page_show_error.lxml"
Else
Open "ROOT/taobin_project/xml/page_show_error.lxml"
EndIf
EndIf
Else
Open "ROOT/taobin_project/xml/page_show_error.xml"