--- a/etherlab/ConfigEditor.py Mon May 21 09:31:15 2012 +0200
+++ b/etherlab/ConfigEditor.py Mon May 21 10:07:11 2012 +0200
@@ -2,7 +2,8 @@
-from controls import CustomGrid, CustomTable, EditorPanel
+from controls import CustomGrid, CustomTable +from ConfTreeNodeEditor import ConfTreeNodeEditor [ETHERCAT_VENDOR, ETHERCAT_GROUP, ETHERCAT_DEVICE] = range(3)
@@ -37,7 +38,7 @@
ID_NODEEDITORVARIABLESGRID,
] = [wx.NewId() for _init_ctrls in range(13)]
-class NodeEditor(EditorPanel):
+class NodeEditor(ConfTreeNodeEditor): @@ -138,7 +139,7 @@
def __init__(self, parent, controler, window):
- EditorPanel.__init__(self, parent, "", window, controler)
+ ConfTreeNodeEditor.__init__(self, parent, "", window, controler) self.SyncManagersTable = SyncManagersTable(self, [], GetSyncManagersTableColnames())
self.SyncManagersGrid.SetTable(self.SyncManagersTable)
@@ -160,15 +161,6 @@
wx.ALIGN_LEFT, wx.ALIGN_LEFT]):
self.VariablesGrid.AddColumn(colname, colsize, colalign)
self.VariablesGrid.SetMainColumn(1)
- img = wx.Bitmap(self.Controler.GetIconPath("Slave.png"), wx.BITMAP_TYPE_PNG).ConvertToImage()
- self.SetIcon(wx.BitmapFromImage(img.Rescale(16, 16)))
- self.Controler.OnCloseEditor(self)
- return self.Controler.CTNFullName()
def GetBufferState(self):
@@ -259,10 +251,4 @@
-class CIA402NodeEditor(NodeEditor):
- def __init__(self, parent, controler, window):
- NodeEditor.__init__(self, parent, controler, window)
- img = wx.Bitmap(self.Controler.GetIconPath("CIA402Slave.png"), wx.BITMAP_TYPE_PNG).ConvertToImage()
- self.SetIcon(wx.BitmapFromImage(img.Rescale(16, 16)))
+CIA402NodeEditor = NodeEditor --- a/etherlab/etherlab.py Mon May 21 09:31:15 2012 +0200
+++ b/etherlab/etherlab.py Mon May 21 10:07:11 2012 +0200
@@ -66,8 +66,8 @@
- def GetIconPath(self, icon):
- return os.path.join(CONFNODEFOLDER, "images", icon)
+ return os.path.join(CONFNODEFOLDER, "images", "Slave.png") def ExtractHexDecValue(self, value):
return ExtractHexDecValue(value)
@@ -135,13 +135,6 @@
"children": self.CTNParent.GetDeviceLocationTree(self.GetSlavePos(), self.GetCurrentLocation(), self.BaseParams.getName())
- {"bitmap" : os.path.join(CONFNODEFOLDER, "images", "editSlave"),
- "name" : _("Edit Slave"),
- "tooltip" : _("Edit Slave"),
- "method" : "_OpenView"},
def CTNGenerate_C(self, buildpath, locations):
@@ -186,12 +179,8 @@
EditorType = CIA402NodeEditor
- {"bitmap" : os.path.join(CONFNODEFOLDER, "images", "editCIA402Slave"),
- "name" : _("Edit CIA402 Slave"),
- "tooltip" : _("Edit CIA402 Slave"),
- "method" : "_OpenView"},
+ return os.path.join(CONFNODEFOLDER, "images", "CIA402Slave.png") def CTNGenerate_C(self, buildpath, locations):