menu_new_layout_gen_v3 add parameter from xml

This commit is contained in:
wanlop run 2025-04-19 23:35:56 +07:00
parent 47c9efc430
commit a84fdc38cb
11 changed files with 2605 additions and 3765 deletions

View file

@ -81,27 +81,41 @@
out_xml('\t\t\t</LanguageGroup>\n')
out_xml('\t\t</Description>\n')
out_xml('\t\t<HotState> ' + pd_stage1 + ' </HotState>\n')
out_xml('\t\t<IceState> ' + pd_stage2 + ' </IceState>\n')
if "show-blend-only" in xml_parameter:
print("Hot price ignore ")
else:
out_xml('\t\t<HotState> ' + pd_stage1 + ' </HotState>\n')
if "show-blend-only" in xml_parameter:
print("Cold price ignore ")
else:
out_xml('\t\t<IceState> ' + pd_stage2 + ' </IceState>\n')
out_xml('\t\t<BlendState> ' + pd_stage3 + ' </BlendState>\n')
if "show-blend-only" in xml_parameter:
print("Hot price ignore ")
else:
out_xml('\t\t<HotPrice> eval( \n')
out_xml('\t\t<HotPrice> eval( \n')
out_xml( '\t\tIf $' + pd_code_1 + '.Price = -1 Then\r\n')
out_xml( '\t\t\tVar return = "Free"\r\n')
out_xml( '\t\tElse\r\n')
out_xml( '\t\t\tVar return !assigned StringFmt( $' + pd_code_1 + '.Price , DisplayFormat, PreScaleConvertShow) \r\n')
out_xml( '\t\tEndIf\r\n')
out_xml('\t\t) </HotPrice>\n')
out_xml( '\t\tIf $' + pd_code_1 + '.Price = -1 Then\r\n')
out_xml( '\t\t\tVar return = "Free"\r\n')
out_xml( '\t\tElse\r\n')
out_xml( '\t\t\tVar return !assigned StringFmt( $' + pd_code_1 + '.Price , DisplayFormat, PreScaleConvertShow) \r\n')
out_xml( '\t\tEndIf\r\n')
out_xml('\t\t) </HotPrice>\n')
out_xml('\t\t<IcePrice> eval( \n')
out_xml( '\t\tIf $' + pd_code_2 + '.Price = -1 Then\r\n')
out_xml( '\t\t\tVar return = "Free"\r\n')
out_xml( '\t\tElse\r\n')
out_xml( '\t\t\tVar return !assigned StringFmt( $' + pd_code_2 + '.Price , DisplayFormat, PreScaleConvertShow) \r\n')
out_xml( '\t\tEndIf\r\n')
out_xml('\t\t) </IcePrice>\n')
if "show-blend-only" in xml_parameter:
print("Cold price ignore ")
else:
out_xml('\t\t<IcePrice> eval( \n')
out_xml( '\t\tIf $' + pd_code_2 + '.Price = -1 Then\r\n')
out_xml( '\t\t\tVar return = "Free"\r\n')
out_xml( '\t\tElse\r\n')
out_xml( '\t\t\tVar return !assigned StringFmt( $' + pd_code_2 + '.Price , DisplayFormat, PreScaleConvertShow) \r\n')
out_xml( '\t\tEndIf\r\n')
out_xml('\t\t) </IcePrice>\n')
out_xml('\t\t<BlendPrice> eval( \n')
@ -133,8 +147,11 @@
out_xml('\t\t<ConditionalDisable>\n')
out_xml('\t\t\t<Script>\n')
out_xml('\t\t\t\tIf $Sum' + str_con_var +' = "Disable" Then\n')
out_xml('\t\t\t\t\tSTRCONTAIN "STG=CLOSE" $' + pd_code_1 + '.TAG tag1_is_disable\n')
out_xml('\t\t\t\t\tSTRCONTAIN "STG=CLOSE" $' + pd_code_2 + '.TAG tag2_is_disable\n')
if "show-blend-only" in xml_parameter:
print("Ignore check hot and cold menu. ")
else:
out_xml('\t\t\t\t\tSTRCONTAIN "STG=CLOSE" $' + pd_code_1 + '.TAG tag1_is_disable\n')
out_xml('\t\t\t\t\tSTRCONTAIN "STG=CLOSE" $' + pd_code_2 + '.TAG tag2_is_disable\n')
out_xml('\t\t\t\t\tSTRCONTAIN "STG=CLOSE" $' + pd_code_3 + '.TAG tag3_is_disable\n')
out_xml('\t\t\t\t\tIf tag1_is_disable = "true" Then\n')
@ -298,19 +315,25 @@
out_xml( '\t\t\t\tVar show_eng = "true"\n')
out_xml( '\t\t\tEndIf\n')
print("topping_xml_file=" + topping_xml_file)
if len( topping_xml_file) > 0 :
print("topping_xml_file=" + topping_xml_file)
print("current_file_name=" + current_file_name)
if len( xml_parameter) > 0 :
print("xml_parameter=" + xml_parameter)
if len( topping_xml_file) == 0 :
out_xml( '\t\t\t\tOpenInst 2 "/mnt/sdcard/coffeevending/taobin_project/xml/page_topping_select5.xml"\n')
else:
out_xml( '\t\t\t\tOpenInst 2 "/mnt/sdcard/coffeevending/taobin_project/inter/tha/xml/'+ topping_xml_file +'\n')
out_xml( '\t\t\t\tOpenInst 2 "/mnt/sdcard/coffeevending/taobin_project/inter/tha/xml/'+ topping_xml_file +'"\n')
out_xml( '\t\t\tElse\n')
if len( topping_xml_file) == 0 :
out_xml( '\t\t\t\tOpenInst 2 "/mnt/sdcard/coffeevending/taobin_project/inter/tha/xml/page_topping_select6.lxml"\n')
else:
out_xml( '\t\t\t\tOpenInst 2 "/mnt/sdcard/coffeevending/taobin_project/inter/tha/xml/'+ topping_xml_file +'\n')
out_xml( '\t\t\t\tOpenInst 2 "/mnt/sdcard/coffeevending/taobin_project/inter/tha/xml/'+ topping_xml_file +'"\n')
out_xml( '\t\t\tEndIf\n')

View file

@ -180,23 +180,7 @@
<LanguageSlot6>-</LanguageSlot6>
</LanguageGroup>
</Description>
<HotState> "Disable2" </HotState>
<IceState> "Disable2" </IceState>
<BlendState> $12-00-07-0001.Button </BlendState>
<HotPrice> eval(
If $##-##-##-####.Price = -1 Then
Var return = "Free"
Else
Var return !assigned StringFmt( $##-##-##-####.Price , DisplayFormat, PreScaleConvertShow)
EndIf
) </HotPrice>
<IcePrice> eval(
If $##-##-##-####.Price = -1 Then
Var return = "Free"
Else
Var return !assigned StringFmt( $##-##-##-####.Price , DisplayFormat, PreScaleConvertShow)
EndIf
) </IcePrice>
<BlendPrice> eval(
If $12-00-07-0001.Price = -1 Then
Var return = "Free"
@ -223,8 +207,6 @@
<ConditionalDisable>
<Script>
If $Sum1200070001 = "Disable" Then
STRCONTAIN "STG=CLOSE" $##-##-##-####.TAG tag1_is_disable
STRCONTAIN "STG=CLOSE" $##-##-##-####.TAG tag2_is_disable
STRCONTAIN "STG=CLOSE" $12-00-07-0001.TAG tag3_is_disable
If tag1_is_disable = "true" Then
Var $Sum1200070001Tag = $##-##-##-####.TAG
@ -297,18 +279,18 @@
Var DescLang[1][3] = ""
Var DescLang[1][4] = ""
Var DescLang[1][5] = ""
Var NameLang[2][0] = ""
Var NameLang[2][1] = ""
Var NameLang[2][2] = ""
Var NameLang[2][3] = ""
Var NameLang[2][4] = ""
Var NameLang[2][5] = ""
Var DescLang[2][0] = ""
Var DescLang[2][1] = ""
Var DescLang[2][2] = ""
Var DescLang[2][3] = ""
Var DescLang[2][4] = ""
Var DescLang[2][5] = ""
Var NameLang[2][0] = "Mango Smoothie"
Var NameLang[2][1] = "มะม่วงปั่น"
Var NameLang[2][2] = "-"
Var NameLang[2][3] = "-"
Var NameLang[2][4] = "-"
Var NameLang[2][5] = "-"
Var DescLang[2][0] = "Mango Frozen"
Var DescLang[2][1] = "มะม่วงสุขแช่แข็ง"
Var DescLang[2][2] = "-"
Var DescLang[2][3] = "-"
Var DescLang[2][4] = "-"
Var DescLang[2][5] = "-"
; end lang
Var PD_STAGE_1 = "Disable2"
Var PD_STAGE_2 = "Disable2"
@ -370,9 +352,9 @@
Else
Var show_eng = "true"
EndIf
OpenInst 2 "/mnt/sdcard/coffeevending/taobin_project/inter/tha/xml/page_topping_frozen_fruit_select.lxml
OpenInst 2 "/mnt/sdcard/coffeevending/taobin_project/inter/tha/xml/page_topping_frozen_fruit_select.lxml"
Else
OpenInst 2 "/mnt/sdcard/coffeevending/taobin_project/inter/tha/xml/page_topping_frozen_fruit_select.lxml
OpenInst 2 "/mnt/sdcard/coffeevending/taobin_project/inter/tha/xml/page_topping_frozen_fruit_select.lxml"
EndIf

File diff suppressed because it is too large Load diff