MYS: prep pro Yuzu template WIP

This commit is contained in:
Pakin 2024-06-20 08:46:26 +07:00
parent 985cfb267f
commit 1d3c15fa5b
27 changed files with 62721 additions and 1541 deletions

View file

@ -1,5 +1,5 @@
if "v2" in param:
def GenMenuProductCodeBlock( str_hot_product_code, str_cold_product_code, str_blend_product_code):
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')
menu_img = spl[ idx_img][1]
@ -181,6 +181,17 @@
out_xml( '\t\tDEBUGVAR PD_STAGE_3\r\n')
out_xml( '\t\tVar SelectDrinkType = 0\r\n')
# 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:
out_xml( '\t\tVar FromProYuzu = 1 \r\n')
out_xml( '\t\t\r\n')
out_xml( '\t\t\r\n')
@ -452,7 +463,7 @@
out_xml( '</Block>\r\n')
def GenMenuBlock( idx_hot_product_code, idx_cold_product_code, idx_blend_product_code):
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] )
@ -488,27 +499,40 @@
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')
elif multi_pro_gen:
out_xml('<Max> 4 </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 multi_pro_gen:
out_xml('<Column> 2 </Column>\r\n')
else:
out_xml('<Column> 4 </Column>\r\n')
out_xml('<Script>\r\n')
print("current_file_name " + current_file_name)
if touch_less_gen == False:
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 = 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('\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')
@ -561,42 +585,76 @@
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(',')
def GenListMenu():
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(spl, hot_pd[ idx], cold_pd[ idx], blend_pd[ idx] )
else:
GenMenuBlock(spl, 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(spl, idx_hot_product_code2, idx_cold_product_code2, idx_blend_product_code2)
if multi_pro_gen:
print("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()
#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')