--- a/etherlab/ConfigEditor.py Fri Sep 28 18:00:50 2018 +0300
+++ b/etherlab/ConfigEditor.py Fri Sep 28 18:04:28 2018 +0300
@@ -30,12 +30,14 @@
[ETHERCAT_VENDOR, ETHERCAT_GROUP, ETHERCAT_DEVICE] = range(3)
+
def AppendMenu(parent, help, id, kind, text):
if wx.VERSION >= (2, 6, 0):
parent.Append(help=help, id=id, kind=kind, text=text)
else:
parent.Append(helpString=help, id=id, kind=kind, item=text)
+
def GetVariablesTableColnames(position=False):
_ = lambda x : x
colname = ["#"]
@@ -48,6 +50,7 @@
'wo': 'W',
'rw': 'R/W'}
+
def GetAccessValue(access, pdo_mapping):
value = "SDO: %s" % ACCESS_TYPES.get(access, "")
if pdo_mapping != "":
@@ -66,6 +69,7 @@
ETHERCAT_SUBINDEX_MODEL = re.compile("#x([0-9a-fA-F]{0,2})$")
LOCATION_MODEL = re.compile("(?:%[IQM](?:[XBWLD]?([0-9]+(?:\.[0-9]+)*)))$")
+
class NodeVariablesSizer(wx.FlexGridSizer):
def __init__(self, parent, controler, position_column=False):
@@ -252,6 +256,7 @@
event.Skip()
+
class NodeEditor(ConfTreeNodeEditor):
CONFNODEEDITOR_TABS = [
@@ -333,6 +338,7 @@
_("Write to (nodeid, index, subindex)"),
_("Description")]
+
class ProcessVariablesTable(CustomTable):
def GetValue(self, row, col):
@@ -386,6 +392,7 @@
self.ResizeRow(grid, row)
+
class ProcessVariableDropTarget(wx.TextDropTarget):
def __init__(self, parent):
@@ -445,10 +452,12 @@
message.ShowModal()
message.Destroy()
+
def GetStartupCommandsTableColnames():
_ = lambda x : x
return [_("Position"), _("Index"), _("Subindex"), _("Value"), _("Description")]
+
class StartupCommandDropTarget(wx.TextDropTarget):
def __init__(self, parent):
@@ -495,6 +504,7 @@
message.ShowModal()
message.Destroy()
+
class StartupCommandsTable(CustomTable):
"""
@@ -567,6 +577,7 @@
return row
return None
+
class MasterNodesVariablesSizer(NodeVariablesSizer):
def __init__(self, parent, controler):
@@ -586,6 +597,7 @@
NODE_POSITION_FILTER_FORMAT = _("Node Position: %d")
+
class MasterEditor(ConfTreeNodeEditor):
CONFNODEEDITOR_TABS = [
@@ -1081,6 +1093,7 @@
# self.FrameLoss2.SetValue(self.MasterState["frameloss2"])
# self.FrameLoss3.SetValue(self.MasterState["frameloss3"])
+
class LibraryEditorSizer(wx.FlexGridSizer):
def __init__(self, parent, module_library, buttons):
@@ -1316,6 +1329,7 @@
param_infos["description"])
event.Skip()
+
class DatabaseManagementDialog(wx.Dialog):
def __init__(self, parent, database):
@@ -1347,6 +1361,7 @@
def GetValue(self):
return self.DatabaseSizer.GetSelectedFilePath()
+
class LibraryEditor(ConfTreeNodeEditor):
CONFNODEEDITOR_TABS = [