taobin_project/xml/page_remove_cup.xml

250 lines
5.2 KiB
XML
Raw Normal View History

2020-12-05 22:46:39 +07:00
<Page>
<X> 0 </X>
<Y> 608 </Y>
<Cache> "Enable" </Cache>
<Width> 1080 </Width>
<Height> 1312 </Height>
<Background> "0xEFEDEA" </Background>
<Volume> SoundVolume </Volume>
<EventOpen>
2021-01-19 23:43:43 +07:00
Var Timeout = 0
2020-12-05 22:46:39 +07:00
Var countClick = 0
Var countClick2 = 0
2023-09-21 20:42:16 +07:00
READ_FILE "/mnt/sdcard/coffeevending/country/short" StrCountryShort
DEBUGVAR StrCountryShort
2024-05-31 16:14:45 +07:00
; Don't forget
; This file can open before page_board.xml
2023-09-21 20:42:16 +07:00
If StrCountryShort = "MYS" Then
2023-10-09 13:30:00 +07:00
Open "ROOT/taobin_project/inter/mys/xml/page_remove_cup.lxml"
2023-09-21 20:42:16 +07:00
EndIf
If StrCountryShort = "AUS" Then
2023-10-17 10:19:27 +07:00
Open "ROOT/taobin_project/inter/aus/xml/page_remove_cup.lxml"
2023-09-21 20:42:16 +07:00
EndIf
2024-05-31 16:14:45 +07:00
If StrCountryShort = "SGP" Then
2024-06-05 15:35:36 +07:00
;Open "ROOT/taobin_project/inter/sgp/xml/page_remove_cup.lxml"
2024-05-31 16:14:45 +07:00
EndIf
2023-09-21 20:42:16 +07:00
2020-12-05 22:46:39 +07:00
If show_eng = "true" Then
Var DirImage = "ROOT/taobin_project/image/user_take_cup_en/"
Var show_btp = "ROOT/taobin_project/image/bn_thai_lang_press.png"
Var show_btn = "ROOT/taobin_project/image/bn_thai_lang.png"
Else
Var DirImage = "ROOT/taobin_project/image/user_take_cup_th/"
Var show_btp = "ROOT/taobin_project/image/bn_eng_lang_press.png"
Var show_btn = "ROOT/taobin_project/image/bn_eng_lang.png"
EndIf
2021-05-04 00:40:17 +07:00
LED LedDoorDoor 5 255 255 255 255
2024-05-31 16:14:45 +07:00
Var TimeoutInstance0 = 0
Var CheckCupStateDoorCupClose = "-"
Var CheckCupStateDoorCupCloseCnt = 0
2024-06-05 15:35:36 +07:00
Var CoundUpDelayCertainStage = 0
2020-12-05 22:46:39 +07:00
</EventOpen>
2024-05-31 16:14:45 +07:00
<Timeout> 1000 </Timeout>
2020-12-05 22:46:39 +07:00
<EventTimeout>
;SAVELOG MachineErrorDetail
Var MachineErrorDetailAll = MachineErrorDetail + " / "
Var MachineErrorDetailAll = MachineErrorDetailAll + MachineErrorDetailEng
2024-05-31 16:14:45 +07:00
2024-06-05 15:35:36 +07:00
;DEBUGVAR HaveCup
;DEBUGVAR CupOnArm
;DEBUGVAR DoorCupPosition
;DEBUGVAR CupChecking
;DEBUGVAR CupArmMove
;DEBUGVAR buttonRemoveCup
2024-05-31 16:14:45 +07:00
2024-05-29 16:32:32 +07:00
; Add haveCup false for block display abnormal. Alternate between page_board.xml and this file.
If HaveCup = "false" Then
If MachineStage = "show-menu" Then
Open "ROOT/taobin_project/xml/page_board.xml"
2020-12-05 22:46:39 +07:00
2024-05-29 16:32:32 +07:00
EndIf
2020-12-05 22:46:39 +07:00
EndIf
2024-05-29 16:32:32 +07:00
2020-12-05 22:46:39 +07:00
If MachineStage = "close-maintenance" Then
Open "ROOT/taobin_project/xml/page_show_error.xml"
EndIf
2024-03-08 22:54:19 +07:00
If show_eng = "true" Then
Else
If Timeout = 0 Then
2024-05-30 15:41:42 +07:00
If CupChecking = "false" Then
If DoorCupPosition = "bottom" Then
Play "/mnt/sdcard/coffeevending/taobin_project/sound_thai/remove_cup.mp3"
EndIf
EndIf
2024-03-08 22:54:19 +07:00
EndIf
2021-01-19 23:43:43 +07:00
EndIf
Var Timeout = Timeout + 1
If Timeout > 15 Then
Var Timeout = 0
2024-05-31 16:14:45 +07:00
EndIf
2023-05-16 22:35:46 +07:00
2024-05-31 16:14:45 +07:00
Var TimeoutInstance0 = TimeoutInstance0 + 1
2023-05-16 22:35:46 +07:00
2024-05-31 16:14:45 +07:00
If TimeoutInstance0 > 600 Then
Var TimeoutInstance0 = 0
SAVELOG "Check Cup all"
Machine CheckCupAll
2023-05-16 22:35:46 +07:00
EndIf
; Logic have differrent drinkfail3.xml
; protect lock
;
If CheckCupStateDoorCupCloseCnt > 0 Then
Var CheckCupStateDoorCupCloseCnt = CheckCupStateDoorCupCloseCnt - 1
2024-05-31 16:14:45 +07:00
DEBUGVAR CheckCupStateDoorCupCloseCnt
2023-05-16 22:35:46 +07:00
2024-05-31 16:14:45 +07:00
If CheckCupStateDoorCupCloseCnt = 0 Then
Var CheckCupStateDoorCupClose = ""
EndIf
2021-01-19 23:43:43 +07:00
EndIf
2023-05-12 15:49:12 +07:00
If HaveCup = "true" Then
If CheckCupStateDoorCupClose = "" Then
Var buttonRemoveCup = "Enable"
EndIf
Else
If buttonRemoveCup = "Enable" Then
Var buttonRemoveCup = "Invisible"
EndIf
EndIf
2024-05-31 16:14:45 +07:00
If DoorCupPosition = "bottom" Then
Else
Var buttonRemoveCup = "Invisible"
2024-06-05 15:35:36 +07:00
Var CoundUpDelayCertainStage = 0
2024-05-31 16:14:45 +07:00
EndIf
If CupArmMove = "true" Then
Var buttonRemoveCup = "Invisible"
If show_eng = "true" Then
Var MachineErrorDetailAll = "Please wait."
Else
Var MachineErrorDetailAll = "กรุณารอสักครู่"
EndIf
Else
If CupArmMove = "false" Then
If HaveCup = "true" Then
If DoorCupPosition = "bottom" Then
If buttonRemoveCup = "Invisible" Then
2024-06-05 15:35:36 +07:00
Var CoundUpDelayCertainStage = CoundUpDelayCertainStage + 1
If CoundUpDelayCertainStage > 2 Then
Var buttonRemoveCup = "Enable"
EndIf
2024-05-31 16:14:45 +07:00
EndIf
EndIf
EndIf
EndIf
EndIf
2020-12-05 22:46:39 +07:00
Refresh
TimerReset
</EventTimeout>
2024-05-31 16:14:45 +07:00
<EventDrink>
SAVELOG "EventDrink"
DEBUGVAR HaveCup
DEBUGVAR CupOnArm
DEBUGVAR DoorCupPosition
DEBUGVAR CupChecking
DEBUGVAR CupArmMove
If HaveCup = "true" Then
Var buttonRemoveCup = "Enable"
Else
Var buttonRemoveCup = "Invisible"
EndIf
</EventDrink>
2020-12-05 22:46:39 +07:00
<Image>
<X> 0 </X>
<Y> 852 </Y>
<Filename> Var(DirImage + "/img5.png") </Filename>
</Image>
<Button>
<X> 212 </X>
<Y> 1661 </Y>
<Filename> Var( DirImage + "/bn_door_open.png" ) </Filename>
<FilenamePress> Var( DirImage + "/bp_door_open.png" )</FilenamePress>
<Sound> "/mnt/sdcard/coffeevending/wav/click.wav" </Sound>
<Volume> SoundVolume </Volume>
2023-05-12 15:49:12 +07:00
<State> buttonRemoveCup </State>
2020-12-05 22:46:39 +07:00
<EventClick>
Machine RemoveCup
2021-05-04 00:40:17 +07:00
Machine DoorLidOpen
2023-05-12 15:49:12 +07:00
Var buttonRemoveCup = "Invisible"
2024-05-31 16:14:45 +07:00
; protect value update too slow.
Var DoorCupPosition = "-"
2023-05-12 15:49:12 +07:00
Var CheckCupStateDoorCupClose = "reset"
2023-05-16 22:35:46 +07:00
Var CheckCupStateDoorCupCloseCnt = 30
2024-05-31 16:14:45 +07:00
Refresh
2020-12-05 22:46:39 +07:00
</EventClick>
</Button>
<Button>
<X> 990 </X>
<Y> 400 </Y>
2023-05-31 15:06:34 +07:00
<State> show_eng_button_stage </State>
2020-12-05 22:46:39 +07:00
<Filename> show_btn </Filename>
<FilenamePress> show_btp </FilenamePress>
<Sound> "/mnt/sdcard/coffeevending/wav/click.wav" </Sound>
<Volume> SoundVolume </Volume>
<EventClick>
; eng
If show_eng = "true" Then
Var show_eng = "false"
Else
Var show_eng = "true"
EndIf
Open CurrentXMLFileName2
</EventClick>
</Button>
<Text>
<X> 5 </X>
<Y> 1868 </Y>
<Size> 24 </Size>
<Align> Center </Align>
<Width> 1080 </Width>
<Font> RobotoRegular </Font>
<Color> 0xDE794E </Color>
<Value> MachineErrorDetailAll </Value>
</Text>
2023-10-09 13:30:00 +07:00
</Page>