--- a/LPCManager.py Fri Jan 26 14:14:05 2018 +0100
+++ b/LPCManager.py Fri Jan 26 16:21:25 2018 +0100
@@ -192,81 +192,9 @@
from IDEFrame import IDEFrame
from dialogs import SearchInProjectDialog
from controls import TextCtrlAutoComplete
-from controls.LocationCellEditor import LocationCellControl, LocationCellEditor
-from dialogs.BrowseLocationsDialog import BrowseLocationsDialog
from py_ext import PythonFileCTNMixin
from plcopen.structures import TestIdentifier, IDENTIFIER_MODEL
-# start region // change name and location on selected variable
-def OnBrowseButtonClick(self, event):
- # pop up the location browser dialog
- dialog = BrowseLocationsDialog(self, self.VarType, self.Controller)
- if dialog.ShowModal() == wx.ID_OK:
- infos = dialog.GetValues()
- location = infos["location"]
- if not infos["location"].startswith("%"):
- dialog = wx.SingleChoiceDialog(self,
- _("Select a variable class:"), _("Variable class"),
- [_("Input"), _("Output"), _("Memory")],
- wx.DEFAULT_DIALOG_STYLE|wx.OK|wx.CANCEL)
- if dialog.ShowModal() == wx.ID_OK:
- selected = dialog.GetSelection()
- self.Location.SetFocus()
- location = "%I" + location
- location = "%Q" + location
- location = "%M" + location
- self.Location.SetValue(location)
- self.VariableName = infos["name"]
- self.VarType = infos["IEC_type"]
- self.Location.SetFocus()
- if hasattr(self, "VariableName"):
- self.tmpName = self.VariableName
- self.position = self.tmpName.find(": ")
- if self.position != -1:
- self.tmpName = self.tmpName[self.position:]
- self.tmpName = self.tmpName.replace(" ", "")
- if TestIdentifier(self.tmpName):
-LocationCellControl.OnBrowseButtonClick = OnBrowseButtonClick
-LocationCellControl.GetName = GetName
-def EndEditInternal(self, row, col, grid, old_loc):
- loc = self.CellControl.GetValue()
- changed = loc != old_loc
- name = self.CellControl.GetName()
- self.Table.SetValueByName(row, 'Name', name)
- self.Table.SetValueByName(row, 'Location', loc)
- self.Table.SetValueByName(row, 'Type', self.CellControl.GetVarType())
- self.CellControl.Disable()
-LocationCellEditor.EndEditInternal = EndEditInternal
def CTNGenerate_C(self, buildpath, locations):
# location string for that CTN
location_str = "_".join(map(lambda x: str(x),