Merge branch 'masterpiece' of ssh://192.168.10.159:/1TBHDD/ikong/taobin_project into masterpiece

This commit is contained in:
thanawat saiyota 2025-03-20 12:49:12 +07:00
commit ee9f275f55
39 changed files with 10812 additions and 6792 deletions

509
inc/page_board_events.inc Normal file
View file

@ -0,0 +1,509 @@
<EventUnitTest1>
ReloadAll
</EventUnitTest1>
<EventUnitTest2>
Var NextPage = "ROOT/taobin_project/xml/page_back_to_main.xml"
OpenInst 1 "/mnt/sdcard/coffeevending/taobin_project/xml/page_advert2.xml"
Var OpenFromPageBoard = 1
If InternationalEnable = 1 Then
; show language icon
OpenInst 3 "ROOT/taobin_project/xml/topview2.xml"
RootLayoutVisible 3 "show"
OpenInst 2 "/mnt/sdcard/coffeevending/taobin_project/xml/page_catalog_group_recommend.lxml"
Else
TRY "/mnt/sdcard/coffeevending/taobin_project/xml/event/script_common_for_open_promotion_xml.ev"
EndIf
Machine DoorClose
TopView "show"
Open "/mnt/sdcard/coffeevending/taobin_project/xml/page_main_blank.xml"
</EventUnitTest2>
<EventUnitTest3>
PRICE "Reset" "-"
PRICE "Load" "-"
PRICE "CheckAndApply" XMLProfile
DEBUGVAR ProfileIndex[0]
DEBUGVAR ProfileIndex[1]
DEBUGVAR ProfileIndex[2]
DEBUGVAR ProfileIndex[3]
DEBUGVAR ProfileIndex[4]
DEBUGVAR ProfileIndex[5]
DEBUGVAR ProfileIndex[6]
DEBUGVAR ProfileIndex[7]
DEBUGVAR ProfileIndex[8]
DEBUGVAR ProfileIndex[9]
DEBUGVAR ProfileIndex[10]
PRICE "Reload" "-"
</EventUnitTest3>
<EventUnitTest4>
If CountryName = "-Thailand-" Then
Var InternationalEnable = 1
DEBUGVAR InternationalEnable
;TRY "/mnt/sdcard/coffeevending/taobin_project/inter/tha/video/script_video.ev"
TRY "/mnt/sdcard/coffeevending/taobin_project/xml/multi_ads/ads_path.ev"
;specified to unittest4
Var OpenFileXML = CountryRootPath + "xml/event/tricker.ev"
DEBUGVAR OpenFileXML
TRY OpenFileXML
EnableLanguage "ENG"
EnableLanguage "THAI"
EnableLanguage "MYANMAR"
SetLanguage "THAI"
LanguageControl "UpdateList" "-"
Var show_eng = "false"
;Var img_press_main_page = "ROOT/taobin_project/image/main_page/bp_main_page_start.png"
;Var img_rest_main_page = ""
;Var img_reset_topup = ""
;ROOT/taobin_project/image/main_page/bn_main_page_topup.png
;Var ShowNetworkProblemText = "Network error. Payment Cash only."
Var CountryRootPath = "ROOT/taobin_project/inter/tha/"
Var CountryShortName = "tha"
Var TextPriceMenuSize = 12
Var TextPriceMenuY = 266
Var TextPriceMenuBlendX = 180
Var TextPriceMenuHotX = 48
Var ShowButtonClick2 = "Invisible"
Var ButtontoTopupMenu = "Enable"
Var PriceUnitText = ""
;Var MemberButtonFileName = "ROOT/taobin_project/image/TermTempage2/bp_main_page_member.png"
;Var MemberButtonFileNameRest = "ROOT/taobin_project/image/TermTempage2/bn_main_page_member.png"
Var show_eng_button_stage = "Invisible"
Var CountDownShowButton = 35
Var XButtonMember = 384
Var YButtonMember = 1695
If Not#LanguageLoaded = "" Then
LoadLanguage "/mnt/sdcard/coffeevending/taobin_project/inter/tha/menu/lang.tsv"
EndIf
Var cups_sold_text = "Cups Sold Worldwide"
Var MinPhoneNumber = 10
Var MaxPhoneNumber = 10
OpenInst 1 "/mnt/sdcard/coffeevending/taobin_project/xml/sold_cup_count.xml"
EndIf
</EventUnitTest4>
<EventUnitTest5>
Var XMLProfile = "y18IDCardCaffeine"
Var TimeProfilePrice = 0
</EventUnitTest5>
<EventUnitTest6>
Var XMLProfile = "ProfileIncrease35"
Var TimeProfilePrice = 0
</EventUnitTest6>
<EventUnitTest7>
Var XMLProfile = "ProfileIncrease45"
Var TimeProfilePrice = 0
</EventUnitTest7>
<EventUnitTest8>
Var buttonRemoveCup = "Enable"
DEBUGVAR buttonRemoveCup
DEBUGVAR bnRemoveCup
DEBUGVAR bpRemoveCup
</EventUnitTest8>
<EventUnitTest9>
Var buttonRemoveCup = "Enable"
Var UseVeryBigRemoveCupButton = "Enable"
DEBUGVAR buttonRemoveCup
</EventUnitTest9>
<EventDrink>
SAVELOG "EventDrink EventDrink EventDrink EventDrink EventDrink "
</EventDrink>
<Timeout> 1000 </Timeout>
<EventTimeout>
If CNTDOWN_PROTECT_SCREEN_BLANK = 0 Then
SAVELOG "CNTDOWN_PROTECT_SCREEN_BLANK"
OpenInst 0 "ROOT/taobin_project/xml/page_board.xml"
EndIf
If IgnoreNetCore = "true" Then
Else
If SELLSTATUS = "DEACTIVE" Then
OpenInst 0 "/ROOT/xml/offline.xml"
EndIf
If NoWaitMachineEnable = 1 Then
If RecoveryRunning = "true" Then
OpenInst 0 "/mnt/sdcard/coffeevending/taobin_project/xml/page_board.xml"
EndIf
If stop_now = "true" Then
OpenInst 0 "/mnt/sdcard/coffeevending/taobin_project/xml/page_board.xml"
EndIf
Else
If MachineStage = "close-maintenance" Then
OpenInst 0 "/mnt/sdcard/coffeevending/taobin_project/xml/page_board.xml"
EndIf
EndIf
If CLOSE_ORDER_NOW = "true" Then
OpenInst 0 "/mnt/sdcard/coffeevending/taobin_project/xml/page_board.xml"
EndIf
If MachineStage = "mcu-upgrade" Then
OpenInst 0 "/mnt/sdcard/coffeevending/taobin_project/xml/page_board.xml"
EndIf
;stop_now
If NETCORE_LOST_CNT > 120 Then
Var stop_now = "true"
Var MachineErrorDetailAll = "???"
SAVELOG "NETCORE_LOST_CNT"
OpenInst 0 "/mnt/sdcard/coffeevending/taobin_project/xml/page_board.xml"
EndIf
;DEBUGVAR NETCORE_EVENT_CNT_X
If NCIC07_EVENT_CNT = NETCORE_EVENT_CNT_TMP Then
If NETCORE_EVENT_CNT_X > 3600 Then
Var stop_now = "true"
Var stop_now_from_netcore_event = 1
Var MachineErrorDetailAll = "Netcore Lost"
SAVELOG "Netcore Lost NCIC07_EVENT_CNT"
DEBUGVAR NCIC07_EVENT_CNT
OpenInst 0 "/mnt/sdcard/coffeevending/taobin_project/xml/page_board.xml"
EndIf
Else
Var NETCORE_EVENT_CNT_X = 0
Var NETCORE_EVENT_CNT_TMP = NCIC07_EVENT_CNT
EndIf
EndIf
If MachineStage = "drink-failed" Then
OpenInst 0 "/mnt/sdcard/coffeevending/taobin_project/xml/page_board.xml"
EndIf
If MachineStage = "remove-cup" Then
OpenInst 0 "/mnt/sdcard/coffeevending/taobin_project/xml/page_board.xml"
EndIf
If BrewTimeoutExtend = 1 Then
DEBUGVAR BrewTimeoutExtend
DEBUGVAR DoorCupPosition
If DoorCupPosition = "bottom" Then
SAVELOG "BrewTimeoutExtend = 0 Clear Error Flag"
Var BrewTimeoutExtend = 0
; clear stage
Else
Var stop_now = "true"
Var stop_now_from_door_cup = 1
OpenInst 0 "/mnt/sdcard/coffeevending/taobin_project/xml/page_board.xml"
EndIf
Else
If DoorCupPosition = "Bottom" Then
Var BrewTimeoutExtend = 0
Else
Var BrewTimeoutExtend = 0
EndIf
EndIf
If NeedUpgrade = "true" Then
OpenInst 0 "/mnt/sdcard/coffeevending/taobin_project/xml/page_board.xml"
EndIf
;DEBUGVAR MachineStage
;DEBUGVAR CountDownShowButton
;DEBUGVAR ShowButtonClick
;DEBUGVAR ShowButtonClickFull
;DEBUGVAR CountDownPauseVideo
If TaobinOnlineX = "true" Then
If CountDownPauseVideo > 0 Then
DEBUGVAR CountDownPauseVideo
; ignore
;Var CountDownPauseVideo = CountDownPauseVideo - 1
;Var CountDownPauseVideo2 = CountDownPauseVideo - 1
DEBUGVAR CountDownPauseVideo2
If CountDownPauseVideo = 2 Then
;TapScreen 30 638
EndIf
If CountDownPauseVideo = 1 Then
;TapScreen 860 1004
EndIf
If CountDownPauseVideo = 0 Then
Var NextPage = "ROOT/taobin_project/xml/page_back_to_main.xml"
OpenInst 1 "/mnt/sdcard/coffeevending/taobin_project/xml/page_advert2.xml"
Var OpenFromPageBoard = 1
If DoorCupPosition = "bottom" Then
If CupOnArm = "true" Then
Else
__CMD "CLI" "arm_id=3,arm_position=posi_espresso_ii" "-" "-"
EndIf
EndIf
DEBUGVAR InternationalEnable
DEBUGVAR CountryName
If InternationalEnable = 1 Then
If CountryName = "Thailand" Then
SAVELOG " Thailand Thailand Thailand Thailand Pooon Pooon Pooon Pooon Pooon"
;TRY "/mnt/sdcard/coffeevending/taobin_project/inter/tha/xml/event/script_common_for_open_promotion_xml.ev"
Else
; show language icon
OpenInst 3 "ROOT/taobin_project/xml/topview2.xml"
RootLayoutVisible 3 "show"
;Var OpenFileXML = CountryRootPath + "xml/event/script_common_for_open_promotion_xml.ev"
;TRY OpenFileXML
EndIf
Else
If BeerTrapEnable = "true" Then
;OpenInst 2 "/mnt/sdcard/coffeevending/taobin_project/xml/page_catalog_cocktail.xml"
Else
;TRY "/mnt/sdcard/coffeevending/taobin_project/xml/event/script_common_for_open_promotion_xml.ev"
EndIf
EndIf
Machine DoorClose
TopView "show"
OpenInst 0 "/mnt/sdcard/coffeevending/taobin_project/xml/page_main_blank.xml"
EndIf
EndIf
EndIf
If TimerFirst = "true" Then
DEBUGVAR CountUpReloadAll
; setvarint CountUpReloadAll 49
; Original value is 40
If EnableMultiInstance = "true" Then
If CountUpReloadAll > 300 Then
Var NeedReboot = "false"
Var StartUpExt = "-"
Var CountUpReloadAll = 0
ReloadAll
EndIf
If CountUpReloadAll = 50 Then
Var SlientRefreshIndex = 2
EndIf
If CountUpReloadAll = 150 Then
Var SlientRefreshIndex = 2
EndIf
If CountUpReloadAll = 200 Then
Var SlientRefreshIndex = 2
EndIf
If CountUpReloadAll = 250 Then
Var SlientRefreshIndex = 2
EndIf
Else
If CountUpReloadAll > 100 Then
Var NeedReboot = "false"
Var StartUpExt = "-"
Var CountUpReloadAll = 0
ReloadAll
EndIf
EndIf
EndIf
If CupOnArm = "true" Then
If CheckCupStateDoorCupClose = "" Then
Var buttonRemoveCup = "Enable"
EndIf
If CheckCupStateDoorCupClose = "done" Then
Var buttonRemoveCup = "Enable"
EndIf
Else
If buttonRemoveCup = "Enable" Then
Var buttonRemoveCup = "Invisible"
EndIf
EndIf
If Seeker = "curr" Then
If DoorCupPosition = "bottom" Then
; It normal
Var EmergencyStop = "false"
Else
;Var EmergencyStop = "true"
EndIf
EndIf
If MainPageEventWithTimeout = "" Then
Else
If MainPageEventWithTimeout > 0 Then
Var MainPageEventWithTimeout = MainPageEventWithTimeout - 1
EndIf
;DEBUGVAR MainPageEventWithTimeout
If MainPageEventWithTimeout = 1 Then
Var CountDownPauseVideo = 4
EndIf
EndIf
;Var TimeProfilePrice = TimeProfilePrice + 1
If XMLProfilePrevious = XMLProfile Then
Else
DEBUGVAR XMLProfile
DEBUGVAR XMLProfilePrevious
If NoTrickPriceProfile = 0 Then
If TimeProfilePrice = 5 Then
PRICE "Reset" "-"
PRICE "Load" "-"
PRICE "CheckAndApply" XMLProfile
DEBUGVAR ProfileIndex[0]
DEBUGVAR ProfileIndex[1]
DEBUGVAR ProfileIndex[2]
DEBUGVAR ProfileIndex[3]
DEBUGVAR ProfileIndex[4]
DEBUGVAR ProfileIndex[5]
DEBUGVAR ProfileIndex[6]
DEBUGVAR ProfileIndex[7]
DEBUGVAR ProfileIndex[8]
DEBUGVAR ProfileIndex[9]
DEBUGVAR ProfileIndex[10]
PRICE "Reload" "-"
Var XMLProfilePrevious = XMLProfile
Var refresh_str = "-RefreshProf"
STRCONTAIN refresh_str XMLProfile HasRefreshProf
If HasRefreshProf = "true" Then
RebootWithCause "RefreshProf_ProMelon"
EndIf
EndIf
EndIf
EndIf
If SleepModeXML = "ON" Then
Var BackgroundColor = "0x2C2F4E"
OpenInst 1 "/mnt/sdcard/coffeevending/taobin_project/xml/sold_cup_count.xml"
Open "ROOT/taobin_project/xml/page_sleepmode.xml"
EndIf
Refresh
TimerReset
</EventTimeout>
<EventNetDown>
SAVELOG NetworkStatus
;Open "/mnt/sdcard/coffeevending/xml/main.xml"
</EventNetDown>
<EventNetDeactive>
SAVELOG NetworkStatus
If SELLSTATUS = "DEACTIVE" Then
Open "/mnt/sdcard/coffeevending/xml/main.xml"
EndIf
</EventNetDeactive>

8
inc/video_page_board.inc Normal file
View file

@ -0,0 +1,8 @@
<Video>
<X> 0 </X>
<Y> 0 </Y>
;<Loop>"true"</Loop>
;<Volume> 80 </Volume>
<Filename> VideoMainPage </Filename>
<FilenameAlternate> "ROOT/taobin_project/video/main_page_en.mp4" </FilenameAlternate>
</Video>