NEWUI: fix eternal wait on wrong password

This commit is contained in:
Pakin 2024-08-23 15:45:03 +07:00
parent fc6bd5ef15
commit 62b864a8e7
8 changed files with 188 additions and 30 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View file

@ -157,6 +157,19 @@
SAVELOG " EventOpen EventOpen EventOpen EventOpen EventOpen EventOpen EventOpen EventOpen EventOpen EventOpen EventOpen EventOpen "
Var MainMenuBlockCount = 2
READ_FILE "/mnt/sdcard/coffeevending/enable_new_machine_test_ui" enable_new_ui
STRCONTAIN "1" enable_new_ui show_newui_mode
If show_newui_mode = "true" Then
Var EnableNewBrewUI = "true"
Else
Var EnableNewBrewUI = "false"
EndIf
</EventOpen>
<Timeout> 1000 </Timeout>
<EventTimeout>
@ -258,6 +271,8 @@
EndIf
EndIf
DEBUGVAR EnableNewBrewUI
Refresh
TimerReset
@ -902,7 +917,7 @@
Var return = "Invisible"
EndIf
) </State>
<Value> "New ui V2" </Value>
<Value> "Access setting (V2)" </Value>
</Text>
;<QRCode>

View file

@ -169,14 +169,33 @@
Var PermissionLevel = ""
Var tmpPassPhrase = ""
Var WaitPasswordCheck = 0
Var WaitPopup = "Invisible"
Var WhileRetryCounter = 0
Var FailPopup = "Invisible"
; define-case
Var FailCasePic = ""
Var FailCaseDir = "ROOT/taobin_project/image/new_vending_info/"
Var FailCaseIncorrect = "popup_incorrect.png"
Var FailCaseTimeout = "popup_timeout.png"
</EventOpen>
<Timeout> 1000 </Timeout>
<EventTimeout>
DEBUGVAR Timeout
DEBUGVAR WhileRetryCounter
Var Timeout = Timeout + 1
If Timeout > 15 Then
If alphaPasswordPromptWithKeyboard = "Enable" Then
Var Timeout = 0
Else
Var Timeout = Timeout + 1
EndIf
If Timeout > 30 Then
Open "ROOT/taobin_project/xml/page_board.xml"
EndIf
@ -187,6 +206,9 @@
Var Timeout = 20
Var PasswordOK = 0
Var WaitPopup = "Invisible"
Var FailPopup = "Invisible"
Var alphaPasswordPromptWithKeyboard = "Invisible"
Var alphaPasswordPrompt = "Invisible"
@ -194,8 +216,8 @@
Var HiddenPassPhrase = ""
If ClickOn = "GetAccess" Then
;MainMenu
Open "ROOT/taobin_project/xml/vending_tasks_pre_main.xml"
MainMenu2
;Open "ROOT/taobin_project/xml/vending_tasks_pre_main.xml"
EndIf
If ClickOn = "QuickTest" Then
@ -207,16 +229,72 @@
If WaitPasswordCheck = 1 Then
If PasswordOK = 1 Then
If PasswordOK = 1 Then
Var Timeout = 20
Var PasswordOK = 0
Else
Var WaitPopup = "Invisible"
Var FailPopup = "Invisible"
__CMD "check-password-wait" "-" "-" "-"
Var alphaPasswordPromptWithKeyboard = "Invisible"
Var alphaPasswordPrompt = "Invisible"
EndIf
Var PassPhrase = ""
Var HiddenPassPhrase = ""
If ClickOn = "GetAccess" Then
MainMenu2
;Open "ROOT/taobin_project/xml/vending_tasks_pre_main.xml"
EndIf
If ClickOn = "QuickTest" Then
;open
EndIf
Else
If WhileRetryCounter < 10 Then
DEBUGVAR "WaitPasswordCheck"
__CMD "check-password-wait" "-" "-" "-"
Var Timeout = 0
Var WaitPopup = "Enable"
Var FailPopup = "Invisible"
Var WhileRetryCounter = WhileRetryCounter + 1
Else
DEBUGVAR "WaitPasswordCheck.MaxTimeout"
Var WhileRetryCounter = 0
Var WaitPopup = "Invisible"
Var FailPopup = "Enable"
Var alphaPasswordPromptWithKeyboard = "Invisible"
Var FailCasePic = FailCaseDir + FailCaseIncorrect
; auto-turnoff
DEBUGVAR "auto-turnoff"
Var WaitPasswordCheck = 0
EndIf
EndIf
Else
If PasswordOK = 0 Then
If WaitPopup = "Enable" Then
Var WhileRetryCounter = WhileRetryCounter + 1
EndIf
EndIf
EndIf
; case-unable-to-fetch-pw
If WhileRetryCounter > 10 Then
If WaitPopup = "Enable" Then
Var WaitPopup = "Invisible"
Var alphaPasswordPromptWithKeyboard = "Invisible"
Var WhileRetryCounter = 0
Var FailPopup = "Enable"
Var FailCasePic = FailCaseDir + FailCaseTimeout
EndIf
EndIf
@ -424,8 +502,8 @@
DEBUGVAR ShowVersionAll
If alphaPasswordPrompt = "Invisible" Then
Var alphaPasswordPrompt = "Enable"
If alphaPasswordPromptWithKeyboard = "Invisible" Then
Var alphaPasswordPromptWithKeyboard = "Enable"
Var ClickOn = "QuickTest"
EndIf
@ -442,27 +520,14 @@
<EventClick>
DEBUGVAR ShowVersionAll
If alphaPasswordPrompt = "Invisible" Then
Var alphaPasswordPrompt = "Enable"
If alphaPasswordPromptWithKeyboard = "Invisible" Then
Var alphaPasswordPromptWithKeyboard = "Enable"
Var ClickOn = "GetAccess"
EndIf
</EventClick>
</Button>
<Button>
<X> 50 </X>
<Y> info_cancel_y </Y>
<Filename> "ROOT/taobin_project/image/new_vending_info/exit_button.png" </Filename>
<FilenamePress> "ROOT/taobin_project/image/new_vending_info/exit_button.png" </FilenamePress>
<Sound> "/mnt/sdcard/coffeevending/wav/click.wav" </Sound>
<Volume> SoundVolume </Volume>
<EventClick>
Open "ROOT/taobin_project/xml/page_board.xml"
</EventClick>
</Button>
<EventIDCard>
Var IDCardState = "Enable"
@ -889,6 +954,7 @@
Var PassPhrase = ""
Var HiddenPassPhrase = ""
Var WaitPopup = "Enable"
</EventClick>
</Button>
@ -925,4 +991,81 @@
<Value> HiddenPassPhrase </Value>
</Text>
; waitPopup-with-alpha
<Image>
<X> 0 </X>
<Y> 0 </Y>
<State> eval(
If WaitPopup = "Enable" Then
Var return = "Enable"
Else
If FailPopup = "Enable" Then
Var return = "Enable"
Else
Var return = "Invisible"
EndIf
EndIf
) </State>
<Filename> "ROOT/taobin_project/image/new_vending_info/alpha.png" </Filename>
</Image>
<Image>
<X> 240 </X>
<Y> 300 </Y>
<State> WaitPopup </State>
<Filename> "ROOT/taobin_project/image/new_vending_info/popup_wait.png" </Filename>
</Image>
<Image>
<X> 240 </X>
<Y> 300 </Y>
<State> FailPopup </State>
<Filename> FailCasePic </Filename>
</Image>
<Button>
<X> 375 </X>
<Y> 500 </Y>
<Refresh> "Enable" </Refresh>
<State> FailPopup </State>
<Filename> "ROOT/taobin_project/image/new_vending_info/bn_close_white.png" </Filename>
<Sound> "ROOT/sounds/codebuttom.wav" </Sound>
<Volume> SoundVolume </Volume>
<EventClick>
Var PassPhrase = ""
Var HiddenPassPhrase = ""
Var alphaPasswordPromptWithKeyboard = "Invisible"
Var alphaPasswordPrompt = "Invisible"
Var WaitPopup = "Invisible"
Var FailPopup = "Invisible"
</EventClick>
</Button>
<Button>
<X> 50 </X>
<Y> info_cancel_y </Y>
<Filename> "ROOT/taobin_project/image/new_vending_info/exit_button.png" </Filename>
<FilenamePress> "ROOT/taobin_project/image/new_vending_info/exit_button.png" </FilenamePress>
<Sound> "/mnt/sdcard/coffeevending/wav/click.wav" </Sound>
<Volume> SoundVolume </Volume>
<EventClick>
Var PassPhrase = ""
Var HiddenPassPhrase = ""
Var alphaPasswordPromptWithKeyboard = "Invisible"
Var alphaPasswordPrompt = "Invisible"
Var WaitPopup = "Invisible"
Var FailPopup = "Invisible"
Var WaitPasswordCheck = 0
Var PasswordOK = 0
Open "ROOT/taobin_project/xml/page_board.xml"
</EventClick>
</Button>
</Page>

View file

@ -115,7 +115,7 @@
<Button>
<Filename> "ROOT/taobin_project/image/new_vending_info/test_sys_only.png" </Filename>
<EventOnClick>
MainMenu
MainMenu2
</EventOnClick>
</Button>
@ -130,7 +130,7 @@
<Button>
<Filename> "ROOT/taobin_project/image/new_vending_info/service_ops.png" </Filename>
<EventOnClick>
MainMenu
MainMenu2
</EventOnClick>
</Button>
@ -145,7 +145,7 @@
<Button>
<Filename> "ROOT/taobin_project/image/new_vending_info/maintenance_repair.png" </Filename>
<EventOnClick>
MainMenu
MainMenu2
</EventOnClick>
</Button>
@ -160,7 +160,7 @@
<Button>
<Filename> "ROOT/taobin_project/image/new_vending_info/configure_machine.png" </Filename>
<EventOnClick>
MainMenu
MainMenu2
</EventOnClick>
</Button>