SGP: add grade overlay
This commit is contained in:
parent
23813b824e
commit
5df34ce479
12 changed files with 3088 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
|||
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] )
|
||||
# print("raw splitted line : ",spl)
|
||||
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')
|
||||
|
|
@ -67,6 +68,42 @@
|
|||
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')
|
||||
|
||||
# overlay
|
||||
|
||||
overlay_position = "_"+spl[idx_img][7]
|
||||
|
||||
overlay_string1 = ""
|
||||
overlay_string2 = ""
|
||||
overlay_string3 = ""
|
||||
gradePD1 = getOverlayGrade(pd_code_1)
|
||||
gradePD2 = getOverlayGrade(pd_code_2)
|
||||
gradePD3 = getOverlayGrade(pd_code_3)
|
||||
print("gradePD1 ", gradePD1, "gradePD2 ", gradePD2, "gradePD3 ", gradePD3)
|
||||
|
||||
if gradePD1 != None or gradePD2 != None or gradePD3 != None:
|
||||
if getOverlayGrade(pd_code_1) != None:
|
||||
overlay_string1 += 'xmlpro( '+pd_code_1+', '+'"ROOT/taobin_project/image/menu_overlay_set/button_overlay_'+gradePD1+overlay_position+'.png")'
|
||||
|
||||
if getOverlayGrade(pd_code_2) != None:
|
||||
overlay_string2 += 'xmlpro( '+pd_code_2+', '+'"ROOT/taobin_project/image/menu_overlay_set/button_overlay_'+gradePD2+overlay_position+'.png")'
|
||||
|
||||
if getOverlayGrade(pd_code_3) != None:
|
||||
overlay_string3 += 'xmlpro( '+pd_code_3+', '+'"ROOT/taobin_project/image/menu_overlay_set/button_overlay_'+gradePD3+overlay_position+'.png")'
|
||||
# Overlay Tag for catalog page
|
||||
# TODO: check if cold pd is available first then blend and hot
|
||||
overlay_tag1 = overlay_string1.replace("button_overlay_", "button_overlay_catalog_")
|
||||
overlay_tag2 = overlay_string2.replace("button_overlay_", "button_overlay_catalog_")
|
||||
overlay_tag3 = overlay_string3.replace("button_overlay_", "button_overlay_catalog_")
|
||||
|
||||
if overlay_string2 != "":
|
||||
out_xml( '\t<OverlayImage> ' + overlay_tag2 + ' </OverlayImage>\r\n')
|
||||
elif overlay_string3 != "":
|
||||
out_xml( '\t<OverlayImage> ' + overlay_tag3 + ' </OverlayImage>\r\n')
|
||||
elif overlay_string1 != "":
|
||||
out_xml( '\t<OverlayImage> ' + overlay_tag1 + ' </OverlayImage>\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')
|
||||
|
|
@ -182,6 +219,44 @@
|
|||
out_xml( '\t\tVar SelectDrinkType = 0\r\n')
|
||||
|
||||
|
||||
# Overlay Filter
|
||||
out_xml( '\t\tVar OverlayMenuFilter = \"\"\r\n')
|
||||
out_xml( '\t\tVar OverlayMenuFilter1 = \"\"\r\n')
|
||||
out_xml( '\t\tVar OverlayMenuFilter2 = \"\"\r\n')
|
||||
out_xml( '\t\tVar OverlayMenuFilter3 = \"\"\r\n')
|
||||
def get_overlay_filter( stage: int, pd_code: str, assign_args: str) -> str:
|
||||
|
||||
# overlay stage
|
||||
overlay_stage = "OverlayMenuFilter"+str(stage)
|
||||
overlay_stage_value = "OverlayMenuFilter"+str(stage)+"_Value"
|
||||
|
||||
# if block
|
||||
if_block = "\n\t\tIf PD_STAGE_"+str(stage)+" = \"Enable\" Then\r\n"
|
||||
if_block += "\t\t\tVar "+overlay_stage+" = \""+pd_code+"\"\r\n"
|
||||
if_block += "\t\t\tVar "+overlay_stage_value+" !assigned "+assign_args+"\r\n"
|
||||
if_block += "\t\t\tDEBUGVAR "+overlay_stage+"\r\n"
|
||||
if_block += "\t\t\tDEBUGVAR "+overlay_stage_value+"\r\n"
|
||||
|
||||
# else block
|
||||
else_block = "\t\tElse\r\n"
|
||||
else_block += "\t\t\tVar OverlayMenuFilter = \"\"\r\n"
|
||||
else_block += "\t\tEndIf\r\n"
|
||||
|
||||
if pd_code == "":
|
||||
return ""
|
||||
else:
|
||||
return if_block + else_block
|
||||
|
||||
if overlay_string1 != "":
|
||||
out_xml( get_overlay_filter(1, pd_code_1, overlay_string1))
|
||||
if overlay_string2 != "":
|
||||
out_xml( get_overlay_filter(2, pd_code_2, overlay_string2))
|
||||
if overlay_string3 != "":
|
||||
out_xml(get_overlay_filter(3, pd_code_3, overlay_string3))
|
||||
|
||||
|
||||
|
||||
|
||||
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')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue