lpcmanager

af62526cfbcb
Parents 9507e2c4259d
Children 33eb1d70db63
Code move: re-organize product descriptions in LPCArch.py
--- a/LPCArch.py Wed Oct 04 11:19:27 2023 +0200
+++ b/LPCArch.py Wed Oct 04 11:20:43 2023 +0200
@@ -5,7 +5,101 @@
SVG_GOT_modules = ['GOT_012', 'LHC2_GOT_012']
MC9_modules = ['MC9', 'MW1']
SOM28_modules = MC9_modules + WX_GOT_modules
-SOM6_modules = SVG_GOT_modules + ['MM1']
+# Temporary until preempt merge in all som6 modules
+PREEMPTSOM6_modules = ['MM1', 'MM2']
+SOM6_modules = SVG_GOT_modules + PREEMPTSOM6_modules
+
+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")]
+ },
+ "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
+ }
+}
product = None
@@ -14,15 +108,22 @@
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:
--- a/LPCBus.py Wed Oct 04 11:19:27 2023 +0200
+++ b/LPCBus.py Wed Oct 04 11:20:43 2023 +0200
@@ -1,7 +1,7 @@
from __future__ import absolute_import
import os
-from LPCArch import GetLPCArch, GetLPCProduct, SOM28_modules
+from LPCArch import GetLPCArch, GetLPCProduct, SOM28_modules, GetLPCProductDesc
import util.paths as paths
from plcopen.structures import LOCATIONDATATYPES
@@ -9,6 +9,7 @@
LOCATION_VAR_INPUT, LOCATION_VAR_OUTPUT, LOCATION_VAR_MEMORY
product = GetLPCProduct()
+product_desc = GetLPCProductDesc()
modpath = os.path.split(__file__)[0]
LPCBusSourcePath = os.path.join(modpath,"LPCBus")
@@ -16,88 +17,7 @@
def GetLocalCode(fname):
return open(os.path.join(LPCBusSourcePath,fname)).read()
-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")]
- },
- "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")]
- }
-}
-product_desc = product_descriptions[product]
LOCATION_TYPES = {"I": LOCATION_VAR_INPUT,
"Q": LOCATION_VAR_OUTPUT,
"M": LOCATION_VAR_MEMORY}
--- a/LPCExtension.py Wed Oct 04 11:19:27 2023 +0200
+++ b/LPCExtension.py Wed Oct 04 11:20:43 2023 +0200
@@ -8,7 +8,7 @@
import features
from POULibrary import SimplePOULibraryFactory
-from LPCArch import GetLPCProduct, GetLPCSOM, WX_GOT_modules, SOM28_modules, SOM6_modules, SVG_GOT_modules, GetLPCArch
+from LPCArch import GetLPCProduct, GetLPCSOM, WX_GOT_modules, SOM28_modules, SOM6_modules, SVG_GOT_modules, GetLPCArch, PREEMPTSOM6_modules
# _lpcmanager_path, arch, etc are defined here because
# globals() of LPCManager.py are passed to extentions
@@ -78,7 +78,7 @@
som = GetLPCSOM()
if som is not None:
# added for MM1 dev, TODO merge with SOM6
- if product == "MM1":
+ if product in PREEMPTSOM6_modules:
rtosname = "Linux"
XSDname = "XSD_PREEMT"
else:
--- a/LPCProjectController.py Wed Oct 04 11:19:27 2023 +0200
+++ b/LPCProjectController.py Wed Oct 04 11:20:43 2023 +0200
@@ -11,7 +11,7 @@
from HostFirmwareUpdater import HostFirmwareUpdater
from plcopen.types_enums import ComputeConfigurationResourceName
-from LPCArch import GetLPCProduct
+from LPCArch import GetLPCProductDesc
LPCStatusMethods = [
{"bitmap": "UpdateFw",
@@ -155,7 +155,7 @@
else :
ProjectController.LoadProject(self, ProjectPath, BuildPath)
- if GetLPCProduct() != "MM1":
+ if GetLPCProductDesc().get("CAN", True):
canopen_child = self.GetChildByName("CanOpen")
if canopen_child is None:
canopen = self.CTNAddChild("CanOpen", "CanOpen", 0)