lpcmanager

New widget HMI:DropDownIndexed was created to accommodate runtime changes of dropdown options, as well as mitigate string length limitations. Redmine issue #4530
#!/usr/bin/env python
# XXX Where is MC8 ?
WX_GOT_modules = ['GOT', 'GOT_111', 'GOT_131', 'LHC2_GOT_111']
SVG_GOT_modules = ['GOT_012', 'LHC2_GOT_012', 'GOT_112', 'LHC2_GOT_112', 'LHC1_GOT_002']
MC9_modules = ['MC9', 'MW1']
SOM28_modules = MC9_modules + WX_GOT_modules
# Temporary until preempt merge in all som6 modules
PREEMPTSOM6_modules = ['MM1', 'MM2', 'MM3']
SOM6_modules = SVG_GOT_modules + PREEMPTSOM6_modules
LOCAL_SVG_modules = SVG_GOT_modules + ['MM3']
product_descriptions = {
"MC8": {
"type": "uC",
"header": "MC8",
"features":[
("Right", "uC_Right"),
("On Board", "uC_OnBoard"),
("Devices", "uC_Devices")]
},
"MC9": {
"type": "SOM",
"header": "MC9",
"features":[
("Right", "SOM28_Right"),
("On Board", "SOM_OnBoard"),
("Devices", "SOM_Devices")]
},
"MW1" :{
"type": "SOM",
"header": "MC9",
"features":[
("Right", "SOM28_Right"),
("On Board", "SOM_OnBoard"),
("Devices", "SOM_Devices")]
},
"GOT" :{
"type": "SOM",
"header": "GOT",
"features":[
("On Board", "SOM_OnBoard"),
("Devices", "SOM_Devices")]
},
"GOT_131" :{
"type": "SOM",
"header": "GOT100",
"features":[
("Right", "SOM28_Right"),
("On Board", "SOM_OnBoard"),
("Devices", "SOM_Devices")]
},
"GOT_111" :{
"type": "SOM",
"header": "GOT100",
"features":[
("Right", "SOM28_Right"), #TODO check if True
("On Board", "SOM_OnBoard"),
("Devices", "SOM_Devices")]
},
"LHC2_GOT_111" :{
"type": "SOM",
"header": "LHC2_GOT100",
"features":[
("Right", "SOM28_Right"), #TODO check if True
("On Board", "SOM_OnBoard"),
("Devices", "SOM_Devices")]
},
"GOT_012" :{
"type": "SOM",
"header": "MC10",
"features":[
("On Board", "SOM_OnBoard"),
("Devices", "SOM_Devices")]
},
"LHC2_GOT_012" :{
"type": "SOM",
"header": "MC10",
"features":[
("On Board", "SOM_OnBoard"),
("Devices", "SOM_Devices")]
},
"LHC1_GOT_002" :{
"type": "SOM",
"header": "LHC1_GOT002",
"features":[
("On Board", "SOM_OnBoard"),
("Devices", "SOM_Devices")]
},
"GOT_112" :{
"type": "SOM",
"header": "MC10",
"features":[
("On Board", "SOM_OnBoard"),
("Devices", "SOM_Devices")]
},
"LHC2_GOT_112" :{
"type": "SOM",
"header": "MC10",
"features":[
("On Board", "SOM_OnBoard"),
("Devices", "SOM_Devices")]
},
"MM1" :{
"type": "SOM",
"header": "MC10",
# "LDFLAGS": '"' + os.path.join(RightPath, "i2c_smt_lib.a") + '"',
"features":[
("Right", "SOM6_Right"),
("On Board", "SOM_OnBoard"),
("Devices", "SOM_Devices")],
"CAN":False
},
"MM2" :{
"type": "SOM",
"header": "MC10",
# "LDFLAGS": '"' + os.path.join(RightPath, "i2c_smt_lib.a") + '"',
"features":[
("Right", "SOM6_Right"),
("On Board", "SOM_OnBoard"),
("Devices", "SOM_Devices")],
"CAN":False
},
"MM3" :{
"type": "SOM",
"header": "MC10",
# "LDFLAGS": '"' + os.path.join(RightPath, "i2c_smt_lib.a") + '"',
"features":[
("Right", "SOM6_Right"),
("On Board", "SOM_OnBoard"),
("Devices", "SOM_Devices")],
"CAN":False
}
}
product = None
def SetLPCProduct(given):
global product
product = given
def GetLPCProduct():
global product
return product
def GetLPCProductDesc():
global product, product_descriptions
return product_descriptions[product]
def GetLPCSOM():
global product
if product in SOM28_modules:
return "SOM28"
if product in SOM6_modules:
return "SOM6"
def GetLPCArch():
global product
if product in SOM28_modules:
return "MC9"
elif product in SOM6_modules:
return "MC10"
elif product is "MC8" :
return "MC8"