12 from datetime import datetime |
12 from datetime import datetime |
13 from weakref import WeakKeyDictionary |
13 from weakref import WeakKeyDictionary |
14 |
14 |
15 import targets |
15 import targets |
16 import connectors |
16 import connectors |
17 from util.misc import CheckPathPerm, GetClassImporter, IECCodeViewer |
17 from util.misc import CheckPathPerm, GetClassImporter |
18 from util.MiniTextControler import MiniTextControler |
18 from util.MiniTextControler import MiniTextControler |
19 from util.ProcessLogger import ProcessLogger |
19 from util.ProcessLogger import ProcessLogger |
20 from util.FileManagementPanel import FileManagementPanel |
20 from util.BitmapLibrary import GetBitmap |
|
21 from editors.FileManagementPanel import FileManagementPanel |
|
22 from editors.ProjectNodeEditor import ProjectNodeEditor |
|
23 from editors.IECCodeViewer import IECCodeViewer |
|
24 from dialogs import DiscoveryDialog |
21 from PLCControler import PLCControler |
25 from PLCControler import PLCControler |
22 from TextViewer import TextViewer |
|
23 from plcopen.structures import IEC_KEYWORDS |
26 from plcopen.structures import IEC_KEYWORDS |
24 from targets.typemapping import DebugTypesSize |
27 from targets.typemapping import DebugTypesSize |
25 from util.discovery import DiscoveryDialog |
|
26 from ConfigTreeNode import ConfigTreeNode |
28 from ConfigTreeNode import ConfigTreeNode |
27 from ProjectNodeEditor import ProjectNodeEditor |
|
28 from utils.BitmapLibrary import GetBitmap |
|
29 |
29 |
30 base_folder = os.path.split(sys.path[0])[0] |
30 base_folder = os.path.split(sys.path[0])[0] |
31 |
31 |
32 MATIEC_ERROR_MODEL = re.compile(".*\.st:(\d+)-(\d+)\.\.(\d+)-(\d+): error : (.*)$") |
32 MATIEC_ERROR_MODEL = re.compile(".*\.st:(\d+)-(\d+)\.\.(\d+)-(\d+): (?:error)|(?:warning) : (.*)$") |
33 |
33 |
34 DEBUG_RETRIES_WARN = 3 |
34 DEBUG_RETRIES_WARN = 3 |
35 DEBUG_RETRIES_REREGISTER = 4 |
35 DEBUG_RETRIES_REREGISTER = 4 |
36 |
36 |
37 ITEM_CONFNODE = 25 |
37 ITEM_CONFNODE = 25 |
935 def _editIECrawcode(self): |
935 def _editIECrawcode(self): |
936 self._OpenView("IEC raw code") |
936 self._OpenView("IEC raw code") |
937 |
937 |
938 _ProjectFilesView = None |
938 _ProjectFilesView = None |
939 def _OpenProjectFiles(self): |
939 def _OpenProjectFiles(self): |
940 self._OpenView("Project files") |
940 self._OpenView("Project Files") |
941 |
941 |
942 _FileEditors = {} |
942 _FileEditors = {} |
943 def _OpenFileEditor(self, filepath): |
943 def _OpenFileEditor(self, filepath): |
944 self._OpenView(filepath) |
944 self._OpenView(filepath) |
945 |
945 |
978 if self._IECRawCodeView is not None: |
978 if self._IECRawCodeView is not None: |
979 self.AppFrame.EditProjectElement(self._IECRawCodeView, name) |
979 self.AppFrame.EditProjectElement(self._IECRawCodeView, name) |
980 |
980 |
981 return self._IECRawCodeView |
981 return self._IECRawCodeView |
982 |
982 |
983 elif name == "Project files": |
983 elif name == "Project Files": |
984 if self._ProjectFilesView is None: |
984 if self._ProjectFilesView is None: |
985 self._ProjectFilesView = FileManagementPanel(self.AppFrame.TabsOpened, self, name, self._getProjectFilesPath(), True) |
985 self._ProjectFilesView = FileManagementPanel(self.AppFrame.TabsOpened, self, name, self._getProjectFilesPath(), True) |
986 |
986 |
987 extensions = [] |
987 extensions = [] |
988 for extension, name, editor in features.file_editors: |
988 for extension, name, editor in features.file_editors: |