30 from controls import CustomGrid, CustomTable, DurationCellEditor |
30 from controls import CustomGrid, CustomTable, DurationCellEditor |
31 from dialogs.DurationEditorDialog import IEC_TIME_MODEL |
31 from dialogs.DurationEditorDialog import IEC_TIME_MODEL |
32 from EditorPanel import EditorPanel |
32 from EditorPanel import EditorPanel |
33 from util.BitmapLibrary import GetBitmap |
33 from util.BitmapLibrary import GetBitmap |
34 from plcopen.structures import LOCATIONDATATYPES, TestIdentifier, IEC_KEYWORDS, DefaultType |
34 from plcopen.structures import LOCATIONDATATYPES, TestIdentifier, IEC_KEYWORDS, DefaultType |
|
35 from util.TranslationCatalogs import NoTranslate |
35 #------------------------------------------------------------------------------- |
36 #------------------------------------------------------------------------------- |
36 # Configuration Editor class |
37 # Configuration Editor class |
37 #------------------------------------------------------------------------------- |
38 #------------------------------------------------------------------------------- |
38 |
39 |
39 [ID_CONFIGURATIONEDITOR, |
40 [ID_CONFIGURATIONEDITOR, |
63 #------------------------------------------------------------------------------- |
64 #------------------------------------------------------------------------------- |
64 # Resource Editor class |
65 # Resource Editor class |
65 #------------------------------------------------------------------------------- |
66 #------------------------------------------------------------------------------- |
66 |
67 |
67 def GetTasksTableColnames(): |
68 def GetTasksTableColnames(): |
68 _ = lambda x: x |
69 _ = NoTranslate |
69 return [_("Name"), _("Triggering"), _("Single"), _("Interval"), _("Priority")] |
70 return [_("Name"), _("Triggering"), _("Single"), _("Interval"), _("Priority")] |
70 |
71 |
71 |
72 |
72 def GetTaskTriggeringOptions(): |
73 def GetTaskTriggeringOptions(): |
73 _ = lambda x: x |
74 _ = NoTranslate |
74 return [_("Interrupt"), _("Cyclic")] |
75 return [_("Interrupt"), _("Cyclic")] |
75 |
76 |
76 |
77 |
77 TASKTRIGGERINGOPTIONS_DICT = dict([(_(option), option) for option in GetTaskTriggeringOptions()]) |
78 TASKTRIGGERINGOPTIONS_DICT = dict([(_(option), option) for option in GetTaskTriggeringOptions()]) |
78 |
79 |
79 SingleCellEditor = lambda *x: wx.grid.GridCellChoiceEditor() |
80 |
|
81 def SingleCellEditor(*x): |
|
82 return wx.grid.GridCellChoiceEditor() |
80 |
83 |
81 |
84 |
82 def CheckSingle(single, varlist): |
85 def CheckSingle(single, varlist): |
83 return single in varlist |
86 return single in varlist |
84 |
87 |
85 |
88 |
86 def GetInstancesTableColnames(): |
89 def GetInstancesTableColnames(): |
87 _ = lambda x: x |
90 _ = NoTranslate |
88 return [_("Name"), _("Type"), _("Task")] |
91 return [_("Name"), _("Type"), _("Task")] |
89 |
92 |
90 |
93 |
91 class ResourceTable(CustomTable): |
94 class ResourceTable(CustomTable): |
92 |
95 |