MYS: add peach menus

This commit is contained in:
Pakin 2025-01-02 08:07:56 +07:00
parent 807a017135
commit 58812f1684
55 changed files with 5549 additions and 678 deletions

View file

@ -1,46 +1,46 @@
if "v2" in param:
def GenMenuProductCodeBlock(spl, str_hot_product_code, str_cold_product_code, str_blend_product_code):
#print(" size " + str( len(spl)) + " img=" + spl[ idx_img][1] )
out_xml( '\t; ==================> Len = ' + str(len(spl)) + '\r\n')
out_xml( '\t; ==================> Len = ' + str(len(spl)) + '\r\n')
menu_img = spl[ idx_img][1]
out_xml( '\t; '+ str_hot_product_code + ' ' + str_cold_product_code + ' ' + str_blend_product_code+ ' \r\n')
out_xml( '<Block>\r\n')
out_xml('\t<MarginLeft> 33 </MarginLeft>\r\n')
out_xml('\t<MarginTop> 22 </MarginTop>\r\n')
out_xml('\t<Width> 225 </Width>\r\n')
out_xml('\t<Height> 296 </Height>\r\n')
str_con = ""
str_con = ""
str_con_var = ""
#print("#########################################################################################################################")
#print( str( spl))
#print("#########################################################################################################################")
if str_hot_product_code != '-':
str_con += str_hot_product_code + '.Button,'
if str_cold_product_code != '-':
str_con += str_cold_product_code + '.Button,'
if str_blend_product_code != '-':
str_con += str_blend_product_code + '.Button,'
if str_hot_product_code != '-':
str_con_var += str_hot_product_code + '-'
if str_cold_product_code != '-':
str_con_var += str_cold_product_code + '-'
if str_blend_product_code != '-':
str_con_var += str_blend_product_code + '-'
str_con_var = str_con_var.replace("-", "")
if touch_less_gen == True:
str_con += "Disable=Invisible,"
str_con += "$Sum" + str_con_var
out_xml( '\t<State> Flag( '+ str_con + ') </State> \r\n')
pd_code_1 = str_hot_product_code
pd_stage1 = '$' + str_hot_product_code + '.Button'
if str_hot_product_code == "-" or len(str_hot_product_code) == 0 :
@ -52,16 +52,16 @@
if str_cold_product_code == "-" or len(str_cold_product_code) == 0:
pd_code_2 = pd_code_available
pd_stage2 = '"Disable2"'
pd_code_3 = str_blend_product_code
pd_stage3 = '$' + str_blend_product_code + '.Button'
if str_blend_product_code == "-" or len(str_blend_product_code) == 0:
pd_code_3 = pd_code_available
pd_stage3 = '"Disable2"'
out_xml( '\t<Button>\r\n')
out_xml( '\t<State> $Sum' + str_con_var +' </State> \r\n')
out_xml( '\t<Filename> "' + new_default_dir + '/'+ menu_img +'" </Filename>\r\n')
@ -70,20 +70,20 @@
out_xml( '\t<Sound> "/mnt/sdcard/coffeevending/wav/click.wav" </Sound>\r\n')
out_xml( '\t<Volume> SoundVolume </Volume>\r\n')
out_xml( '\t<EventOnClick> \r\n')
# Default
# Default
#out_xml( '\t\tVar NameDrink = "' + spl[ idx_of_eng_des].replace("\\n", " ") + '"\r\n')
#out_xml( '\t\tVar NameDrinkTH = "' + spl[ idx_of_eng].replace("\\n", " ") + '"\r\n')
#out_xml( '\t\tVar DrinkDescriptionTH = "' + spl[ idx_of_thai].replace("\\n", " ") + '"\r\n')
#out_xml( '\t\tVar DrinkDescription = "' + spl[ idx_of_thai_des].replace("\\n", " ") + '"\r\n')
out_xml( '\t\tVar PictureDrink = "' + new_default_dir2 + '" + \"' + menu_img + '\"\r\n')
out_xml( '\t\tVar OpenFromXML = CurrentXMLFileName2\r\n')
out_xml( '\t\tVar PriceD1 = $' + str_hot_product_code + '.Price\r\n')
out_xml( '\t\tVar PriceD2 = $' + str_cold_product_code + '.Price\r\n')
out_xml( '\t\tVar PriceD3 = $' + str_blend_product_code + '.Price\r\n')
out_xml( '\t\tVar PD_CODE1 = "' + pd_code_1 + '"\r\n')
out_xml( '\t\tVar PD_CODE2 = "' + pd_code_2 + '"\r\n')
out_xml( '\t\tVar PD_CODE3 = "' + pd_code_3 + '"\r\n')
@ -100,7 +100,7 @@
for x in range( max_can_have_lang):
out_xml( '\t\tVar DescLang[0]['+ str(x) +'] = "'+ get_desc_lang( pd_code_1 , x)+'"\r\n')
for x in range( max_can_have_lang):
out_xml( '\t\tVar NameLang[1]['+ str(x) +'] = "'+ get_name_lang( pd_code_2 , x)+'"\r\n')
for x in range( max_can_have_lang):
@ -114,7 +114,7 @@
out_xml( '\t\t; end lang \r\n')
out_xml( '\t\tVar PD_STAGE_1 = ' + pd_stage1 + '\r\n')
out_xml( '\t\tVar PD_STAGE_2 = ' + pd_stage2 + '\r\n')
out_xml( '\t\tVar PD_STAGE_3 = ' + pd_stage3 + '\r\n')
@ -122,7 +122,7 @@
out_xml( '\t\tVar SelectCountDrinkType = 0\r\n')
out_xml( '\t\tVar DefaultDrinkType = 0\r\n')
out_xml( '\t\tIf PD_STAGE_1 = "Enable" Then\r\n')
out_xml( '\t\t\tVar SelectCountDrinkType = SelectCountDrinkType + 1\r\n')
out_xml( '\t\t\tVar DefaultDrinkType = 1\r\n')
@ -171,10 +171,10 @@
#out_xml( '\t\tVar menu_desc_eng_blender = $' + pd_code_3 + '.descriptionE\r\n')
#out_xml( '\t\tVar menu_name_thai_blender = $' + pd_code_3 + '.Name\r\n')
#out_xml( '\t\tVar menu_desc_thai_blender = $' + pd_code_3 + '.description\r\n')
out_xml( '\t\t\r\n')
out_xml( '\t\tDEBUGVAR PD_STAGE_1\r\n')
out_xml( '\t\tDEBUGVAR PD_STAGE_2\r\n')
@ -185,29 +185,29 @@
# zone pro
if "fruity_raya" in current_file_name:
out_xml( '\t\tVar FromFruityRaya = 1 \r\n')
if "thai_tea" in current_file_name:
out_xml( '\t\tVar FromProThaiTea = 1 \r\n')
if "yuzu" in current_file_name and "250" not in current_file_name:
out_xml( '\t\tVar FromProYuzu = 1 \r\n')
if "yuzu_250" in current_file_name:
out_xml( '\t\tVar FromProYuzu250 = 1 \r\n')
out_xml( '\t\t\r\n')
out_xml( '\t\t\r\n')
out_xml( '\t\tOpen "ROOT/taobin_project/xml/page_topping_select6.lxml"\r\n')
out_xml( '\t\t\r\n')
out_xml( '\t</EventOnClick>\r\n')
out_xml( '\t</Button>\r\n')
out_xml( '\t<Text>\r\n')
out_xml( '\t<X> 16 </X>\r\n')
out_xml( '\t<Y> 164 </Y>\r\n')
@ -216,7 +216,7 @@
out_xml( '\t<Mode> "multi2" </Mode>\r\n')
out_xml( '\t<Font> KanitMediumTTF </Font>\r\n')
out_xml( '\t<Color> 0x322B26 </Color>\r\n')
out_xml( '\t<LanguageGroup>\r\n')
out_xml( '\t\t<LanguageSlot1>' + spl[ idx_name][ idx_lang_eng] + '</LanguageSlot1>\r\n')
out_xml( '\t\t<LanguageSlot2>' + spl[ idx_name][ idx_lang_thai] + '</LanguageSlot2>\r\n')
@ -225,7 +225,7 @@
out_xml( '\t\t<LanguageSlot5>' + spl[ idx_name][ idx_lang_malay] + '</LanguageSlot5>\r\n')
out_xml( '\t\t<LanguageSlot6>' + spl[ idx_name][ idx_lang_thai] + '</LanguageSlot6>\r\n')
out_xml( '\t</LanguageGroup>\r\n')
out_xml( '\t</Text>\r\n')
out_xml( '\t<Text>\r\n')
@ -272,21 +272,21 @@
out_xml( '\t<Filename> Var( DirImage2 + "hot.png" ) </Filename>\r\n')
out_xml( '\t<FilenameDisable> Var( DirImage2 + "hot_db.png" ) </FilenameDisable>\r\n')
out_xml( '\t</Image>\r\n')
out_xml( '\t<Text>\r\n')
out_xml( '\t<X> TextPriceMenuHotX </X>\r\n')
out_xml( '\t<Y> TextPriceMenuY </Y>\r\n')
out_xml( '\t<Size> TextPriceMenuSize </Size>\r\n')
out_xml( '\t<Width>220</Width>\r\n')
out_xml( '\t<Font> KanitMediumTTF </Font>\r\n')
out_xml( '\t<Color> 0x6F5F51 </Color>\r\n')
out_xml( '\t<ColorDisable> 0xEAE6E1 </ColorDisable>\r\n')
out_xml( '\t<State> ' + shw + ' </State>\r\n')
#out_xml( '\t<Value> Var( "฿" + $' + spl[ idx_hot_product_code] + '.Price ) </Value>\r\n')
if "inter" in param:
if "free" in param:
out_xml( '\t<Value> "Free" </Value>\r\n')
@ -295,7 +295,7 @@
else:
out_xml( '\t<Value> Var( "฿" + $' + str_hot_product_code + '.Price ) </Value>\r\n')
out_xml( '\t</Text>\r\n')
ice_tab_ice_show = True
shw = "$" + str_cold_product_code + ".Button"
@ -324,7 +324,7 @@
out_xml( '\t<Size> TextPriceMenuSize </Size>\r\n')
out_xml( '\t<Width>220</Width>\r\n')
out_xml( '\t<Font> KanitMediumTTF </Font>\r\n')
out_xml( '\t<Color> 0x6F5F51 </Color>\r\n')
out_xml( '\t<ColorDisable> 0xEAE6E1 </ColorDisable>\r\n')
out_xml( '\t<State> ' + shw + ' </State>\r\n')
@ -336,7 +336,7 @@
else:
out_xml( '\t<Value> Var( "฿" + $' + str_cold_product_code + '.Price ) </Value>\r\n')
out_xml( '\t</Text>\r\n')
ice_tab_blend_show = True
shw = "$" + str_blend_product_code + ".Button"
@ -363,7 +363,7 @@
out_xml( '\t<Width>220</Width>\r\n')
out_xml( '\t<Font> KanitRegularTTF </Font>\r\n')
#out_xml( '\t<Align> end </Align>\r\n')
out_xml( '\t<Color> 0x6F5F51 </Color>\r\n')
out_xml( '\t<ColorDisable> 0xEAE6E1 </ColorDisable>\r\n')
out_xml( '\t<State> ' + shw + ' </State>\r\n')
@ -375,7 +375,7 @@
else:
out_xml( '\t<Value> Var( "฿" + $' + str_blend_product_code + '.Price ) </Value>\r\n')
out_xml( '\t</Text>\r\n')
out_xml( '\t<Image>\r\n')
out_xml( '\t<X> 81 </X>\r\n')
out_xml( '\t<Y> 264 </Y>\r\n')
@ -393,7 +393,7 @@
out_xml( '\t\t\tEndIf\r\n')
else:
out_xml( '\t\t\tVar ice_tab_process_show = "Invisible"\r\n')
out_xml( '\t\t\r\n')
out_xml( '\t\tElse\r\n')
out_xml( '\t\t\tVar ice_tab_process_show = "Invisible"\r\n')
@ -405,7 +405,7 @@
out_xml( '\t<FilenameDisable> "ROOT/taobin_project/image/drink_option/ice_tab_unavalible_dis.png" </FilenameDisable>\r\n')
out_xml( '\t</Image>\r\n')
out_xml( '\t<Image>\r\n')
out_xml( '\t<X> 49 </X>\r\n')
out_xml( '\t<Y> 117 </Y>\r\n')
@ -437,7 +437,7 @@
out_xml( '\t</State>\r\n')
out_xml( '\t<Filename> "ROOT/taobin_project/image//img_menu_err2.png" </Filename>\r\n')
out_xml( '\t</Image>\r\n')
out_xml( '\t<Text>\r\n')
out_xml( '\t<X> 84 </X>\r\n')
out_xml( '\t<Y> 266 </Y>\r\n')
@ -465,10 +465,10 @@
out_xml( '</Block>\r\n')
def GenMenuBlock(spl, idx_hot_product_code, idx_cold_product_code, idx_blend_product_code):
GenMenuProductCodeBlock( spl[ idx_name][ idx_hot_product_code], spl[ idx_name][ idx_cold_product_code] , spl[ idx_name][ idx_blend_product_code] )
idx_lang_malay = 5
idx_lang_japan = 4
@ -485,8 +485,8 @@
idx_hot_product_code = 7
idx_cold_product_code = idx_hot_product_code + 1
idx_blend_product_code = idx_cold_product_code + 1
#
#
idx_hot_product_code2 = idx_blend_product_code + 1
idx_cold_product_code2 = idx_hot_product_code2 + 1
idx_blend_product_code2 = idx_cold_product_code2 + 1
@ -495,20 +495,20 @@
idx_of_thai = 0
idx_of_thai_des = 1
print ("--------------------------------------------------------------------------------------------------------------------------")
if current_file_name == "page_catalog_group_recommend.skt":
touch_less_gen = True
else:
touch_less_gen = False
if current_file_name == "page_catalog_group_recommend_multi_pro.skt":
multi_pro_gen = True
else:
multi_pro_gen = False
print("Found multi pro skt: ", multi_pro_gen )
out_xml('<FrameScroll> \r\n')
if touch_less_gen == True:
out_xml('<Max> 16 </Max>\r\n')
@ -523,19 +523,19 @@
out_xml('<Column> 2 </Column>\r\n')
else:
out_xml('<Column> 4 </Column>\r\n')
out_xml('<Script>\r\n')
out_xml('<Script>\r\n')
print("current_file_name " + current_file_name)
if touch_less_gen == False or multi_pro_gen:
out_xml('\t Var block_index_override = 0\r\n')
out_xml('\t Var block_index_move = 0\r\n')
else:
out_xml('\t Var block_index_override = 4\r\n')
out_xml('\t Var block_index_move = 1\r\n')
out_xml('\t Var block_index_override = 0\r\n')
out_xml('\t Var block_index_move = 0\r\n')
#out_xml('\t Var block_index_override = 4\r\n')
#out_xml('\t Var block_index_move = 1\r\n')
#out_xml('\tIf Seeker = "curr" Then\r\n')
@ -549,10 +549,10 @@
#out_xml('\t\tVar TouchLessStg = "Disable"\r\n')
#out_xml('\t\tVar TouchLessQrStg = "Invisible"\r\n')
#out_xml('\tEndIf\r\n')
out_xml('</Script>\r\n')
pd_code_available = '##-##-##-####'
count = 0
count_test = 0
@ -577,12 +577,12 @@
# out_xml('\t<Color> "0xeae6e1" </Color>\r\n')
# out_xml('\t<QRColor> "0x513C2F" </Color>\r\n')
# out_xml('\t<Height> 150 </Height>\r\n')
#
#
# #out_xml('\t<State> TouchLessQrStg </State>\r\n')
# #out_xml('\t<Service> "Herr" </Service>\r\n')
# out_xml('\t<State> TouchLessQrStg </State>\r\n')
# out_xml('\t<Service> testservice </Service>\r\n')
#
#
# out_xml('\t</QRCode>\r\n')
# out_xml('</Block>\r\n')
out_xml(';dummy_layout.inc\r\n')
@ -595,11 +595,11 @@
# continue
if len(spl) == 1:
if spl[0].startswith("TAG"):
out_xml( '\t;' + spl[0] + '\r\n')
out_xml( '\t;' + spl[0] + '\r\n')
print("Have TAGESP")
continue
print( '\t; '+ spl[ idx_name][ idx_hot_product_code] + ' ' + spl[ idx_name][ idx_cold_product_code] + ' ' + spl[ idx_name][ idx_blend_product_code] + ' \r\n')
if "," in spl[ idx_name][ idx_hot_product_code] and "," in spl[ idx_name][ idx_cold_product_code] and "," in spl[ idx_name][ idx_blend_product_code]:
#print(" hot = " + spl[ idx_name][ idx_hot_product_code])
hot_pd = spl[ idx_name][ idx_hot_product_code].split(',')
@ -625,7 +625,7 @@
if len( spl[idx_name] ) >= 11:
if spl[ idx_name][ idx_hot_product_code2] != "-" or spl[ idx_name][ idx_cold_product_code2] != "-" or spl[ idx_name][ idx_blend_product_code2] != "-":
GenMenuBlock(spl, idx_hot_product_code2, idx_cold_product_code2, idx_blend_product_code2)
if multi_pro_gen:
print("multi_pro_gen")
@ -676,6 +676,3 @@
out_xml('</EventClick>\r\n')
out_xml('</Button>\r\n')
# if "v2" in param: