75 self._init_coll_MainSizer_Growables(self.MainSizer) |
77 self._init_coll_MainSizer_Growables(self.MainSizer) |
76 self._init_coll_MainSizer_Items(self.MainSizer) |
78 self._init_coll_MainSizer_Items(self.MainSizer) |
77 self._init_coll_SlaveInfosDetailsSizer_Growables(self.SlaveInfosDetailsSizer) |
79 self._init_coll_SlaveInfosDetailsSizer_Growables(self.SlaveInfosDetailsSizer) |
78 self._init_coll_SlaveInfosDetailsSizer_Items(self.SlaveInfosDetailsSizer) |
80 self._init_coll_SlaveInfosDetailsSizer_Items(self.SlaveInfosDetailsSizer) |
79 |
81 |
80 self.ConfNodeEditor.SetSizer(self.MainSizer) |
82 self.EthercatNodeEditor.SetSizer(self.MainSizer) |
81 |
83 |
82 def _init_ConfNodeEditor(self, prnt): |
84 def _create_EthercatNodeEditor(self, prnt): |
83 self.ConfNodeEditor = wx.ScrolledWindow(id=-1, name='SlavePanel', parent=prnt, |
85 self.EthercatNodeEditor = wx.ScrolledWindow(id=-1, name='SlavePanel', parent=prnt, |
84 size=wx.Size(0, 0), style=wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER|wx.HSCROLL|wx.VSCROLL) |
86 size=wx.Size(0, 0), style=wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER|wx.HSCROLL|wx.VSCROLL) |
85 self.ConfNodeEditor.Bind(wx.EVT_SIZE, self.OnConfNodeEditorResize) |
87 self.EthercatNodeEditor.Bind(wx.EVT_SIZE, self.OnEthercatNodeEditorResize) |
86 |
88 |
87 self.VendorLabel = wx.StaticText(id=ID_NODEEDITORVENDORLABEL, |
89 self.VendorLabel = wx.StaticText(id=ID_NODEEDITORVENDORLABEL, |
88 label=_('Vendor:'), name='VendorLabel', parent=self.ConfNodeEditor, |
90 label=_('Vendor:'), name='VendorLabel', parent=self.EthercatNodeEditor, |
89 pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) |
91 pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) |
90 |
92 |
91 self.Vendor = wx.TextCtrl(id=ID_NODEEDITORVENDOR, value='', |
93 self.Vendor = wx.TextCtrl(id=ID_NODEEDITORVENDOR, value='', |
92 name='Vendor', parent=self.ConfNodeEditor, pos=wx.Point(0, 0), |
94 name='Vendor', parent=self.EthercatNodeEditor, pos=wx.Point(0, 0), |
93 size=wx.Size(0, 24), style=wx.TE_READONLY) |
95 size=wx.Size(0, 24), style=wx.TE_READONLY) |
94 |
96 |
95 self.ProductCodeLabel = wx.StaticText(id=ID_NODEEDITORPRODUCTCODELABEL, |
97 self.ProductCodeLabel = wx.StaticText(id=ID_NODEEDITORPRODUCTCODELABEL, |
96 label=_('Product code:'), name='ProductCodeLabel', parent=self.ConfNodeEditor, |
98 label=_('Product code:'), name='ProductCodeLabel', parent=self.EthercatNodeEditor, |
97 pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) |
99 pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) |
98 |
100 |
99 self.ProductCode = wx.TextCtrl(id=ID_NODEEDITORPRODUCTCODE, value='', |
101 self.ProductCode = wx.TextCtrl(id=ID_NODEEDITORPRODUCTCODE, value='', |
100 name='ProductCode', parent=self.ConfNodeEditor, pos=wx.Point(0, 0), |
102 name='ProductCode', parent=self.EthercatNodeEditor, pos=wx.Point(0, 0), |
101 size=wx.Size(0, 24), style=wx.TE_READONLY) |
103 size=wx.Size(0, 24), style=wx.TE_READONLY) |
102 |
104 |
103 self.RevisionNumberLabel = wx.StaticText(id=ID_NODEEDITORREVISIONNUMBERLABEL, |
105 self.RevisionNumberLabel = wx.StaticText(id=ID_NODEEDITORREVISIONNUMBERLABEL, |
104 label=_('Revision number:'), name='RevisionNumberLabel', parent=self.ConfNodeEditor, |
106 label=_('Revision number:'), name='RevisionNumberLabel', parent=self.EthercatNodeEditor, |
105 pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) |
107 pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) |
106 |
108 |
107 self.RevisionNumber = wx.TextCtrl(id=ID_NODEEDITORREVISIONNUMBER, value='', |
109 self.RevisionNumber = wx.TextCtrl(id=ID_NODEEDITORREVISIONNUMBER, value='', |
108 name='RevisionNumber', parent=self.ConfNodeEditor, pos=wx.Point(0, 0), |
110 name='RevisionNumber', parent=self.EthercatNodeEditor, pos=wx.Point(0, 0), |
109 size=wx.Size(0, 24), style=wx.TE_READONLY) |
111 size=wx.Size(0, 24), style=wx.TE_READONLY) |
110 |
112 |
111 self.PhysicsLabel = wx.StaticText(id=ID_NODEEDITORPHYSICSLABEL, |
113 self.PhysicsLabel = wx.StaticText(id=ID_NODEEDITORPHYSICSLABEL, |
112 label=_('Physics:'), name='PhysicsLabel', parent=self.ConfNodeEditor, |
114 label=_('Physics:'), name='PhysicsLabel', parent=self.EthercatNodeEditor, |
113 pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) |
115 pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) |
114 |
116 |
115 self.Physics = wx.TextCtrl(id=ID_NODEEDITORPHYSICS, value='', |
117 self.Physics = wx.TextCtrl(id=ID_NODEEDITORPHYSICS, value='', |
116 name='Physics', parent=self.ConfNodeEditor, pos=wx.Point(0, 0), |
118 name='Physics', parent=self.EthercatNodeEditor, pos=wx.Point(0, 0), |
117 size=wx.Size(0, 24), style=wx.TE_READONLY) |
119 size=wx.Size(0, 24), style=wx.TE_READONLY) |
118 |
120 |
119 self.SyncManagersLabel = wx.StaticText(id=ID_NODEEDITORSYNCMANAGERSLABEL, |
121 self.SyncManagersLabel = wx.StaticText(id=ID_NODEEDITORSYNCMANAGERSLABEL, |
120 label=_('Sync managers:'), name='SyncManagersLabel', parent=self.ConfNodeEditor, |
122 label=_('Sync managers:'), name='SyncManagersLabel', parent=self.EthercatNodeEditor, |
121 pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) |
123 pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) |
122 |
124 |
123 self.SyncManagersGrid = CustomGrid(id=ID_NODEEDITORSYNCMANAGERSGRID, |
125 self.SyncManagersGrid = CustomGrid(id=ID_NODEEDITORSYNCMANAGERSGRID, |
124 name='SyncManagersGrid', parent=self.ConfNodeEditor, pos=wx.Point(0, 0), |
126 name='SyncManagersGrid', parent=self.EthercatNodeEditor, pos=wx.Point(0, 0), |
125 size=wx.Size(0, 200), style=wx.VSCROLL) |
127 size=wx.Size(0, 200), style=wx.VSCROLL) |
126 |
128 |
127 self.VariablesLabel = wx.StaticText(id=ID_NODEEDITORVARIABLESLABEL, |
129 self.VariablesLabel = wx.StaticText(id=ID_NODEEDITORVARIABLESLABEL, |
128 label=_('Variable entries:'), name='VariablesLabel', parent=self.ConfNodeEditor, |
130 label=_('Variable entries:'), name='VariablesLabel', parent=self.EthercatNodeEditor, |
129 pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) |
131 pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) |
130 |
132 |
131 self.VariablesGrid = wx.gizmos.TreeListCtrl(id=ID_NODEEDITORVARIABLESGRID, |
133 self.VariablesGrid = wx.gizmos.TreeListCtrl(id=ID_NODEEDITORVARIABLESGRID, |
132 name='VariablesGrid', parent=self.ConfNodeEditor, pos=wx.Point(0, 0), |
134 name='VariablesGrid', parent=self.EthercatNodeEditor, pos=wx.Point(0, 0), |
133 size=wx.Size(0, 400), style=wx.TR_DEFAULT_STYLE | |
135 size=wx.Size(0, 400), style=wx.TR_DEFAULT_STYLE | |
134 wx.TR_ROW_LINES | |
136 wx.TR_ROW_LINES | |
135 wx.TR_COLUMN_LINES | |
137 wx.TR_COLUMN_LINES | |
136 wx.TR_HIDE_ROOT | |
138 wx.TR_HIDE_ROOT | |
137 wx.TR_FULL_ROW_HIGHLIGHT) |
139 wx.TR_FULL_ROW_HIGHLIGHT) |
138 self.VariablesGrid.GetMainWindow().Bind(wx.EVT_LEFT_DOWN, self.OnVariablesGridLeftClick) |
140 self.VariablesGrid.GetMainWindow().Bind(wx.EVT_LEFT_DOWN, self.OnVariablesGridLeftClick) |
139 |
141 |
140 self._init_sizers() |
142 self._init_sizers() |
|
143 |
|
144 return self.EthercatNodeEditor |
141 |
145 |
142 def __init__(self, parent, controler, window): |
146 def __init__(self, parent, controler, window): |
143 ConfTreeNodeEditor.__init__(self, parent, controler, window) |
147 ConfTreeNodeEditor.__init__(self, parent, controler, window) |
144 |
148 |
145 self.SyncManagersTable = SyncManagersTable(self, [], GetSyncManagersTableColnames()) |
149 self.SyncManagersTable = SyncManagersTable(self, [], GetSyncManagersTableColnames()) |