taobin_project/xml/menu_new_layout_gen.py
wanlop run 5f0eb840c3 do
2025-03-27 13:37:17 +07:00

1750 lines
75 KiB
Python

def GetPrice_Old(price_list, product_code_1, product_code_2, product_code_3):
if product_code_1 in price_list:
return price_list[product_code_1]
elif product_code_2 in price_list:
return price_list[product_code_2]
elif product_code_3 in price_list:
return price_list[product_code_3]
else:
return '"-"'
def GetPrice(price_list, product_code):
if product_code in price_list:
return price_list[product_code]
else:
return '"-"'
def GetOriginalPrice_Old(original_price_list, product_code_1, product_code_2, product_code_3):
if product_code_1 in original_price_list:
return original_price_list[product_code_1]
elif product_code_2 in original_price_list:
return original_price_list[product_code_2]
elif product_code_3 in original_price_list:
return original_price_list[product_code_3]
else:
return '"-"'
def GetOriginalPrice(original_price_list, product_code):
if product_code in original_price_list:
return original_price_list[product_code]
else:
return '"-"'
def GetTricker(tricker_list, product_code_1, product_code_2, product_code_3):
if product_code_1 in tricker_list:
return tricker_list[product_code_1]
elif product_code_2 in tricker_list:
return tricker_list[product_code_2]
elif product_code_3 in tricker_list:
return tricker_list[product_code_3]
else:
return ""
button_add_string = ""
print(" current_file_name " + current_file_name + " ")
if "v2" in param:
print("Version 1 ignore ")
else:
menu_white_color_catalog = False
menu_xml_var = ""
if current_file_name == "page_catalog_group_recommend.skt":
recommend_page = True
button_add_string = "Var OpenFromInstMenuTab = 0"
else:
recommend_page = False
button_add_string = ""
if current_file_name == "page_catalog_group_recommend_multi_pro.skt":
multi_pro_gen = True
else:
multi_pro_gen = False
if current_file_name == "page_catalog_group_pro_15THB.skt":
fixed_price = 15
else:
fixed_price = 0
if current_file_name == "page_catalog_group_pro_rerun.skt":
rerun_prices = {
"12-02-02-0043": 15,
"12-99-05-0057": 15,
"12-99-05-0059": 15,
"12-02-02-0044": 20,
"12-99-03-0046": 20,
"12-99-02-0050": 20,
"12-99-02-0011": 25,
"12-99-02-0015": 25,
"12-99-02-0003": 30,
"12-99-02-0001": 30,
"12-03-02-0036": 30,
"12-03-03-0035": 35,
"12-99-03-0066": 30
}
rerun_original_prices = {
"12-02-02-0043": 35,
"12-99-05-0057": 20,
"12-99-05-0059": 20,
"12-02-02-0044": 25,
"12-99-03-0046": 25,
"12-99-02-0050": 25,
"12-99-02-0011": 30,
"12-99-02-0015": 30,
"12-99-02-0003": 35,
"12-99-02-0001": 35,
"12-03-02-0036": 40,
"12-03-03-0035": 45,
"12-99-03-0066": 60
}
rerun_trickers = {
"12-02-02-0043": "PMD20",
"12-99-05-0057": "PMD05",
"12-99-05-0059": "PMD05",
"12-02-02-0044": "PMD05",
"12-99-03-0046": "PMD05",
"12-99-02-0011": "PMD05",
"12-99-02-0015": "PMD05",
"12-99-02-0003": "PMD05",
"12-99-02-0001": "PMD05",
"12-03-02-0036": "PMD10",
"12-03-03-0035": "PMD10",
"12-99-03-0066": "PMD30"
}
rerun_fix_price = True
else:
rerun_prices = {}
rerun_original_prices = {}
rerun_trickers = {}
rerun_fix_price = False
if current_file_name == "page_catalog_group_pro_mymint.skt":
from_my_mint_promotion = True
menu_white_color_catalog = True
else:
from_my_mint_promotion = False
if current_file_name == "page_catalog_group_pro_bad_valentine.skt":
from_bad_valentine = True
# menu_white_color_catalog = True
else:
from_bad_valentine = False
if current_file_name == "page_catalog_group_pro_pepsi_second_cup_30.skt":
from_pepsi_second_cup_30 = True
else:
from_pepsi_second_cup_30 = False
if current_file_name == "page_catalog_group_pro_lipit.skt":
from_lipit_pro = True
else:
from_lipit_pro = False
if current_file_name == "page_catalog_group_pro_monday_banana.skt":
monday_banana_prices = {
"12-03-02-0024": 30,
"12-03-03-0024": 35,
"12-03-03-0029": 40,
"12-03-02-0023": 25,
"12-03-03-0023": 30
}
monday_banana_original_prices = {
"12-03-02-0024": 40,
"12-03-03-0024": 45,
"12-03-03-0029": 50,
"12-03-02-0023": 35,
"12-03-03-0023": 40
}
monday_banana_fix_price = True
else:
monday_banana_prices = {}
monday_banana_original_prices = {}
monday_banana_fix_price = False
if current_file_name == "page_catalog_group_pro_tea_time.skt":
from_tea_time_pro = True
else:
from_tea_time_pro = False
if current_file_name == "page_catalog_group_pro_wednesday_melon.skt":
wednesday_melon_prices = {
"12-03-01-0022": 25,
"12-03-02-0022": 30,
"12-03-03-0022": 35,
"12-01-01-0039": 30,
"12-01-02-0039": 35,
"12-21-01-0039": 30,
"12-21-02-0039": 35,
"12-03-03-0028": 40,
"12-05-02-0044": 20,
"12-05-02-0047": 15,
"12-05-03-0047": 20,
"12-05-02-0105": 15,
"12-05-03-0105": 20,
"12-99-02-0011": 20,
"12-99-02-0013": 30,
"12-99-02-0014": 20,
"12-99-02-0015": 15,
"12-99-02-0016": 20,
"12-99-02-0018": 25,
"12-99-03-0016": 35
}
wednesday_melon_original_prices = {
"12-03-01-0022": 35,
"12-03-02-0022": 40,
"12-03-03-0022": 45,
"12-01-01-0039": 40,
"12-01-02-0039": 45,
"12-21-01-0039": 40,
"12-21-02-0039": 45,
"12-03-03-0028": 50,
"12-05-02-0044": 30,
"12-05-02-0047": 25,
"12-05-03-0047": 30,
"12-05-02-0105": 25,
"12-05-03-0105": 30,
"12-99-02-0011": 30,
"12-99-02-0013": 40,
"12-99-02-0014": 30,
"12-99-02-0015": 25,
"12-99-02-0016": 30,
"12-99-02-0018": 35,
"12-99-03-0016": 45
}
wednesday_melon_fix_price = True
else:
wednesday_melon_prices = {}
wednesday_melon_original_prices = {}
wednesday_melon_fix_price = False
if current_file_name == "page_catalog_group_pro_nam_hom_coconut.skt":
from_nam_hom_coconut = True
else:
from_nam_hom_coconut = False
if current_file_name == "page_catalog_group_pro_cocoa_77.skt":
from_cocoa77 = True
cocoa77_fix_price = True
else:
from_cocoa77 = False
cocoa77_fix_price = False
if current_file_name == "page_catalog_group_pro_passion_mint.skt":
passion_mint = True
passion_mint_fix_price = {
"12-01-02-0057": 29,
"12-21-02-0057": 29,
"12-01-02-0058": 19,
"12-21-02-0058": 19,
"12-02-03-0050": 39,
"12-01-02-0064": 29,
"12-21-02-0064": 29,
"12-03-02-0035": 29,
"12-03-03-0034": 39,
"12-03-03-0037": 29,
"12-05-02-0063": 19,
"12-05-02-0064": 19,
"12-05-02-0067": 19
}
else:
passion_mint = False
passion_mint_fix_price = {}
if current_file_name == "page_catalog_group_pro_7up_lucky_draw_x2.skt":
menu_white_color_catalog = True
if current_file_name == "page_catalog_group_pro_robinson_beauty.skt":
from_robinson_beauty = True
else:
from_robinson_beauty = False
if current_file_name == "page_catalog_group_pro_jemila.skt":
from_jemila = True
else:
from_jemila = False
if current_file_name == "page_catalog_group_pro_halloween.skt":
from_halloween = True
menu_white_color_catalog = True
else:
from_halloween = False
if current_file_name == "page_catalog_group_pro_oreo_11.skt":
from_oreo_11 = True
else:
from_oreo_11 = False
if current_file_name == "page_catalog_group_pro_happy_trios.skt":
from_happy_trios = True
else:
from_happy_trios = False
if current_file_name == "page_catalog_group_pro_12_day_12_menu.skt":
from_12_day_12_menu = True
price_12_day_12_menu = {
"12-03-03-0067": 40,
"12-02-03-0058": 40,
"12-03-03-0058": 30,
"12-03-03-0006": 30,
"12-01-02-0001": 25,
"12-21-02-0001": 25,
"12-03-03-0011": 30,
"12-03-03-0010": 30,
"12-31-02-0001": 30,
"12-11-02-0001": 30,
"12-02-03-0064": 30,
"12-02-03-0039": 30,
"12-02-02-0042": 25,
"12-05-02-0025": 15,
}
original_price_12_day_12_menu = {
"12-03-03-0067": 55,
"12-02-03-0058": 60,
"12-03-03-0058": 40,
"12-03-03-0006": 40,
"12-01-02-0001": 35,
"12-21-02-0001": 35,
"12-03-03-0011": 45,
"12-03-03-0010": 45,
"12-31-02-0001": 45,
"12-11-02-0001": 45,
"12-02-03-0064": 45,
"12-02-03-0039": 45,
"12-02-02-0042": 35,
"12-05-02-0025": 25,
}
else:
from_12_day_12_menu = False
price_12_day_12_menu = {}
original_price_12_day_12_menu = {}
#print ("######################################################################################################")
idx_of_eng = 2
out_xml('<FrameScroll> \r\n')
if multi_pro_gen:
out_xml('<Max> 4 </Max>\r\n')
elif recommend_page:
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')
if multi_pro_gen:
out_xml('<Column> 2 </Column>\r\n')
else:
out_xml('<Column> 4 </Column>\r\n')
if recommend_page:
out_xml(';layout_mode\r\n')
out_xml('<Script>\r\n')
if "all" in verbose:
print("current_file_name " + current_file_name)
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')
def GenListMenu():
for spl in menu_new_list:
#product_code = s
if spl[0] == "IGNORE":
continue
if spl[0].startswith("TAG"):
out_xml( '\t;' + spl[0] + '\r\n')
continue
out_xml( '\t; ==================> Len = ' + str(len(spl)) + '\r\n')
menu_img = spl[7]
out_xml( '\t; '+ spl[4] + ' ' + spl[5] + ' ' + spl[6]+ ' \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 = ""
if spl[4] != '-':
str_con += spl[4] + '.Button,'
if spl[5] != '-':
str_con += spl[5] + '.Button,'
if spl[6] != '-':
str_con += spl[6] + '.Button,'
if spl[4] != '-':
str_con_var += spl[4] + '-'
if spl[5] != '-':
str_con_var += spl[5] + '-'
if spl[6] != '-':
str_con_var += spl[6] + '-'
str_con_var = str_con_var.replace("-", "")
if re.match(r'(\d{4})/(\d{2})/(\d{2})T(\d{2}):(\d{2}):(\d{2})', spl[12].strip()):
str_con += f'DateTimeStart="{spl[12].strip()}",'
if re.match(r'(\d{4})/(\d{2})/(\d{2})T(\d{2}):(\d{2}):(\d{2})', spl[13].strip()):
str_con += f'DateTimeEnd="{spl[13].strip()}",'
if re.match(r'^\w.*', spl[14].strip()):
str_con += f'Var={spl[14].strip()},'
if recommend_page:
str_con += "Disable=Invisible,"
str_con += "$Sum" + str_con_var
out_xml( '\t<State> Flag( '+ str_con + ') </State> \r\n')
pd_code_1 = spl[4]
pd_stage1 = '$' + spl[4] + '.Button'
if spl[4] == "-" or len(spl[4]) == 0 :
pd_code_1 = pd_code_available
pd_stage1 = '"Disable2"'
pd_code_2 = spl[5]
pd_stage2 = '$' + spl[5] + '.Button'
if spl[5] == "-" or len(spl[5]) == 0:
pd_code_2 = pd_code_available
pd_stage2 = '"Disable2"'
pd_code_3 = spl[6]
pd_stage3 = '$' + spl[6] + '.Button'
if spl[6] == "-" or len(spl[6]) == 0:
pd_code_3 = pd_code_available
pd_stage3 = '"Disable2"'
print(" pd_code_1 " + pd_code_1 + " pd_code_2 " + pd_code_2 + " pd_code_3 " + pd_code_3)
out_xml( '\t<Button>\r\n')
out_xml( '\t<State> $Sum' + str_con_var +' </State> \r\n')
if menu_img.startswith("#"):
out_xml( '\t<Filename> '+ menu_img[1:] + '_resting </Filename>\r\n')
out_xml( '\t<FilenamePress> '+ menu_img[1:] + '_press </FilenamePress>\r\n')
out_xml( '\t<FilenameDisable> '+ menu_img[1:] + '_disable </FilenameDisable>\r\n')
else:
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')
if len( spl) > 11:
if spl[4] != '-':
out_xml( '\t<OverlayImage> xmlpro( '+spl[4]+', "ROOT/taobin_project/image/menu_overlay_set/button_overlay_%s_'+ spl[11] +'.png") </OverlayImage>\r\n')
menu_xml_var = 'xmlpro( '+spl[4]+', "ROOT/taobin_project/image/menu_overlay_set/button_overlay_pic_%s_'+ spl[11] +'.png")'
elif spl[6] != '-':
out_xml( '\t<OverlayImage> xmlpro( '+spl[6]+', "ROOT/taobin_project/image/menu_overlay_set/button_overlay_%s_'+ spl[11] +'.png") </OverlayImage>\r\n')
menu_xml_var = 'xmlpro( '+spl[6]+', "ROOT/taobin_project/image/menu_overlay_set/button_overlay_pic_%s_'+ spl[11] +'.png")'
else:
out_xml( '\t<OverlayImage> xmlpro( '+spl[5]+', "ROOT/taobin_project/image/menu_overlay_set/button_overlay_%s_'+ spl[11] +'.png") </OverlayImage>\r\n')
menu_xml_var = 'xmlpro( '+spl[5]+', "ROOT/taobin_project/image/menu_overlay_set/button_overlay_pic_%s_'+ spl[11] +'.png")'
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[1].replace("\\n", " ") + '"\r\n')
out_xml( '\t\tVar NameDrinkTH = "' + spl[0].replace("\\n", " ") + '"\r\n')
out_xml( '\t\tVar DrinkDescriptionTH = "' + spl[2].replace("\\n", " ") + '"\r\n')
out_xml( '\t\tVar DrinkDescription = "' + spl[3].replace("\\n", " ") + '"\r\n')
if menu_img.startswith("#"):
out_xml( '\t\tVar PictureDrink = bn_oreo_vo_get1_full_path\r\n')
else:
out_xml( '\t\tVar PictureDrink = "' + new_default_dir2 + '" + \"' + menu_img + '\"\r\n')
out_xml( '\t\tVar OpenFromXML = CurrentXMLFileName2\r\n')
if rerun_fix_price:
out_xml( '\t\tVar PriceD1 = ' + str(GetPrice_Old(rerun_prices, pd_code_1, pd_code_2, pd_code_3)) + '\r\n')
out_xml( '\t\tVar PriceD2 = ' + str(GetPrice_Old(rerun_prices, pd_code_1, pd_code_2, pd_code_3)) + '\r\n')
out_xml( '\t\tVar PriceD3 = ' + str(GetPrice_Old(rerun_prices, pd_code_1, pd_code_2, pd_code_3)) + '\r\n')
out_xml( '\t\tVar OldPrice = ' + str(GetOriginalPrice_Old(rerun_original_prices, pd_code_1, pd_code_2, pd_code_3)) + '\r\n')
elif monday_banana_fix_price:
out_xml( '\t\tVar PriceD1 = ' + str(GetPrice(monday_banana_prices, pd_code_1)) + '\r\n')
out_xml( '\t\tVar PriceD2 = ' + str(GetPrice(monday_banana_prices, pd_code_2)) + '\r\n')
out_xml( '\t\tVar PriceD3 = ' + str(GetPrice(monday_banana_prices, pd_code_3)) + '\r\n')
out_xml( '\t\tVar OriginalPriceD1 = ' + str(GetOriginalPrice(monday_banana_original_prices, pd_code_1)) + '\r\n')
out_xml( '\t\tVar OriginalPriceD2 = ' + str(GetOriginalPrice(monday_banana_original_prices, pd_code_2)) + '\r\n')
out_xml( '\t\tVar OriginalPriceD3 = ' + str(GetOriginalPrice(monday_banana_original_prices, pd_code_3)) + '\r\n')
elif wednesday_melon_fix_price:
out_xml( '\t\tVar PriceD1 = ' + str(GetPrice(wednesday_melon_prices, pd_code_1)) + '\r\n')
out_xml( '\t\tVar PriceD2 = ' + str(GetPrice(wednesday_melon_prices, pd_code_2)) + '\r\n')
out_xml( '\t\tVar PriceD3 = ' + str(GetPrice(wednesday_melon_prices, pd_code_3)) + '\r\n')
out_xml( '\t\tVar OriginalPriceD1 = ' + str(GetOriginalPrice(wednesday_melon_original_prices, pd_code_1)) + '\r\n')
out_xml( '\t\tVar OriginalPriceD2 = ' + str(GetOriginalPrice(wednesday_melon_original_prices, pd_code_2)) + '\r\n')
out_xml( '\t\tVar OriginalPriceD3 = ' + str(GetOriginalPrice(wednesday_melon_original_prices, pd_code_3)) + '\r\n')
elif cocoa77_fix_price:
out_xml( '\t\tVar PriceD1 = $' + spl[4] + '.Price - 7\r\n')
out_xml( '\t\tVar PriceD2 = $' + spl[5] + '.Price - 7\r\n')
out_xml( '\t\tVar PriceD3 = $' + spl[6] + '.Price - 7\r\n')
out_xml( '\t\tVar OriginalPriceD1 = $' + spl[4] + '.Price\r\n')
out_xml( '\t\tVar OriginalPriceD2 = $' + spl[5] + '.Price\r\n')
out_xml( '\t\tVar OriginalPriceD3 = $' + spl[6] + '.Price\r\n')
elif passion_mint:
out_xml( '\t\tVar PriceD1 = ' + str(GetPrice(passion_mint_fix_price, pd_code_1)) + '\r\n')
out_xml( '\t\tVar PriceD2 = ' + str(GetPrice(passion_mint_fix_price, pd_code_2)) + '\r\n')
out_xml( '\t\tVar PriceD3 = ' + str(GetPrice(passion_mint_fix_price, pd_code_3)) + '\r\n')
out_xml( '\t\tVar OriginalPriceD1 = $' + spl[4] + '.Price\r\n')
out_xml( '\t\tVar OriginalPriceD2 = $' + spl[5] + '.Price\r\n')
out_xml( '\t\tVar OriginalPriceD3 = $' + spl[6] + '.Price\r\n')
elif from_12_day_12_menu:
out_xml( '\t\tVar PriceD1 = ' + str(GetPrice(price_12_day_12_menu, pd_code_1)) + '\r\n')
out_xml( '\t\tVar PriceD2 = ' + str(GetPrice(price_12_day_12_menu, pd_code_2)) + '\r\n')
out_xml( '\t\tVar PriceD3 = ' + str(GetPrice(price_12_day_12_menu, pd_code_3)) + '\r\n')
out_xml( '\t\tVar OriginalPriceD1 = ' + str(GetOriginalPrice(original_price_12_day_12_menu, pd_code_1)) + '\r\n')
out_xml( '\t\tVar OriginalPriceD2 = ' + str(GetOriginalPrice(original_price_12_day_12_menu, pd_code_2)) + '\r\n')
out_xml( '\t\tVar OriginalPriceD3 = ' + str(GetOriginalPrice(original_price_12_day_12_menu, pd_code_3)) + '\r\n')
else:
out_xml( '\t\tVar PriceD1 = $' + spl[4] + '.Price\r\n')
out_xml( '\t\tVar PriceD2 = $' + spl[5] + '.Price\r\n')
out_xml( '\t\tVar PriceD3 = $' + spl[6] + '.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\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')
if len( menu_xml_var) > 0:
out_xml( '\t\tVar OverlayMenuFilter !assigned ' + menu_xml_var + '\r\n')
out_xml( '\t\tDEBUGVAR OverlayMenuFilter\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" "'+ spl[5].replace("-alter", "") +'"\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" "'+ spl[4].replace("-alter", "") +'"\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" "'+ spl[6].replace("-alter", "") +'"\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')
if fixed_price > 0:
out_xml( '\t\tVar From15THBPro = 1 \r\n')
if rerun_fix_price:
out_xml( '\t\tVar FromRerunPro = 1 \r\n')
out_xml( '\t\tVar RerunProCode = "' + GetTricker(rerun_trickers, pd_code_1, pd_code_2, pd_code_3) + '"\r\n')
if monday_banana_fix_price:
out_xml( '\t\tVar FromMondayBananaPro = 1 \r\n')
if wednesday_melon_fix_price:
out_xml( '\t\tVar FromWednesdayMelonPro = 1 \r\n')
if from_my_mint_promotion:
out_xml( '\t\tVar FromMyMintPro = 1 \r\n')
if from_bad_valentine:
out_xml( '\t\tVar FromBadValentinePro = 1 \r\n')
if from_pepsi_second_cup_30:
out_xml( '\t\tVar FromPepsiSecondCup30 = 1 \r\n')
if from_lipit_pro:
out_xml( '\t\tVar FromLipitPro = 1 \r\n')
if from_tea_time_pro:
out_xml( '\t\tVar FromTeaTimePro = 1 \r\n')
if from_nam_hom_coconut:
out_xml( '\t\tVar FromNamHomCoconutPro = 1 \r\n')
if from_cocoa77:
out_xml( '\t\tVar FromCocoa77Pro = 1 \r\n')
if passion_mint:
out_xml( '\t\tVar FromPassionMintPro = 1 \r\n')
if from_robinson_beauty:
out_xml( '\t\tVar FromRobinsonBeautyPro = 1 \r\n')
if from_jemila:
out_xml( '\t\tVar FromJemilaPro = 1 \r\n')
if from_halloween:
out_xml( '\t\tVar FromHalloweenPro = 1 \r\n')
if from_oreo_11:
out_xml( '\t\tVar FromOreoDiscount11Pro = 1 \r\n')
if from_happy_trios:
out_xml( '\t\tVar FromHappyTriosPro = 1 \r\n')
if from_12_day_12_menu:
out_xml( '\t\tVar From12Day12MenuPro = 1 \r\n')
out_xml( '\t\t\r\n')
out_xml( '\t\t'+ button_add_string +'\r\n')
out_xml( '\t\tOpen "ROOT/taobin_project/xml/page_topping_select5.xml"\r\n')
out_xml( '\t\t\r\n')
out_xml( '\t</EventOnClick>\r\n')
out_xml( '\t</Button>\r\n')
if "all" in verbose:
print("len= " + str(len( spl) ) )
menu_color_font = None
desc_color_font = None
# white color menu name & description catalog
if menu_white_color_catalog == True:
menu_color_font = '0xFFFFFF'
desc_color_font = '0xFFFFFF'
if spl[1] != "None":
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> 24 </Size>\r\n')
out_xml( '\t<Width>220</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' if menu_color_font == None else '\t<Color> '+menu_color_font+' </Color>\r\n')
out_xml( '\t<State> showthaiText </State>\r\n')
out_xml( '\t<Value> "' + spl[0].replace("\\n", "\n") + '" </Value>\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>220</Width>\r\n')
out_xml( '\t<Font> KanitMediumTTF </Font>\r\n')
out_xml( '\t<Color> 0x6F5F51 </Color>\r\n' if menu_color_font == None else '\t<Color> '+menu_color_font+' </Color>\r\n')
out_xml( '\t<State> showthaiText </State>\r\n')
out_xml( '\t<Value> "' + spl[2].replace("\\n", "\n") + '" </Value>\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> 164 </Y>\r\n')
out_xml( '\t<Size> 22 </Size>\r\n')
out_xml( '\t<Width>220</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' if menu_color_font == None else '\t<Color> '+menu_color_font+' </Color>\r\n')
out_xml( '\t<State> showengText </State>\r\n')
out_xml( '\t<Value> "' + spl[1].replace("\\n", "\n") + '" </Value>\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>220</Width>\r\n')
out_xml( '\t<Font> KanitMediumTTF </Font>\r\n')
out_xml( '\t<Color> 0x6F5F51 </Color>\r\n' if menu_color_font == None else '\t<Color> '+menu_color_font+' </Color>\r\n')
out_xml( '\t<State> showengText </State>\r\n')
out_xml( '\t<Value> "' + spl[3].replace("\\n", "\n") + '" </Value>\r\n')
out_xml( '\t</Text>\r\n')
if spl[4] != "TAOTIM":
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 = "$" + spl[4] + ".Button"
if spl[4] == "-" :
shw = '"Invisible"'
ice_tab_hot_show = False
if len(spl[4]) == 0 :
shw = '"Invisible"'
ice_tab_hot_show = False
if spl[4] == "TAOTIM":
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')
if "inter" in param:
out_xml( '\t<Text>\r\n')
out_xml( '\t<X> 50 </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')
else:
out_xml( '\t<Text>\r\n')
out_xml( '\t<X> 50 </X>\r\n')
out_xml( '\t<Y> 265 </Y>\r\n')
out_xml( '\t<Size> 14 </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[4] + '.Price ) </Value>\r\n')
if "inter" in param:
if "free" in param:
out_xml( '\t<Value> "Free" </Value>\r\n')
else:
if fixed_price > 0:
out_xml( '\t<Value> StringFmt( 15 , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif rerun_fix_price:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice_Old(rerun_prices, pd_code_1, pd_code_2, pd_code_3)) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif monday_banana_fix_price:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(monday_banana_prices, spl[4])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif wednesday_melon_prices:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(wednesday_melon_prices, spl[4])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif cocoa77_fix_price:
out_xml( '\t<Value> StringFmt( $' + spl[4] + '.Price - 7 , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif passion_mint:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(passion_mint_fix_price, spl[4])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif from_12_day_12_menu:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(price_12_day_12_menu, spl[4])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
else:
out_xml( '\t<Value> StringFmt( $' + spl[4] + '.Price , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
else:
if fixed_price > 0:
out_xml( '\t<Value> "฿15" </Value>\r\n')
elif rerun_fix_price:
out_xml( '\t<Value> "฿' + str(GetPrice_Old(rerun_prices, pd_code_1, pd_code_2, pd_code_3)) + '" </Value>\r\n')
elif monday_banana_fix_price:
out_xml( '\t<Value> "฿' + str(GetPrice(monday_banana_prices, spl[4])) + '" </Value>\r\n')
elif wednesday_melon_prices:
out_xml( '\t<Value> "฿' + str(GetPrice(wednesday_melon_prices, spl[4])) + '" </Value>\r\n')
elif cocoa77_fix_price:
out_xml( '\t<Value> Var( "฿" + $' + spl[4] + '.Price - 7 ) </Value>\r\n')
elif passion_mint:
out_xml( '\t<Value> "฿' + str(GetPrice(passion_mint_fix_price, spl[4])) + '" </Value>\r\n')
elif from_12_day_12_menu:
out_xml( '\t<Value> "฿' + str(GetPrice(price_12_day_12_menu, spl[4])) + '" </Value>\r\n')
else:
out_xml( '\t<Value> Var( "฿" + $' + spl[4] + '.Price ) </Value>\r\n')
out_xml( '\t</Text>\r\n')
ice_tab_ice_show = True
shw = "$" + spl[5] + ".Button"
if spl[5] == "-" :
shw = '"Invisible"'
ice_tab_ice_show = False
if len(spl[5]) == 0 :
shw = '"Invisible"'
ice_tab_ice_show = False
if spl[4] == "TAOTIM":
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')
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')
if "inter" in param:
out_xml( '\t<Text>\r\n')
out_xml( '\t<X> 115 </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')
else:
out_xml( '\t<Text>\r\n')
out_xml( '\t<X> 115 </X>\r\n')
out_xml( '\t<Y> 265 </Y>\r\n')
out_xml( '\t<Size> 14 </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:
if fixed_price > 0:
out_xml( '\t<Value> StringFmt( 15 , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif rerun_fix_price:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice_Old(rerun_prices, pd_code_1, pd_code_2, pd_code_3)) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif monday_banana_fix_price:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(monday_banana_prices, spl[5])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif wednesday_melon_fix_price:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(wednesday_melon_prices, spl[5])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif cocoa77_fix_price:
out_xml( '\t<Value> StringFmt( $' + spl[5] + '.Price - 7, DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif passion_mint:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(passion_mint_fix_price, spl[5])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif from_12_day_12_menu:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(price_12_day_12_menu, spl[5])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
else:
out_xml( '\t<Value> StringFmt( $' + spl[5] + '.Price , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
else:
if fixed_price > 0:
out_xml( '\t<Value> "฿15" </Value>\r\n')
elif rerun_fix_price:
out_xml( '\t<Value> "฿' + str(GetPrice_Old(rerun_prices, pd_code_1, pd_code_2, pd_code_3)) + '" </Value>\r\n')
elif monday_banana_fix_price:
out_xml( '\t<Value> "฿' + str(GetPrice(monday_banana_prices, spl[5])) + '" </Value>\r\n')
elif wednesday_melon_fix_price:
out_xml( '\t<Value> "฿' + str(GetPrice(wednesday_melon_prices, spl[5])) + '" </Value>\r\n')
elif cocoa77_fix_price:
out_xml( '\t<Value> Var( "฿" + $' + spl[5] + '.Price - 7 ) </Value>\r\n')
elif passion_mint:
out_xml( '\t<Value> "฿' + str(GetPrice(passion_mint_fix_price, spl[5])) + '" </Value>\r\n')
elif from_12_day_12_menu:
out_xml( '\t<Value> "฿' + str(GetPrice(price_12_day_12_menu, spl[5])) + '" </Value>\r\n')
else:
out_xml( '\t<Value> Var( "฿" + $' + spl[5] + '.Price ) </Value>\r\n')
out_xml( '\t</Text>\r\n')
ice_tab_blend_show = True
if spl[4] == "TAOTIM":
shw = "$" + spl[6] + ".Button"
if spl[6] == "-" :
shw = '"Invisible"'
ice_tab_blend_show = False
if len(spl[6]) == 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 + "pricetaotim.png" ) </Filename>\r\n')
out_xml( '\t<FilenameDisable> Var( DirImage2 + "pricetaotim.png" ) </FilenameDisable>\r\n')
out_xml( '\t<State> ' + shw + ' </State>\r\n')
out_xml( '\t</Image>\r\n')
else:
shw = "$" + spl[6] + ".Button"
if spl[6] == "-" :
shw = '"Invisible"'
ice_tab_blend_show = False
if len(spl[6]) == 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')
if "inter" in param:
out_xml( '\t<X> 180 </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')
else:
out_xml( '\t<X> 183 </X>\r\n')
out_xml( '\t<Y> 264 </Y>\r\n')
out_xml( '\t<Size> 14 </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:
if fixed_price > 0:
out_xml( '\t<Value> StringFmt( 15 , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif rerun_fix_price:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice_Old(rerun_prices, pd_code_1, pd_code_2, pd_code_3)) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif monday_banana_fix_price:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(monday_banana_prices, spl[6])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif wednesday_melon_fix_price:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(wednesday_melon_prices, spl[6])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif cocoa77_fix_price:
out_xml( '\t<Value> StringFmt( $' + spl[6] + '.Price - 7, DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif passion_mint:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(passion_mint_fix_price, spl[6])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif from_12_day_12_menu:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(price_12_day_12_menu, spl[6])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
else:
out_xml( '\t<Value> StringFmt( $' + spl[6] + '.Price , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
else:
if fixed_price > 0:
out_xml( '\t<Value> "฿15" </Value>\r\n')
elif rerun_fix_price:
out_xml( '\t<Value> "฿' + str(GetPrice_Old(rerun_prices, pd_code_1, pd_code_2, pd_code_3)) + '" </Value>\r\n')
elif monday_banana_fix_price:
out_xml( '\t<Value> "฿' + str(GetPrice(monday_banana_prices, spl[6])) + '" </Value>\r\n')
elif wednesday_melon_fix_price:
out_xml( '\t<Value> "฿' + str(GetPrice(wednesday_melon_prices, spl[6])) + '" </Value>\r\n')
elif cocoa77_fix_price:
out_xml( '\t<Value> Var( "฿" + $' + spl[6] + '.Price - 7 ) </Value>\r\n')
elif passion_mint:
out_xml( '\t<Value> "฿' + str(GetPrice(passion_mint_fix_price, spl[6])) + '" </Value>\r\n')
elif from_12_day_12_menu:
out_xml( '\t<Value> "฿' + str(GetPrice(price_12_day_12_menu, spl[6])) + '" </Value>\r\n')
else:
out_xml( '\t<Value> Var( "฿" + $' + spl[6] + '.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')
if param == "old":
out_xml( '\t</State>\r\n')
out_xml( '\t<Filename> "ROOT/taobin_project/image//img_menu_err.png" </Filename>\r\n')
out_xml( '\t</Image>\r\n')
else:
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')
if param == "old":
print(";param=" + param)
else:
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<Font> MITRegularTTF </Font>\r\n')
out_xml( '\t<Color> 0x5A5A5A </Color>\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<Value> text_unavailable </Value>\r\n')
out_xml( '\t<Align> center-vertical-horizontal </Align>\r\n')
out_xml( '\t</Text>\r\n')
out_xml( '</Block>\r\n')
###############################################################################
if "all" in verbose:
print("sp[2]" + spl[2])
out_xml( '\t; '+ spl[8] + ' ' + spl[9] + ' ' + spl[10]+ ' \r\n')
if spl[8] != '-' or spl[9] != '-' or spl[10] != '-':
menu_img = spl[7]
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 = ""
if spl[8] != '-':
str_con += spl[8] + '.Button,'
if spl[9] != '-':
str_con += spl[9] + '.Button,'
if spl[6] != '-':
str_con += spl[10] + '.Button,'
if spl[8] != '-':
str_con_var += spl[8] + '-'
if spl[9] != '-':
str_con_var += spl[9] + '-'
if spl[10] != '-':
str_con_var += spl[10] + '-'
str_con_var = str_con_var.replace("-", "")
if re.match(r'(\d{4})/(\d{2})/(\d{2})T(\d{2}):(\d{2}):(\d{2})', spl[12].strip()):
str_con += f'DateTimeStart="{spl[12].strip()}",'
if re.match(r'(\d{4})/(\d{2})/(\d{2})T(\d{2}):(\d{2}):(\d{2})', spl[13].strip()):
str_con += f'DateTimeEnd="{spl[13].strip()}",'
if re.match(r'^\w.*', spl[14].strip()):
str_con += f'Var={spl[14].strip()},'
if recommend_page:
str_con += "Disable=Invisible,"
str_con += "$Sum" + str_con_var
out_xml( '\t<State> Flag( '+ str_con + ') </State> \r\n')
pd_code_1 = spl[8]
pd_stage1 = '$' + spl[8] + '.Button'
if spl[8] == "-" or len(spl[8]) == 0 :
pd_code_1 = pd_code_available
pd_stage1 = '"Disable2"'
pd_code_2 = spl[9]
pd_stage2 = '$' + spl[9] + '.Button'
if spl[9] == "-" or len(spl[9]) == 0:
pd_code_2 = pd_code_available
pd_stage2 = '"Disable2"'
pd_code_3 = spl[10]
pd_stage3 = '$' + spl[10] + '.Button'
if spl[10] == "-" or len(spl[10]) == 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')
if len( spl) > 11:
if spl[8] != '-':
out_xml( '\t<OverlayImage> xmlpro( '+spl[8]+', "ROOT/taobin_project/image/menu_overlay_set/button_overlay_%s_'+ spl[11] +'.png") </OverlayImage>\r\n')
menu_xml_var = 'xmlpro( '+spl[8]+', "ROOT/taobin_project/image/menu_overlay_set/button_overlay_pic_%s_'+ spl[11] +'.png")'
elif spl[10] != '-':
out_xml( '\t<OverlayImage> xmlpro( '+spl[10]+', "ROOT/taobin_project/image/menu_overlay_set/button_overlay_%s_'+ spl[11] +'.png") </OverlayImage>\r\n')
menu_xml_var = 'xmlpro( '+spl[10]+', "ROOT/taobin_project/image/menu_overlay_set/button_overlay_pic_%s_'+ spl[11] +'.png")'
else:
out_xml( '\t<OverlayImage> xmlpro( '+spl[9]+', "ROOT/taobin_project/image/menu_overlay_set/button_overlay_%s_'+ spl[11] +'.png") </OverlayImage>\r\n')
menu_xml_var = 'xmlpro( '+spl[9]+', "ROOT/taobin_project/image/menu_overlay_set/button_overlay_pic_%s_'+ spl[11] +'.png")'
out_xml( '\t<EventOnClick> \r\n')
# Default
out_xml( '\t\tVar NameDrink = "' + spl[1].replace("\\n", " ") + '"\r\n')
out_xml( '\t\tVar NameDrinkTH = "' + spl[0].replace("\\n", " ") + '"\r\n')
out_xml( '\t\tVar DrinkDescriptionTH = "' + spl[2].replace("\\n", " ") + '"\r\n')
out_xml( '\t\tVar DrinkDescription = "' + spl[3].replace("\\n", " ") + '"\r\n')
out_xml( '\t\tVar PictureDrink = "' + new_default_dir2 + '" + \"' + menu_img + '\"\r\n')
out_xml( '\t\tVar OpenFromXML = CurrentXMLFileName2\r\n')
if wednesday_melon_fix_price:
out_xml( '\t\tVar PriceD1 = ' + str(GetPrice(wednesday_melon_prices, pd_code_1)) + '\r\n')
out_xml( '\t\tVar PriceD2 = ' + str(GetPrice(wednesday_melon_prices, pd_code_2)) + '\r\n')
out_xml( '\t\tVar PriceD3 = ' + str(GetPrice(wednesday_melon_prices, pd_code_3)) + '\r\n')
out_xml( '\t\tVar OriginalPriceD1 = ' + str(GetOriginalPrice(wednesday_melon_original_prices, pd_code_1)) + '\r\n')
out_xml( '\t\tVar OriginalPriceD2 = ' + str(GetOriginalPrice(wednesday_melon_original_prices, pd_code_2)) + '\r\n')
out_xml( '\t\tVar OriginalPriceD3 = ' + str(GetOriginalPrice(wednesday_melon_original_prices, pd_code_3)) + '\r\n')
elif cocoa77_fix_price:
out_xml( '\t\tVar PriceD1 = $' + spl[8] + '.Price - 7\r\n')
out_xml( '\t\tVar PriceD2 = $' + spl[9] + '.Price - 7\r\n')
out_xml( '\t\tVar PriceD3 = $' + spl[10] + '.Price - 7\r\n')
out_xml( '\t\tVar OriginalPriceD1 = $' + spl[8] + '.Price\r\n')
out_xml( '\t\tVar OriginalPriceD2 = $' + spl[9] + '.Price\r\n')
out_xml( '\t\tVar OriginalPriceD3 = $' + spl[10] + '.Price\r\n')
elif passion_mint:
out_xml( '\t\tVar PriceD1 = ' + str(GetPrice(passion_mint_fix_price, pd_code_1)) + '\r\n')
out_xml( '\t\tVar PriceD2 = ' + str(GetPrice(passion_mint_fix_price, pd_code_2)) + '\r\n')
out_xml( '\t\tVar PriceD3 = ' + str(GetPrice(passion_mint_fix_price, pd_code_3)) + '\r\n')
out_xml( '\t\tVar OriginalPriceD1 = $' + spl[8] + '.Price\r\n')
out_xml( '\t\tVar OriginalPriceD2 = $' + spl[9] + '.Price\r\n')
out_xml( '\t\tVar OriginalPriceD3 = $' + spl[10] + '.Price\r\n')
elif from_12_day_12_menu:
out_xml( '\t\tVar PriceD1 = ' + str(GetPrice(price_12_day_12_menu, pd_code_1)) + '\r\n')
out_xml( '\t\tVar PriceD2 = ' + str(GetPrice(price_12_day_12_menu, pd_code_2)) + '\r\n')
out_xml( '\t\tVar PriceD3 = ' + str(GetPrice(price_12_day_12_menu, pd_code_3)) + '\r\n')
out_xml( '\t\tVar OriginalPriceD1 = ' + str(GetOriginalPrice(original_price_12_day_12_menu, pd_code_1)) + '\r\n')
out_xml( '\t\tVar OriginalPriceD2 = ' + str(GetOriginalPrice(original_price_12_day_12_menu, pd_code_2)) + '\r\n')
out_xml( '\t\tVar OriginalPriceD3 = ' + str(GetOriginalPrice(original_price_12_day_12_menu, pd_code_3)) + '\r\n')
else:
out_xml( '\t\tVar PriceD1 = $' + spl[8] + '.Price\r\n')
out_xml( '\t\tVar PriceD2 = $' + spl[9] + '.Price\r\n')
out_xml( '\t\tVar PriceD3 = $' + spl[10] + '.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\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')
if len( menu_xml_var) > 0:
out_xml( '\t\tVar OverlayMenuFilter !assigned ' + menu_xml_var + '\r\n')
out_xml( '\t\tDEBUGVAR OverlayMenuFilter\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" "'+ spl[9] +'"\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" "'+ spl[8] +'"\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" "'+ spl[10] +'"\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')
if from_my_mint_promotion:
out_xml( '\t\tVar FromMyMintPro = 1 \r\n')
if from_bad_valentine:
out_xml( '\t\tVar FromBadValentinePro = 1 \r\n')
if from_pepsi_second_cup_30:
out_xml( '\t\tVar FromPepsiSecondCup30 = 1 \r\n')
if from_lipit_pro:
out_xml( '\t\tVar FromLipitPro = 1 \r\n')
if from_tea_time_pro:
out_xml( '\t\tVar FromTeaTimePro = 1 \r\n')
if wednesday_melon_fix_price:
out_xml( '\t\tVar FromWednesdayMelonPro = 1 \r\n')
if from_nam_hom_coconut:
out_xml( '\t\tVar FromNamHomCoconutPro = 1 \r\n')
if from_cocoa77:
out_xml( '\t\tVar FromCocoa77Pro = 1 \r\n')
if passion_mint:
out_xml( '\t\tVar FromPassionMintPro = 1 \r\n')
if from_robinson_beauty:
out_xml( '\t\tVar FromRobinsonBeautyPro = 1 \r\n')
if from_jemila:
out_xml( '\t\tVar FromJemilaPro = 1 \r\n')
if from_halloween:
out_xml( '\t\tVar FromHalloweenPro = 1 \r\n')
if from_oreo_11:
out_xml( '\t\tVar FromOreoDiscount11Pro = 1 \r\n')
if from_happy_trios:
out_xml( '\t\tVar FromHappyTriosPro = 1 \r\n')
if from_12_day_12_menu:
out_xml( '\t\tVar From12Day12MenuPro = 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_select5.xml"\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> 24 </Size>\r\n')
out_xml( '\t<Width>220</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' if menu_color_font == None else '\t<Color> '+menu_color_font+' </Color>\r\n')
out_xml( '\t<State> showthaiText </State>\r\n')
out_xml( '\t<Value> "' + spl[0].replace("\\n", "\n") + '" </Value>\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>220</Width>\r\n')
out_xml( '\t<Font> KanitMediumTTF </Font>\r\n')
out_xml( '\t<Color> 0x6F5F51 </Color>\r\n' if menu_color_font == None else '\t<Color> '+menu_color_font+' </Color>\r\n')
out_xml( '\t<State> showthaiText </State>\r\n')
out_xml( '\t<Value> "' + spl[2].replace("\\n", "\n") + '" </Value>\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> 164 </Y>\r\n')
out_xml( '\t<Size> 22 </Size>\r\n')
out_xml( '\t<Width>220</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' if menu_color_font == None else '\t<Color> '+menu_color_font+' </Color>\r\n')
out_xml( '\t<State> showengText </State>\r\n')
out_xml( '\t<Value> "' + spl[1].replace("\\n", "\n") + '" </Value>\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>220</Width>\r\n')
out_xml( '\t<Font> KanitMediumTTF </Font>\r\n')
out_xml( '\t<Color> 0x6F5F51 </Color>\r\n' if menu_color_font == None else '\t<Color> '+menu_color_font+' </Color>\r\n')
out_xml( '\t<State> showengText </State>\r\n')
out_xml( '\t<Value> "' + spl[3].replace("\\n", "\n") + '" </Value>\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 = "$" + spl[8] + ".Button"
if spl[4] == "-" :
shw = '"Invisible"'
ice_tab_hot_show = False
if len(spl[8]) == 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')
if "inter" in param:
out_xml( '\t<Text>\r\n')
out_xml( '\t<X> 50 </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')
else:
out_xml( '\t<Text>\r\n')
out_xml( '\t<X> 50 </X>\r\n')
out_xml( '\t<Y> 265 </Y>\r\n')
out_xml( '\t<Size> 14 </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:
if wednesday_melon_prices:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(wednesday_melon_prices, spl[8])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif cocoa77_fix_price:
out_xml( '\t<Value> StringFmt( $' +spl[8] + '.Price - 7 , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif passion_mint:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(passion_mint_fix_price, spl[8])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif price_12_day_12_menu:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(price_12_day_12_menu, spl[8])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
else:
out_xml( '\t<Value> StringFmt( $' +spl[8] + '.Price , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
else:
if wednesday_melon_prices:
out_xml( '\t<Value> "฿' + str(GetPrice(wednesday_melon_prices, spl[8])) + '" </Value>\r\n')
elif cocoa77_fix_price:
out_xml( '\t<Value> Var( "฿" + $' + spl[8] + '.Price - 7 ) </Value>\r\n')
elif passion_mint:
out_xml( '\t<Value> "฿' + str(GetPrice(passion_mint_fix_price, spl[8])) + '" </Value>\r\n')
elif price_12_day_12_menu:
out_xml( '\t<Value> "฿' + str(GetPrice(price_12_day_12_menu, spl[8])) + '" </Value>\r\n')
else:
out_xml( '\t<Value> Var( "฿" + $' + spl[8] + '.Price ) </Value>\r\n')
out_xml( '\t</Text>\r\n')
ice_tab_ice_show = True
shw = "$" + spl[9] + ".Button"
if spl[9] == "-" :
shw = '"Invisible"'
ice_tab_ice_show = False
if len(spl[9]) == 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')
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')
if "inter" in param:
out_xml( '\t<Text>\r\n')
out_xml( '\t<X> 115 </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')
else:
out_xml( '\t<Text>\r\n')
out_xml( '\t<X> 115 </X>\r\n')
out_xml( '\t<Y> 265 </Y>\r\n')
out_xml( '\t<Size> 14 </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:
if wednesday_melon_prices:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(wednesday_melon_prices, spl[9])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif cocoa77_fix_price:
out_xml( '\t<Value> StringFmt( $' +spl[9] + '.Price - 7, DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif passion_mint:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(passion_mint_fix_price, spl[9])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif from_12_day_12_menu:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(price_12_day_12_menu, spl[9])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
else:
out_xml( '\t<Value> StringFmt( $' +spl[9] + '.Price , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
else:
if wednesday_melon_prices:
out_xml( '\t<Value> "฿' + str(GetPrice(wednesday_melon_prices, spl[9])) + '" </Value>\r\n')
elif cocoa77_fix_price:
out_xml( '\t<Value> Var( "฿" + $' + spl[9] + '.Price - 7 ) </Value>\r\n')
elif passion_mint:
out_xml( '\t<Value> "฿' + str(GetPrice(passion_mint_fix_price, spl[9])) + '" </Value>\r\n')
elif from_12_day_12_menu:
out_xml( '\t<Value> "฿' + str(GetPrice(price_12_day_12_menu, spl[9])) + '" </Value>\r\n')
else:
out_xml( '\t<Value> Var( "฿" + $' + spl[9] + '.Price ) </Value>\r\n')
out_xml( '\t</Text>\r\n')
ice_tab_blend_show = True
shw = "$" + spl[10] + ".Button"
if spl[10] == "-" :
shw = '"Invisible"'
ice_tab_blend_show = False
if len(spl[10]) == 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')
if "inter" in param:
out_xml( '\t<Text>\r\n')
out_xml( '\t<X> 183 </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')
else:
out_xml( '\t<Text>\r\n')
out_xml( '\t<X> 183 </X>\r\n')
out_xml( '\t<Y> 265 </Y>\r\n')
out_xml( '\t<Size> 14 </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:
if wednesday_melon_prices:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(wednesday_melon_prices, spl[10])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif cocoa77_fix_price:
out_xml( '\t<Value> StringFmt( $' +spl[10] + '.Price - 7, DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif passion_mint:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(passion_mint_fix_price, spl[10])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
elif from_12_day_12_menu:
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(price_12_day_12_menu, spl[10])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
else:
out_xml( '\t<Value> StringFmt( $' +spl[10] + '.Price , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
else:
if wednesday_melon_prices:
out_xml( '\t<Value> "฿' + str(GetPrice(wednesday_melon_prices, spl[10])) + '" </Value>\r\n')
elif cocoa77_fix_price:
out_xml( '\t<Value> Var( "฿" + $' + spl[10] + '.Price - 7 ) </Value>\r\n')
elif passion_mint:
out_xml( '\t<Value> "฿' + str(GetPrice(passion_mint_fix_price, spl[10])) + '" </Value>\r\n')
elif from_12_day_12_menu:
out_xml( '\t<Value> "฿' + str(GetPrice(price_12_day_12_menu, spl[10])) + '" </Value>\r\n')
else:
out_xml( '\t<Value> Var( "฿" + $' + spl[10] + '.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')
if param == "old":
out_xml( '\t</State>\r\n')
out_xml( '\t<Filename> "ROOT/taobin_project/image//img_menu_err.png" </Filename>\r\n')
out_xml( '\t</Image>\r\n')
else:
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')
if param == "old":
print("param=" + param)
else:
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<Font> MITRegularTTF </Font>\r\n')
out_xml( '\t<Color> 0x5A5A5A </Color>\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<Value> text_unavailable </Value>\r\n')
out_xml( '\t<Align> center-vertical-horizontal </Align>\r\n')
out_xml( '\t</Text>\r\n')
out_xml( '</Block>\r\n')
if spl[0].startswith("TAG"):
out_xml( '\t;' + spl[0] + '\r\n')
count_test = count_test + 1
#if count_test > 8 :
# break
if multi_pro_gen:
for i in range(1, 5):
out_xml(';block'+str(i)+'\r\n')
out_xml('\t<Block>\r\n')
out_xml('\t\t<State> \"Enable\" </State> \r\n')
# out_xml('\t\t<MarginTop> 22 </MarginTop>\r\n')
# out_xml('\t\t<MarginLeft> 33 </MarginLeft>\r\n')
out_xml('\t\t<Width> 516 </Width>\r\n')
out_xml('\t\t<Height> 636 </Height>\r\n')
out_xml('\t\t<FrameScroll>\r\n')
out_xml('\t\t\t<Max> 4 </Max>\r\n')
out_xml('\t\t\t<X> 0 </X>\r\n')
out_xml('\t\t\t<Y> 0 </Y>\r\n')
out_xml('\t\t\t<Width> 516 </Width>\r\n')
out_xml('\t\t\t<Height> 636 </Height>\r\n')
out_xml('\t\t\t<ScrollHeight> "auto" </ScrollHeight>\r\n')
out_xml('\t\t\t<Scroll> "Vertical" </Scroll>\r\n')
out_xml('\t\t\t<Column> 2 </Column>\r\n')
out_xml('\t\t\t<Script>\r\n')
out_xml('\t\t\t\tVar block_index_override = 0\r\n')
out_xml('\t\t\t\tVar block_index_move = 0\r\n')
out_xml('\t\t\t</Script>\r\n')
GenListMenu()
out_xml('\t\t</FrameScroll>\r\n')
out_xml('\t\t</Block>\r\n')
out_xml(';endblock'+str(i)+'\r\n')
else:
out_xml('; menu_new_list '+ str(len(menu_new_list))+'\r\n')
GenListMenu()
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')