574 lines
25 KiB
Python
574 lines
25 KiB
Python
if "v2" in param:
|
|
def GenMenuProductCodeBlock( 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')
|
|
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_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 recommend_page == 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 :
|
|
pd_code_1 = pd_code_available
|
|
pd_stage1 = '"Disable2"'
|
|
|
|
pd_code_2 = str_cold_product_code
|
|
pd_stage2 = '$' + str_cold_product_code + '.Button'
|
|
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')
|
|
out_xml( '\t<FilenamePress> "' + new_default_dir_press + '/'+ menu_img +'" </FilenamePress>\r\n')
|
|
out_xml( '\t<FilenameDisable> "' + new_default_dir_disable + '/'+ menu_img +'" </FilenameDisable>\r\n')
|
|
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
|
|
#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')
|
|
|
|
out_xml( '\t\t; begin lang \r\n')
|
|
for x in range( max_can_have_lang):
|
|
if x < len( spl[ idx_name]):
|
|
out_xml( '\t\tVar aliasName['+ str(x) +'] = "'+ spl[ idx_name][ x + 1]+'"\r\n')
|
|
out_xml( '\t\tVar aliasDesc['+ str(x) +'] = "'+ spl[ idx_desc][ x + 1]+'"\r\n')
|
|
|
|
|
|
for x in range( max_can_have_lang):
|
|
out_xml( '\t\tVar NameLang[0]['+ str(x) +'] = "'+ get_name_lang( pd_code_1 , x)+'"\r\n')
|
|
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):
|
|
out_xml( '\t\tVar DescLang[1]['+ str(x) +'] = "'+ get_desc_lang( pd_code_2 , x)+'"\r\n')
|
|
|
|
for x in range( max_can_have_lang):
|
|
out_xml( '\t\tVar NameLang[2]['+ str(x) +'] = "'+ get_name_lang( pd_code_3 , x)+'"\r\n')
|
|
for x in range( max_can_have_lang):
|
|
out_xml( '\t\tVar DescLang[2]['+ str(x) +'] = "'+ get_desc_lang( pd_code_3 , x)+'"\r\n')
|
|
|
|
|
|
|
|
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')
|
|
|
|
|
|
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')
|
|
out_xml( '\t\tEndIf\r\n')
|
|
|
|
|
|
out_xml( '\t\tIf PD_STAGE_2 = "Enable" Then\r\n')
|
|
out_xml( '\t\t\tVar SelectCountDrinkType = SelectCountDrinkType + 1\r\n')
|
|
out_xml( '\t\t\tVar DefaultDrinkType = 2\r\n')
|
|
out_xml( '\t\tEndIf\r\n')
|
|
|
|
|
|
out_xml( '\t\tIf PD_STAGE_3 = "Enable" Then\r\n')
|
|
out_xml( '\t\t\tVar SelectCountDrinkType = SelectCountDrinkType + 1\r\n')
|
|
out_xml( '\t\t\tVar DefaultDrinkType = 3\r\n')
|
|
out_xml( '\t\tEndIf\r\n')
|
|
|
|
|
|
|
|
out_xml( '\t\tIf PD_STAGE_2 = "Enable" Then\r\n')
|
|
#out_xml( '\t\t\tVar PD_STAGE_2 = "Enable"\r\n')
|
|
out_xml( '\t\t\tTopping "Load" "'+ str_cold_product_code +'"\r\n')
|
|
out_xml( '\t\tElse\r\n')
|
|
out_xml( '\t\t\tIf PD_STAGE_1 = "Enable" Then\r\n')
|
|
#out_xml( '\t\t\t\tVar PD_STAGE_1 = "Enable"\r\n')
|
|
out_xml( '\t\t\tTopping "Load" "'+ str_hot_product_code +'"\r\n')
|
|
out_xml( '\t\t\tElse\r\n')
|
|
#out_xml( '\t\t\t\tVar PD_STAGE_3 = "Enable"\r\n')
|
|
out_xml( '\t\t\tTopping "Load" "'+ str_blend_product_code +'"\r\n')
|
|
out_xml( '\t\t\tEndIf\r\n')
|
|
out_xml( '\t\tEndIf\r\n')
|
|
|
|
|
|
|
|
#out_xml( '\t\tVar menu_name_eng_hot = $' + pd_code_1 + '.NameE\r\n')
|
|
#out_xml( '\t\tVar menu_desc_eng_hot = $' + pd_code_1 + '.descriptionE\r\n')
|
|
#out_xml( '\t\tVar menu_name_thai_hot = $' + pd_code_1 + '.Name\r\n')
|
|
#out_xml( '\t\tVar menu_desc_thai_hot = $' + pd_code_1 + '.description\r\n')
|
|
#out_xml( '\t\t\r\n')
|
|
#out_xml( '\t\tVar menu_name_eng_cold = $' + pd_code_2 + '.NameE\r\n')
|
|
#out_xml( '\t\tVar menu_desc_eng_cold = $' + pd_code_2 + '.descriptionE\r\n')
|
|
#out_xml( '\t\tVar menu_name_thai_cold = $' + pd_code_2 + '.Name\r\n')
|
|
#out_xml( '\t\tVar menu_desc_thai_cold = $' + pd_code_2 + '.description\r\n')
|
|
#out_xml( '\t\t\r\n')
|
|
#out_xml( '\t\tVar menu_name_eng_blender = $' + pd_code_3 + '.NameE\r\n')
|
|
#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')
|
|
out_xml( '\t\tDEBUGVAR PD_STAGE_3\r\n')
|
|
out_xml( '\t\tVar SelectDrinkType = 0\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')
|
|
out_xml( '\t<Size> 22 </Size>\r\n')
|
|
out_xml( '\t<Width>222</Width>\r\n')
|
|
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')
|
|
out_xml( '\t\t<LanguageSlot3>' + spl[ idx_name][ idx_lang_eng] + '</LanguageSlot3>\r\n')
|
|
out_xml( '\t\t<LanguageSlot4>' + spl[ idx_name][ idx_lang_thai] + '</LanguageSlot4>\r\n')
|
|
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')
|
|
out_xml( '\t<X> 16 </X>\r\n')
|
|
out_xml( '\t<Y> 220 </Y>\r\n')
|
|
out_xml( '\t<Size> 14 </Size>\r\n')
|
|
out_xml( '\t<Width>222</Width>\r\n')
|
|
out_xml( '\t<Font> KanitMediumTTF </Font>\r\n')
|
|
out_xml( '\t<Color> 0x6F5F51 </Color>\r\n')
|
|
#out_xml( '\t<State> showthaiText </State>\r\n')
|
|
out_xml( '\t<LanguageGroup>\r\n')
|
|
out_xml( '\t\t<LanguageSlot1>' + spl[ idx_desc][ idx_lang_eng] + '</LanguageSlot1>\r\n')
|
|
out_xml( '\t\t<LanguageSlot2>' + spl[ idx_desc][ idx_lang_thai] + '</LanguageSlot2>\r\n')
|
|
out_xml( '\t\t<LanguageSlot3>' + spl[ idx_desc][ idx_lang_eng] + '</LanguageSlot3>\r\n')
|
|
out_xml( '\t\t<LanguageSlot4>' + spl[ idx_desc][ idx_lang_thai] + '</LanguageSlot4>\r\n')
|
|
out_xml( '\t\t<LanguageSlot5>' + spl[ idx_desc][ idx_lang_malay] + '</LanguageSlot5>\r\n')
|
|
out_xml( '\t\t<LanguageSlot6>' + spl[ idx_desc][ idx_lang_thai] + '</LanguageSlot6>\r\n')
|
|
out_xml( '\t</LanguageGroup>\r\n')
|
|
|
|
out_xml( '\t</Text>\r\n')
|
|
|
|
|
|
|
|
out_xml( '\t<Image>\r\n')
|
|
out_xml( '\t<X> 16 </X>\r\n')
|
|
out_xml( '\t<Y> 264 </Y>\r\n')
|
|
out_xml( '\t<Filename> Var( DirImage2 + "option_deactive.png" ) </Filename>\r\n')
|
|
out_xml( '\t</Image>\r\n')
|
|
|
|
ice_tab_hot_show = True
|
|
shw = "$" + str_hot_product_code + ".Button"
|
|
if str_hot_product_code == "-" :
|
|
shw = '"Invisible"'
|
|
ice_tab_hot_show = False
|
|
|
|
if len(str_hot_product_code) == 0 :
|
|
shw = '"Invisible"'
|
|
ice_tab_hot_show = False
|
|
|
|
out_xml( '\t<Image>\r\n')
|
|
out_xml( '\t<X> 16 </X>\r\n')
|
|
out_xml( '\t<Y> 264 </Y>\r\n')
|
|
out_xml( '\t<State> ' + shw + ' </State>\r\n')
|
|
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')
|
|
else:
|
|
out_xml( '\t<Value> StringFmt( $' + str_hot_product_code + '.Price , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
|
|
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"
|
|
if str_cold_product_code == "-" :
|
|
shw = '"Invisible"'
|
|
ice_tab_ice_show = False
|
|
|
|
if len(str_cold_product_code) == 0 :
|
|
shw = '"Invisible"'
|
|
ice_tab_ice_show = False
|
|
|
|
out_xml( '\t<Image>\r\n')
|
|
out_xml( '\t<X> 81 </X>\r\n')
|
|
out_xml( '\t<Y> 264 </Y>\r\n')
|
|
if pd_code_2 == "51-05-02-0016":
|
|
out_xml( '\t<Filename> Var( DirImage2 + "normal.png" ) </Filename>\r\n')
|
|
out_xml( '\t<FilenameDisable> Var( DirImage2 + "cold_db.png" ) </FilenameDisable>\r\n')
|
|
else:
|
|
out_xml( '\t<Filename> Var( DirImage2 + "cold.png" ) </Filename>\r\n')
|
|
out_xml( '\t<FilenameDisable> Var( DirImage2 + "cold_db.png" ) </FilenameDisable>\r\n')
|
|
out_xml( '\t<State> ' + shw + ' </State>\r\n')
|
|
out_xml( '\t</Image>\r\n')
|
|
out_xml( '\t<Text>\r\n')
|
|
out_xml( '\t<X> 113 </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')
|
|
if "inter" in param:
|
|
if "free" in param:
|
|
out_xml( '\t<Value> "Free" </Value>\r\n')
|
|
else:
|
|
out_xml( '\t<Value> StringFmt( $' + str_cold_product_code + '.Price , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
|
|
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"
|
|
if str_blend_product_code == "-" :
|
|
shw = '"Invisible"'
|
|
ice_tab_blend_show = False
|
|
|
|
if len(str_blend_product_code) == 0 :
|
|
shw = '"Invisible"'
|
|
ice_tab_blend_show = False
|
|
|
|
out_xml( '\t<Image>\r\n')
|
|
out_xml( '\t<X> 146 </X>\r\n')
|
|
out_xml( '\t<Y> 264 </Y>\r\n')
|
|
out_xml( '\t<Filename> Var( DirImage2 + "blend.png" ) </Filename>\r\n')
|
|
out_xml( '\t<FilenameDisable> Var( DirImage2 + "blend_db.png" ) </FilenameDisable>\r\n')
|
|
out_xml( '\t<State> ' + shw + ' </State>\r\n')
|
|
out_xml( '\t</Image>\r\n')
|
|
|
|
out_xml( '\t<Text>\r\n')
|
|
out_xml( '\t<X> TextPriceMenuBlendX </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> 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')
|
|
if "inter" in param:
|
|
if "free" in param:
|
|
out_xml( '\t<Value> " Free" </Value>\r\n')
|
|
else:
|
|
out_xml( '\t<Value> StringFmt( $' + str_blend_product_code + '.Price , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
|
|
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')
|
|
out_xml( '\t<State> \r\n')
|
|
out_xml( '\t\teval( \r\n')
|
|
out_xml( '\t\tIf ICE_PROCESS_STATUS = 2 Then\r\n')
|
|
out_xml( '\t\t\r\n')
|
|
if ice_tab_hot_show == True:
|
|
|
|
#out_xml( '\t\t\tDEBUGVAR $Sum' + str_con_var +'\r\n')
|
|
out_xml( '\t\t\tIf $Sum' + str_con_var +' = "Disable" Then\r\n')
|
|
out_xml( '\t\t\t\tVar ice_tab_process_show = "Disable"\r\n')
|
|
out_xml( '\t\t\tElse\r\n')
|
|
out_xml( '\t\t\t\tVar ice_tab_process_show = "Enable"\r\n')
|
|
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')
|
|
out_xml( '\t\tEndIf\r\n')
|
|
out_xml( '\t\tVar return = ice_tab_process_show\r\n')
|
|
out_xml( '\t\t)\r\n')
|
|
out_xml( '\t</State>\r\n')
|
|
out_xml( '\t<Filename> "ROOT/taobin_project/image/drink_option/ice_tab_unavalible.png" </Filename>\r\n')
|
|
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')
|
|
out_xml( '\t<State> \r\n')
|
|
out_xml( '\t\teval( \r\n')
|
|
out_xml( '\t\t\tIf $Sum' + str_con_var +' = "Disable" Then\r\n')
|
|
out_xml( '\t\t\t\tSTRCONTAIN "ERR" $' + pd_code_1 + '.TAG tag1_is_disable\r\n')
|
|
out_xml( '\t\t\t\tSTRCONTAIN "ERR" $' + pd_code_2 + '.TAG tag2_is_disable\r\n')
|
|
out_xml( '\t\t\t\tSTRCONTAIN "ERR" $' + pd_code_3 + '.TAG tag3_is_disable\r\n')
|
|
#out_xml( '\t\t\t\tDEBUGVAR $' + pd_code_1 + '.TAG\r\n')
|
|
#out_xml( '\t\t\t\tDEBUGVAR $' + pd_code_2 + '.TAG\r\n')
|
|
#out_xml( '\t\t\t\tDEBUGVAR $' + pd_code_3 + '.TAG\r\n')
|
|
out_xml( '\t\t\t\tVar return = "Invisible"\r\n')
|
|
out_xml( '\t\t\t\tIf tag1_is_disable = "true" Then\r\n')
|
|
out_xml( '\t\t\t\t\tVar return = "Enable"\r\n')
|
|
out_xml( '\t\t\t\tEndIf\r\n')
|
|
out_xml( '\t\t\t\tIf tag2_is_disable = "true" Then\r\n')
|
|
out_xml( '\t\t\t\t\tVar return = "Enable"\r\n')
|
|
out_xml( '\t\t\t\tEndIf\r\n')
|
|
out_xml( '\t\t\t\tIf tag3_is_disable = "true" Then\r\n')
|
|
out_xml( '\t\t\t\t\tVar return = "Enable"\r\n')
|
|
out_xml( '\t\t\t\tEndIf\r\n')
|
|
out_xml( '\t\t\tElse\r\n')
|
|
out_xml( '\t\t\t\t\tVar return = "Invisible"\r\n')
|
|
|
|
out_xml( '\t\t\tEndIf\r\n')
|
|
|
|
out_xml( '\t\t)\r\n')
|
|
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')
|
|
out_xml( '\t<Size> 10 </Size>\r\n')
|
|
out_xml( '\t<Font> OpunMediumTTF </Font>\r\n')
|
|
out_xml( '\t<Color> 0xDE794E </Color>\r\n')
|
|
out_xml( '\t<State> ice_tab_process_show </State>\r\n')
|
|
out_xml( '\t<Value> ice_show_open </Value>\r\n')
|
|
out_xml( '\t</Text>\r\n')
|
|
|
|
|
|
out_xml( '\t<Text>\r\n')
|
|
out_xml( '\t<X> 48 </X>\r\n')
|
|
out_xml( '\t<Y> 116 </Y>\r\n')
|
|
out_xml( '\t<Size> 32 </Size>\r\n')
|
|
out_xml( '\t<Width>128</Width>\r\n')
|
|
out_xml( '\t<Height>64</Height>\r\n')
|
|
out_xml( '\t<Mode> "disable-show" </Mode>\r\n')
|
|
out_xml( '\t<State> $Sum' + str_con_var +' </State> \r\n')
|
|
out_xml( '\t<Language>\r\n')
|
|
out_xml( '\t\t<ID> 000013 </ID> \r\n')
|
|
out_xml( '\t</Language>\r\n')
|
|
out_xml( '\t<Align> center-vertical-horizontal </Align>\r\n')
|
|
out_xml( '\t</Text>\r\n')
|
|
|
|
|
|
out_xml( '</Block>\r\n')
|
|
|
|
def GenMenuBlock( 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
|
|
idx_lang_china = 3
|
|
idx_lang_thai = 2
|
|
idx_lang_eng = 1
|
|
|
|
|
|
idx_name = 0
|
|
idx_desc = 1
|
|
idx_img = 2
|
|
|
|
|
|
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
|
|
idx_of_eng = 2
|
|
idx_of_eng_des = 3
|
|
idx_of_thai = 0
|
|
idx_of_thai_des = 1
|
|
print ("--------------------------------------------------------------------------------------------------------------------------")
|
|
|
|
|
|
if current_file_name == "page_catalog_group_recommend.skt":
|
|
recommend_page = True
|
|
else:
|
|
recommend_page = False
|
|
|
|
out_xml('<FrameScroll> \r\n')
|
|
if recommend_page == True:
|
|
out_xml('<Max> 16 </Max>\r\n')
|
|
out_xml('<X> 10 </X>\r\n')
|
|
out_xml('<Y> 497 </Y>\r\n')
|
|
out_xml('<Width> 1080 </Width>\r\n')
|
|
out_xml('<ScrollHeight> "auto" </ScrollHeight>\r\n')
|
|
out_xml('<Scroll> "Vertical" </Scroll>\r\n')
|
|
out_xml('<Column> 4 </Column>\r\n')
|
|
if recommend_page == True:
|
|
out_xml(';layout_mode\r\n')
|
|
out_xml('<Script>\r\n')
|
|
|
|
|
|
out_xml('\t\tVar block_index_override = 0\r\n')
|
|
out_xml('\t\tVar block_index_move = 0\r\n')
|
|
if recommend_page:
|
|
out_xml('\t\t;banner_shifting\r\n')
|
|
|
|
|
|
out_xml('</Script>\r\n')
|
|
|
|
pd_code_available = '##-##-##-####'
|
|
count = 0
|
|
count_test = 0
|
|
out_xml(';dummy_layout.inc\r\n')
|
|
#
|
|
#out_xml('; menu_new_list '+ str(len(menu_new_list))+'\r\n')
|
|
for spl in menu_new_list:
|
|
#product_code = s
|
|
#if spl[ idx_of_eng] == "IGNORE":
|
|
# continue
|
|
if len(spl) == 1:
|
|
if spl[0].startswith("TAG"):
|
|
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(',')
|
|
cold_pd = spl[ idx_name][ idx_cold_product_code].split(',')
|
|
blend_pd = spl[ idx_name][ idx_blend_product_code].split(',')
|
|
|
|
#print(' size = ' + str( len( hot_pd)) + ' size = ' + str( len( cold_pd)) + ' size = ' + str( len( blend_pd)) + '\r\n')
|
|
list_size = len( hot_pd)
|
|
for idx in range( list_size):
|
|
print(' hot = ' + hot_pd[ idx] + ' cold = ' + cold_pd[ idx]+ ' blend_pd = ' + blend_pd[ idx] + '\r\n')
|
|
if hot_pd[ idx] == '-' and cold_pd[ idx] == '-' and blend_pd[ idx] == '-':
|
|
print("\t\t==> ignore ")
|
|
else:
|
|
print("\t\t==> gen ")
|
|
GenMenuProductCodeBlock( hot_pd[ idx], cold_pd[ idx], blend_pd[ idx] )
|
|
else:
|
|
GenMenuBlock( idx_hot_product_code, idx_cold_product_code, idx_blend_product_code)
|
|
#out_xml( '\t; parallel '+ spl[ idx_name][ idx_hot_product_code2] + ' ' + spl[ idx_name][ idx_cold_product_code2] + ' ' + spl[ idx_name][ idx_blend_product_code2] + ' \r\n')
|
|
#print("++++++++++++++++++++++++++++++ " + str( count_test) )
|
|
#count_test = count_test + 1
|
|
#if count_test > 5 :
|
|
# break
|
|
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( idx_hot_product_code2, idx_cold_product_code2, idx_blend_product_code2)
|
|
|
|
out_xml('</FrameScroll>\r\n')
|
|
|
|
|
|
out_xml('; Cart\r\n')
|
|
out_xml('<Button>\r\n')
|
|
out_xml('<X> 915 </X>\r\n')
|
|
out_xml('<Y> 1769 </Y>\r\n')
|
|
out_xml('<State> showCart </State>\r\n')
|
|
out_xml('<Filename> cart_image_bn </Filename>\r\n')
|
|
out_xml('<FilenamePress> cart_image_bp </FilenamePress>\r\n')
|
|
out_xml('<Sound> "/mnt/sdcard/coffeevending/wav/click.wav" </Sound>\r\n')
|
|
out_xml('<Volume> SoundVolume </Volume>\r\n')
|
|
out_xml('<EventClick> \r\n')
|
|
out_xml('\tOpen "ROOT/taobin_project/xml/page_payment_multi.xml"\r\n')
|
|
out_xml('</EventClick>\r\n')
|
|
out_xml('</Button>\r\n')
|
|
# if "v2" in param:
|
|
|
|
|