lpcmanager

Parents 4cc2bebba9d7
Children 32b2020010ba
Changes LPCManager way to add its own CTN type to the ona available. Now uses features.catalog.
--- a/LPCExtension.py Wed Feb 07 13:57:10 2018 +0100
+++ b/LPCExtension.py Wed Feb 07 15:45:26 2018 +0100
@@ -27,6 +27,17 @@
features.libraries += [('LPC', SimplePOULibraryFactory(_poulibpath("LPC")))]
#
+# --------- Configuration Tree Nodes (CTN) catalog extension ------------
+#
+_oldcatalog = features.catalog
+catalog_index = dict(zip(zip(*_oldcatalog)[0],_oldcatalog))
+wanted_beremiz_features = [catalog_index[feature]
+ for feature in ["modbus", "c_ext", "py_ext"]]
+features.catalog = wanted_beremiz_features + [
+ ('LPCBus', _('LPC bus'), _('Support for Smarteh modules'), 'LPCBus.LPCBus'),
+ ('CanOpen', _('CANOpen'), _('Support for CANopen'), 'LPCCanFestival.LPCCanOpen')]
+
+#
# --------- Connectors Extension ------------
#
--- a/LPCProjectController.py Wed Feb 07 13:57:10 2018 +0100
+++ b/LPCProjectController.py Wed Feb 07 15:45:26 2018 +0100
@@ -134,7 +134,6 @@
ProjectController.__init__(self, frame, logger)
- self.CTNChildrenTypes += [("LPCBus", LPCBus, "LPC bus"), ("CanOpen", LPCCanOpen, "CanOpen bus")]
self.CTNType = "LPC"
self.OnlineMode = "NORMAL" if self.arch in PLC_module else "OFF"