--- a/.hgignore Thu Sep 16 09:40:36 2021 +0200
+++ b/.hgignore Fri Oct 01 17:44:52 2021 +0200
@@ -9,6 +9,7 @@
syntax: regexp
^tests/.*/build$
+^exemples/.*/build$
^.idea/.*
syntax: regexp
^.*\.pyc$
--- a/BeremizIDE.py Thu Sep 16 09:40:36 2021 +0200
+++ b/BeremizIDE.py Fri Oct 01 17:44:52 2021 +0200
@@ -92,7 +92,7 @@
return os.path.join(beremiz_dir, *args)
def AppendMenu(parent, help, id, kind, text):
- return parent.Append(help=help, id=id, kind=kind, text=text)
+ return parent.Append(wx.MenuItem(helpString=help, id=id, kind=kind, text=text))
MAX_RECENT_PROJECTS = 9
@@ -179,7 +179,7 @@
if style is None:
style = self.black_white
if style != self.black_white:
- self.output.StartStyling(self.output.GetLength(), 0xff)
+ self.output.StartStyling(self.output.GetLength())
# Temporary deactivate read only mode on StyledTextCtrl for
# adding text. It seems that text modifications, even
@@ -241,6 +241,7 @@
def _init_utils(self):
self.ConfNodeMenu = wx.Menu(title='')
self.RecentProjectsMenu = wx.Menu(title='')
+ self.TutorialsProjectsMenu = wx.Menu(title='')
IDEFrame._init_utils(self)
@@ -249,7 +250,29 @@
kind=wx.ITEM_NORMAL, text=_(u'New') + '\tCTRL+N')
AppendMenu(parent, help='', id=wx.ID_OPEN,
kind=wx.ITEM_NORMAL, text=_(u'Open') + '\tCTRL+O')
- parent.AppendMenu(ID_FILEMENURECENTPROJECTS, _("&Recent Projects"), self.RecentProjectsMenu)
+ parent.Append(ID_FILEMENURECENTPROJECTS, _("&Recent Projects"), self.RecentProjectsMenu)
+ parent.AppendSeparator()
+ parent.Append(wx.ID_ANY, _("&Tutorials and Examples"), self.TutorialsProjectsMenu)
+
+ exemples_dir = Bpath("exemples")
+ project_list = sorted(os.listdir(exemples_dir))
+
+ for idx, dirname in enumerate(project_list):
+ text = u'&%d: %s' % (idx + 1, dirname)
+
+ item = self.TutorialsProjectsMenu.Append(wx.ID_ANY, text, '')
+
+ projectpath = os.path.join(exemples_dir, dirname)
+
+ def OpenExemple(event):
+ if self.CTR is not None and not self.CheckSaveBeforeClosing():
+ return
+
+ self.OpenProject(projectpath)
+ if not self.CTR.CheckProjectPathPerm():
+ self.ResetView()
+
+ self.Bind(wx.EVT_MENU, OpenExemple, item)
parent.AppendSeparator()
AppendMenu(parent, help='', id=wx.ID_SAVE,
kind=wx.ITEM_NORMAL, text=_(u'Save') + '\tCTRL+S')
@@ -291,10 +314,10 @@
for name, text, helpstr, children in items:
if len(children) > 0:
new_menu = wx.Menu(title='')
- menu.AppendMenu(wx.ID_ANY, text, new_menu)
+ menu.AppendSubMenu(new_menu, text)
self._RecursiveAddMenuItems(new_menu, children)
else:
- item = menu.Append(wx.ID_ANY, text, helpstr)
+ item = menu.Append(wx.MenuItem(text=text, helpString=helpstr))
self.Bind(wx.EVT_MENU, self.GetAddConfNodeFunction(name), item)
def _init_coll_AddMenu_Items(self, parent):
@@ -311,16 +334,16 @@
item = parent.Append(wx.ID_ANY, _(u'Community support'), '')
self.Bind(wx.EVT_MENU, handler, item)
- parent.Append(help='', id=wx.ID_ABOUT,
- kind=wx.ITEM_NORMAL, text=_(u'About'))
+ parent.Append(wx.MenuItem(helpString='', id=wx.ID_ABOUT,
+ kind=wx.ITEM_NORMAL, text=_(u'About')))
self.Bind(wx.EVT_MENU, self.OnAboutMenu, id=wx.ID_ABOUT)
def _init_coll_ConnectionStatusBar_Fields(self, parent):
parent.SetFieldsCount(3)
- parent.SetStatusText(number=0, text='')
- parent.SetStatusText(number=1, text='')
- parent.SetStatusText(number=2, text='')
+ parent.SetStatusText(i=0, text='')
+ parent.SetStatusText(i=1, text='')
+ parent.SetStatusText(i=2, text='')
parent.SetStatusWidths([-1, 300, 200])
@@ -397,7 +420,7 @@
self.AUIManager.Update()
- self.ConnectionStatusBar = esb.EnhancedStatusBar(self, style=wx.ST_SIZEGRIP)
+ self.ConnectionStatusBar = esb.EnhancedStatusBar(self, style=wx.STB_SIZEGRIP)
self._init_coll_ConnectionStatusBar_Fields(self.ConnectionStatusBar)
self.ProgressStatusBar = wx.Gauge(self.ConnectionStatusBar, -1, range=100)
self.ConnectionStatusBar.AddWidget(self.ProgressStatusBar, esb.ESB_EXACT_FIT, esb.ESB_EXACT_FIT, 2)
@@ -474,8 +497,6 @@
if self.EnableDebug:
self.DebugVariablePanel.SetDataProducer(self.CTR)
- self.Bind(wx.EVT_CLOSE, self.OnCloseFrame)
-
self._Refresh(TITLE, EDITORTOOLBAR, FILEMENU, EDITMENU, DISPLAYMENU)
self.RefreshAll()
self.LogConsole.SetFocus()
@@ -625,6 +646,7 @@
if self.CTR is None or self.CheckSaveBeforeClosing(_("Close Application")):
if self.CTR is not None:
self.CTR.KillDebugThread()
+ self.CTR._Disconnect()
self.KillLocalRuntime()
self.SaveLastState()
@@ -639,6 +661,7 @@
def OnCloseFrame(self, event):
if self.TryCloseFrame():
self.LogConsole.Disconnect(-1, -1, wx.wxEVT_KILL_FOCUS)
+ super(Beremiz, self).OnCloseFrame(event)
event.Skip()
else:
# prevent event to continue, i.e. cancel closing
@@ -699,7 +722,7 @@
while self.RecentProjectsMenu.GetMenuItemCount() > 0:
item = self.RecentProjectsMenu.FindItemByPosition(0)
- self.RecentProjectsMenu.RemoveItem(item)
+ self.RecentProjectsMenu.Remove(item)
self.FileMenu.Enable(ID_FILEMENURECENTPROJECTS, len(recent_projects) > 0)
for idx, projectpath in enumerate(recent_projects):
@@ -746,9 +769,9 @@
for confnode_method in self.CTR.StatusMethods:
if "method" in confnode_method and confnode_method.get("shown", True):
- tool = StatusToolBar.AddSimpleTool(
- wx.ID_ANY, GetBitmap(confnode_method.get("bitmap", "Unknown")),
- confnode_method["tooltip"])
+ tool = StatusToolBar.AddTool(
+ wx.ID_ANY, confnode_method["tooltip"],
+ GetBitmap(confnode_method.get("bitmap", "Unknown")))
self.Bind(wx.EVT_MENU, self.GetMenuCallBackFunction(confnode_method["method"]), tool)
StatusToolBar.Realize()
@@ -798,7 +821,7 @@
else:
self.EditMenu.Delete(item.GetId())
self.LastPanelSelected = None
- self.MenuBar.UpdateMenus()
+ self.MenuBar.Refresh()
def RefreshAll(self):
self.RefreshStatusToolBar()
--- a/Beremiz_service.py Thu Sep 16 09:40:36 2021 +0200
+++ b/Beremiz_service.py Fri Oct 01 17:44:52 2021 +0200
@@ -224,6 +224,7 @@
if havewx:
import re
+ import wx.adv
if wx.VERSION >= (3, 0, 0):
app = wx.App(redirect=False)
@@ -265,7 +266,7 @@
def SetTests(self, tests):
self.Tests = tests
- class BeremizTaskBarIcon(wx.TaskBarIcon):
+ class BeremizTaskBarIcon(wx.adv.TaskBarIcon):
TBMENU_START = wx.NewId()
TBMENU_STOP = wx.NewId()
TBMENU_CHANGE_NAME = wx.NewId()
@@ -277,7 +278,7 @@
TBMENU_QUIT = wx.NewId()
def __init__(self, pyroserver):
- wx.TaskBarIcon.__init__(self)
+ wx.adv.TaskBarIcon.__init__(self)
self.pyroserver = pyroserver
# Set the image
self.UpdateIcon(None)
@@ -325,7 +326,7 @@
elif "wxGTK" in wx.PlatformInfo:
img = img.Scale(22, 22)
# wxMac can be any size upto 128x128, so leave the source img alone....
- icon = wx.IconFromBitmap(img.ConvertToBitmap())
+ icon = wx.Icon(img.ConvertToBitmap())
return icon
def OnTaskBarStartPLC(self, evt):
--- a/ConfigTreeNode.py Thu Sep 16 09:40:36 2021 +0200
+++ b/ConfigTreeNode.py Fri Oct 01 17:44:52 2021 +0200
@@ -194,7 +194,7 @@
os.mkdir(self.CTNPath())
def CTNRequestSave(self, from_project_path=None):
- if self.GetCTRoot().CheckProjectPathPerm(False):
+ if self.GetCTRoot().CheckProjectPathPerm():
# If confnode do not have corresponding directory
ctnpath = self.CTNPath()
if not os.path.isdir(ctnpath):
--- a/IDEFrame.py Thu Sep 16 09:40:36 2021 +0200
+++ b/IDEFrame.py Fri Oct 01 17:44:52 2021 +0200
@@ -115,7 +115,7 @@
def AppendMenu(parent, help, kind, text, id=wx.ID_ANY):
- return parent.Append(help=help, kind=kind, text=text, id=id)
+ return parent.Append(wx.MenuItem(helpString=help, kind=kind, text=text, id=id))
[
@@ -391,7 +391,7 @@
parent.AppendSeparator()
add_menu = wx.Menu(title='')
self._init_coll_AddMenu_Items(add_menu)
- parent.AppendMenu(wx.ID_ADD, _(u"&Add Element"), add_menu)
+ parent.Append(wx.ID_ADD, _(u"&Add Element"), add_menu)
AppendMenu(parent, help='', id=wx.ID_SELECTALL,
kind=wx.ITEM_NORMAL, text=_(u'Select All') + '\tCTRL+A')
AppendMenu(parent, help='', id=wx.ID_DELETE,
@@ -442,7 +442,7 @@
kind=wx.ITEM_NORMAL, text=_(u'Clear Errors') + '\tCTRL+K')
parent.AppendSeparator()
zoommenu = wx.Menu(title='')
- parent.AppendMenu(wx.ID_ZOOM_FIT, _("Zoom"), zoommenu)
+ parent.Append(wx.ID_ZOOM_FIT, _("Zoom"), zoommenu)
for idx, value in enumerate(ZOOM_FACTORS):
new_item = AppendMenu(zoommenu, help='',
kind=wx.ITEM_RADIO, text=str(int(round(value * 100))) + "%")
@@ -569,8 +569,8 @@
self.ProjectPanel = wx.SplitterWindow(
id=ID_PLCOPENEDITORPROJECTPANEL,
- name='ProjectPanel', parent=self.LeftNoteBook, point=wx.Point(0, 0),
- size=wx.Size(0, 0), style=wx.SP_3D)
+ name='ProjectPanel', parent=self.LeftNoteBook,
+ size=wx.Size(0, 0))
self.ProjectTree = CustomTree(id=ID_PLCOPENEDITORPROJECTTREE,
name='ProjectTree',
@@ -631,9 +631,9 @@
wx.TB_FLAT | wx.TB_NODIVIDER | wx.NO_BORDER)
EditorToolBar.SetToolBitmapSize(wx.Size(25, 25))
EditorToolBar.AddRadioTool(ID_PLCOPENEDITOREDITORTOOLBARSELECTION,
+ _("Select an object"),
GetBitmap("select"),
- wx.NullBitmap,
- _("Select an object"))
+ wx.NullBitmap)
EditorToolBar.Realize()
self.Panes["EditorToolBar"] = EditorToolBar
self.AUIManager.AddPane(EditorToolBar, wx.aui.AuiPaneInfo().
@@ -759,6 +759,8 @@
self.SetRefreshFunctions()
self.SetDeleteFunctions()
+ self.Bind(wx.EVT_CLOSE, self.OnCloseFrame)
+
wx.CallAfter(self.InitFindDialog)
def __del__(self):
@@ -919,12 +921,8 @@
:param elements: List of elements to refresh.
"""
- try:
- for element in elements:
- self.RefreshFunctions[element]()
- except wx.PyDeadObjectError:
- # ignore exceptions caused by refresh while quitting
- pass
+ for element in elements:
+ self.RefreshFunctions[element]()
def OnPageClose(self, event):
"""Callback function when AUINotebook Page closed with CloseButton
@@ -1154,6 +1152,9 @@
def OnQuitMenu(self, event):
self.Close()
+ def OnCloseFrame(self, event):
+ self.AUIManager.UnInit()
+
# -------------------------------------------------------------------------------
# Edit Menu Functions
# -------------------------------------------------------------------------------
@@ -1413,7 +1414,8 @@
self.AuiTabCtrl = auitabctrl
if self.TabsOpened.GetPageCount() == 0:
pane = self.AUIManager.GetPane(self.TabsOpened)
- if pane.IsMaximized():
+ # on wxPython 4.1.0, AuiPaneInfo has no "IsMaximized" attribute...
+ if (not hasattr(pane, "IsMaximized")) or pane.IsMaximized():
self.AUIManager.RestorePane(pane)
self.AUIManager.Update()
@@ -1501,7 +1503,8 @@
def SwitchPerspective(self, evt):
pane = self.AUIManager.GetPane(self.TabsOpened)
- if pane.IsMaximized():
+ # on wxPython 4.1.0, AuiPaneInfo has no "IsMaximized" attribute...
+ if (not hasattr(pane, "IsMaximized")) or pane.IsMaximized():
self.AUIManager.RestorePane(pane)
else:
self.AUIManager.MaximizePane(pane)
@@ -1803,7 +1806,7 @@
else:
block_type = "Action"
self.LastToolTipItem = item
- wx.CallAfter(self.ProjectTree.SetToolTipString,
+ wx.CallAfter(self.ProjectTree.SetToolTip,
"%s : %s : %s" % (
block_type, bodytype, item_infos["name"]))
elif self.LastToolTipItem is not None:
@@ -2113,7 +2116,7 @@
MenuToolBar.AddSeparator()
else:
id, bitmap, help, callback = toolbar_item
- MenuToolBar.AddSimpleTool(id=id, shortHelpString=help, bitmap=GetBitmap(bitmap))
+ MenuToolBar.AddTool(id, help, GetBitmap(bitmap))
if callback is not None:
self.Bind(wx.EVT_TOOL, callback, id=id)
MenuToolBar.Realize()
@@ -2153,9 +2156,9 @@
for radio, modes, id, method, picture, help in self.EditorToolBarItems[menu]:
if modes & self.DrawingMode:
if radio or self.DrawingMode == FREEDRAWING_MODE:
- EditorToolBar.AddRadioTool(id, GetBitmap(picture), wx.NullBitmap, help)
+ EditorToolBar.AddRadioTool(id, help, GetBitmap(picture), wx.NullBitmap)
else:
- EditorToolBar.AddSimpleTool(id, GetBitmap(picture), help)
+ EditorToolBar.AddTool(id, help, GetBitmap(picture))
self.Bind(wx.EVT_MENU, getattr(self, method), id=id)
self.CurrentEditorToolBar.append(id)
EditorToolBar.Realize()
--- a/ProjectController.py Thu Sep 16 09:40:36 2021 +0200
+++ b/ProjectController.py Fri Oct 01 17:44:52 2021 +0200
@@ -402,7 +402,7 @@
return res
# helper func to check project path write permission
- def CheckProjectPathPerm(self, dosave=True):
+ def CheckProjectPathPerm(self):
if CheckPathPerm(self.ProjectPath):
return True
if self.AppFrame is not None:
@@ -577,7 +577,7 @@
return True
def SaveProject(self, from_project_path=None):
- if self.CheckProjectPathPerm(False):
+ if self.CheckProjectPathPerm():
if from_project_path is not None:
old_projectfiles_path = self._getProjectFilesPath(
from_project_path)
--- a/bacnet/BacnetSlaveEditor.py Thu Sep 16 09:40:36 2021 +0200
+++ b/bacnet/BacnetSlaveEditor.py Fri Oct 01 17:44:52 2021 +0200
@@ -367,8 +367,7 @@
"Engineering Units": {"GridCellEditor": wx.grid.GridCellChoiceEditor,
# use string renderer with choice editor!
"GridCellRenderer": wx.grid.GridCellStringRenderer,
- # syntax for GridCellChoiceEditor -> comma separated values
- "GridCellEditorParam": ','.join([x[0] for x in BACnetEngineeringUnits])}
+ "GridCellEditorConstructorArgs": [x[0] for x in BACnetEngineeringUnits]}
}
# obj_properties should be a dictionary, with keys "Object Identifier",
@@ -576,7 +575,10 @@
PropertyName = self.BACnetObjectType.PropertyNames[col]
PropertyConfig = self.BACnetObjectType.PropertyConfig[PropertyName]
grid.SetReadOnly(row, col, False)
- grid.SetCellEditor(row, col, PropertyConfig["GridCellEditor"]())
+ GridCellEditorConstructorArgs = \
+ PropertyConfig["GridCellEditorConstructorArgs"]
+ if "GridCellEditorConstructorArgs" in PropertyConfig else []
+ grid.SetCellEditor(row, col, PropertyConfig["GridCellEditor"](*GridCellEditorConstructorArgs))
grid.SetCellRenderer(row, col, PropertyConfig["GridCellRenderer"]())
grid.SetCellBackgroundColour(row, col, wx.WHITE)
grid.SetCellTextColour(row, col, wx.BLACK)
@@ -816,7 +818,7 @@
self, bitmap=GetBitmap(bitmap),
size=wx.Size(28, 28),
style=wx.NO_BORDER)
- button.SetToolTipString(help)
+ button.SetToolTip(help)
setattr(self, name, button)
controls_sizer.Add(button)
@@ -826,7 +828,7 @@
# use only to enable drag'n'drop
# self.VariablesGrid.SetDropTarget(VariableDropTarget(self))
self.VariablesGrid.Bind(
- wx.grid.EVT_GRID_CELL_CHANGE, self.OnVariablesGridCellChange)
+ wx.grid.EVT_GRID_CELL_CHANGING, self.OnVariablesGridCellChange)
# self.VariablesGrid.Bind(wx.grid.EVT_GRID_CELL_LEFT_CLICK, self.OnVariablesGridCellLeftClick)
# self.VariablesGrid.Bind(wx.grid.EVT_GRID_EDITOR_SHOWN, self.OnVariablesGridEditorShown)
self.MainSizer.Add(self.VariablesGrid, flag=wx.GROW)
--- a/canfestival/NetworkEditor.py Thu Sep 16 09:40:36 2021 +0200
+++ b/canfestival/NetworkEditor.py Fri Oct 01 17:44:52 2021 +0200
@@ -68,7 +68,7 @@
main_sizer.AddGrowableCol(0)
main_sizer.AddGrowableRow(0)
- main_sizer.AddWindow(self.NetworkNodes, 0, border=5, flag=wx.GROW | wx.ALL)
+ main_sizer.Add(self.NetworkNodes, 0, border=5, flag=wx.GROW | wx.ALL)
self.NetworkEditor.SetSizer(main_sizer)
--- a/connectors/SchemeEditor.py Thu Sep 16 09:40:36 2021 +0200
+++ b/connectors/SchemeEditor.py Fri Oct 01 17:44:52 2021 +0200
@@ -28,19 +28,19 @@
(wx.StaticText(self, label=label),
wx.ALIGN_CENTER_VERTICAL),
(txtctrl, wx.GROW)]:
- self.fieldsizer.AddWindow(win, flag=flag)
+ self.fieldsizer.Add(win, flag=flag)
self.fieldsizer.AddSpacer(20)
if self.EnableIDSelector:
self.mainsizer = wx.FlexGridSizer(cols=2, hgap=10, vgap=10)
- self.mainsizer.AddSizer(self.fieldsizer)
+ self.mainsizer.Add(self.fieldsizer)
self.idselector = IDBrowser(
self, parent.ctr,
# use a callafter, as editor can be deleted by calling SetURI
partial(wx.CallAfter, parent.SetURI),
self.txtctrls["ID"].SetValue)
- self.mainsizer.AddWindow(self.idselector)
+ self.mainsizer.Add(self.idselector)
self.SetSizer(self.mainsizer)
else:
self.SetSizer(self.fieldsizer)
--- a/controls/CustomEditableListBox.py Thu Sep 16 09:40:36 2021 +0200
+++ b/controls/CustomEditableListBox.py Fri Oct 01 17:44:52 2021 +0200
@@ -25,13 +25,13 @@
from __future__ import absolute_import
import wx
-import wx.gizmos
+import wx.adv
-class CustomEditableListBox(wx.gizmos.EditableListBox):
+class CustomEditableListBox(wx.adv.EditableListBox):
def __init__(self, *args, **kwargs):
- wx.gizmos.EditableListBox.__init__(self, *args, **kwargs)
+ wx.adv.EditableListBox.__init__(self, *args, **kwargs)
listbox = self.GetListCtrl()
listbox.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
@@ -44,7 +44,7 @@
(self.GetDelButton(), _("Delete item"), "_OnDelButton"),
(self.GetUpButton(), _("Move up"), "_OnUpButton"),
(self.GetDownButton(), _("Move down"), "_OnDownButton")]:
- button.SetToolTipString(tooltip)
+ button.SetToolTip(tooltip)
button.Bind(wx.EVT_BUTTON, self.GetButtonPressedFunction(call_function))
self.Editing = False
--- a/controls/CustomStyledTextCtrl.py Thu Sep 16 09:40:36 2021 +0200
+++ b/controls/CustomStyledTextCtrl.py Fri Oct 01 17:44:52 2021 +0200
@@ -105,9 +105,9 @@
[self.GetMarginWidth(i) for i in xrange(3)],
0)
if x <= margin_width:
- self.SetCursor(wx.StockCursor(wx.CURSOR_ARROW))
+ self.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
else:
- self.SetCursor(wx.StockCursor(wx.CURSOR_IBEAM))
+ self.SetCursor(wx.Cursor(wx.CURSOR_IBEAM))
else:
event.Skip()
else:
--- a/controls/CustomTable.py Thu Sep 16 09:40:36 2021 +0200
+++ b/controls/CustomTable.py Fri Oct 01 17:44:52 2021 +0200
@@ -40,7 +40,7 @@
"""
def __init__(self, parent, data, colnames):
# The base class must be initialized *first*
- wx.grid.PyGridTableBase.__init__(self)
+ wx.grid.GridTableBase.__init__(self)
self.data = data
self.colnames = colnames
self.Highlights = {}
@@ -64,7 +64,7 @@
return self.colnames[col]
def GetRowLabelValue(self, row, translate=True):
- return row
+ return str(row)
def GetValue(self, row, col):
if row < self.GetNumberRows():
--- a/controls/CustomToolTip.py Thu Sep 16 09:40:36 2021 +0200
+++ b/controls/CustomToolTip.py Fri Oct 01 17:44:52 2021 +0200
@@ -137,7 +137,7 @@
max_width = max_height = 0
# Create a memory DC for calculating text extent
- dc = wx.MemoryDC(wx.EmptyBitmap(1, 1))
+ dc = wx.MemoryDC(wx.Bitmap(1, 1))
dc.SetFont(self.Font)
# Compute max tip text size
@@ -175,7 +175,6 @@
dc.SetFont(self.Font)
# Draw Tool tip
- dc.BeginDrawing()
tip_width, tip_height = self.GetToolTipSize()
# Draw background rectangle
@@ -188,6 +187,5 @@
_line_width, line_height = dc.GetTextExtent(line)
line_offset += line_height
- dc.EndDrawing()
event.Skip()
--- a/controls/CustomTree.py Thu Sep 16 09:40:36 2021 +0200
+++ b/controls/CustomTree.py Fri Oct 01 17:44:52 2021 +0200
@@ -120,9 +120,9 @@
_item, flags = self.HitTest(pos)
bitmap_rect = self.GetBitmapRect()
- if ((bitmap_rect.InsideXY(pos.x, pos.y) or
+ if ((bitmap_rect.Contains(pos.x, pos.y) or
flags & wx.TREE_HITTEST_NOWHERE) and self.AddMenu is not None):
- wx.CallAfter(self.PopupMenuXY, self.AddMenu, pos.x, pos.y)
+ wx.CallAfter(self.PopupMenu, self.AddMenu, pos.x, pos.y)
event.Skip()
def OnEraseBackground(self, event):
--- a/controls/DebugVariablePanel/DebugVariableGraphicViewer.py Thu Sep 16 09:40:36 2021 +0200
+++ b/controls/DebugVariablePanel/DebugVariableGraphicViewer.py Fri Oct 01 17:44:52 2021 +0200
@@ -174,7 +174,7 @@
# If mouse is dropped in graph canvas bounding box and graph is
# not 3D canvas, graphs will be merged
rect = self.ParentControl.GetAxesBoundingBox()
- if not self.ParentControl.Is3DCanvas() and rect.InsideXY(x, y):
+ if not self.ParentControl.Is3DCanvas() and rect.Contains(x, y):
# Default merge type is parallel
merge_type = GRAPH_PARALLEL
@@ -182,7 +182,7 @@
# wall be merged orthogonally
merge_rect = wx.Rect(rect.x, rect.y,
rect.width / 2., rect.height)
- if merge_rect.InsideXY(x, y):
+ if merge_rect.Contains(x, y):
merge_type = GRAPH_ORTHOGONAL
# Merge graphs
@@ -625,7 +625,7 @@
(x0, y0), (x1, y1) = t.get_window_extent().get_points()
rect = wx.Rect(x0, height - y1, x1 - x0, y1 - y0)
# Check if mouse was over label
- if rect.InsideXY(x, y):
+ if rect.Contains(x, y):
item_idx = i
break
@@ -736,7 +736,7 @@
(x0, y0), (x1, y1) = t.get_window_extent().get_points()
rect = wx.Rect(x0, height - y1, x1 - x0, y1 - y0)
# Check if mouse was over label
- if rect.InsideXY(event.x, height - event.y):
+ if rect.Contains(event.x, height - event.y):
item_idx = i
menu_direction = dir
break
@@ -756,7 +756,7 @@
# Update resize highlight
if event.y <= 5:
if self.SetHighlight(HIGHLIGHT_RESIZE):
- self.SetCursor(wx.StockCursor(wx.CURSOR_SIZENS))
+ self.SetCursor(wx.Cursor(wx.CURSOR_SIZENS))
self.ParentWindow.ForceRefresh()
else:
if self.SetHighlight(HIGHLIGHT_NONE):
@@ -832,7 +832,7 @@
# Check that double click was done inside figure
pos = event.GetPosition()
rect = self.GetAxesBoundingBox()
- if rect.InsideXY(pos.x, pos.y):
+ if rect.Contains(pos.x, pos.y):
# Reset Cursor tick to value before starting clicking
self.ParentWindow.SetCursorTick(self.StartCursorTick)
# Toggle to text Viewer(s)
@@ -926,10 +926,10 @@
# Mouse is over Viewer figure and graph is not 3D
bbox = self.GetAxesBoundingBox()
- if bbox.InsideXY(x, y) and not self.Is3DCanvas():
+ if bbox.Contains(x, y) and not self.Is3DCanvas():
rect = wx.Rect(bbox.x, bbox.y, bbox.width // 2, bbox.height)
# Mouse is over Viewer left part of figure
- if rect.InsideXY(x, y):
+ if rect.Contains(x, y):
self.SetHighlight(HIGHLIGHT_LEFT)
# Mouse is over Viewer right part of figure
@@ -1381,8 +1381,6 @@
# rendering
destGC = wx.GCDC(destDC)
- destGC.BeginDrawing()
-
# Get canvas size and figure bounding box in canvas
width, height = self.GetSize()
bbox = self.GetAxesBoundingBox()
@@ -1409,7 +1407,5 @@
# Draw other Viewer common elements
self.DrawCommonElements(destGC, self.GetButtons())
- destGC.EndDrawing()
-
self._isDrawn = True
self.gui_repaint(drawDC=drawDC)
--- a/controls/DebugVariablePanel/DebugVariablePanel.py Thu Sep 16 09:40:36 2021 +0200
+++ b/controls/DebugVariablePanel/DebugVariablePanel.py Fri Oct 01 17:44:52 2021 +0200
@@ -221,14 +221,14 @@
self.GraphicPanels = []
graphics_button_sizer = wx.BoxSizer(wx.HORIZONTAL)
- main_sizer.AddSizer(graphics_button_sizer, border=5, flag=wx.GROW | wx.ALL)
+ main_sizer.Add(graphics_button_sizer, border=5, flag=wx.GROW | wx.ALL)
range_label = wx.StaticText(self, label=_('Range:'))
- graphics_button_sizer.AddWindow(range_label, flag=wx.ALIGN_CENTER_VERTICAL)
+ graphics_button_sizer.Add(range_label, flag=wx.ALIGN_CENTER_VERTICAL)
self.CanvasRange = wx.ComboBox(self, style=wx.CB_READONLY)
self.Bind(wx.EVT_COMBOBOX, self.OnRangeChanged, self.CanvasRange)
- graphics_button_sizer.AddWindow(self.CanvasRange, 1,
+ graphics_button_sizer.Add(self.CanvasRange, 1,
border=5,
flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL)
@@ -246,10 +246,10 @@
button = wx.lib.buttons.GenBitmapButton(
self, bitmap=GetBitmap(bitmap),
size=wx.Size(28, 28), style=wx.NO_BORDER)
- button.SetToolTipString(help)
+ button.SetToolTip(help)
setattr(self, name, button)
self.Bind(wx.EVT_BUTTON, getattr(self, "On" + name), button)
- graphics_button_sizer.AddWindow(button, border=5, flag=wx.LEFT)
+ graphics_button_sizer.Add(button, border=5, flag=wx.LEFT)
self.CanvasPosition = wx.ScrollBar(
self, size=wx.Size(0, 16), style=wx.SB_HORIZONTAL)
@@ -263,19 +263,19 @@
self.OnPositionChanging, self.CanvasPosition)
self.CanvasPosition.Bind(wx.EVT_SCROLL_PAGEDOWN,
self.OnPositionChanging, self.CanvasPosition)
- main_sizer.AddWindow(self.CanvasPosition, border=5, flag=wx.GROW | wx.LEFT | wx.RIGHT | wx.BOTTOM)
+ main_sizer.Add(self.CanvasPosition, border=5, flag=wx.GROW | wx.LEFT | wx.RIGHT | wx.BOTTOM)
self.TickSizer = wx.BoxSizer(wx.HORIZONTAL)
- main_sizer.AddSizer(self.TickSizer, border=5, flag=wx.ALL | wx.GROW)
+ main_sizer.Add(self.TickSizer, border=5, flag=wx.ALL | wx.GROW)
self.TickLabel = wx.StaticText(self)
- self.TickSizer.AddWindow(self.TickLabel, border=5, flag=wx.RIGHT)
+ self.TickSizer.Add(self.TickLabel, border=5, flag=wx.RIGHT)
self.MaskLabel = wx.TextCtrl(self, style=wx.TE_READONLY | wx.TE_CENTER | wx.NO_BORDER)
- self.TickSizer.AddWindow(self.MaskLabel, 1, border=5, flag=wx.RIGHT | wx.GROW)
+ self.TickSizer.Add(self.MaskLabel, 1, border=5, flag=wx.RIGHT | wx.GROW)
self.TickTimeLabel = wx.StaticText(self)
- self.TickSizer.AddWindow(self.TickTimeLabel)
+ self.TickSizer.Add(self.TickTimeLabel)
self.GraphicsWindow = wx.ScrolledWindow(self, style=wx.HSCROLL | wx.VSCROLL)
self.GraphicsWindow.SetBackgroundColour(wx.WHITE)
@@ -284,7 +284,7 @@
self.GraphicsWindow.Bind(wx.EVT_SIZE, self.OnGraphicsWindowResize)
self.GraphicsWindow.Bind(wx.EVT_MOUSEWHEEL, self.OnGraphicsWindowMouseWheel)
- main_sizer.AddWindow(self.GraphicsWindow, 1, flag=wx.GROW)
+ main_sizer.Add(self.GraphicsWindow, 1, flag=wx.GROW)
self.GraphicsSizer = wx.BoxSizer(wx.VERTICAL)
self.GraphicsWindow.SetSizer(self.GraphicsSizer)
@@ -441,7 +441,7 @@
x, y = panel.GetPosition()
width, height = panel.GetSize()
rect = wx.Rect(x, y, width, height)
- if rect.InsideXY(x_mouse, y_mouse) or \
+ if rect.Contains(x_mouse, y_mouse) or \
idx == 0 and y_mouse < 0 or \
idx == len(self.GraphicPanels) - 1 and y_mouse > panel.GetPosition()[1]:
panel.RefreshHighlight(x_mouse - x, y_mouse - y)
@@ -488,7 +488,7 @@
xw, yw = panel.GetPosition()
width, height = panel.GetSize()
bbox = wx.Rect(xw, yw, width, height)
- if bbox.InsideXY(x_mouse, y_mouse):
+ if bbox.Contains(x_mouse, y_mouse):
panel.ShowButtons(True)
merge_type = GRAPH_PARALLEL
if isinstance(panel, DebugVariableTextViewer) or panel.Is3DCanvas():
@@ -497,9 +497,9 @@
wx.CallAfter(self.MoveValue, variable, idx, True)
else:
rect = panel.GetAxesBoundingBox(True)
- if rect.InsideXY(x_mouse, y_mouse):
+ if rect.Contains(x_mouse, y_mouse):
merge_rect = wx.Rect(rect.x, rect.y, rect.width // 2, rect.height)
- if merge_rect.InsideXY(x_mouse, y_mouse):
+ if merge_rect.Contains(x_mouse, y_mouse):
merge_type = GRAPH_ORTHOGONAL
wx.CallAfter(self.MergeGraphs, variable, idx, merge_type, force=True)
else:
@@ -510,7 +510,7 @@
return
width, height = self.GraphicsWindow.GetVirtualSize()
rect = wx.Rect(0, 0, width, height)
- if rect.InsideXY(x_mouse, y_mouse):
+ if rect.Contains(x_mouse, y_mouse):
wx.CallAfter(self.MoveValue, variable, len(self.GraphicPanels), True)
self.ForceRefresh()
@@ -518,7 +518,7 @@
self.GraphicsSizer.Clear()
for panel in self.GraphicPanels:
- self.GraphicsSizer.AddWindow(panel, flag=wx.GROW)
+ self.GraphicsSizer.Add(panel, flag=wx.GROW)
self.GraphicsSizer.Layout()
self.RefreshGraphicsWindowScrollbars()
--- a/controls/DebugVariablePanel/DebugVariableTextViewer.py Thu Sep 16 09:40:36 2021 +0200
+++ b/controls/DebugVariablePanel/DebugVariableTextViewer.py Fri Oct 01 17:44:52 2021 +0200
@@ -195,7 +195,7 @@
# Create buffered DC for drawing in panel
width, height = self.GetSize()
- bitmap = wx.EmptyBitmap(width, height)
+ bitmap = wx.Bitmap(width, height)
dc = wx.BufferedDC(wx.PaintDC(self), bitmap)
dc.Clear()
@@ -203,8 +203,6 @@
# rendering
gc = wx.GCDC(dc)
- gc.BeginDrawing()
-
# Get first item
item = self.ItemsDict.values()[0]
@@ -232,8 +230,6 @@
# Draw other Viewer common elements
self.DrawCommonElements(gc)
- gc.EndDrawing()
-
def OnLeftDown(self, event):
"""
Function called when mouse left button is pressed
@@ -252,7 +248,7 @@
# start a move drag'n drop of item variable
x, y = event.GetPosition()
item_path_bbox = wx.Rect(20, (height - h) / 2, w, h)
- if item_path_bbox.InsideXY(x, y):
+ if item_path_bbox.Contains(x, y):
self.ShowButtons(False)
data = wx.TextDataObject(str((item.GetVariable(), "debug", "move")))
dragSource = wx.DropSource(self)
--- a/controls/DebugVariablePanel/GraphButton.py Thu Sep 16 09:40:36 2021 +0200
+++ b/controls/DebugVariablePanel/GraphButton.py Fri Oct 01 17:44:52 2021 +0200
@@ -146,7 +146,7 @@
# Test if point is inside button
w, h = self.Bitmap.GetSize()
rect = wx.Rect(self.Position.x, self.Position.y, w, h)
- return rect.InsideXY(x, y)
+ return rect.Contains(x, y)
def ProcessCallback(self):
"""
--- a/controls/DiscoveryPanel.py Thu Sep 16 09:40:36 2021 +0200
+++ b/controls/DiscoveryPanel.py Fri Oct 01 17:44:52 2021 +0200
@@ -44,17 +44,17 @@
class DiscoveryPanel(wx.Panel, listmix.ColumnSorterMixin):
def _init_coll_MainSizer_Items(self, parent):
- parent.AddWindow(self.staticText1, 0, border=20, flag=wx.TOP | wx.LEFT | wx.RIGHT | wx.GROW)
- parent.AddWindow(self.ServicesList, 0, border=20, flag=wx.LEFT | wx.RIGHT | wx.GROW)
- parent.AddSizer(self.ButtonGridSizer, 0, border=20, flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.GROW)
+ parent.Add(self.staticText1, 0, border=20, flag=wx.TOP | wx.LEFT | wx.RIGHT | wx.GROW)
+ parent.Add(self.ServicesList, 0, border=20, flag=wx.LEFT | wx.RIGHT | wx.GROW)
+ parent.Add(self.ButtonGridSizer, 0, border=20, flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.GROW)
def _init_coll_MainSizer_Growables(self, parent):
parent.AddGrowableCol(0)
parent.AddGrowableRow(1)
def _init_coll_ButtonGridSizer_Items(self, parent):
- parent.AddWindow(self.RefreshButton, 0, border=0, flag=0)
- # parent.AddWindow(self.ByIPCheck, 0, border=0, flag=0)
+ parent.Add(self.RefreshButton, 0, border=0, flag=0)
+ # parent.Add(self.ByIPCheck, 0, border=0, flag=0)
def _init_coll_ButtonGridSizer_Growables(self, parent):
parent.AddGrowableCol(0)
--- a/controls/DurationCellEditor.py Thu Sep 16 09:40:36 2021 +0200
+++ b/controls/DurationCellEditor.py Fri Oct 01 17:44:52 2021 +0200
@@ -46,12 +46,12 @@
self.Duration = wx.TextCtrl(self, size=wx.Size(0, -1),
style=wx.TE_PROCESS_ENTER)
self.Duration.Bind(wx.EVT_KEY_DOWN, self.OnDurationChar)
- main_sizer.AddWindow(self.Duration, flag=wx.GROW)
+ main_sizer.Add(self.Duration, flag=wx.GROW)
# create browse button
self.EditButton = wx.Button(self, label='...', size=wx.Size(30, -1))
self.Bind(wx.EVT_BUTTON, self.OnEditButtonClick, self.EditButton)
- main_sizer.AddWindow(self.EditButton, flag=wx.GROW)
+ main_sizer.Add(self.EditButton, flag=wx.GROW)
self.Bind(wx.EVT_SIZE, self.OnSize)
@@ -98,12 +98,12 @@
self.Duration.SetFocus()
-class DurationCellEditor(wx.grid.PyGridCellEditor):
+class DurationCellEditor(wx.grid.GridCellEditor):
'''
Grid cell editor that uses DurationCellControl to display an edit button.
'''
def __init__(self, table, colname):
- wx.grid.PyGridCellEditor.__init__(self)
+ wx.grid.GridCellEditor.__init__(self)
self.Table = table
self.Colname = colname
--- a/controls/EnhancedStatusBar.py Thu Sep 16 09:40:36 2021 +0200
+++ b/controls/EnhancedStatusBar.py Fri Oct 01 17:44:52 2021 +0200
@@ -85,12 +85,12 @@
class EnhancedStatusBar(wx.StatusBar):
- def __init__(self, parent, id=wx.ID_ANY, style=wx.ST_SIZEGRIP,
+ def __init__(self, parent, id=wx.ID_ANY, style=wx.STB_SIZEGRIP,
name="EnhancedStatusBar"):
"""Default Class Constructor.
EnhancedStatusBar.__init__(self, parent, id=wx.ID_ANY,
- style=wx.ST_SIZEGRIP,
+ style=wx.STB_SIZEGRIP,
name="EnhancedStatusBar")
"""
@@ -100,7 +100,7 @@
self._curPos = 0
self._parent = parent
- wx.EVT_SIZE(self, self.OnSize)
+ self.Bind(wx.EVT_SIZE, self.OnSize)
wx.CallAfter(self.OnSize, None)
def OnSize(self, event):
--- a/controls/FolderTree.py Thu Sep 16 09:40:36 2021 +0200
+++ b/controls/FolderTree.py Fri Oct 01 17:44:52 2021 +0200
@@ -74,12 +74,12 @@
self.Bind(wx.EVT_TREE_ITEM_COLLAPSED, self.OnTreeItemCollapsed, self.Tree)
self.Bind(wx.EVT_TREE_BEGIN_LABEL_EDIT, self.OnTreeBeginLabelEdit, self.Tree)
self.Bind(wx.EVT_TREE_END_LABEL_EDIT, self.OnTreeEndLabelEdit, self.Tree)
- main_sizer.AddWindow(self.Tree, 1, flag=wx.GROW)
+ main_sizer.Add(self.Tree, 1, flag=wx.GROW)
if filter is not None:
self.Filter = wx.ComboBox(self, style=wx.CB_READONLY)
self.Bind(wx.EVT_COMBOBOX, self.OnFilterChanged, self.Filter)
- main_sizer.AddWindow(self.Filter, flag=wx.GROW)
+ main_sizer.Add(self.Filter, flag=wx.GROW)
else:
self.Filter = None
--- a/controls/LibraryPanel.py Thu Sep 16 09:40:36 2021 +0200
+++ b/controls/LibraryPanel.py Fri Oct 01 17:44:52 2021 +0200
@@ -77,12 +77,12 @@
search_textctrl = self.SearchCtrl.GetChildren()[0]
search_textctrl.Bind(wx.EVT_CHAR, self.OnKeyDown)
- main_sizer.AddWindow(self.SearchCtrl, flag=wx.GROW)
+ main_sizer.Add(self.SearchCtrl, flag=wx.GROW)
# Add Splitter window for tree and block comment to main sizer
splitter_window = wx.SplitterWindow(self)
splitter_window.SetSashGravity(1.0)
- main_sizer.AddWindow(splitter_window, flag=wx.GROW)
+ main_sizer.Add(splitter_window, flag=wx.GROW)
# Add TreeCtrl for functions and function blocks library in splitter
# window
@@ -216,7 +216,7 @@
# Set data associated to tree item (only save that item is a
# category)
- self.Tree.SetPyData(category_item, {"type": CATEGORY})
+ self.Tree.SetItemData(category_item, {"type": CATEGORY})
# Iterate over functions and function blocks defined in library
# category add a tree item to category tree item for each of
@@ -253,7 +253,7 @@
if blocktype["extensible"] else None),
"comment": _(comment) + blocktype.get("usage", "")
}
- self.Tree.SetPyData(blocktype_item, block_data)
+ self.Tree.SetItemData(blocktype_item, block_data)
# Select block tree item in tree if it corresponds to
# previously selected one
--- a/controls/LocationCellEditor.py Thu Sep 16 09:40:36 2021 +0200
+++ b/controls/LocationCellEditor.py Fri Oct 01 17:44:52 2021 +0200
@@ -46,12 +46,12 @@
self.Location = wx.TextCtrl(self, size=wx.Size(0, -1),
style=wx.TE_PROCESS_ENTER)
self.Location.Bind(wx.EVT_KEY_DOWN, self.OnLocationChar)
- main_sizer.AddWindow(self.Location, flag=wx.GROW)
+ main_sizer.Add(self.Location, flag=wx.GROW)
# create browse button
self.BrowseButton = wx.Button(self, label='...', size=wx.Size(30, -1))
self.BrowseButton.Bind(wx.EVT_BUTTON, self.OnBrowseButtonClick)
- main_sizer.AddWindow(self.BrowseButton, flag=wx.GROW)
+ main_sizer.Add(self.BrowseButton, flag=wx.GROW)
self.Bind(wx.EVT_SIZE, self.OnSize)
@@ -150,12 +150,12 @@
self.Location.SetFocus()
-class LocationCellEditor(wx.grid.PyGridCellEditor):
+class LocationCellEditor(wx.grid.GridCellEditor):
'''
Grid cell editor that uses LocationCellControl to display a browse button.
'''
def __init__(self, table, controller):
- wx.grid.PyGridCellEditor.__init__(self)
+ wx.grid.GridCellEditor.__init__(self)
self.Table = table
self.Controller = controller
--- a/controls/LogViewer.py Thu Sep 16 09:40:36 2021 +0200
+++ b/controls/LogViewer.py Fri Oct 01 17:44:52 2021 +0200
@@ -99,8 +99,8 @@
width, height = self.GetClientSize()
range_rect = self.GetRangeRect()
thumb_rect = self.GetThumbRect()
- if range_rect.InsideXY(posx, posy):
- if thumb_rect.InsideXY(posx, posy):
+ if range_rect.Contains(posx, posy):
+ if thumb_rect.Contains(posx, posy):
self.ThumbScrollingStartPos = wx.Point(posx, posy)
elif posy < thumb_rect.y:
self.Parent.ScrollToLast()
@@ -139,7 +139,6 @@
def OnPaint(self, event):
dc = wx.BufferedPaintDC(self)
dc.Clear()
- dc.BeginDrawing()
gc = wx.GCDC(dc)
@@ -179,7 +178,6 @@
gc.DrawRectangle(thumb_rect.x, thumb_rect.y,
thumb_rect.width, thumb_rect.height)
- dc.EndDrawing()
event.Skip()
@@ -207,7 +205,7 @@
def HitTest(self, x, y):
rect = wx.Rect(self.Position.x, self.Position.y,
self.Size.width, self.Size.height)
- if rect.InsideXY(x, y):
+ if rect.Contains(x, y):
return True
return False
@@ -303,7 +301,7 @@
main_sizer.AddGrowableRow(1)
filter_sizer = wx.BoxSizer(wx.HORIZONTAL)
- main_sizer.AddSizer(filter_sizer, border=5, flag=wx.TOP | wx.LEFT | wx.RIGHT | wx.GROW)
+ main_sizer.Add(filter_sizer, border=5, flag=wx.TOP | wx.LEFT | wx.RIGHT | wx.GROW)
self.MessageFilter = wx.ComboBox(self, style=wx.CB_READONLY)
self.MessageFilter.Append(_("All"))
@@ -312,7 +310,7 @@
for level in levels:
self.MessageFilter.Append(_(level))
self.Bind(wx.EVT_COMBOBOX, self.OnMessageFilterChanged, self.MessageFilter)
- filter_sizer.AddWindow(self.MessageFilter, 1, border=5, flag=wx.RIGHT | wx.ALIGN_CENTER_VERTICAL)
+ filter_sizer.Add(self.MessageFilter, 1, border=5, flag=wx.RIGHT | wx.ALIGN_CENTER_VERTICAL)
self.SearchMessage = wx.SearchCtrl(self, style=wx.TE_PROCESS_ENTER)
self.SearchMessage.ShowSearchButton(True)
@@ -322,18 +320,18 @@
self.OnSearchMessageSearchButtonClick, self.SearchMessage)
self.Bind(wx.EVT_SEARCHCTRL_CANCEL_BTN,
self.OnSearchMessageCancelButtonClick, self.SearchMessage)
- filter_sizer.AddWindow(self.SearchMessage, 3, border=5, flag=wx.RIGHT | wx.ALIGN_CENTER_VERTICAL)
+ filter_sizer.Add(self.SearchMessage, 3, border=5, flag=wx.RIGHT | wx.ALIGN_CENTER_VERTICAL)
self.CleanButton = wx.lib.buttons.GenBitmapButton(self, bitmap=GetBitmap("Clean"),
size=wx.Size(28, 28), style=wx.NO_BORDER)
- self.CleanButton.SetToolTipString(_("Clean log messages"))
+ self.CleanButton.SetToolTip(_("Clean log messages"))
self.Bind(wx.EVT_BUTTON, self.OnCleanButton, self.CleanButton)
- filter_sizer.AddWindow(self.CleanButton)
+ filter_sizer.Add(self.CleanButton)
message_panel_sizer = wx.FlexGridSizer(cols=2, hgap=0, rows=1, vgap=0)
message_panel_sizer.AddGrowableCol(0)
message_panel_sizer.AddGrowableRow(0)
- main_sizer.AddSizer(message_panel_sizer, border=5, flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.GROW)
+ main_sizer.Add(message_panel_sizer, border=5, flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.GROW)
self.MessagePanel = wx.Panel(self)
if wx.Platform == '__WXMSW__':
@@ -349,10 +347,10 @@
self.MessagePanel.Bind(wx.EVT_ERASE_BACKGROUND, self.OnMessagePanelEraseBackground)
self.MessagePanel.Bind(wx.EVT_PAINT, self.OnMessagePanelPaint)
self.MessagePanel.Bind(wx.EVT_SIZE, self.OnMessagePanelResize)
- message_panel_sizer.AddWindow(self.MessagePanel, flag=wx.GROW)
+ message_panel_sizer.Add(self.MessagePanel, flag=wx.GROW)
self.MessageScrollBar = LogScrollBar(self, wx.Size(16, -1))
- message_panel_sizer.AddWindow(self.MessageScrollBar, flag=wx.GROW)
+ message_panel_sizer.Add(self.MessageScrollBar, flag=wx.GROW)
self.SetSizer(main_sizer)
@@ -534,10 +532,9 @@
def RefreshView(self):
width, height = self.MessagePanel.GetClientSize()
- bitmap = wx.EmptyBitmap(width, height)
+ bitmap = wx.Bitmap(width, height)
dc = wx.BufferedDC(wx.ClientDC(self.MessagePanel), bitmap)
dc.Clear()
- dc.BeginDrawing()
if self.CurrentMessage is not None:
@@ -559,8 +556,6 @@
draw_date = message.Date != previous_message.Date
message = previous_message
- dc.EndDrawing()
-
self.MessageScrollBar.RefreshThumbPosition()
def IsPLCLogEmpty(self):
--- a/controls/PouInstanceVariablesPanel.py Thu Sep 16 09:40:36 2021 +0200
+++ b/controls/PouInstanceVariablesPanel.py Fri Oct 01 17:44:52 2021 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#.!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of Beremiz, a Integrated Development Environment for
@@ -93,7 +93,7 @@
rect = wx.Rect(images_bbx.x + 4, images_bbx.y + 4,
r_image_w, r_image_h)
for r_image in rightimages:
- if rect.Inside(point):
+ if rect.Contains(point):
return r_image
rect.x += r_image_w + 4
@@ -132,7 +132,7 @@
self.ParentButton = wx.lib.buttons.GenBitmapButton(
self, bitmap=GetBitmap("top"), size=wx.Size(28, 28), style=wx.NO_BORDER)
- self.ParentButton.SetToolTipString(_("Parent instance"))
+ self.ParentButton.SetToolTip(_("Parent instance"))
self.Bind(wx.EVT_BUTTON, self.OnParentButtonClick,
self.ParentButton)
@@ -142,7 +142,7 @@
self.DebugButton = wx.lib.buttons.GenBitmapButton(
self, bitmap=GetBitmap("debug_instance"), size=wx.Size(28, 28), style=wx.NO_BORDER)
- self.DebugButton.SetToolTipString(_("Debug instance"))
+ self.DebugButton.SetToolTip(_("Debug instance"))
self.Bind(wx.EVT_BUTTON, self.OnDebugButtonClick,
self.DebugButton)
@@ -175,15 +175,15 @@
self.DebugButtonCallback, self.DebugButtonDClickCallback)}
buttons_sizer = wx.FlexGridSizer(cols=3, hgap=0, rows=1, vgap=0)
- buttons_sizer.AddWindow(self.ParentButton)
- buttons_sizer.AddWindow(self.InstanceChoice, flag=wx.GROW)
- buttons_sizer.AddWindow(self.DebugButton)
+ buttons_sizer.Add(self.ParentButton)
+ buttons_sizer.Add(self.InstanceChoice, flag=wx.GROW)
+ buttons_sizer.Add(self.DebugButton)
buttons_sizer.AddGrowableCol(1)
buttons_sizer.AddGrowableRow(0)
main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=0)
- main_sizer.AddSizer(buttons_sizer, flag=wx.GROW)
- main_sizer.AddWindow(self.VariablesList, flag=wx.GROW)
+ main_sizer.Add(buttons_sizer, flag=wx.GROW)
+ main_sizer.Add(self.VariablesList, flag=wx.GROW)
main_sizer.AddGrowableCol(0)
main_sizer.AddGrowableRow(1)
--- a/controls/ProjectPropertiesPanel.py Thu Sep 16 09:40:36 2021 +0200
+++ b/controls/ProjectPropertiesPanel.py Fri Oct 01 17:44:52 2021 +0200
@@ -57,7 +57,7 @@
border |= wx.BOTTOM
st = wx.StaticText(parent, label=label)
- sizer.AddWindow(st, border=10,
+ sizer.Add(st, border=10,
flag=wx.ALIGN_CENTER_VERTICAL | border | wx.LEFT)
tc = wx.TextCtrl(parent, style=wx.TE_PROCESS_ENTER)
@@ -65,7 +65,7 @@
callback = self.GetTextCtrlChangedFunction(tc, name)
self.Bind(wx.EVT_TEXT_ENTER, callback, tc)
tc.Bind(wx.EVT_KILL_FOCUS, callback)
- sizer.AddWindow(tc, border=10,
+ sizer.Add(tc, border=10,
flag=wx.GROW | border | wx.RIGHT)
def __init__(self, parent, controller=None, window=None, enable_required=True, scrolling=True):
@@ -125,19 +125,19 @@
pageSize_st = wx.StaticText(self.GraphicsPanel,
label=_('Page Size (optional):'))
- graphicpanel_sizer.AddWindow(
+ graphicpanel_sizer.Add(
pageSize_st, border=10,
flag=wx.ALIGN_CENTER_VERTICAL | wx.TOP | wx.LEFT | wx.RIGHT)
pageSize_sizer = wx.FlexGridSizer(cols=2, hgap=5, rows=2, vgap=5)
pageSize_sizer.AddGrowableCol(1)
- graphicpanel_sizer.AddSizer(pageSize_sizer, border=10,
+ graphicpanel_sizer.Add(pageSize_sizer, border=10,
flag=wx.GROW | wx.LEFT | wx.RIGHT)
for name, label in [('PageWidth', _('Width:')),
('PageHeight', _('Height:'))]:
st = wx.StaticText(self.GraphicsPanel, label=label)
- pageSize_sizer.AddWindow(st, border=12,
+ pageSize_sizer.Add(st, border=12,
flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT)
sp = wx.SpinCtrl(self.GraphicsPanel,
@@ -146,15 +146,15 @@
callback = self.GetPageSizeChangedFunction(sp, name)
self.Bind(wx.EVT_TEXT_ENTER, callback, sp)
sp.Bind(wx.EVT_KILL_FOCUS, callback)
- pageSize_sizer.AddWindow(sp, flag=wx.GROW)
+ pageSize_sizer.Add(sp, flag=wx.GROW)
scaling_st = wx.StaticText(self.GraphicsPanel,
label=_('Grid Resolution:'))
- graphicpanel_sizer.AddWindow(scaling_st, border=10,
+ graphicpanel_sizer.Add(scaling_st, border=10,
flag=wx.GROW | wx.LEFT | wx.RIGHT)
scaling_nb = wx.Notebook(self.GraphicsPanel)
- graphicpanel_sizer.AddWindow(scaling_nb, border=10,
+ graphicpanel_sizer.Add(scaling_nb, border=10,
flag=wx.GROW | wx.BOTTOM | wx.LEFT | wx.RIGHT)
self.Scalings = {}
@@ -173,7 +173,7 @@
border = wx.BOTTOM
st = wx.StaticText(scaling_panel, label=label)
- scalingpanel_sizer.AddWindow(
+ scalingpanel_sizer.Add(
st, border=10,
flag=wx.ALIGN_CENTER_VERTICAL | border | wx.LEFT)
@@ -183,7 +183,7 @@
callback = self.GetScalingChangedFunction(sp, language, name)
self.Bind(wx.EVT_TEXT_ENTER, callback, sp)
sp.Bind(wx.EVT_KILL_FOCUS, callback)
- scalingpanel_sizer.AddWindow(sp, border=10,
+ scalingpanel_sizer.Add(sp, border=10,
flag=wx.GROW | border | wx.RIGHT)
self.Scalings[language] = scaling_controls
@@ -206,18 +206,18 @@
language_label = wx.StaticText(self.MiscellaneousPanel,
label=_('Language (optional):'))
- miscellaneouspanel_sizer.AddWindow(language_label, border=10,
+ miscellaneouspanel_sizer.Add(language_label, border=10,
flag=wx.ALIGN_CENTER_VERTICAL | wx.TOP | wx.LEFT)
self.Language = wx.ComboBox(self.MiscellaneousPanel,
style=wx.CB_READONLY)
self.Bind(wx.EVT_COMBOBOX, self.OnLanguageChanged, self.Language)
- miscellaneouspanel_sizer.AddWindow(self.Language, border=10,
+ miscellaneouspanel_sizer.Add(self.Language, border=10,
flag=wx.GROW | wx.TOP | wx.RIGHT)
description_label = wx.StaticText(
self.MiscellaneousPanel, label=_('Content Description (optional):'))
- miscellaneouspanel_sizer.AddWindow(description_label, border=10,
+ miscellaneouspanel_sizer.Add(description_label, border=10,
flag=wx.BOTTOM | wx.LEFT)
self.ContentDescription = wx.TextCtrl(
@@ -227,7 +227,7 @@
self.ContentDescription)
self.ContentDescription.Bind(wx.EVT_KILL_FOCUS,
self.OnContentDescriptionChanged)
- miscellaneouspanel_sizer.AddWindow(self.ContentDescription, border=10,
+ miscellaneouspanel_sizer.Add(self.ContentDescription, border=10,
flag=wx.GROW | wx.BOTTOM | wx.RIGHT)
self.AddPage(self.MiscellaneousPanel, _("Miscellaneous"))
--- a/controls/SearchResultPanel.py Thu Sep 16 09:40:36 2021 +0200
+++ b/controls/SearchResultPanel.py Fri Oct 01 17:44:52 2021 +0200
@@ -52,16 +52,16 @@
class SearchResultPanel(wx.Panel):
def _init_coll_MainSizer_Items(self, parent):
- parent.AddSizer(self.HeaderSizer, 0, border=0, flag=wx.GROW)
- parent.AddWindow(self.SearchResultsTree, 1, border=0, flag=wx.GROW)
+ parent.Add(self.HeaderSizer, 0, border=0, flag=wx.GROW)
+ parent.Add(self.SearchResultsTree, 1, border=0, flag=wx.GROW)
def _init_coll_MainSizer_Growables(self, parent):
parent.AddGrowableCol(0)
parent.AddGrowableRow(1)
def _init_coll_HeaderSizer_Items(self, parent):
- parent.AddWindow(self.HeaderLabel, 1, border=5, flag=wx.LEFT | wx.RIGHT | wx.ALIGN_CENTER_VERTICAL)
- parent.AddWindow(self.ResetButton, 0, border=0, flag=0)
+ parent.Add(self.HeaderLabel, 1, border=5, flag=wx.LEFT | wx.RIGHT | wx.ALIGN_CENTER_VERTICAL)
+ parent.Add(self.ResetButton, 0, border=0, flag=0)
def _init_coll_HeaderSizer_Growables(self, parent):
parent.AddGrowableCol(0)
@@ -90,7 +90,7 @@
self.ResetButton = wx.lib.buttons.GenBitmapButton(
self, bitmap=GetBitmap("reset"),
size=wx.Size(28, 28), style=wx.NO_BORDER)
- self.ResetButton.SetToolTipString(_("Reset search result"))
+ self.ResetButton.SetToolTip(_("Reset search result"))
self.Bind(wx.EVT_BUTTON, self.OnResetButton, self.ResetButton)
self._init_sizers()
--- a/controls/TextCtrlAutoComplete.py Thu Sep 16 09:40:36 2021 +0200
+++ b/controls/TextCtrlAutoComplete.py Fri Oct 01 17:44:52 2021 +0200
@@ -97,7 +97,7 @@
parent_rect = wx.Rect(0, -parent_size[1], parent_size[0], parent_size[1])
if selected != wx.NOT_FOUND:
wx.CallAfter(self.Parent.SetValueFromSelected, self.ListBox.GetString(selected))
- elif parent_rect.InsideXY(event.GetX(), event.GetY()):
+ elif parent_rect.Contains(event.GetX(), event.GetY()):
result, x, y = self.Parent.HitTest(wx.Point(event.GetX(), event.GetY() + parent_size[1]))
if result != wx.TE_HT_UNKNOWN:
self.Parent.SetInsertionPoint(self.Parent.XYToPosition(x, y))
--- a/controls/VariablePanel.py Thu Sep 16 09:40:36 2021 +0200
+++ b/controls/VariablePanel.py Fri Oct 01 17:44:52 2021 +0200
@@ -200,8 +200,7 @@
retain=self.Parent.ElementType != "function" and var_class in ["Local", "Input", "Output", "Global"],
non_retain=self.Parent.ElementType != "function" and var_class in ["Local", "Input", "Output"])
if len(options) > 1:
- editor = wx.grid.GridCellChoiceEditor()
- editor.SetParameters(",".join(map(_, options)))
+ editor = wx.grid.GridCellChoiceEditor(map(_, options))
else:
grid.SetReadOnly(row, col, True)
elif col != 0 and self._GetRowEdit(row):
@@ -212,8 +211,7 @@
elif colname == "Initial Value":
if var_class not in ["External", "InOut"]:
if self.Parent.Controler.IsEnumeratedType(var_type):
- editor = wx.grid.GridCellChoiceEditor()
- editor.SetParameters(",".join([""] + self.Parent.Controler.GetEnumeratedDataValues(var_type)))
+ editor = wx.grid.GridCellChoiceEditor([""] + self.Parent.Controler.GetEnumeratedDataValues(var_type))
else:
editor = wx.grid.GridCellTextEditor()
renderer = wx.grid.GridCellStringRenderer()
@@ -229,11 +227,10 @@
if len(self.Parent.ClassList) == 1:
grid.SetReadOnly(row, col, True)
else:
- editor = wx.grid.GridCellChoiceEditor()
excluded = []
if self.Parent.IsFunctionBlockType(var_type):
excluded.extend(["Local", "Temp"])
- editor.SetParameters(",".join([_(choice) for choice in self.Parent.ClassList if choice not in excluded]))
+ editor = wx.grid.GridCellChoiceEditor([_(choice) for choice in self.Parent.ClassList if choice not in excluded])
elif colname != "Documentation":
grid.SetReadOnly(row, col, True)
@@ -456,32 +453,32 @@
controls_sizer = wx.FlexGridSizer(cols=10, hgap=5, rows=1, vgap=5)
controls_sizer.AddGrowableCol(5)
controls_sizer.AddGrowableRow(0)
- self.MainSizer.AddSizer(controls_sizer, border=5, flag=wx.GROW | wx.ALL)
+ self.MainSizer.Add(controls_sizer, border=5, flag=wx.GROW | wx.ALL)
self.ReturnTypeLabel = wx.StaticText(self, label=_('Return Type:'))
- controls_sizer.AddWindow(self.ReturnTypeLabel, flag=wx.ALIGN_CENTER_VERTICAL)
+ controls_sizer.Add(self.ReturnTypeLabel, flag=wx.ALIGN_CENTER_VERTICAL)
self.ReturnType = wx.ComboBox(self,
size=wx.Size(145, -1), style=wx.CB_READONLY)
self.Bind(wx.EVT_COMBOBOX, self.OnReturnTypeChanged, self.ReturnType)
- controls_sizer.AddWindow(self.ReturnType)
+ controls_sizer.Add(self.ReturnType)
self.DescriptionLabel = wx.StaticText(self, label=_('Description:'))
- controls_sizer.AddWindow(self.DescriptionLabel, flag=wx.ALIGN_CENTER_VERTICAL)
+ controls_sizer.Add(self.DescriptionLabel, flag=wx.ALIGN_CENTER_VERTICAL)
self.Description = wx.TextCtrl(self,
size=wx.Size(250, -1), style=wx.TE_PROCESS_ENTER)
self.Bind(wx.EVT_TEXT_ENTER, self.OnDescriptionChanged, self.Description)
self.Description.Bind(wx.EVT_KILL_FOCUS, self.OnDescriptionChanged)
- controls_sizer.AddWindow(self.Description)
+ controls_sizer.Add(self.Description)
class_filter_label = wx.StaticText(self, label=_('Class Filter:'))
- controls_sizer.AddWindow(class_filter_label, flag=wx.ALIGN_CENTER_VERTICAL)
+ controls_sizer.Add(class_filter_label, flag=wx.ALIGN_CENTER_VERTICAL)
self.ClassFilter = wx.ComboBox(self,
size=wx.Size(145, -1), style=wx.CB_READONLY)
self.Bind(wx.EVT_COMBOBOX, self.OnClassFilter, self.ClassFilter)
- controls_sizer.AddWindow(self.ClassFilter)
+ controls_sizer.Add(self.ClassFilter)
for name, bitmap, help in [
("AddButton", "add_element", _("Add variable")),
@@ -490,19 +487,19 @@
("DownButton", "down", _("Move variable down"))]:
button = wx.lib.buttons.GenBitmapButton(self, bitmap=GetBitmap(bitmap),
size=wx.Size(28, 28), style=wx.NO_BORDER)
- button.SetToolTipString(help)
+ button.SetToolTip(help)
setattr(self, name, button)
- controls_sizer.AddWindow(button)
+ controls_sizer.Add(button)
self.VariablesGrid = CustomGrid(self, style=wx.VSCROLL | wx.HSCROLL)
self.VariablesGrid.SetDropTarget(VariableDropTarget(self))
- self.VariablesGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGE,
+ self.VariablesGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGING,
self.OnVariablesGridCellChange)
self.VariablesGrid.Bind(wx.grid.EVT_GRID_CELL_LEFT_CLICK,
self.OnVariablesGridCellLeftClick)
self.VariablesGrid.Bind(wx.grid.EVT_GRID_EDITOR_SHOWN,
self.OnVariablesGridEditorShown)
- self.MainSizer.AddWindow(self.VariablesGrid, flag=wx.GROW)
+ self.MainSizer.Add(self.VariablesGrid, flag=wx.GROW)
self.SetSizer(self.MainSizer)
@@ -848,7 +845,7 @@
# build a submenu containing standard IEC types
base_menu = wx.Menu(title='')
for base_type in self.Controler.GetBaseTypes():
- item = base_menu.Append(wx.ID_ANY, help='', kind=wx.ITEM_NORMAL, text=base_type)
+ item = base_menu.Append(wx.ID_ANY, helpString='', kind=wx.ITEM_NORMAL, item=base_type)
self.Bind(wx.EVT_MENU, self.GetVariableTypeFunction(base_type), item)
type_menu.AppendMenu(wx.ID_ANY, _("Base Types"), base_menu)
@@ -858,7 +855,7 @@
datatype_menu = wx.Menu(title='')
datatypes = self.Controler.GetDataTypes(basetypes=False, confnodetypes=False)
for datatype in datatypes:
- item = datatype_menu.Append(wx.ID_ANY, help='', kind=wx.ITEM_NORMAL, text=datatype)
+ item = datatype_menu.Append(wx.ID_ANY, helpString='', kind=wx.ITEM_NORMAL, item=datatype)
self.Bind(wx.EVT_MENU, self.GetVariableTypeFunction(datatype), item)
type_menu.AppendMenu(wx.ID_ANY, _("User Data Types"), datatype_menu)
@@ -869,7 +866,7 @@
# build a submenu containing confnode types
confnode_datatype_menu = wx.Menu(title='')
for datatype in category["list"]:
- item = confnode_datatype_menu.Append(wx.ID_ANY, help='', kind=wx.ITEM_NORMAL, text=datatype)
+ item = confnode_datatype_menu.Append(wx.ID_ANY, helpString='', kind=wx.ITEM_NORMAL, item=datatype)
self.Bind(wx.EVT_MENU, self.GetVariableTypeFunction(datatype), item)
type_menu.AppendMenu(wx.ID_ANY, category["name"], confnode_datatype_menu)
@@ -883,13 +880,13 @@
functionblock_menu = wx.Menu(title='')
fbtypes = self.Controler.GetFunctionBlockTypes(self.TagName)
for functionblock_type in fbtypes:
- item = functionblock_menu.Append(wx.ID_ANY, help='', kind=wx.ITEM_NORMAL, text=functionblock_type)
+ item = functionblock_menu.Append(wx.ID_ANY, helpString='', kind=wx.ITEM_NORMAL, item=functionblock_type)
self.Bind(wx.EVT_MENU, self.GetVariableTypeFunction(functionblock_type), item)
type_menu.AppendMenu(wx.ID_ANY, _("Function Block Types"), functionblock_menu)
def BuildArrayTypesMenu(self, type_menu):
- item = type_menu.Append(wx.ID_ANY, help='', kind=wx.ITEM_NORMAL, text=_("Array"))
+ item = type_menu.Append(wx.ID_ANY, helpString='', kind=wx.ITEM_NORMAL, item=_("Array"))
self.Bind(wx.EVT_MENU, self.VariableArrayTypeFunction, item)
def OnVariablesGridEditorShown(self, event):
@@ -916,7 +913,7 @@
corner_y = rect.y + self.VariablesGrid.GetColLabelSize()
# pop up this new menu
- self.VariablesGrid.PopupMenuXY(type_menu, corner_x, corner_y)
+ self.VariablesGrid.PopupMenu(type_menu, corner_x, corner_y)
type_menu.Destroy()
event.Veto()
value = self.Values[row].Type
--- a/dialogs/ActionBlockDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/ActionBlockDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -85,29 +85,24 @@
readonly = False
colname = self.GetColLabelValue(col, False)
if colname == "Qualifier":
- editor = wx.grid.GridCellChoiceEditor()
- editor.SetParameters(self.Parent.QualifierList)
+ editor = wx.grid.GridCellChoiceEditor(self.Parent.QualifierList)
if colname == "Duration":
editor = wx.grid.GridCellTextEditor()
renderer = wx.grid.GridCellStringRenderer()
readonly = not self.Parent.DurationList[self.data[row].qualifier]
elif colname == "Type":
- editor = wx.grid.GridCellChoiceEditor()
- editor.SetParameters(self.Parent.TypeList)
+ editor = wx.grid.GridCellChoiceEditor(self.Parent.TypeList)
elif colname == "Value":
value_type = self.data[row].type
if value_type == "Action":
- editor = wx.grid.GridCellChoiceEditor()
- editor.SetParameters(self.Parent.ActionList)
+ editor = wx.grid.GridCellChoiceEditor(self.Parent.ActionList)
elif value_type == "Variable":
- editor = wx.grid.GridCellChoiceEditor()
- editor.SetParameters(self.Parent.VariableList)
+ editor = wx.grid.GridCellChoiceEditor(self.Parent.VariableList)
elif value_type == "Inline":
editor = wx.grid.GridCellTextEditor()
renderer = wx.grid.GridCellStringRenderer()
elif colname == "Indicator":
- editor = wx.grid.GridCellChoiceEditor()
- editor.SetParameters(self.Parent.VariableList)
+ editor = wx.grid.GridCellChoiceEditor(self.Parent.VariableList)
grid.SetCellEditor(row, col, editor)
grid.SetCellRenderer(row, col, renderer)
@@ -133,11 +128,11 @@
top_sizer = wx.FlexGridSizer(cols=5, hgap=5, rows=1, vgap=0)
top_sizer.AddGrowableCol(0)
top_sizer.AddGrowableRow(0)
- main_sizer.AddSizer(top_sizer, border=20,
+ main_sizer.Add(top_sizer, border=20,
flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT)
actions_label = wx.StaticText(self, label=_('Actions:'))
- top_sizer.AddWindow(actions_label, flag=wx.ALIGN_BOTTOM)
+ top_sizer.Add(actions_label, flag=wx.ALIGN_BOTTOM)
for name, bitmap, help in [
("AddButton", "add_element", _("Add action")),
@@ -147,21 +142,21 @@
button = wx.lib.buttons.GenBitmapButton(
self, bitmap=GetBitmap(bitmap),
size=wx.Size(28, 28), style=wx.NO_BORDER)
- button.SetToolTipString(help)
+ button.SetToolTip(help)
setattr(self, name, button)
- top_sizer.AddWindow(button)
+ top_sizer.Add(button)
self.ActionsGrid = CustomGrid(self, size=wx.Size(-1, 250), style=wx.VSCROLL)
self.ActionsGrid.DisableDragGridSize()
self.ActionsGrid.EnableScrolling(False, True)
- self.ActionsGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGE,
+ self.ActionsGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGING,
self.OnActionsGridCellChange)
- main_sizer.AddSizer(self.ActionsGrid, border=20,
+ main_sizer.Add(self.ActionsGrid, border=20,
flag=wx.GROW | wx.LEFT | wx.RIGHT)
button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE)
- self.Bind(wx.EVT_BUTTON, self.OnOK, button_sizer.GetAffirmativeButton())
- main_sizer.AddSizer(button_sizer, border=20,
+ self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.GetAffirmativeId())
+ main_sizer.Add(button_sizer, border=20,
flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
self.SetSizer(main_sizer)
--- a/dialogs/ArrayTypeDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/ArrayTypeDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -50,31 +50,31 @@
main_sizer.AddGrowableRow(1)
top_sizer = wx.BoxSizer(wx.HORIZONTAL)
- main_sizer.AddSizer(top_sizer, border=20,
+ main_sizer.Add(top_sizer, border=20,
flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT)
basetype_label = wx.StaticText(self, label=_('Base Type:'))
- top_sizer.AddWindow(basetype_label, 1, flag=wx.ALIGN_BOTTOM)
+ top_sizer.Add(basetype_label, 1, flag=wx.ALIGN_BOTTOM)
self.BaseType = wx.ComboBox(self, style=wx.CB_READONLY)
- top_sizer.AddWindow(self.BaseType, 1, flag=wx.GROW)
+ top_sizer.Add(self.BaseType, 1, flag=wx.GROW)
self.Dimensions = CustomEditableListBox(self, label=_("Dimensions:"),
- style=(wx.gizmos.EL_ALLOW_NEW |
- wx.gizmos.EL_ALLOW_EDIT |
- wx.gizmos.EL_ALLOW_DELETE))
+ style=(wx.adv.EL_ALLOW_NEW |
+ wx.adv.EL_ALLOW_EDIT |
+ wx.adv.EL_ALLOW_DELETE))
for func in ["_OnLabelEndEdit",
"_OnAddButton",
"_OnDelButton",
"_OnUpButton",
"_OnDownButton"]:
setattr(self.Dimensions, func, self.OnDimensionsChanged)
- main_sizer.AddSizer(self.Dimensions, border=20,
+ main_sizer.Add(self.Dimensions, border=20,
flag=wx.GROW | wx.LEFT | wx.RIGHT)
button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE)
- self.Bind(wx.EVT_BUTTON, self.OnOK, button_sizer.GetAffirmativeButton())
- main_sizer.AddSizer(button_sizer, border=20,
+ self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.GetAffirmativeId())
+ main_sizer.Add(button_sizer, border=20,
flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
self.SetSizer(main_sizer)
--- a/dialogs/BlockPreviewDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/BlockPreviewDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -75,8 +75,7 @@
# Add default dialog buttons sizer
self.ButtonSizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE)
- self.Bind(wx.EVT_BUTTON, self.OnOK,
- self.ButtonSizer.GetAffirmativeButton())
+ self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.GetAffirmativeId())
self.Element = None # Graphic element to display in preview
self.MinElementSize = None # Graphic element minimal size
@@ -120,7 +119,7 @@
# Create a sizer for dividing parameters in two columns
self.ColumnSizer = wx.BoxSizer(wx.HORIZONTAL)
- self.MainSizer.AddSizer(self.ColumnSizer, border=20,
+ self.MainSizer.Add(self.ColumnSizer, border=20,
flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT)
# Create a sizer for left column
@@ -129,7 +128,7 @@
self.LeftGridSizer.AddGrowableCol(0)
if left_growable_row is not None:
self.LeftGridSizer.AddGrowableRow(left_growable_row)
- self.ColumnSizer.AddSizer(self.LeftGridSizer, 1, border=5,
+ self.ColumnSizer.Add(self.LeftGridSizer, 1, border=5,
flag=wx.GROW | wx.RIGHT | wx.EXPAND)
# Create a sizer for right column
@@ -138,7 +137,7 @@
self.RightGridSizer.AddGrowableCol(0)
if right_growable_row is not None:
self.RightGridSizer.AddGrowableRow(right_growable_row)
- self.ColumnSizer.AddSizer(self.RightGridSizer, 1, border=5,
+ self.ColumnSizer.Add(self.RightGridSizer, 1, border=5,
flag=wx.GROW | wx.LEFT)
self.SetSizer(self.MainSizer)
--- a/dialogs/BrowseLocationsDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/BrowseLocationsDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -76,7 +76,7 @@
main_sizer.AddGrowableRow(1)
locations_label = wx.StaticText(self, label=_('Locations available:'))
- main_sizer.AddWindow(locations_label, border=20,
+ main_sizer.Add(locations_label, border=20,
flag=wx.TOP | wx.LEFT | wx.RIGHT | wx.GROW)
self.LocationsTree = wx.TreeCtrl(self,
@@ -88,7 +88,7 @@
self.LocationsTree.SetInitialSize(wx.Size(-1, 300))
self.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnLocationsTreeItemActivated,
self.LocationsTree)
- main_sizer.AddWindow(self.LocationsTree, border=20,
+ main_sizer.Add(self.LocationsTree, border=20,
flag=wx.LEFT | wx.RIGHT | wx.GROW)
self.RenameCheckBox = wx.CheckBox(self, label=_("Rename variable to signal name"))
@@ -97,37 +97,37 @@
self.RenameCheckBox.SetValue(default_checked)
self.do_rename = default_checked
- main_sizer.AddWindow(self.RenameCheckBox, border=20,
+ main_sizer.Add(self.RenameCheckBox, border=20,
flag=wx.LEFT | wx.RIGHT | wx.GROW)
button_gridsizer = wx.FlexGridSizer(cols=5, hgap=5, rows=1, vgap=0)
button_gridsizer.AddGrowableCol(1)
button_gridsizer.AddGrowableCol(3)
button_gridsizer.AddGrowableRow(0)
- main_sizer.AddSizer(button_gridsizer, border=20,
+ main_sizer.Add(button_gridsizer, border=20,
flag=wx.BOTTOM | wx.LEFT | wx.RIGHT | wx.GROW)
direction_label = wx.StaticText(self, label=_('Direction:'))
- button_gridsizer.AddWindow(direction_label,
+ button_gridsizer.Add(direction_label,
flag=wx.ALIGN_CENTER_VERTICAL)
self.DirFilterChoice = wx.ComboBox(self, style=wx.CB_READONLY)
self.Bind(wx.EVT_COMBOBOX, self.OnFilterChoice, self.DirFilterChoice)
- button_gridsizer.AddWindow(self.DirFilterChoice,
+ button_gridsizer.Add(self.DirFilterChoice,
flag=wx.GROW | wx.ALIGN_CENTER_VERTICAL)
filter_label = wx.StaticText(self, label=_('Type:'))
- button_gridsizer.AddWindow(filter_label,
+ button_gridsizer.Add(filter_label,
flag=wx.ALIGN_CENTER_VERTICAL)
self.TypeFilterChoice = wx.ComboBox(self, style=wx.CB_READONLY)
self.Bind(wx.EVT_COMBOBOX, self.OnFilterChoice, self.TypeFilterChoice)
- button_gridsizer.AddWindow(self.TypeFilterChoice,
+ button_gridsizer.Add(self.TypeFilterChoice,
flag=wx.GROW | wx.ALIGN_CENTER_VERTICAL)
button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE)
- self.Bind(wx.EVT_BUTTON, self.OnOK, button_sizer.GetAffirmativeButton())
- button_gridsizer.AddSizer(button_sizer, flag=wx.ALIGN_RIGHT)
+ self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.GetAffirmativeId())
+ button_gridsizer.Add(button_sizer, flag=wx.ALIGN_RIGHT)
self.SetSizer(main_sizer)
--- a/dialogs/BrowseValuesLibraryDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/BrowseValuesLibraryDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -51,13 +51,13 @@
self.ButtonSizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE)
- self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.ButtonSizer.GetAffirmativeButton().GetId())
+ self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.GetAffirmativeId())
self.flexGridSizer1 = wx.FlexGridSizer(cols=1, hgap=0, rows=3, vgap=10)
- self.flexGridSizer1.AddWindow(self.staticText1, 0, border=20, flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT)
- self.flexGridSizer1.AddWindow(self.ValuesLibrary, 0, border=20, flag=wx.GROW | wx.LEFT | wx.RIGHT)
- self.flexGridSizer1.AddSizer(self.ButtonSizer, 0, border=20, flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
+ self.flexGridSizer1.Add(self.staticText1, 0, border=20, flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT)
+ self.flexGridSizer1.Add(self.ValuesLibrary, 0, border=20, flag=wx.GROW | wx.LEFT | wx.RIGHT)
+ self.flexGridSizer1.Add(self.ButtonSizer, 0, border=20, flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
self.flexGridSizer1.AddGrowableCol(0)
self.flexGridSizer1.AddGrowableRow(1)
--- a/dialogs/ConnectionDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/ConnectionDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -59,7 +59,7 @@
# Create label for connection type
type_label = wx.StaticText(self, label=_('Type:'))
- self.LeftGridSizer.AddWindow(type_label, flag=wx.GROW)
+ self.LeftGridSizer.Add(type_label, flag=wx.GROW)
# Create radio buttons for selecting connection type
self.TypeRadioButtons = {}
@@ -70,27 +70,27 @@
style=(wx.RB_GROUP if first else 0))
radio_button.SetValue(first)
self.Bind(wx.EVT_RADIOBUTTON, self.OnTypeChanged, radio_button)
- self.LeftGridSizer.AddWindow(radio_button, flag=wx.GROW)
+ self.LeftGridSizer.Add(radio_button, flag=wx.GROW)
self.TypeRadioButtons[type] = radio_button
first = False
# Create label for connection name
name_label = wx.StaticText(self, label=_('Name:'))
- self.LeftGridSizer.AddWindow(name_label, flag=wx.GROW)
+ self.LeftGridSizer.Add(name_label, flag=wx.GROW)
# Create text control for defining connection name
self.ConnectionName = wx.TextCtrl(self)
self.ConnectionName.SetMinSize(wx.Size(200, -1))
self.Bind(wx.EVT_TEXT, self.OnNameChanged, self.ConnectionName)
- self.LeftGridSizer.AddWindow(self.ConnectionName, flag=wx.GROW)
+ self.LeftGridSizer.Add(self.ConnectionName, flag=wx.GROW)
# Add preview panel and associated label to sizers
self.Preview.SetMinSize(wx.Size(-1, 100))
- self.LeftGridSizer.AddWindow(self.PreviewLabel, flag=wx.GROW)
- self.LeftGridSizer.AddWindow(self.Preview, flag=wx.GROW)
+ self.LeftGridSizer.Add(self.PreviewLabel, flag=wx.GROW)
+ self.LeftGridSizer.Add(self.Preview, flag=wx.GROW)
# Add buttons sizer to sizers
- self.MainSizer.AddSizer(
+ self.MainSizer.Add(
self.ButtonSizer, border=20,
flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
self.ColumnSizer.RemoveSizer(self.RightGridSizer)
@@ -99,10 +99,10 @@
# of POU
if apply_button:
self.ApplyToAllButton = wx.Button(self, label=_("Propagate Name"))
- self.ApplyToAllButton.SetToolTipString(
+ self.ApplyToAllButton.SetToolTip(
_("Apply name modification to all continuations with the same name"))
self.Bind(wx.EVT_BUTTON, self.OnApplyToAll, self.ApplyToAllButton)
- self.ButtonSizer.AddWindow(self.ApplyToAllButton, flag=wx.LEFT)
+ self.ButtonSizer.Add(self.ApplyToAllButton, flag=wx.LEFT)
else:
self.ConnectionName.ChangeValue(
controller.GenerateNewName(
--- a/dialogs/DurationEditorDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/DurationEditorDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -68,7 +68,7 @@
main_sizer.AddGrowableRow(0)
controls_sizer = wx.FlexGridSizer(cols=len(CONTROLS), hgap=10, rows=2, vgap=10)
- main_sizer.AddSizer(controls_sizer, border=20,
+ main_sizer.Add(controls_sizer, border=20,
flag=wx.TOP | wx.LEFT | wx.RIGHT | wx.GROW)
controls = []
@@ -85,14 +85,14 @@
controls.append((st, txtctrl))
for st, txtctrl in controls:
- controls_sizer.AddWindow(st, flag=wx.GROW)
+ controls_sizer.Add(st, flag=wx.GROW)
for st, txtctrl in controls:
- controls_sizer.AddWindow(txtctrl, flag=wx.GROW)
+ controls_sizer.Add(txtctrl, flag=wx.GROW)
button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE)
- self.Bind(wx.EVT_BUTTON, self.OnOK, button_sizer.GetAffirmativeButton())
- main_sizer.AddSizer(button_sizer, border=20,
+ self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.GetAffirmativeId())
+ main_sizer.Add(button_sizer, border=20,
flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
self.SetSizer(main_sizer)
--- a/dialogs/FBDBlockDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/FBDBlockDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -68,7 +68,7 @@
# Create static box around library panel
type_staticbox = wx.StaticBox(self, label=_('Type:'))
left_staticboxsizer = wx.StaticBoxSizer(type_staticbox, wx.VERTICAL)
- self.LeftGridSizer.AddSizer(left_staticboxsizer, border=5, flag=wx.GROW)
+ self.LeftGridSizer.Add(left_staticboxsizer, border=5, flag=wx.GROW)
# Create Library panel and add it to static box
self.LibraryPanel = LibraryPanel(self)
@@ -77,65 +77,65 @@
# Set function to call when selection in Library panel changed
setattr(self.LibraryPanel, "_OnTreeItemSelected",
self.OnLibraryTreeItemSelected)
- left_staticboxsizer.AddWindow(self.LibraryPanel, 1, border=5,
+ left_staticboxsizer.Add(self.LibraryPanel, 1, border=5,
flag=wx.GROW | wx.TOP)
# Create sizer for other block parameters
top_right_gridsizer = wx.FlexGridSizer(cols=2, hgap=0, rows=4, vgap=5)
top_right_gridsizer.AddGrowableCol(1)
- self.RightGridSizer.AddSizer(top_right_gridsizer, flag=wx.GROW)
+ self.RightGridSizer.Add(top_right_gridsizer, flag=wx.GROW)
# Create label for block name
name_label = wx.StaticText(self, label=_('Name:'))
- top_right_gridsizer.AddWindow(name_label,
+ top_right_gridsizer.Add(name_label,
flag=wx.ALIGN_CENTER_VERTICAL)
# Create text control for defining block name
self.BlockName = wx.TextCtrl(self)
self.Bind(wx.EVT_TEXT, self.OnNameChanged, self.BlockName)
- top_right_gridsizer.AddWindow(self.BlockName, flag=wx.GROW)
+ top_right_gridsizer.Add(self.BlockName, flag=wx.GROW)
# Create label for extended block input number
inputs_label = wx.StaticText(self, label=_('Inputs:'))
- top_right_gridsizer.AddWindow(inputs_label,
+ top_right_gridsizer.Add(inputs_label,
flag=wx.ALIGN_CENTER_VERTICAL)
# Create spin control for defining extended block input number
self.Inputs = wx.SpinCtrl(self, min=2, max=20,
style=wx.SP_ARROW_KEYS)
self.Bind(wx.EVT_SPINCTRL, self.OnInputsChanged, self.Inputs)
- top_right_gridsizer.AddWindow(self.Inputs, flag=wx.GROW)
+ top_right_gridsizer.Add(self.Inputs, flag=wx.GROW)
# Create label for block execution order
execution_order_label = wx.StaticText(self,
label=_('Execution Order:'))
- top_right_gridsizer.AddWindow(execution_order_label,
+ top_right_gridsizer.Add(execution_order_label,
flag=wx.ALIGN_CENTER_VERTICAL)
# Create spin control for defining block execution order
self.ExecutionOrder = wx.SpinCtrl(self, min=0, style=wx.SP_ARROW_KEYS)
self.Bind(wx.EVT_SPINCTRL, self.OnExecutionOrderChanged,
self.ExecutionOrder)
- top_right_gridsizer.AddWindow(self.ExecutionOrder, flag=wx.GROW)
+ top_right_gridsizer.Add(self.ExecutionOrder, flag=wx.GROW)
# Create label for block execution control
execution_control_label = wx.StaticText(self,
label=_('Execution Control:'))
- top_right_gridsizer.AddWindow(execution_control_label,
+ top_right_gridsizer.Add(execution_control_label,
flag=wx.ALIGN_CENTER_VERTICAL)
# Create check box to enable block execution control
self.ExecutionControl = wx.CheckBox(self)
self.Bind(wx.EVT_CHECKBOX, self.OnExecutionOrderChanged,
self.ExecutionControl)
- top_right_gridsizer.AddWindow(self.ExecutionControl, flag=wx.GROW)
+ top_right_gridsizer.Add(self.ExecutionControl, flag=wx.GROW)
# Add preview panel and associated label to sizers
- self.RightGridSizer.AddWindow(self.PreviewLabel, flag=wx.GROW)
- self.RightGridSizer.AddWindow(self.Preview, flag=wx.GROW)
+ self.RightGridSizer.Add(self.PreviewLabel, flag=wx.GROW)
+ self.RightGridSizer.Add(self.Preview, flag=wx.GROW)
# Add buttons sizer to sizers
- self.MainSizer.AddSizer(self.ButtonSizer, border=20,
+ self.MainSizer.Add(self.ButtonSizer, border=20,
flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
# Dictionary containing correspondence between parameter exchanged and
--- a/dialogs/FBDVariableDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/FBDVariableDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -73,49 +73,49 @@
# Create label for variable class
class_label = wx.StaticText(self, label=_('Class:'))
- self.LeftGridSizer.AddWindow(class_label, flag=wx.GROW)
+ self.LeftGridSizer.Add(class_label, flag=wx.GROW)
# Create a combo box for defining variable class
self.Class = wx.ComboBox(self, style=wx.CB_READONLY)
self.Bind(wx.EVT_COMBOBOX, self.OnClassChanged, self.Class)
- self.LeftGridSizer.AddWindow(self.Class, flag=wx.GROW)
+ self.LeftGridSizer.Add(self.Class, flag=wx.GROW)
# Create label for variable execution order
execution_order_label = wx.StaticText(self,
label=_('Execution Order:'))
- self.LeftGridSizer.AddWindow(execution_order_label, flag=wx.GROW)
+ self.LeftGridSizer.Add(execution_order_label, flag=wx.GROW)
# Create spin control for defining variable execution order
self.ExecutionOrder = wx.SpinCtrl(self, min=0, style=wx.SP_ARROW_KEYS)
self.Bind(wx.EVT_SPINCTRL, self.OnExecutionOrderChanged,
self.ExecutionOrder)
- self.LeftGridSizer.AddWindow(self.ExecutionOrder, flag=wx.GROW)
+ self.LeftGridSizer.Add(self.ExecutionOrder, flag=wx.GROW)
# Create label for variable expression
name_label = wx.StaticText(self, label=_('Expression:'))
- self.RightGridSizer.AddWindow(name_label, border=5,
+ self.RightGridSizer.Add(name_label, border=5,
flag=wx.GROW | wx.BOTTOM)
# Create text control for defining variable expression
self.Expression = wx.TextCtrl(self)
self.Bind(wx.EVT_TEXT, self.OnExpressionChanged, self.Expression)
- self.RightGridSizer.AddWindow(self.Expression, flag=wx.GROW)
+ self.RightGridSizer.Add(self.Expression, flag=wx.GROW)
# Create a list box to selected variable expression in the list of
# variables defined in POU
self.VariableName = wx.ListBox(self, size=wx.Size(-1, 120),
style=wx.LB_SINGLE | wx.LB_SORT)
self.Bind(wx.EVT_LISTBOX, self.OnNameChanged, self.VariableName)
- self.RightGridSizer.AddWindow(self.VariableName, border=4, flag=wx.GROW | wx.TOP)
+ self.RightGridSizer.Add(self.VariableName, border=4, flag=wx.GROW | wx.TOP)
# Add preview panel and associated label to sizers
- self.MainSizer.AddWindow(self.PreviewLabel, border=20,
+ self.MainSizer.Add(self.PreviewLabel, border=20,
flag=wx.GROW | wx.LEFT | wx.RIGHT)
- self.MainSizer.AddWindow(self.Preview, border=20,
+ self.MainSizer.Add(self.Preview, border=20,
flag=wx.GROW | wx.LEFT | wx.RIGHT)
# Add buttons sizer to sizers
- self.MainSizer.AddSizer(
+ self.MainSizer.Add(
self.ButtonSizer, border=20,
flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
--- a/dialogs/FindInPouDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/FindInPouDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -48,76 +48,76 @@
main_sizer.AddGrowableRow(0)
controls_sizer = wx.BoxSizer(wx.VERTICAL)
- main_sizer.AddSizer(controls_sizer, border=20,
+ main_sizer.Add(controls_sizer, border=20,
flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT)
patterns_sizer = wx.FlexGridSizer(cols=2, hgap=5, rows=1, vgap=5)
patterns_sizer.AddGrowableCol(1)
- controls_sizer.AddSizer(patterns_sizer, border=5, flag=wx.GROW | wx.BOTTOM)
+ controls_sizer.Add(patterns_sizer, border=5, flag=wx.GROW | wx.BOTTOM)
find_label = wx.StaticText(panel, label=_("Find:"))
- patterns_sizer.AddWindow(find_label, flag=wx.ALIGN_CENTER_VERTICAL)
+ patterns_sizer.Add(find_label, flag=wx.ALIGN_CENTER_VERTICAL)
self.FindPattern = wx.TextCtrl(panel)
self.Bind(wx.EVT_TEXT, self.OnFindPatternChanged, self.FindPattern)
self.Bind(wx.EVT_CHAR_HOOK, self.OnEscapeKey)
- patterns_sizer.AddWindow(self.FindPattern, flag=wx.GROW)
+ patterns_sizer.Add(self.FindPattern, flag=wx.GROW)
params_sizer = wx.BoxSizer(wx.HORIZONTAL)
- controls_sizer.AddSizer(params_sizer, border=5, flag=wx.GROW | wx.BOTTOM)
+ controls_sizer.Add(params_sizer, border=5, flag=wx.GROW | wx.BOTTOM)
direction_staticbox = wx.StaticBox(panel, label=_("Direction"))
direction_staticboxsizer = wx.StaticBoxSizer(
direction_staticbox, wx.VERTICAL)
- params_sizer.AddSizer(direction_staticboxsizer, 1, border=5,
+ params_sizer.Add(direction_staticboxsizer, 1, border=5,
flag=wx.GROW | wx.RIGHT)
self.Forward = wx.RadioButton(panel, label=_("Forward"),
style=wx.RB_GROUP)
- direction_staticboxsizer.AddWindow(self.Forward, border=5,
+ direction_staticboxsizer.Add(self.Forward, border=5,
flag=wx.ALL | wx.GROW)
self.Backward = wx.RadioButton(panel, label=_("Backward"))
- direction_staticboxsizer.AddWindow(self.Backward, border=5,
+ direction_staticboxsizer.Add(self.Backward, border=5,
flag=wx.ALL | wx.GROW)
options_staticbox = wx.StaticBox(panel, label=_("Options"))
options_staticboxsizer = wx.StaticBoxSizer(
options_staticbox, wx.VERTICAL)
- params_sizer.AddSizer(options_staticboxsizer, 1, flag=wx.GROW)
+ params_sizer.Add(options_staticboxsizer, 1, flag=wx.GROW)
self.CaseSensitive = wx.CheckBox(panel, label=_("Case sensitive"))
self.CaseSensitive.SetValue(True)
- options_staticboxsizer.AddWindow(self.CaseSensitive, border=5,
+ options_staticboxsizer.Add(self.CaseSensitive, border=5,
flag=wx.ALL | wx.GROW)
self.WrapSearch = wx.CheckBox(panel, label=_("Wrap search"))
self.WrapSearch.SetValue(True)
- options_staticboxsizer.AddWindow(self.WrapSearch, border=5,
+ options_staticboxsizer.Add(self.WrapSearch, border=5,
flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.GROW)
self.RegularExpressions = wx.CheckBox(panel, label=_("Regular expressions"))
- options_staticboxsizer.AddWindow(self.RegularExpressions, border=5,
+ options_staticboxsizer.Add(self.RegularExpressions, border=5,
flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.GROW)
buttons_sizer = wx.BoxSizer(wx.HORIZONTAL)
- main_sizer.AddSizer(buttons_sizer, border=20,
+ main_sizer.Add(buttons_sizer, border=20,
flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.ALIGN_RIGHT)
self.FindButton = wx.Button(panel, label=_("Find"))
self.FindButton.SetDefault()
self.Bind(wx.EVT_BUTTON, self.OnFindButton, self.FindButton)
- buttons_sizer.AddWindow(self.FindButton, border=5, flag=wx.RIGHT)
+ buttons_sizer.Add(self.FindButton, border=5, flag=wx.RIGHT)
self.CloseButton = wx.Button(panel, label=_("Close"))
self.Bind(wx.EVT_BUTTON, self.OnCloseButton, self.CloseButton)
- buttons_sizer.AddWindow(self.CloseButton)
+ buttons_sizer.Add(self.CloseButton)
# set the longest message here, to use it length to calculate
# optimal size of dialog window
self.RegExpSyntaxErrMsg = _("Syntax error in regular expression of pattern to search!")
self.StatusLabel = wx.StaticText(panel, label=self.RegExpSyntaxErrMsg)
- controls_sizer.AddWindow(self.StatusLabel, flag=wx.ALIGN_CENTER_VERTICAL)
+ controls_sizer.Add(self.StatusLabel)
panel.SetSizer(main_sizer)
main_sizer.Fit(self)
--- a/dialogs/ForceVariableDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/ForceVariableDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -189,7 +189,7 @@
info_sizer = wx.BoxSizer(wx.VERTICAL)
message_label = wx.StaticText(self, label=_("Forcing Variable Value"))
- info_sizer.AddWindow(message_label, border=10,
+ info_sizer.Add(message_label, border=10,
flag=wx.ALIGN_LEFT | wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT)
if GetTypeValue[self.IEC_Type] in [getinteger, getfloat]:
@@ -201,8 +201,8 @@
self.GetEnteredValue = self.GetValueDefault
button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE)
- self.Bind(wx.EVT_BUTTON, self.OnOK, button_sizer.GetAffirmativeButton())
- info_sizer.AddSizer(button_sizer, border=10, flag=wx.ALIGN_RIGHT | wx.ALL)
+ self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.GetAffirmativeId())
+ info_sizer.Add(button_sizer, border=10, flag=wx.ALIGN_RIGHT | wx.ALL)
self.SetSizer(info_sizer)
self.Fit()
@@ -216,7 +216,7 @@
"""Add simple text control to change variable of any type"""
self.ValueCtrl = wx.TextCtrl(self)
self.ValueCtrl.SetValue(defaultValue)
- info_sizer.AddWindow(self.ValueCtrl, border=10, proportion=1,
+ info_sizer.Add(self.ValueCtrl, border=10, proportion=1,
flag=wx.ALIGN_LEFT | wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT)
def GetValueDefault(self):
@@ -235,11 +235,11 @@
sizer = wx.BoxSizer(wx.HORIZONTAL)
self.InitCtrlDefault(sizer, defaultValue)
self.SpinButtonCtrl = wx.SpinButton(self, style=wx.HORIZONTAL | wx.SP_WRAP)
- sizer.AddWindow(self.SpinButtonCtrl, border=10,
+ sizer.Add(self.SpinButtonCtrl, border=10,
flag=wx.ALIGN_LEFT | wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT | wx.EXPAND)
self.Bind(wx.EVT_SPIN_UP, self.SpinButtonChanged)
self.Bind(wx.EVT_SPIN_DOWN, self.SpinButtonChanged)
- info_sizer.AddWindow(sizer, proportion=1, flag=wx.EXPAND)
+ info_sizer.Add(sizer, proportion=1, flag=wx.EXPAND)
def SpinButtonChanged(self, evt):
"""Increment/decrement variable value"""
@@ -261,7 +261,7 @@
if value is not None:
self.ValueCtrl.SetValue(value)
- info_sizer.AddWindow(self.ValueCtrl, border=10,
+ info_sizer.Add(self.ValueCtrl, border=10,
flag=wx.ALIGN_LEFT | wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT | wx.GROW)
def OnOK(self, event):
--- a/dialogs/IDMergeDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/IDMergeDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -15,11 +15,11 @@
main_sizer = wx.BoxSizer(wx.VERTICAL)
message = wx.StaticText(self, label=question)
- main_sizer.AddWindow(message, border=20,
+ main_sizer.Add(message, border=20,
flag=wx.ALIGN_CENTER_HORIZONTAL | wx.TOP | wx.LEFT | wx.RIGHT)
self.check = wx.CheckBox(self, label=optiontext)
- main_sizer.AddWindow(self.check, border=20,
+ main_sizer.Add(self.check, border=20,
flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.ALIGN_CENTER_HORIZONTAL)
buttons_sizer = wx.BoxSizer(wx.HORIZONTAL)
@@ -30,9 +30,9 @@
return lambda event: self.EndModal(_wxID)
self.Bind(wx.EVT_BUTTON, OnButtonFactory(wxID), Button)
- buttons_sizer.AddWindow(Button)
+ buttons_sizer.Add(Button)
- main_sizer.AddSizer(buttons_sizer, border=20,
+ main_sizer.Add(buttons_sizer, border=20,
flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.ALIGN_RIGHT)
self.SetSizer(main_sizer)
--- a/dialogs/LDElementDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/LDElementDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -63,7 +63,7 @@
# Create label for LD element modifier
modifier_label = wx.StaticText(self, label=_('Modifier:'))
- self.LeftGridSizer.AddWindow(modifier_label, border=5,
+ self.LeftGridSizer.Add(modifier_label, border=5,
flag=wx.GROW | wx.BOTTOM)
# Create radio buttons for selecting LD element modifier
@@ -84,13 +84,13 @@
style=(wx.RB_GROUP if first else 0))
radio_button.SetValue(first)
self.Bind(wx.EVT_RADIOBUTTON, self.OnModifierChanged, radio_button)
- self.LeftGridSizer.AddWindow(radio_button, flag=wx.GROW)
+ self.LeftGridSizer.Add(radio_button, flag=wx.GROW)
self.ModifierRadioButtons[modifier] = radio_button
first = False
# Create label for LD element variable
element_variable_label = wx.StaticText(self, label=_('Variable:'))
- self.LeftGridSizer.AddWindow(element_variable_label, border=5,
+ self.LeftGridSizer.Add(element_variable_label, border=5,
flag=wx.GROW | wx.TOP)
# Create a combo box for defining LD element variable
@@ -99,15 +99,15 @@
self.ElementVariable)
self.Bind(wx.EVT_TEXT, self.OnVariableChanged,
self.ElementVariable)
- self.LeftGridSizer.AddWindow(self.ElementVariable, border=5,
+ self.LeftGridSizer.Add(self.ElementVariable, border=5,
flag=wx.GROW | wx.TOP)
# Add preview panel and associated label to sizers
- self.RightGridSizer.AddWindow(self.PreviewLabel, flag=wx.GROW)
- self.RightGridSizer.AddWindow(self.Preview, flag=wx.GROW)
+ self.RightGridSizer.Add(self.PreviewLabel, flag=wx.GROW)
+ self.RightGridSizer.Add(self.Preview, flag=wx.GROW)
# Add buttons sizer to sizers
- self.MainSizer.AddSizer(self.ButtonSizer, border=20,
+ self.MainSizer.Add(self.ButtonSizer, border=20,
flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
# Save LD element class
@@ -198,8 +198,9 @@
self.GetElementModifier(),
value)
- button = self.ButtonSizer.GetAffirmativeButton()
- button.Enable(value != "")
+ # FIXME : how to disable OK button when content is not valid
+ # button = self.ButtonSizer.GetAffirmativeButton()
+ # button.Enable(value != "")
# Call BlockPreviewDialog function
BlockPreviewDialog.DrawPreview(self)
--- a/dialogs/LDPowerRailDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/LDPowerRailDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -56,7 +56,7 @@
# Create label for connection type
type_label = wx.StaticText(self, label=_('Type:'))
- self.LeftGridSizer.AddWindow(type_label, flag=wx.GROW)
+ self.LeftGridSizer.Add(type_label, flag=wx.GROW)
# Create radio buttons for selecting power rail type
self.TypeRadioButtons = {}
@@ -67,27 +67,27 @@
style=(wx.RB_GROUP if first else 0))
radio_button.SetValue(first)
self.Bind(wx.EVT_RADIOBUTTON, self.OnTypeChanged, radio_button)
- self.LeftGridSizer.AddWindow(radio_button, flag=wx.GROW)
+ self.LeftGridSizer.Add(radio_button, flag=wx.GROW)
self.TypeRadioButtons[type] = radio_button
first = False
# Create label for power rail pin number
pin_number_label = wx.StaticText(self, label=_('Pin number:'))
- self.LeftGridSizer.AddWindow(pin_number_label, flag=wx.GROW)
+ self.LeftGridSizer.Add(pin_number_label, flag=wx.GROW)
# Create spin control for defining power rail pin number
self.PinNumber = wx.SpinCtrl(self, min=1, max=50,
style=wx.SP_ARROW_KEYS)
self.PinNumber.SetValue(1)
self.Bind(wx.EVT_SPINCTRL, self.OnPinNumberChanged, self.PinNumber)
- self.LeftGridSizer.AddWindow(self.PinNumber, flag=wx.GROW)
+ self.LeftGridSizer.Add(self.PinNumber, flag=wx.GROW)
# Add preview panel and associated label to sizers
- self.RightGridSizer.AddWindow(self.PreviewLabel, flag=wx.GROW)
- self.RightGridSizer.AddWindow(self.Preview, flag=wx.GROW)
+ self.RightGridSizer.Add(self.PreviewLabel, flag=wx.GROW)
+ self.RightGridSizer.Add(self.Preview, flag=wx.GROW)
# Add buttons sizer to sizers
- self.MainSizer.AddSizer(
+ self.MainSizer.Add(
self.ButtonSizer, border=20,
flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
self.Fit()
--- a/dialogs/PouActionDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/PouActionDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -50,27 +50,26 @@
infos_sizer = wx.FlexGridSizer(cols=2, hgap=5, rows=3, vgap=15)
infos_sizer.AddGrowableCol(1)
- main_sizer.AddSizer(infos_sizer, border=20,
+ main_sizer.Add(infos_sizer, border=20,
flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT)
actionname_label = wx.StaticText(self, label=_('Action Name:'))
- infos_sizer.AddWindow(actionname_label, border=4,
+ infos_sizer.Add(actionname_label, border=4,
flag=wx.ALIGN_CENTER_VERTICAL | wx.TOP)
self.ActionName = wx.TextCtrl(self, size=wx.Size(180, -1))
- infos_sizer.AddWindow(self.ActionName, flag=wx.GROW)
+ infos_sizer.Add(self.ActionName, flag=wx.GROW)
language_label = wx.StaticText(self, label=_('Language:'))
- infos_sizer.AddWindow(language_label, border=4,
+ infos_sizer.Add(language_label, border=4,
flag=wx.ALIGN_CENTER_VERTICAL | wx.TOP)
self.Language = wx.ComboBox(self, style=wx.CB_READONLY)
- infos_sizer.AddWindow(self.Language, flag=wx.GROW)
+ infos_sizer.Add(self.Language, flag=wx.GROW)
button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE)
- self.Bind(wx.EVT_BUTTON, self.OnOK,
- button_sizer.GetAffirmativeButton())
- main_sizer.AddSizer(button_sizer, border=20,
+ self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.GetAffirmativeId())
+ main_sizer.Add(button_sizer, border=20,
flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
self.SetSizer(main_sizer)
--- a/dialogs/PouDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/PouDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -58,34 +58,34 @@
infos_sizer = wx.FlexGridSizer(cols=2, hgap=5, rows=3, vgap=15)
infos_sizer.AddGrowableCol(1)
- main_sizer.AddSizer(infos_sizer, border=20,
+ main_sizer.Add(infos_sizer, border=20,
flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT)
pouname_label = wx.StaticText(self, label=_('POU Name:'))
- infos_sizer.AddWindow(pouname_label, border=4,
+ infos_sizer.Add(pouname_label, border=4,
flag=wx.ALIGN_CENTER_VERTICAL | wx.TOP)
self.PouName = wx.TextCtrl(self)
- infos_sizer.AddWindow(self.PouName, flag=wx.GROW)
+ infos_sizer.Add(self.PouName, flag=wx.GROW)
poutype_label = wx.StaticText(self, label=_('POU Type:'))
- infos_sizer.AddWindow(poutype_label, border=4,
+ infos_sizer.Add(poutype_label, border=4,
flag=wx.ALIGN_CENTER_VERTICAL | wx.TOP)
self.PouType = wx.ComboBox(self, style=wx.CB_READONLY)
self.Bind(wx.EVT_COMBOBOX, self.OnTypeChanged, self.PouType)
- infos_sizer.AddWindow(self.PouType, flag=wx.GROW)
+ infos_sizer.Add(self.PouType, flag=wx.GROW)
language_label = wx.StaticText(self, label=_('Language:'))
- infos_sizer.AddWindow(language_label, border=4,
+ infos_sizer.Add(language_label, border=4,
flag=wx.ALIGN_CENTER_VERTICAL | wx.TOP)
self.Language = wx.ComboBox(self, style=wx.CB_READONLY)
- infos_sizer.AddWindow(self.Language, flag=wx.GROW)
+ infos_sizer.Add(self.Language, flag=wx.GROW)
button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE)
- self.Bind(wx.EVT_BUTTON, self.OnOK, button_sizer.GetAffirmativeButton())
- main_sizer.AddSizer(button_sizer, border=20,
+ self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.GetAffirmativeId())
+ main_sizer.Add(button_sizer, border=20,
flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
self.SetSizer(main_sizer)
--- a/dialogs/PouNameDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/PouNameDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -40,8 +40,7 @@
self.PouNames = []
- self.Bind(wx.EVT_BUTTON, self.OnOK,
- self.GetSizer().GetItem(2).GetSizer().GetItem(1).GetSizer().GetAffirmativeButton())
+ self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.GetAffirmativeId())
def OnOK(self, event):
message = None
--- a/dialogs/PouTransitionDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/PouTransitionDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -53,26 +53,26 @@
infos_sizer = wx.FlexGridSizer(cols=2, hgap=5, rows=3, vgap=10)
infos_sizer.AddGrowableCol(1)
- main_sizer.AddSizer(infos_sizer, border=20,
+ main_sizer.Add(infos_sizer, border=20,
flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT)
transitionname_label = wx.StaticText(self, label=_('Transition Name:'))
- infos_sizer.AddWindow(transitionname_label, border=4,
+ infos_sizer.Add(transitionname_label, border=4,
flag=wx.ALIGN_CENTER_VERTICAL | wx.TOP)
self.TransitionName = wx.TextCtrl(self, size=wx.Size(180, -1))
- infos_sizer.AddWindow(self.TransitionName, flag=wx.GROW)
+ infos_sizer.Add(self.TransitionName, flag=wx.GROW)
language_label = wx.StaticText(self, label=_('Language:'))
- infos_sizer.AddWindow(language_label, border=4,
+ infos_sizer.Add(language_label, border=4,
flag=wx.ALIGN_CENTER_VERTICAL | wx.TOP)
self.Language = wx.ComboBox(self, style=wx.CB_READONLY)
- infos_sizer.AddWindow(self.Language, flag=wx.GROW)
+ infos_sizer.Add(self.Language, flag=wx.GROW)
button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE)
- self.Bind(wx.EVT_BUTTON, self.OnOK, button_sizer.GetAffirmativeButton())
- main_sizer.AddSizer(button_sizer, border=20, flag=wx.ALIGN_RIGHT | wx.BOTTOM)
+ self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.GetAffirmativeId())
+ main_sizer.Add(button_sizer, border=20, flag=wx.ALIGN_RIGHT | wx.BOTTOM)
self.SetSizer(main_sizer)
--- a/dialogs/ProjectDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/ProjectDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -42,12 +42,11 @@
self.ProjectProperties = ProjectPropertiesPanel(
self, enable_required=enable_required, scrolling=False)
- main_sizer.AddWindow(self.ProjectProperties, flag=wx.GROW)
+ main_sizer.Add(self.ProjectProperties, flag=wx.GROW)
self.ButtonSizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE)
- self.Bind(wx.EVT_BUTTON, self.OnOK,
- self.ButtonSizer.GetAffirmativeButton())
- main_sizer.AddSizer(self.ButtonSizer, border=20,
+ self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.GetAffirmativeId())
+ main_sizer.Add(self.ButtonSizer, border=20,
flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
self.SetSizer(main_sizer)
--- a/dialogs/SFCDivergenceDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/SFCDivergenceDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -58,7 +58,7 @@
# Create label for divergence type
type_label = wx.StaticText(self, label=_('Type:'))
- self.LeftGridSizer.AddWindow(type_label, flag=wx.GROW)
+ self.LeftGridSizer.Add(type_label, flag=wx.GROW)
# Create radio buttons for selecting divergence type
divergence_buttons = [
@@ -80,7 +80,7 @@
style=(wx.RB_GROUP if first else 0))
radio_button.SetValue(first)
self.Bind(wx.EVT_RADIOBUTTON, self.OnTypeChanged, radio_button)
- self.LeftGridSizer.AddWindow(radio_button, flag=wx.GROW)
+ self.LeftGridSizer.Add(radio_button, flag=wx.GROW)
self.TypeRadioButtons[type] = radio_button
if first:
focusbtn = type
@@ -89,19 +89,19 @@
# Create label for number of divergence sequences
sequences_label = wx.StaticText(self,
label=_('Number of sequences:'))
- self.LeftGridSizer.AddWindow(sequences_label, flag=wx.GROW)
+ self.LeftGridSizer.Add(sequences_label, flag=wx.GROW)
# Create spin control for defining number of divergence sequences
self.Sequences = wx.SpinCtrl(self, min=2, max=20, initial=2)
self.Bind(wx.EVT_SPINCTRL, self.OnSequencesChanged, self.Sequences)
- self.LeftGridSizer.AddWindow(self.Sequences, flag=wx.GROW)
+ self.LeftGridSizer.Add(self.Sequences, flag=wx.GROW)
# Add preview panel and associated label to sizers
- self.RightGridSizer.AddWindow(self.PreviewLabel, flag=wx.GROW)
- self.RightGridSizer.AddWindow(self.Preview, flag=wx.GROW)
+ self.RightGridSizer.Add(self.PreviewLabel, flag=wx.GROW)
+ self.RightGridSizer.Add(self.Preview, flag=wx.GROW)
# Add buttons sizer to sizers
- self.MainSizer.AddSizer(
+ self.MainSizer.Add(
self.ButtonSizer, border=20,
flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
--- a/dialogs/SFCStepDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/SFCStepDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -57,16 +57,16 @@
# Create label for SFC step name
name_label = wx.StaticText(self, label=_('Name:'))
- self.LeftGridSizer.AddWindow(name_label, flag=wx.GROW)
+ self.LeftGridSizer.Add(name_label, flag=wx.GROW)
# Create text control for defining SFC step name
self.StepName = wx.TextCtrl(self)
self.Bind(wx.EVT_TEXT, self.OnNameChanged, self.StepName)
- self.LeftGridSizer.AddWindow(self.StepName, flag=wx.GROW)
+ self.LeftGridSizer.Add(self.StepName, flag=wx.GROW)
# Create label for SFC step connectors
connectors_label = wx.StaticText(self, label=_('Connectors:'))
- self.LeftGridSizer.AddWindow(connectors_label, flag=wx.GROW)
+ self.LeftGridSizer.Add(connectors_label, flag=wx.GROW)
# Create check boxes for defining connectors available on SFC step
self.ConnectorsCheckBox = {}
@@ -77,15 +77,15 @@
if name == "output" or (name == "input" and not initial):
check_box.SetValue(True)
self.Bind(wx.EVT_CHECKBOX, self.OnConnectorsChanged, check_box)
- self.LeftGridSizer.AddWindow(check_box, flag=wx.GROW)
+ self.LeftGridSizer.Add(check_box, flag=wx.GROW)
self.ConnectorsCheckBox[name] = check_box
# Add preview panel and associated label to sizers
- self.RightGridSizer.AddWindow(self.PreviewLabel, flag=wx.GROW)
- self.RightGridSizer.AddWindow(self.Preview, flag=wx.GROW)
+ self.RightGridSizer.Add(self.PreviewLabel, flag=wx.GROW)
+ self.RightGridSizer.Add(self.Preview, flag=wx.GROW)
# Add buttons sizer to sizers
- self.MainSizer.AddSizer(
+ self.MainSizer.Add(
self.ButtonSizer, border=20,
flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
--- a/dialogs/SFCStepNameDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/SFCStepNameDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -42,8 +42,7 @@
self.Variables = []
self.StepNames = []
- self.Bind(wx.EVT_BUTTON, self.OnOK,
- self.GetSizer().GetItem(2).GetSizer().GetItem(1).GetSizer().GetAffirmativeButton())
+ self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.GetAffirmativeId())
def OnOK(self, event):
message = None
--- a/dialogs/SFCTransitionDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/SFCTransitionDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -57,7 +57,7 @@
# Create label for transition type
type_label = wx.StaticText(self, label=_('Type:'))
- self.LeftGridSizer.AddWindow(type_label, flag=wx.GROW)
+ self.LeftGridSizer.Add(type_label, flag=wx.GROW)
# Create combo box for selecting reference value
reference = wx.ComboBox(self, style=wx.CB_READONLY)
@@ -80,28 +80,28 @@
style=(wx.RB_GROUP if first else 0))
radio_button.SetValue(first)
self.Bind(wx.EVT_RADIOBUTTON, self.OnTypeChanged, radio_button)
- self.LeftGridSizer.AddWindow(radio_button, flag=wx.GROW)
+ self.LeftGridSizer.Add(radio_button, flag=wx.GROW)
if control is not None:
control.Enable(first)
- self.LeftGridSizer.AddWindow(control, flag=wx.GROW)
+ self.LeftGridSizer.Add(control, flag=wx.GROW)
self.TypeRadioButtons[type] = (radio_button, control)
first = False
# Create label for transition priority
priority_label = wx.StaticText(self, label=_('Priority:'))
- self.LeftGridSizer.AddWindow(priority_label, flag=wx.GROW)
+ self.LeftGridSizer.Add(priority_label, flag=wx.GROW)
# Create spin control for defining priority value
self.Priority = wx.SpinCtrl(self, min=0, style=wx.SP_ARROW_KEYS)
self.Bind(wx.EVT_TEXT, self.OnPriorityChanged, self.Priority)
- self.LeftGridSizer.AddWindow(self.Priority, flag=wx.GROW)
+ self.LeftGridSizer.Add(self.Priority, flag=wx.GROW)
# Add preview panel and associated label to sizers
- self.RightGridSizer.AddWindow(self.PreviewLabel, flag=wx.GROW)
- self.RightGridSizer.AddWindow(self.Preview, flag=wx.GROW)
+ self.RightGridSizer.Add(self.PreviewLabel, flag=wx.GROW)
+ self.RightGridSizer.Add(self.Preview, flag=wx.GROW)
# Add buttons sizer to sizers
- self.MainSizer.AddSizer(
+ self.MainSizer.Add(
self.ButtonSizer, border=20,
flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
--- a/dialogs/SearchInProjectDialog.py Thu Sep 16 09:40:36 2021 +0200
+++ b/dialogs/SearchInProjectDialog.py Fri Oct 01 17:44:52 2021 +0200
@@ -54,59 +54,59 @@
pattern_sizer = wx.FlexGridSizer(cols=2, hgap=5, rows=2, vgap=5)
pattern_sizer.AddGrowableCol(0)
- main_sizer.AddSizer(pattern_sizer, border=20,
+ main_sizer.Add(pattern_sizer, border=20,
flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT)
pattern_label = wx.StaticText(self, label=_('Pattern to search:'))
- pattern_sizer.AddWindow(pattern_label, flag=wx.ALIGN_BOTTOM)
+ pattern_sizer.Add(pattern_label, flag=wx.ALIGN_BOTTOM)
self.CaseSensitive = wx.CheckBox(self, label=_('Case sensitive'))
- pattern_sizer.AddWindow(self.CaseSensitive, flag=wx.GROW)
+ pattern_sizer.Add(self.CaseSensitive, flag=wx.GROW)
self.Pattern = wx.TextCtrl(self, size=wx.Size(250, -1))
self.Bind(wx.EVT_TEXT, self.FindPatternChanged, self.Pattern)
- pattern_sizer.AddWindow(self.Pattern, flag=wx.GROW)
+ pattern_sizer.Add(self.Pattern, flag=wx.GROW)
self.Bind(wx.EVT_CHAR_HOOK, self.OnEscapeKey)
self.RegularExpression = wx.CheckBox(self, label=_('Regular expression'))
- pattern_sizer.AddWindow(self.RegularExpression, flag=wx.GROW)
+ pattern_sizer.Add(self.RegularExpression, flag=wx.GROW)
scope_staticbox = wx.StaticBox(self, label=_('Scope'))
scope_sizer = wx.StaticBoxSizer(scope_staticbox, wx.HORIZONTAL)
- main_sizer.AddSizer(scope_sizer, border=20,
+ main_sizer.Add(scope_sizer, border=20,
flag=wx.GROW | wx.LEFT | wx.RIGHT)
scope_selection_sizer = wx.BoxSizer(wx.VERTICAL)
- scope_sizer.AddSizer(scope_selection_sizer, 1, border=5,
+ scope_sizer.Add(scope_selection_sizer, 1, border=5,
flag=wx.GROW | wx.TOP | wx.LEFT | wx.BOTTOM)
self.WholeProject = wx.RadioButton(self, label=_('Whole Project'), style=wx.RB_GROUP)
self.WholeProject.SetValue(True)
self.Bind(wx.EVT_RADIOBUTTON, self.OnScopeChanged, self.WholeProject)
- scope_selection_sizer.AddWindow(self.WholeProject, border=5,
+ scope_selection_sizer.Add(self.WholeProject, border=5,
flag=wx.GROW | wx.BOTTOM)
self.OnlyElements = wx.RadioButton(self, label=_('Only Elements'))
self.Bind(wx.EVT_RADIOBUTTON, self.OnScopeChanged, self.OnlyElements)
self.OnlyElements.SetValue(False)
- scope_selection_sizer.AddWindow(self.OnlyElements, flag=wx.GROW)
+ scope_selection_sizer.Add(self.OnlyElements, flag=wx.GROW)
self.ElementsList = wx.CheckListBox(self)
self.ElementsList.Enable(False)
- scope_sizer.AddWindow(self.ElementsList, 1, border=5,
+ scope_sizer.Add(self.ElementsList, 1, border=5,
flag=wx.GROW | wx.TOP | wx.RIGHT | wx.BOTTOM)
buttons_sizer = wx.BoxSizer(wx.HORIZONTAL)
- main_sizer.AddSizer(buttons_sizer, border=20,
+ main_sizer.Add(buttons_sizer, border=20,
flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.ALIGN_RIGHT)
self.FindButton = wx.Button(self, label=_("Find"))
self.FindButton.SetDefault()
self.Bind(wx.EVT_BUTTON, self.OnFindButton, self.FindButton)
- buttons_sizer.AddWindow(self.FindButton, border=5, flag=wx.RIGHT)
+ buttons_sizer.Add(self.FindButton, border=5, flag=wx.RIGHT)
self.CloseButton = wx.Button(self, label=_("Close"))
self.Bind(wx.EVT_BUTTON, self.OnCloseButton, self.CloseButton)
- buttons_sizer.AddWindow(self.CloseButton)
+ buttons_sizer.Add(self.CloseButton)
self.SetSizer(main_sizer)
--- a/editors/CodeFileEditor.py Thu Sep 16 09:40:36 2021 +0200
+++ b/editors/CodeFileEditor.py Fri Oct 01 17:44:52 2021 +0200
@@ -291,17 +291,16 @@
doc_end_pos = self.GetLength()
for section in self.Controler.SECTIONS_NAMES:
section_comments = self.SectionsComments[section]
- start_pos = self.FindText(0, doc_end_pos, section_comments["comment"])
- end_pos = start_pos + len(section_comments["comment"])
- self.StartStyling(start_pos, 0xff)
+ start_pos, end_pos = self.FindText(0, doc_end_pos, section_comments["comment"])
+ self.StartStyling(start_pos)
self.SetStyling(end_pos - start_pos, STC_CODE_SECTION)
self.SetLineState(self.LineFromPosition(start_pos), 1)
- self.StartStyling(end_pos, 0x00)
+ self.StartStyling(end_pos)
self.SetStyling(doc_end_pos - end_pos, stc.STC_STYLE_DEFAULT)
def DoGetBestSize(self):
- return self.ParentWindow.GetPanelBestSize()
+ return self.ParentWindow.GetBestSize()
def RefreshModel(self):
text = self.GetText()
@@ -597,9 +596,9 @@
highlight_end_pos = end[1] + 1
else:
highlight_end_pos = self.GetLineEndPosition(end[0] - 1) + end[1] + 2
- self.StartStyling(highlight_start_pos, 0xff)
+ self.StartStyling(highlight_start_pos)
self.SetStyling(highlight_end_pos - highlight_start_pos, highlight_type)
- self.StartStyling(highlight_end_pos, 0x00)
+ self.StartStyling(highlight_end_pos)
self.SetStyling(len(self.GetText()) - highlight_end_pos, stc.STC_STYLE_DEFAULT)
@@ -614,8 +613,7 @@
class ClassGridCellEditor(wx.grid.GridCellChoiceEditor):
def __init__(self, table, row, col):
- wx.grid.GridCellChoiceEditor.__init__(self)
- self.SetParameters("input,memory,output")
+ wx.grid.GridCellChoiceEditor.__init__(self,["input","memory","output"])
class VariablesTable(CustomTable):
@@ -678,7 +676,7 @@
main_sizer.AddGrowableRow(0)
controls_sizer = wx.BoxSizer(wx.VERTICAL)
- main_sizer.AddSizer(controls_sizer, border=5, flag=wx.ALL)
+ main_sizer.Add(controls_sizer, border=5, flag=wx.ALL)
for name, bitmap, help in [
("AddVariableButton", "add_element", _("Add variable")),
@@ -687,15 +685,15 @@
("DownVariableButton", "down", _("Move variable down"))]:
button = wx.lib.buttons.GenBitmapButton(self, bitmap=GetBitmap(bitmap),
size=wx.Size(28, 28), style=wx.NO_BORDER)
- button.SetToolTipString(help)
+ button.SetToolTip(help)
setattr(self, name, button)
- controls_sizer.AddWindow(button, border=5, flag=wx.BOTTOM)
+ controls_sizer.Add(button, border=5, flag=wx.BOTTOM)
self.VariablesGrid = CustomGrid(self, style=wx.VSCROLL)
- self.VariablesGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGE, self.OnVariablesGridCellChange)
+ self.VariablesGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGING, self.OnVariablesGridCellChange)
self.VariablesGrid.Bind(wx.grid.EVT_GRID_CELL_LEFT_CLICK, self.OnVariablesGridCellLeftClick)
self.VariablesGrid.Bind(wx.grid.EVT_GRID_EDITOR_SHOWN, self.OnVariablesGridEditorShown)
- main_sizer.AddWindow(self.VariablesGrid, flag=wx.GROW)
+ main_sizer.Add(self.VariablesGrid, flag=wx.GROW)
self.SetSizer(main_sizer)
@@ -785,7 +783,7 @@
self.VariablesGrid.RefreshButtons()
def DoGetBestSize(self):
- return self.ParentWindow.GetPanelBestSize()
+ return self.ParentWindow.GetBestSize()
def ShowErrorMessage(self, message):
dialog = wx.MessageDialog(self, message, _("Error"), wx.OK | wx.ICON_ERROR)
@@ -836,7 +834,7 @@
type_menu.AppendMenu(wx.ID_ANY, "User Data Types", datatype_menu)
rect = self.VariablesGrid.BlockToDeviceRect((row, col), (row, col))
- self.VariablesGrid.PopupMenuXY(type_menu, rect.x + rect.width, rect.y + self.VariablesGrid.GetColLabelSize())
+ self.VariablesGrid.PopupMenu(type_menu, rect.x + rect.width, rect.y + self.VariablesGrid.GetColLabelSize())
type_menu.Destroy()
event.Veto()
else:
--- a/editors/ConfTreeNodeEditor.py Thu Sep 16 09:40:36 2021 +0200
+++ b/editors/ConfTreeNodeEditor.py Fri Oct 01 17:44:52 2021 +0200
@@ -120,7 +120,7 @@
bitmap = GetBitmap(bitmapname)
if bitmap is None:
- bitmap = wx.EmptyBitmap(0, 0)
+ bitmap = wx.Bitmap()
wx.StaticBitmap.__init__(self, parent, ID,
bitmap,
@@ -148,18 +148,18 @@
if self.SHOW_BASE_PARAMS:
baseparamseditor_sizer = wx.BoxSizer(wx.HORIZONTAL)
- self.MainSizer.AddSizer(baseparamseditor_sizer, border=5,
+ self.MainSizer.Add(baseparamseditor_sizer, border=5,
flag=wx.GROW | wx.ALL)
self.FullIECChannel = wx.StaticText(self.Editor, -1)
self.FullIECChannel.SetFont(
wx.Font(faces["size"], wx.DEFAULT, wx.NORMAL,
wx.BOLD, faceName=faces["helv"]))
- baseparamseditor_sizer.AddWindow(self.FullIECChannel,
+ baseparamseditor_sizer.Add(self.FullIECChannel,
flag=wx.ALIGN_CENTER_VERTICAL)
updownsizer = wx.BoxSizer(wx.VERTICAL)
- baseparamseditor_sizer.AddSizer(updownsizer, border=5,
+ baseparamseditor_sizer.Add(updownsizer, border=5,
flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL)
self.IECCUpButton = wx.lib.buttons.GenBitmapTextButton(
@@ -169,14 +169,14 @@
style=wx.NO_BORDER)
self.IECCUpButton.Bind(wx.EVT_BUTTON, self.GetItemChannelChangedFunction(1),
self.IECCUpButton)
- updownsizer.AddWindow(self.IECCUpButton, flag=wx.ALIGN_LEFT)
+ updownsizer.Add(self.IECCUpButton, flag=wx.ALIGN_LEFT)
self.IECCDownButton = wx.lib.buttons.GenBitmapButton(
self.Editor, bitmap=GetBitmap('IECCUp'),
size=wx.Size(16, 16), style=wx.NO_BORDER)
self.IECCDownButton.Bind(wx.EVT_BUTTON, self.GetItemChannelChangedFunction(-1),
self.IECCDownButton)
- updownsizer.AddWindow(self.IECCDownButton, flag=wx.ALIGN_LEFT)
+ updownsizer.Add(self.IECCDownButton, flag=wx.ALIGN_LEFT)
self.ConfNodeName = wx.TextCtrl(self.Editor,
size=wx.Size(150, 25))
@@ -187,17 +187,17 @@
wx.EVT_TEXT,
self.GetTextCtrlCallBackFunction(self.ConfNodeName, "BaseParams.Name", True),
self.ConfNodeName)
- baseparamseditor_sizer.AddWindow(
+ baseparamseditor_sizer.Add(
self.ConfNodeName, border=5,
flag=wx.LEFT | wx.RIGHT | wx.ALIGN_CENTER_VERTICAL)
buttons_sizer = self.GenerateMethodButtonSizer()
- baseparamseditor_sizer.AddSizer(buttons_sizer, flag=wx.ALIGN_CENTER)
+ baseparamseditor_sizer.Add(buttons_sizer, flag=wx.ALIGN_CENTER)
if tabs_num > 1:
self.ConfNodeNoteBook = wx.Notebook(self.Editor)
parent = self.ConfNodeNoteBook
- self.MainSizer.AddWindow(self.ConfNodeNoteBook, 1, flag=wx.GROW)
+ self.MainSizer.Add(self.ConfNodeNoteBook, 1, flag=wx.GROW)
else:
parent = self.Editor
self.ConfNodeNoteBook = None
@@ -212,7 +212,7 @@
if self.ConfNodeNoteBook is not None:
self.ConfNodeNoteBook.AddPage(editor, title)
elif self.SHOW_BASE_PARAMS:
- self.MainSizer.AddWindow(editor, 1, flag=wx.GROW)
+ self.MainSizer.Add(editor, 1, flag=wx.GROW)
else:
self.Editor = editor
@@ -232,7 +232,7 @@
self.ParamsEditor.SetSizer(self.ParamsEditorSizer)
self.ConfNodeParamsSizer = wx.BoxSizer(wx.VERTICAL)
- self.ParamsEditorSizer.AddSizer(self.ConfNodeParamsSizer, border=5,
+ self.ParamsEditorSizer.Add(self.ConfNodeParamsSizer, border=5,
flag=wx.LEFT | wx.RIGHT | wx.BOTTOM)
self.RefreshConfNodeParamsSizer()
@@ -240,7 +240,7 @@
if self.ConfNodeNoteBook is not None:
self.ConfNodeNoteBook.AddPage(self.ParamsEditor, _("Config"))
elif self.SHOW_BASE_PARAMS:
- self.MainSizer.AddWindow(self.ParamsEditor, 1, flag=wx.GROW)
+ self.MainSizer.Add(self.ParamsEditor, 1, flag=wx.GROW)
else:
self.Editor = self.ParamsEditor
else:
@@ -317,7 +317,7 @@
label=confnode_method["name"],
style=wx.NO_BORDER)
button.SetFont(normal_bt_font)
- button.SetToolTipString(confnode_method["tooltip"])
+ button.SetToolTip(confnode_method["tooltip"])
if confnode_method.get("push", False):
button.Bind(wx.EVT_LEFT_DOWN, self.GetButtonCallBackFunction(confnode_method["method"], True))
else:
@@ -335,7 +335,7 @@
# hack to force size to mini
if not confnode_method.get("enabled", True):
button.Disable()
- msizer.AddWindow(button, flag=wx.ALIGN_CENTER)
+ msizer.Add(button, flag=wx.ALIGN_CENTER)
return msizer
def UriOptions(self, event):
@@ -380,32 +380,32 @@
flags = (wx.GROW | wx.BOTTOM | wx.LEFT | wx.RIGHT)
if first:
flags |= wx.TOP
- sizer.AddSizer(staticboxsizer, border=5, flag=flags)
+ sizer.Add(staticboxsizer, border=5, flag=flags)
self.GenerateSizerElements(staticboxsizer,
element_infos["children"],
element_path)
else:
- boxsizer = wx.FlexGridSizer(cols=4, rows=1)
+ boxsizer = wx.FlexGridSizer(cols=4, rows=1, gap=wx.Size(0,0))
boxsizer.AddGrowableCol(1)
flags = (wx.GROW | wx.BOTTOM | wx.LEFT | wx.RIGHT)
if first:
flags |= wx.TOP
- sizer.AddSizer(boxsizer, border=5, flag=flags)
+ sizer.Add(boxsizer, border=5, flag=flags)
staticbitmap = GenStaticBitmap(
ID=-1, bitmapname=element_infos["name"],
name="%s_bitmap" % element_infos["name"], parent=self.ParamsEditor,
pos=wx.Point(0, 0), size=wx.Size(24, 24), style=0)
- boxsizer.AddWindow(staticbitmap, border=5, flag=wx.RIGHT)
+ boxsizer.Add(staticbitmap, border=5, flag=wx.RIGHT)
statictext = wx.StaticText(self.ParamsEditor,
label="%s:" % _(element_infos["name"]))
- boxsizer.AddWindow(statictext, border=5,
+ boxsizer.Add(statictext, border=5,
flag=wx.ALIGN_CENTER_VERTICAL | wx.RIGHT)
if isinstance(element_infos["type"], list):
if isinstance(element_infos["value"], tuple):
browse_boxsizer = wx.BoxSizer(wx.HORIZONTAL)
- boxsizer.AddSizer(browse_boxsizer)
+ boxsizer.Add(browse_boxsizer)
textctrl = wx.TextCtrl(self.ParamsEditor,
size=wx.Size(275, -1), style=wx.TE_READONLY)
@@ -414,10 +414,10 @@
value_infos = element_infos["value"][1]
else:
value_infos = None
- browse_boxsizer.AddWindow(textctrl)
+ browse_boxsizer.Add(textctrl)
button = wx.Button(self.ParamsEditor, label="...")
- browse_boxsizer.AddWindow(button)
+ browse_boxsizer.Add(button)
button.Bind(wx.EVT_BUTTON,
self.GetBrowseCallBackFunction(element_infos["name"], textctrl, element_infos["type"],
value_infos, element_path),
@@ -425,7 +425,7 @@
else:
combobox = wx.ComboBox(self.ParamsEditor,
size=wx.Size(300, -1), style=wx.CB_READONLY)
- boxsizer.AddWindow(combobox)
+ boxsizer.Add(combobox)
if element_infos["use"] == "optional":
combobox.Append("")
@@ -439,7 +439,7 @@
label="%s - %s" % (_(name), _(value)),
size=wx.Size(10, 0))
staticboxsizer = wx.StaticBoxSizer(staticbox, wx.VERTICAL)
- sizer.AddSizer(staticboxsizer, border=5, flag=wx.GROW | wx.BOTTOM | wx.LEFT | wx.RIGHT)
+ sizer.Add(staticboxsizer, border=5, flag=wx.GROW | wx.BOTTOM | wx.LEFT | wx.RIGHT)
self.GenerateSizerElements(staticboxsizer, element_infos["children"], element_path)
callback = self.GetChoiceContentCallBackFunction(combobox, staticboxsizer, element_path)
else:
@@ -463,7 +463,7 @@
size=wx.Size(300, -1),
style=wx.SP_ARROW_KEYS | wx.ALIGN_RIGHT)
spinctrl.SetRange(scmin, scmax)
- boxsizer.AddWindow(spinctrl)
+ boxsizer.Add(spinctrl)
if element_infos["value"] is not None:
spinctrl.SetValue(element_infos["value"])
spinctrl.Bind(wx.EVT_SPINCTRL,
@@ -473,7 +473,7 @@
else:
if element_infos["type"] == "boolean":
checkbox = wx.CheckBox(self.ParamsEditor)
- boxsizer.AddWindow(checkbox, flag=wx.ALIGN_CENTER_VERTICAL | wx.RIGHT)
+ boxsizer.Add(checkbox, flag=wx.ALIGN_CENTER_VERTICAL | wx.RIGHT)
if element_infos["value"] is not None:
checkbox.SetValue(element_infos["value"])
checkbox.Bind(wx.EVT_CHECKBOX,
@@ -490,7 +490,7 @@
size=wx.Size(300, -1),
style=wx.SP_ARROW_KEYS | wx.ALIGN_RIGHT)
spinctrl.SetRange(scmin, scmax)
- boxsizer.AddWindow(spinctrl)
+ boxsizer.Add(spinctrl)
if element_infos["value"] is not None:
spinctrl.SetValue(element_infos["value"])
spinctrl.Bind(wx.EVT_SPINCTRL,
@@ -513,12 +513,12 @@
self.EditButton = wx.Button(self.ParamsEditor, label='...', size=wx.Size(30, -1))
self.Bind(wx.EVT_BUTTON, self.UriOptions, self.EditButton)
- uriSizer.AddWindow(textctrl, flag=wx.GROW)
- uriSizer.AddWindow(self.EditButton, flag=wx.GROW)
-
- boxsizer.AddWindow(uriSizer)
+ uriSizer.Add(textctrl, flag=wx.GROW)
+ uriSizer.Add(self.EditButton, flag=wx.GROW)
+
+ boxsizer.Add(uriSizer)
else:
- boxsizer.AddWindow(textctrl)
+ boxsizer.Add(textctrl)
if element_infos["value"] is not None:
textctrl.ChangeValue(str(element_infos["value"]))
@@ -535,7 +535,7 @@
self.GetResetFunction(element_path),
bt)
- boxsizer.AddWindow(bt, border=5, flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT)
+ boxsizer.Add(bt, border=5, flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT)
first = False
sizer.Layout()
self.RefreshScrollbars()
--- a/editors/DataTypeEditor.py Thu Sep 16 09:40:36 2021 +0200
+++ b/editors/DataTypeEditor.py Fri Oct 01 17:44:52 2021 +0200
@@ -155,49 +155,49 @@
self.MainSizer.AddGrowableRow(1)
top_sizer = wx.BoxSizer(wx.HORIZONTAL)
- self.MainSizer.AddSizer(top_sizer, border=5,
+ self.MainSizer.Add(top_sizer, border=5,
flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT)
derivation_type_label = wx.StaticText(self.Editor, label=_('Derivation Type:'))
- top_sizer.AddWindow(derivation_type_label, border=5,
+ top_sizer.Add(derivation_type_label, border=5,
flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT)
self.DerivationType = wx.ComboBox(self.Editor,
size=wx.Size(200, -1), style=wx.CB_READONLY)
self.Bind(wx.EVT_COMBOBOX, self.OnDerivationTypeChanged, self.DerivationType)
- top_sizer.AddWindow(self.DerivationType, border=5, flag=wx.GROW | wx.RIGHT)
+ top_sizer.Add(self.DerivationType, border=5, flag=wx.GROW | wx.RIGHT)
typeinfos_staticbox = wx.StaticBox(self.Editor, label=_('Type infos:'))
typeinfos_sizer = wx.StaticBoxSizer(typeinfos_staticbox, wx.HORIZONTAL)
- self.MainSizer.AddSizer(typeinfos_sizer, border=5,
+ self.MainSizer.Add(typeinfos_sizer, border=5,
flag=wx.GROW | wx.BOTTOM | wx.LEFT | wx.RIGHT)
# Panel for Directly derived data types
self.DirectlyPanel = wx.Panel(self.Editor, style=wx.TAB_TRAVERSAL)
- typeinfos_sizer.AddWindow(self.DirectlyPanel, 1)
+ typeinfos_sizer.Add(self.DirectlyPanel, 1)
directly_panel_sizer = wx.BoxSizer(wx.HORIZONTAL)
directly_basetype_label = wx.StaticText(self.DirectlyPanel,
label=_('Base Type:'))
- directly_panel_sizer.AddWindow(directly_basetype_label, 1, border=5,
+ directly_panel_sizer.Add(directly_basetype_label, 1, border=5,
flag=wx.ALIGN_CENTER_VERTICAL | wx.ALL)
self.DirectlyBaseType = wx.ComboBox(self.DirectlyPanel, style=wx.CB_READONLY)
self.Bind(wx.EVT_COMBOBOX, self.OnInfosChanged, self.DirectlyBaseType)
- directly_panel_sizer.AddWindow(self.DirectlyBaseType, 1, border=5,
+ directly_panel_sizer.Add(self.DirectlyBaseType, 1, border=5,
flag=wx.GROW | wx.ALL)
directly_initialvalue_label = wx.StaticText(self.DirectlyPanel,
label=_('Initial Value:'))
- directly_panel_sizer.AddWindow(directly_initialvalue_label, 1, border=5,
+ directly_panel_sizer.Add(directly_initialvalue_label, 1, border=5,
flag=wx.ALIGN_CENTER_VERTICAL | wx.ALL)
self.DirectlyInitialValue = wx.TextCtrl(self.DirectlyPanel,
style=wx.TE_PROCESS_ENTER | wx.TE_RICH)
self.Bind(wx.EVT_TEXT_ENTER, self.OnReturnKeyPressed, self.DirectlyInitialValue)
- directly_panel_sizer.AddWindow(self.DirectlyInitialValue, 1, border=5,
+ directly_panel_sizer.Add(self.DirectlyInitialValue, 1, border=5,
flag=wx.ALL)
self.DirectlyPanel.SetSizer(directly_panel_sizer)
@@ -205,52 +205,52 @@
# Panel for Subrange data types
self.SubrangePanel = wx.Panel(self.Editor, style=wx.TAB_TRAVERSAL)
- typeinfos_sizer.AddWindow(self.SubrangePanel, 1)
+ typeinfos_sizer.Add(self.SubrangePanel, 1)
subrange_panel_sizer = wx.GridSizer(cols=4, hgap=5, rows=3, vgap=0)
subrange_basetype_label = wx.StaticText(self.SubrangePanel,
label=_('Base Type:'))
- subrange_panel_sizer.AddWindow(subrange_basetype_label, 1, border=5,
+ subrange_panel_sizer.Add(subrange_basetype_label, 1, border=5,
flag=wx.ALIGN_CENTER_VERTICAL | wx.ALL)
self.SubrangeBaseType = wx.ComboBox(self.SubrangePanel, style=wx.CB_READONLY)
self.Bind(wx.EVT_COMBOBOX, self.OnSubrangeBaseTypeChanged,
self.SubrangeBaseType)
- subrange_panel_sizer.AddWindow(self.SubrangeBaseType, 1, border=5,
+ subrange_panel_sizer.Add(self.SubrangeBaseType, 1, border=5,
flag=wx.GROW | wx.ALL)
subrange_initialvalue_label = wx.StaticText(self.SubrangePanel,
label=_('Initial Value:'))
- subrange_panel_sizer.AddWindow(subrange_initialvalue_label, 1, border=5,
+ subrange_panel_sizer.Add(subrange_initialvalue_label, 1, border=5,
flag=wx.ALIGN_CENTER_VERTICAL | wx.ALL)
self.SubrangeInitialValue = CustomIntCtrl(self.SubrangePanel, style=wx.TAB_TRAVERSAL)
self.SubrangeInitialValue.Bind(CustomIntCtrl.EVT_CUSTOM_INT, self.OnInfosChanged)
- subrange_panel_sizer.AddWindow(self.SubrangeInitialValue, 1, border=5,
+ subrange_panel_sizer.Add(self.SubrangeInitialValue, 1, border=5,
flag=wx.GROW | wx.ALL)
subrange_minimum_label = wx.StaticText(self.SubrangePanel, label=_('Minimum:'))
- subrange_panel_sizer.AddWindow(subrange_minimum_label, 1, border=5,
+ subrange_panel_sizer.Add(subrange_minimum_label, 1, border=5,
flag=wx.ALIGN_CENTER_VERTICAL | wx.ALL)
self.SubrangeMinimum = CustomIntCtrl(self.SubrangePanel, style=wx.TAB_TRAVERSAL)
self.SubrangeMinimum.Bind(CustomIntCtrl.EVT_CUSTOM_INT, self.OnSubrangeMinimumChanged)
- subrange_panel_sizer.AddWindow(self.SubrangeMinimum, 1, border=5,
+ subrange_panel_sizer.Add(self.SubrangeMinimum, 1, border=5,
flag=wx.GROW | wx.ALL)
for dummy in xrange(2):
- subrange_panel_sizer.AddWindow(wx.Size(0, 0), 1)
+ subrange_panel_sizer.Add(wx.Size(0, 0), 1)
subrange_maximum_label = wx.StaticText(self.SubrangePanel,
label=_('Maximum:'))
- subrange_panel_sizer.AddWindow(subrange_maximum_label, 1, border=5,
+ subrange_panel_sizer.Add(subrange_maximum_label, 1, border=5,
flag=wx.ALIGN_CENTER_VERTICAL | wx.ALL)
self.SubrangeMaximum = CustomIntCtrl(self.SubrangePanel, style=wx.TAB_TRAVERSAL)
self.SubrangeMaximum.Bind(CustomIntCtrl.EVT_CUSTOM_INT, self.OnSubrangeMaximumChanged)
- subrange_panel_sizer.AddWindow(self.SubrangeMaximum, 1, border=5,
+ subrange_panel_sizer.Add(self.SubrangeMaximum, 1, border=5,
flag=wx.GROW | wx.ALL)
self.SubrangePanel.SetSizer(subrange_panel_sizer)
@@ -258,35 +258,35 @@
# Panel for Enumerated data types
self.EnumeratedPanel = wx.Panel(self.Editor, style=wx.TAB_TRAVERSAL)
- typeinfos_sizer.AddWindow(self.EnumeratedPanel, 1)
+ typeinfos_sizer.Add(self.EnumeratedPanel, 1)
enumerated_panel_sizer = wx.BoxSizer(wx.HORIZONTAL)
self.EnumeratedValues = CustomEditableListBox(
self.EnumeratedPanel,
label=_("Values:"),
- style=(wx.gizmos.EL_ALLOW_NEW |
- wx.gizmos.EL_ALLOW_EDIT |
- wx.gizmos.EL_ALLOW_DELETE))
+ style=(wx.adv.EL_ALLOW_NEW |
+ wx.adv.EL_ALLOW_EDIT |
+ wx.adv.EL_ALLOW_DELETE))
setattr(self.EnumeratedValues, "_OnLabelEndEdit", self.OnEnumeratedValueEndEdit)
for func in ["_OnAddButton", "_OnDelButton", "_OnUpButton", "_OnDownButton"]:
setattr(self.EnumeratedValues, func, self.OnEnumeratedValuesChanged)
- enumerated_panel_sizer.AddWindow(self.EnumeratedValues, 1, border=5,
+ enumerated_panel_sizer.Add(self.EnumeratedValues, 1, border=5,
flag=wx.GROW | wx.ALL)
enumerated_panel_rightsizer = wx.BoxSizer(wx.HORIZONTAL)
- enumerated_panel_sizer.AddSizer(enumerated_panel_rightsizer, 1)
+ enumerated_panel_sizer.Add(enumerated_panel_rightsizer, 1)
enumerated_initialvalue_label = wx.StaticText(self.EnumeratedPanel,
label=_('Initial Value:'))
- enumerated_panel_rightsizer.AddWindow(enumerated_initialvalue_label, 1,
+ enumerated_panel_rightsizer.Add(enumerated_initialvalue_label, 1,
border=5,
flag=wx.ALIGN_CENTER_VERTICAL | wx.ALL)
self.EnumeratedInitialValue = wx.ComboBox(self.EnumeratedPanel,
style=wx.CB_READONLY)
self.Bind(wx.EVT_COMBOBOX, self.OnInfosChanged, self.EnumeratedInitialValue)
- enumerated_panel_rightsizer.AddWindow(self.EnumeratedInitialValue, 1,
+ enumerated_panel_rightsizer.Add(self.EnumeratedInitialValue, 1,
border=5, flag=wx.ALL)
self.EnumeratedPanel.SetSizer(enumerated_panel_sizer)
@@ -294,7 +294,7 @@
# Panel for Array data types
self.ArrayPanel = wx.Panel(self.Editor, style=wx.TAB_TRAVERSAL)
- typeinfos_sizer.AddWindow(self.ArrayPanel, 1)
+ typeinfos_sizer.Add(self.ArrayPanel, 1)
array_panel_sizer = wx.FlexGridSizer(cols=2, hgap=5, rows=2, vgap=0)
array_panel_sizer.AddGrowableCol(0)
@@ -302,41 +302,41 @@
array_panel_sizer.AddGrowableRow(1)
array_panel_leftSizer = wx.BoxSizer(wx.HORIZONTAL)
- array_panel_sizer.AddSizer(array_panel_leftSizer, flag=wx.GROW)
+ array_panel_sizer.Add(array_panel_leftSizer, flag=wx.GROW)
array_basetype_label = wx.StaticText(self.ArrayPanel, label=_('Base Type:'))
- array_panel_leftSizer.AddWindow(array_basetype_label, 1, border=5,
+ array_panel_leftSizer.Add(array_basetype_label, 1, border=5,
flag=wx.ALIGN_CENTER_VERTICAL | wx.ALL)
self.ArrayBaseType = wx.ComboBox(self.ArrayPanel, style=wx.CB_READONLY)
self.Bind(wx.EVT_COMBOBOX, self.OnInfosChanged, self.ArrayBaseType)
- array_panel_leftSizer.AddWindow(self.ArrayBaseType, 1, border=5,
+ array_panel_leftSizer.Add(self.ArrayBaseType, 1, border=5,
flag=wx.GROW | wx.ALL)
array_panel_rightsizer = wx.BoxSizer(wx.HORIZONTAL)
- array_panel_sizer.AddSizer(array_panel_rightsizer, flag=wx.GROW)
+ array_panel_sizer.Add(array_panel_rightsizer, flag=wx.GROW)
array_initialvalue_label = wx.StaticText(self.ArrayPanel,
label=_('Initial Value:'))
- array_panel_rightsizer.AddWindow(array_initialvalue_label, 1, border=5,
+ array_panel_rightsizer.Add(array_initialvalue_label, 1, border=5,
flag=wx.ALIGN_CENTER_VERTICAL | wx.ALL)
self.ArrayInitialValue = wx.TextCtrl(self.ArrayPanel,
style=wx.TE_PROCESS_ENTER | wx.TE_RICH)
self.Bind(wx.EVT_TEXT_ENTER, self.OnReturnKeyPressed, self.ArrayInitialValue)
- array_panel_rightsizer.AddWindow(self.ArrayInitialValue, 1, border=5,
+ array_panel_rightsizer.Add(self.ArrayInitialValue, 1, border=5,
flag=wx.ALL)
self.ArrayDimensions = CustomEditableListBox(
self.ArrayPanel,
label=_("Dimensions:"),
- style=(wx.gizmos.EL_ALLOW_NEW |
- wx.gizmos.EL_ALLOW_EDIT |
- wx.gizmos.EL_ALLOW_DELETE))
+ style=(wx.adv.EL_ALLOW_NEW |
+ wx.adv.EL_ALLOW_EDIT |
+ wx.adv.EL_ALLOW_DELETE))
for func in ["_OnLabelEndEdit", "_OnAddButton", "_OnDelButton",
"_OnUpButton", "_OnDownButton"]:
setattr(self.ArrayDimensions, func, self.OnDimensionsChanged)
- array_panel_sizer.AddWindow(self.ArrayDimensions, 0, border=5,
+ array_panel_sizer.Add(self.ArrayDimensions, 0, border=5,
flag=wx.GROW | wx.ALL)
self.ArrayPanel.SetSizer(array_panel_sizer)
@@ -344,7 +344,7 @@
# Panel for Structure data types
self.StructurePanel = wx.Panel(self.Editor, style=wx.TAB_TRAVERSAL)
- typeinfos_sizer.AddWindow(self.StructurePanel, 1)
+ typeinfos_sizer.Add(self.StructurePanel, 1)
structure_panel_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=0)
structure_panel_sizer.AddGrowableCol(0)
@@ -353,12 +353,12 @@
structure_button_sizer = wx.FlexGridSizer(cols=5, hgap=5, rows=1, vgap=0)
structure_button_sizer.AddGrowableCol(0)
structure_button_sizer.AddGrowableRow(0)
- structure_panel_sizer.AddSizer(structure_button_sizer, 0, border=5,
+ structure_panel_sizer.Add(structure_button_sizer, 0, border=5,
flag=wx.ALL | wx.GROW)
structure_elements_label = wx.StaticText(self.StructurePanel,
label=_('Elements :'))
- structure_button_sizer.AddWindow(structure_elements_label, flag=wx.ALIGN_BOTTOM)
+ structure_button_sizer.Add(structure_elements_label, flag=wx.ALIGN_BOTTOM)
for name, bitmap, help in [
("StructureAddButton", "add_element", _("Add element")),
@@ -369,17 +369,17 @@
bitmap=GetBitmap(bitmap),
size=wx.Size(28, 28),
style=wx.NO_BORDER)
- button.SetToolTipString(help)
+ button.SetToolTip(help)
setattr(self, name, button)
- structure_button_sizer.AddWindow(button)
+ structure_button_sizer.Add(button)
self.StructureElementsGrid = CustomGrid(self.StructurePanel,
size=wx.Size(0, 150), style=wx.VSCROLL)
- self.StructureElementsGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGE,
+ self.StructureElementsGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGING,
self.OnStructureElementsGridCellChange)
self.StructureElementsGrid.Bind(wx.grid.EVT_GRID_EDITOR_SHOWN,
self.OnStructureElementsGridEditorShown)
- structure_panel_sizer.AddWindow(self.StructureElementsGrid, flag=wx.GROW)
+ structure_panel_sizer.Add(self.StructureElementsGrid, flag=wx.GROW)
self.StructurePanel.SetSizer(structure_panel_sizer)
@@ -647,7 +647,7 @@
self.Bind(wx.EVT_MENU, self.ElementArrayTypeFunction, new_entry)
rect = self.StructureElementsGrid.BlockToDeviceRect((row, col), (row, col))
- self.StructureElementsGrid.PopupMenuXY(type_menu, rect.x + rect.width, rect.y + self.StructureElementsGrid.GetColLabelSize())
+ self.StructureElementsGrid.PopupMenu(type_menu, rect.x + rect.width, rect.y + self.StructureElementsGrid.GetColLabelSize())
type_menu.Destroy()
event.Veto()
else:
@@ -786,7 +786,7 @@
value = control.GetValueStr() if isinstance(control, CustomIntCtrl) else \
control.GetValue()
control.SetStyle(0, len(value), wx.TextAttr(wx.NullColour))
- elif isinstance(control, wx.gizmos.EditableListBox):
+ elif isinstance(control, wx.adv.EditableListBox):
listctrl = control.GetListCtrl()
for i in xrange(listctrl.GetItemCount()):
listctrl.SetItemBackgroundColour(i, wx.NullColour)
@@ -811,7 +811,7 @@
control.SetForegroundColour(highlight_type[1])
elif isinstance(control, wx.TextCtrl):
control.SetStyle(start[1], end[1] + 1, wx.TextAttr(highlight_type[1], highlight_type[0]))
- elif isinstance(control, wx.gizmos.EditableListBox):
+ elif isinstance(control, wx.adv.EditableListBox):
listctrl = control.GetListCtrl()
listctrl.SetItemBackgroundColour(infos[1], highlight_type[0])
listctrl.SetItemTextColour(infos[1], highlight_type[1])
--- a/editors/FileManagementPanel.py Thu Sep 16 09:40:36 2021 +0200
+++ b/editors/FileManagementPanel.py Fri Oct 01 17:44:52 2021 +0200
@@ -43,14 +43,14 @@
main_sizer = wx.BoxSizer(wx.HORIZONTAL)
left_sizer = wx.BoxSizer(wx.VERTICAL)
- main_sizer.AddSizer(left_sizer, 1, border=5, flag=wx.GROW | wx.ALL)
+ main_sizer.Add(left_sizer, 1, border=5, flag=wx.GROW | wx.ALL)
managed_dir_label = wx.StaticText(self.Editor, label=_(self.TagName) + ":")
- left_sizer.AddWindow(managed_dir_label, border=5, flag=wx.GROW | wx.BOTTOM)
+ left_sizer.Add(managed_dir_label, border=5, flag=wx.GROW | wx.BOTTOM)
FILTER = _("All files (*.*)|*.*|CSV files (*.csv)|*.csv")
self.ManagedDir = FolderTree(self.Editor, self.Folder, FILTER)
- left_sizer.AddWindow(self.ManagedDir, 1, flag=wx.GROW)
+ left_sizer.Add(self.ManagedDir, 1, flag=wx.GROW)
managed_treectrl = self.ManagedDir.GetTreeCtrl()
self.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnTreeItemChanged, managed_treectrl)
@@ -58,7 +58,7 @@
self.Bind(wx.EVT_TREE_BEGIN_DRAG, self.OnTreeBeginDrag, managed_treectrl)
button_sizer = wx.BoxSizer(wx.VERTICAL)
- main_sizer.AddSizer(button_sizer, border=5,
+ main_sizer.Add(button_sizer, border=5,
flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL)
for idx, (name, bitmap, help) in enumerate([
@@ -70,26 +70,26 @@
self.Editor,
bitmap=GetBitmap(bitmap),
size=wx.Size(28, 28), style=wx.NO_BORDER)
- button.SetToolTipString(help)
+ button.SetToolTip(help)
setattr(self, name, button)
if idx > 0:
flag = wx.TOP
else:
flag = 0
self.Bind(wx.EVT_BUTTON, getattr(self, "On" + name), button)
- button_sizer.AddWindow(button, border=20, flag=flag)
+ button_sizer.Add(button, border=20, flag=flag)
right_sizer = wx.BoxSizer(wx.VERTICAL)
- main_sizer.AddSizer(right_sizer, 1, border=5, flag=wx.GROW | wx.ALL)
+ main_sizer.Add(right_sizer, 1, border=5, flag=wx.GROW | wx.ALL)
if wx.Platform == '__WXMSW__':
system_dir_label = wx.StaticText(self.Editor, label=_("My Computer:"))
else:
system_dir_label = wx.StaticText(self.Editor, label=_("Home Directory:"))
- right_sizer.AddWindow(system_dir_label, border=5, flag=wx.GROW | wx.BOTTOM)
+ right_sizer.Add(system_dir_label, border=5, flag=wx.GROW | wx.BOTTOM)
self.SystemDir = FolderTree(self.Editor, self.HomeDirectory, FILTER, False)
- right_sizer.AddWindow(self.SystemDir, 1, flag=wx.GROW)
+ right_sizer.Add(self.SystemDir, 1, flag=wx.GROW)
system_treectrl = self.SystemDir.GetTreeCtrl()
self.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnTreeItemChanged, system_treectrl)
--- a/editors/ProjectNodeEditor.py Thu Sep 16 09:40:36 2021 +0200
+++ b/editors/ProjectNodeEditor.py Fri Oct 01 17:44:52 2021 +0200
@@ -60,7 +60,7 @@
ConfTreeNodeEditor.__init__(self, parent, controler, window, tagname)
buttons_sizer = self.GenerateMethodButtonSizer()
- self.MainSizer.InsertSizer(0, buttons_sizer, 0, border=5, flag=wx.ALL)
+ self.MainSizer.Insert(0, buttons_sizer, 0, border=5, flag=wx.ALL)
self.MainSizer.Layout()
self.VariableEditor = self.VariableEditorPanel
--- a/editors/ResourceEditor.py Thu Sep 16 09:40:36 2021 +0200
+++ b/editors/ResourceEditor.py Fri Oct 01 17:44:52 2021 +0200
@@ -76,10 +76,6 @@
return [_("Interrupt"), _("Cyclic")]
-def SingleCellEditor(*x):
- return wx.grid.GridCellChoiceEditor()
-
-
def CheckSingle(single, varlist):
return single in varlist
@@ -162,25 +158,21 @@
if interval != "" and IEC_TIME_MODEL.match(interval.upper()) is None:
error = True
elif colname == "Single":
- editor = SingleCellEditor(self, colname)
- editor.SetParameters(self.Parent.VariableList)
+ editor = wx.grid.GridCellChoiceEditor(self.Parent.VariableList)
if self.GetValueByName(row, "Triggering") != "Interrupt":
grid.SetReadOnly(row, col, True)
single = self.GetValueByName(row, colname)
if single != "" and not CheckSingle(single, self.Parent.VariableList):
error = True
elif colname == "Triggering":
- editor = wx.grid.GridCellChoiceEditor()
- editor.SetParameters(",".join(map(_, GetTaskTriggeringOptions())))
+ editor = wx.grid.GridCellChoiceEditor(map(_, GetTaskTriggeringOptions()))
elif colname == "Type":
- editor = wx.grid.GridCellChoiceEditor()
- editor.SetParameters(self.Parent.TypeList)
+ editor = wx.grid.GridCellChoiceEditor(self.Parent.TypeList)
elif colname == "Priority":
editor = wx.grid.GridCellNumberEditor()
editor.SetParameters("0,65535")
elif colname == "Task":
- editor = wx.grid.GridCellChoiceEditor()
- editor.SetParameters(self.Parent.TaskList)
+ editor = wx.grid.GridCellChoiceEditor(self.Parent.TaskList)
grid.SetCellEditor(row, col, editor)
grid.SetCellRenderer(row, col, renderer)
@@ -230,16 +222,16 @@
tasks_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=5)
tasks_sizer.AddGrowableCol(0)
tasks_sizer.AddGrowableRow(1)
- main_sizer.AddSizer(tasks_sizer, border=5,
+ main_sizer.Add(tasks_sizer, border=5,
flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT)
tasks_buttons_sizer = wx.FlexGridSizer(cols=5, hgap=5, rows=1, vgap=0)
tasks_buttons_sizer.AddGrowableCol(0)
tasks_buttons_sizer.AddGrowableRow(0)
- tasks_sizer.AddSizer(tasks_buttons_sizer, flag=wx.GROW)
+ tasks_sizer.Add(tasks_buttons_sizer, flag=wx.GROW)
tasks_label = wx.StaticText(self.Editor, label=_(u'Tasks:'))
- tasks_buttons_sizer.AddWindow(tasks_label, flag=wx.ALIGN_BOTTOM)
+ tasks_buttons_sizer.Add(tasks_label, flag=wx.ALIGN_BOTTOM)
for name, bitmap, help in [
("AddTaskButton", "add_element", _("Add task")),
@@ -250,27 +242,27 @@
bitmap=GetBitmap(bitmap),
size=wx.Size(28, 28),
style=wx.NO_BORDER)
- button.SetToolTipString(help)
+ button.SetToolTip(help)
setattr(self, name, button)
- tasks_buttons_sizer.AddWindow(button)
+ tasks_buttons_sizer.Add(button)
self.TasksGrid = CustomGrid(self.Editor, style=wx.VSCROLL)
- self.TasksGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGE, self.OnTasksGridCellChange)
- tasks_sizer.AddWindow(self.TasksGrid, flag=wx.GROW)
+ self.TasksGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGING, self.OnTasksGridCellChange)
+ tasks_sizer.Add(self.TasksGrid, flag=wx.GROW)
instances_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=5)
instances_sizer.AddGrowableCol(0)
instances_sizer.AddGrowableRow(1)
- main_sizer.AddSizer(instances_sizer, border=5,
+ main_sizer.Add(instances_sizer, border=5,
flag=wx.GROW | wx.BOTTOM | wx.LEFT | wx.RIGHT)
instances_buttons_sizer = wx.FlexGridSizer(cols=5, hgap=5, rows=1, vgap=0)
instances_buttons_sizer.AddGrowableCol(0)
instances_buttons_sizer.AddGrowableRow(0)
- instances_sizer.AddSizer(instances_buttons_sizer, flag=wx.GROW)
+ instances_sizer.Add(instances_buttons_sizer, flag=wx.GROW)
instances_label = wx.StaticText(self.Editor, label=_(u'Instances:'))
- instances_buttons_sizer.AddWindow(instances_label, flag=wx.ALIGN_BOTTOM)
+ instances_buttons_sizer.Add(instances_label, flag=wx.ALIGN_BOTTOM)
for name, bitmap, help in [
("AddInstanceButton", "add_element", _("Add instance")),
@@ -280,13 +272,13 @@
button = wx.lib.buttons.GenBitmapButton(
self.Editor, bitmap=GetBitmap(bitmap),
size=wx.Size(28, 28), style=wx.NO_BORDER)
- button.SetToolTipString(help)
+ button.SetToolTip(help)
setattr(self, name, button)
- instances_buttons_sizer.AddWindow(button)
+ instances_buttons_sizer.Add(button)
self.InstancesGrid = CustomGrid(self.Editor, style=wx.VSCROLL)
- self.InstancesGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGE, self.OnInstancesGridCellChange)
- instances_sizer.AddWindow(self.InstancesGrid, flag=wx.GROW)
+ self.InstancesGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGING, self.OnInstancesGridCellChange)
+ instances_sizer.Add(self.InstancesGrid, flag=wx.GROW)
self.Editor.SetSizer(main_sizer)
@@ -405,20 +397,20 @@
self.RefreshHighlightsTimer.Stop()
def RefreshTypeList(self):
- self.TypeList = ""
+ self.TypeList = []
blocktypes = self.Controler.GetBlockResource()
for blocktype in blocktypes:
- self.TypeList += ",%s" % blocktype
+ self.TypeList.append(blocktype)
def RefreshTaskList(self):
- self.TaskList = ""
+ self.TaskList = []
for row in xrange(self.TasksTable.GetNumberRows()):
- self.TaskList += ",%s" % self.TasksTable.GetValueByName(row, "Name")
+ self.TaskList.append(self.TasksTable.GetValueByName(row, "Name"))
def RefreshVariableList(self):
- self.VariableList = ""
+ self.VariableList = []
for variable in self.Controler.GetEditedResourceVariables(self.TagName):
- self.VariableList += ",%s" % variable
+ self.VariableList.append(variable)
def RefreshModel(self):
self.Controler.SetEditedResourceInfos(self.TagName, self.TasksTable.GetData(), self.InstancesTable.GetData())
@@ -481,7 +473,7 @@
wx.CallAfter(self.ShowErrorMessage, message)
return
- tasklist = [name for name in self.TaskList.split(",") if name != ""]
+ tasklist = [name for name in self.TaskList if name != ""]
for i in xrange(self.TasksTable.GetNumberRows()):
task = self.TasksTable.GetValueByName(i, "Name")
if task in tasklist:
--- a/editors/TextViewer.py Thu Sep 16 09:40:36 2021 +0200
+++ b/editors/TextViewer.py Fri Oct 01 17:44:52 2021 +0200
@@ -198,12 +198,20 @@
def Colourise(self, start, end):
self.Editor.Colourise(start, end)
- def StartStyling(self, pos, mask):
- self.Editor.StartStyling(pos, mask)
+ def StartStyling(self, pos):
+ self.Editor.StartStyling(pos)
+
+ INDIC0 = 0
+ INDIC1 = 1
+ INDIC2 = 2
def SetStyling(self, length, style):
self.Editor.SetStyling(length, style)
+ def SetIndicatorCurrentFillRange(start, length, indic):
+ self.Editor.SetIndicatorCurrent(indic)
+ self.Editor.IndicatorFillRange(start, length)
+
def GetCurrentPos(self):
return self.Editor.GetCurrentPos()
@@ -560,7 +568,7 @@
start_pos = last_styled_pos = self.Editor.GetLineEndPosition(line_number - 1) + 1
self.RefreshLineFolding(line_number)
end_pos = event.GetPosition()
- self.StartStyling(start_pos, 0xff)
+ self.StartStyling(start_pos)
current_context = self.Variables
current_call = None
@@ -595,9 +603,8 @@
else:
self.SetStyling(current_pos - last_styled_pos, STC_PLC_EMPTY)
if word not in ["]", ")"] and (self.GetCurrentPos() < last_styled_pos or self.GetCurrentPos() > current_pos):
- self.StartStyling(last_styled_pos, wx.stc.STC_INDICS_MASK)
- self.SetStyling(current_pos - last_styled_pos, wx.stc.STC_INDIC0_MASK)
- self.StartStyling(current_pos, 0xff)
+ self.SetIndicatorCurrentFillRange(last_styled_pos, current_pos - last_styled_pos, self.INDIC0)
+ self.StartStyling(current_pos)
else:
self.SetStyling(current_pos - last_styled_pos, STC_PLC_EMPTY)
last_styled_pos = current_pos
@@ -698,9 +705,8 @@
else:
self.SetStyling(current_pos - last_styled_pos, STC_PLC_EMPTY)
if word not in ["]", ")"] and (self.GetCurrentPos() < last_styled_pos or self.GetCurrentPos() > current_pos):
- self.StartStyling(last_styled_pos, wx.stc.STC_INDICS_MASK)
- self.SetStyling(current_pos - last_styled_pos, wx.stc.STC_INDIC0_MASK)
- self.StartStyling(current_pos, 0xff)
+ self.SetIndicatorCurrentFillRange(last_styled_pos, current_pos - last_styled_pos, self.INDIC0)
+ self.StartStyling(current_pos)
if char == '.':
if word != "]":
if current_context is not None:
@@ -956,8 +962,8 @@
else:
highlight_end_pos = self.Editor.GetLineEndPosition(end[0] - 1) + end[1] - indent + 2
if highlight_start_pos < end_pos and highlight_end_pos > start_pos:
- self.StartStyling(highlight_start_pos, 0xff)
+ self.StartStyling(highlight_start_pos)
self.SetStyling(highlight_end_pos - highlight_start_pos, highlight_type)
- self.StartStyling(highlight_start_pos, 0x00)
+ self.StartStyling(highlight_start_pos)
until_end = max(0, len(self.Editor.GetText()) - highlight_end_pos)
self.SetStyling(until_end, wx.stc.STC_STYLE_DEFAULT)
--- a/editors/Viewer.py Thu Sep 16 09:40:36 2021 +0200
+++ b/editors/Viewer.py Fri Oct 01 17:44:52 2021 +0200
@@ -60,11 +60,11 @@
global CURSORS
if CURSORS is None:
CURSORS = [wx.NullCursor,
- wx.StockCursor(wx.CURSOR_HAND),
- wx.StockCursor(wx.CURSOR_SIZENWSE),
- wx.StockCursor(wx.CURSOR_SIZENESW),
- wx.StockCursor(wx.CURSOR_SIZEWE),
- wx.StockCursor(wx.CURSOR_SIZENS)]
+ wx.Cursor(wx.CURSOR_HAND),
+ wx.Cursor(wx.CURSOR_SIZENWSE),
+ wx.Cursor(wx.CURSOR_SIZENESW),
+ wx.Cursor(wx.CURSOR_SIZEWE),
+ wx.Cursor(wx.CURSOR_SIZENS)]
if wx.Platform == '__WXMSW__':
@@ -410,7 +410,7 @@
if len(tree[0]) > 0:
menu = wx.Menu(title='')
self.GenerateTreeMenu(x, y, scaling, menu, "", var_class, [(values[0], values[2], tree)])
- self.ParentWindow.PopupMenuXY(menu)
+ self.ParentWindow.PopupMenu(menu)
else:
self.ParentWindow.AddVariableBlock(x, y, scaling, var_class, values[0], values[2])
else:
@@ -712,7 +712,7 @@
break
faces["size"] -= 1
self.Editor.SetFont(font)
- self.MiniTextDC = wx.MemoryDC(wx.EmptyBitmap(1, 1))
+ self.MiniTextDC = wx.MemoryDC(wx.Bitmap(1, 1))
self.MiniTextDC.SetFont(wx.Font(faces["size"] * 0.75, wx.SWISS, wx.NORMAL, wx.NORMAL, faceName=faces["helv"]))
self.CurrentScale = None
@@ -825,15 +825,14 @@
def GetViewScale(self):
return self.ViewScale
- def GetLogicalDC(self, buffered=False):
- if buffered:
- bitmap = wx.EmptyBitmap(*self.Editor.GetClientSize())
- dc = wx.MemoryDC(bitmap)
- else:
- dc = wx.ClientDC(self.Editor)
+ def PrepareDC(self, dc):
dc.SetFont(self.GetFont())
self.Editor.DoPrepareDC(dc)
dc.SetUserScale(self.ViewScale[0], self.ViewScale[1])
+
+ def GetLogicalDC(self):
+ dc = wx.ClientDC(self.Editor)
+ self.PrepareDC(dc)
return dc
def RefreshRect(self, rect, eraseBackground=True):
@@ -1058,7 +1057,7 @@
self.SelectedElement.SetSelected(False)
self.SelectedElement = None
if self.Mode == MODE_MOTION:
- wx.CallAfter(self.Editor.SetCursor, wx.StockCursor(wx.CURSOR_HAND))
+ wx.CallAfter(self.Editor.SetCursor, wx.Cursor(wx.CURSOR_HAND))
self.SavedMode = True
# Return current drawing mode
@@ -1116,13 +1115,13 @@
if self.DrawGrid:
width = max(2, int(scaling[0] * self.ViewScale[0]))
height = max(2, int(scaling[1] * self.ViewScale[1]))
- bitmap = wx.EmptyBitmap(width, height)
+ bitmap = wx.Bitmap(width, height)
dc = wx.MemoryDC(bitmap)
dc.SetBackground(wx.Brush(self.Editor.GetBackgroundColour()))
dc.Clear()
dc.SetPen(MiterPen(wx.Colour(180, 180, 180)))
dc.DrawPoint(0, 0)
- self.GridBrush = wx.BrushFromBitmap(bitmap)
+ self.GridBrush = wx.Brush(bitmap)
else:
self.GridBrush = wx.TRANSPARENT_BRUSH
else:
@@ -3379,7 +3378,7 @@
element = self.ParentWindow.GetCopyBuffer()
if bbx is None:
mouse_pos = self.Editor.ScreenToClient(wx.GetMousePosition())
- middle = wx.Rect(0, 0, *self.Editor.GetClientSize()).InsideXY(mouse_pos.x, mouse_pos.y)
+ middle = wx.Rect(0, 0, *self.Editor.GetClientSize()).Contains(mouse_pos.x, mouse_pos.y)
if middle:
x, y = self.CalcUnscrolledPosition(mouse_pos.x, mouse_pos.y)
else:
@@ -3633,7 +3632,6 @@
else:
dc.SetBackground(wx.Brush(self.Editor.GetBackgroundColour()))
dc.Clear()
- dc.BeginDrawing()
if self.Scaling is not None and self.DrawGrid and not printing:
dc.SetPen(wx.TRANSPARENT_PEN)
dc.SetBrush(self.GridBrush)
@@ -3680,12 +3678,15 @@
self.InstanceName.Draw(dc)
if self.rubberBand.IsShown():
self.rubberBand.Draw(dc)
- dc.EndDrawing()
def OnPaint(self, event):
- dc = self.GetLogicalDC(True)
+ event.Skip()
+ sx,sy = self.Editor.GetClientSize()
+ if sx <= 0 or sy <= 0 :
+ return
+ dc = wx.MemoryDC(wx.Bitmap(sx,sy))
+ self.PrepareDC(dc)
self.DoDrawing(dc)
wx.BufferedPaintDC(self.Editor, dc.GetAsBitmap())
if self.Debug:
DebugViewer.RefreshNewData(self)
- event.Skip()
--- a/etherlab/ConfigEditor.py Thu Sep 16 09:40:36 2021 +0200
+++ b/etherlab/ConfigEditor.py Fri Oct 01 17:44:52 2021 +0200
@@ -16,7 +16,7 @@
import wx
import wx.grid
-import wx.gizmos
+import wx.adv
import wx.lib.buttons
from plcopen.structures import IEC_KEYWORDS, TestIdentifier
@@ -81,9 +81,9 @@
self.VariablesFilter.Bind(wx.EVT_COMBOBOX, self.OnVariablesFilterChanged)
self.VariablesFilter.Bind(wx.EVT_TEXT_ENTER, self.OnVariablesFilterChanged)
self.VariablesFilter.Bind(wx.EVT_CHAR, self.OnVariablesFilterKeyDown)
- self.AddWindow(self.VariablesFilter, flag=wx.GROW)
-
- self.VariablesGrid = wx.gizmos.TreeListCtrl(parent,
+ self.Add(self.VariablesFilter, flag=wx.GROW)
+
+ self.VariablesGrid = wx.adv.TreeListCtrl(parent,
style=wx.TR_DEFAULT_STYLE |
wx.TR_ROW_LINES |
wx.TR_COLUMN_LINES |
@@ -91,7 +91,7 @@
wx.TR_FULL_ROW_HIGHLIGHT)
self.VariablesGrid.GetMainWindow().Bind(wx.EVT_LEFT_DOWN,
self.OnVariablesGridLeftClick)
- self.AddWindow(self.VariablesGrid, flag=wx.GROW)
+ self.Add(self.VariablesGrid, flag=wx.GROW)
self.Filters = []
for desc, value in VARIABLES_FILTERS:
@@ -274,10 +274,10 @@
variables_label = wx.StaticText(self.EthercatNodeEditor,
label=_('Variable entries:'))
- main_sizer.AddWindow(variables_label, border=10, flag=wx.TOP | wx.LEFT | wx.RIGHT)
+ main_sizer.Add(variables_label, border=10, flag=wx.TOP | wx.LEFT | wx.RIGHT)
self.NodeVariables = NodeVariablesSizer(self.EthercatNodeEditor, self.Controler)
- main_sizer.AddSizer(self.NodeVariables, border=10,
+ main_sizer.Add(self.NodeVariables, border=10,
flag=wx.GROW | wx.BOTTOM | wx.LEFT | wx.RIGHT)
self.EthercatNodeEditor.SetSizer(main_sizer)
@@ -310,7 +310,7 @@
self.EtherCATManagementTreebook = EtherCATManagementTreebook(self.EtherCATManagementEditor, self.Controler, self)
- self.EtherCATManagermentEditor_Main_Sizer.AddSizer(self.EtherCATManagementTreebook, border=10, flag=wx.GROW)
+ self.EtherCATManagermentEditor_Main_Sizer.Add(self.EtherCATManagementTreebook, border=10, flag=wx.GROW)
self.EtherCATManagementEditor.SetSizer(self.EtherCATManagermentEditor_Main_Sizer)
return self.EtherCATManagementEditor
@@ -617,7 +617,7 @@
self.MasterStateEditor_Panel = MasterStatePanelClass(self.MasterStateEditor, self.Controler)
- self.MasterStateEditor_Panel_Main_Sizer.AddSizer(self.MasterStateEditor_Panel, border=10, flag=wx.GROW)
+ self.MasterStateEditor_Panel_Main_Sizer.Add(self.MasterStateEditor_Panel, border=10, flag=wx.GROW)
self.MasterStateEditor.SetSizer(self.MasterStateEditor_Panel_Main_Sizer)
return self.MasterStateEditor
@@ -651,7 +651,7 @@
process_variables_label = wx.StaticText(self.EthercatMasterEditor,
label=_("Process variables mapped between nodes:"))
- process_variables_header.AddWindow(process_variables_label, 1,
+ process_variables_header.Add(process_variables_label, 1,
flag=wx.ALIGN_CENTER_VERTICAL)
for name, bitmap, help in [
@@ -661,14 +661,14 @@
("DownVariableButton", "down", _("Move process variable down"))]:
button = wx.lib.buttons.GenBitmapButton(self.EthercatMasterEditor, bitmap=GetBitmap(bitmap),
size=wx.Size(28, 28), style=wx.NO_BORDER)
- button.SetToolTipString(help)
+ button.SetToolTip(help)
setattr(self, name, button)
- process_variables_header.AddWindow(button, border=5, flag=wx.LEFT)
+ process_variables_header.Add(button, border=5, flag=wx.LEFT)
self.ProcessVariablesGrid = CustomGrid(self.EthercatMasterEditor, style=wx.VSCROLL)
self.ProcessVariablesGrid.SetMinSize(wx.Size(0, 150))
self.ProcessVariablesGrid.SetDropTarget(ProcessVariableDropTarget(self))
- self.ProcessVariablesGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGE,
+ self.ProcessVariablesGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGING,
self.OnProcessVariablesGridCellChange)
self.ProcessVariablesGrid.Bind(wx.grid.EVT_GRID_CELL_LEFT_CLICK,
self.OnProcessVariablesGridCellLeftClick)
@@ -678,7 +678,7 @@
startup_commands_label = wx.StaticText(self.EthercatMasterEditor,
label=_("Startup service variables assignments:"))
- startup_commands_header.AddWindow(startup_commands_label, 1,
+ startup_commands_header.Add(startup_commands_label, 1,
flag=wx.ALIGN_CENTER_VERTICAL)
for name, bitmap, help in [
@@ -686,14 +686,14 @@
("DeleteCommandButton", "remove_element", _("Remove startup service variable"))]:
button = wx.lib.buttons.GenBitmapButton(self.EthercatMasterEditor, bitmap=GetBitmap(bitmap),
size=wx.Size(28, 28), style=wx.NO_BORDER)
- button.SetToolTipString(help)
+ button.SetToolTip(help)
setattr(self, name, button)
- startup_commands_header.AddWindow(button, border=5, flag=wx.LEFT)
+ startup_commands_header.Add(button, border=5, flag=wx.LEFT)
self.StartupCommandsGrid = CustomGrid(self.EthercatMasterEditor, style=wx.VSCROLL)
self.StartupCommandsGrid.SetDropTarget(StartupCommandDropTarget(self))
self.StartupCommandsGrid.SetMinSize(wx.Size(0, 150))
- self.StartupCommandsGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGE,
+ self.StartupCommandsGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGING,
self.OnStartupCommandsGridCellChange)
self.StartupCommandsGrid.Bind(wx.grid.EVT_GRID_EDITOR_SHOWN,
self.OnStartupCommandsGridEditorShow)
@@ -702,29 +702,29 @@
main_staticbox = wx.StaticBox(self.EthercatMasterEditor, label=_("Node filter:"))
staticbox_sizer = wx.StaticBoxSizer(main_staticbox, wx.VERTICAL)
- self.EthercatMasterEditorSizer.AddSizer(staticbox_sizer, 0, border=10, flag=wx.GROW | wx.ALL)
+ self.EthercatMasterEditorSizer.Add(staticbox_sizer, 0, border=10, flag=wx.GROW | wx.ALL)
main_staticbox_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=6, vgap=0)
main_staticbox_sizer.AddGrowableCol(0)
main_staticbox_sizer.AddGrowableRow(2)
main_staticbox_sizer.AddGrowableRow(4)
main_staticbox_sizer.AddGrowableRow(5)
- staticbox_sizer.AddSizer(main_staticbox_sizer, 1, flag=wx.GROW)
- main_staticbox_sizer.AddWindow(self.NodesFilter, border=5, flag=wx.GROW | wx.ALL)
- main_staticbox_sizer.AddSizer(process_variables_header, border=5,
+ staticbox_sizer.Add(main_staticbox_sizer, 1, flag=wx.GROW)
+ main_staticbox_sizer.Add(self.NodesFilter, border=5, flag=wx.GROW | wx.ALL)
+ main_staticbox_sizer.Add(process_variables_header, border=5,
flag=wx.GROW | wx.LEFT | wx.RIGHT | wx.BOTTOM)
- main_staticbox_sizer.AddWindow(self.ProcessVariablesGrid, 1,
+ main_staticbox_sizer.Add(self.ProcessVariablesGrid, 1,
border=5, flag=wx.GROW | wx.LEFT | wx.RIGHT | wx.BOTTOM)
- main_staticbox_sizer.AddSizer(startup_commands_header,
+ main_staticbox_sizer.Add(startup_commands_header,
border=5, flag=wx.GROW | wx.LEFT | wx.RIGHT | wx.BOTTOM)
- main_staticbox_sizer.AddWindow(self.StartupCommandsGrid, 1,
+ main_staticbox_sizer.Add(self.StartupCommandsGrid, 1,
border=5, flag=wx.GROW | wx.LEFT | wx.RIGHT | wx.BOTTOM)
second_staticbox = wx.StaticBox(self.EthercatMasterEditor, label=_("Nodes variables filter:"))
second_staticbox_sizer = wx.StaticBoxSizer(second_staticbox, wx.VERTICAL)
- second_staticbox_sizer.AddSizer(self.NodesVariables, 1, border=5, flag=wx.GROW | wx.ALL)
-
- main_staticbox_sizer.AddSizer(second_staticbox_sizer, 1,
+ second_staticbox_sizer.Add(self.NodesVariables, 1, border=5, flag=wx.GROW | wx.ALL)
+
+ main_staticbox_sizer.Add(second_staticbox_sizer, 1,
border=5, flag=wx.GROW | wx.LEFT | wx.RIGHT | wx.BOTTOM)
self.EthercatMasterEditor.SetSizer(self.EthercatMasterEditorSizer)
@@ -1113,21 +1113,21 @@
ESI_files_label = wx.StaticText(parent,
label=_("ESI Files:"))
- self.AddWindow(ESI_files_label, border=10,
+ self.Add(ESI_files_label, border=10,
flag=wx.TOP | wx.LEFT | wx.RIGHT)
folder_tree_sizer = wx.FlexGridSizer(cols=2, hgap=5, rows=1, vgap=0)
folder_tree_sizer.AddGrowableCol(0)
folder_tree_sizer.AddGrowableRow(0)
- self.AddSizer(folder_tree_sizer, border=10,
+ self.Add(folder_tree_sizer, border=10,
flag=wx.GROW | wx.LEFT | wx.RIGHT)
self.ESIFiles = FolderTree(parent, self.GetPath(), editable=False)
self.ESIFiles.SetFilter(".xml")
- folder_tree_sizer.AddWindow(self.ESIFiles, flag=wx.GROW)
+ folder_tree_sizer.Add(self.ESIFiles, flag=wx.GROW)
buttons_sizer = wx.BoxSizer(wx.VERTICAL)
- folder_tree_sizer.AddSizer(buttons_sizer,
+ folder_tree_sizer.Add(buttons_sizer,
flag=wx.ALIGN_CENTER_VERTICAL)
for idx, (name, bitmap, help, callback) in enumerate(buttons):
@@ -1135,7 +1135,7 @@
bitmap=GetBitmap(bitmap),
size=wx.Size(28, 28),
style=wx.NO_BORDER)
- button.SetToolTipString(help)
+ button.SetToolTip(help)
setattr(self, name, button)
if idx > 0:
flag = wx.TOP
@@ -1145,14 +1145,14 @@
callback = getattr(self, "On" + name, None)
if callback is not None:
parent.Bind(wx.EVT_BUTTON, callback, button)
- buttons_sizer.AddWindow(button, border=10, flag=flag)
+ buttons_sizer.Add(button, border=10, flag=flag)
modules_label = wx.StaticText(parent,
label=_("Modules library:"))
- self.AddSizer(modules_label, border=10,
+ self.Add(modules_label, border=10,
flag=wx.LEFT | wx.RIGHT)
- self.ModulesGrid = wx.gizmos.TreeListCtrl(parent,
+ self.ModulesGrid = wx.adv.TreeListCtrl(parent,
style=wx.TR_DEFAULT_STYLE |
wx.TR_ROW_LINES |
wx.TR_COLUMN_LINES |
@@ -1166,7 +1166,7 @@
self.OnModulesGridEndLabelEdit)
self.ModulesGrid.GetHeaderWindow().Bind(wx.EVT_MOTION,
self.OnModulesGridHeaderMotion)
- self.AddWindow(self.ModulesGrid, border=10,
+ self.Add(self.ModulesGrid, border=10,
flag=wx.GROW | wx.BOTTOM | wx.LEFT | wx.RIGHT)
for colname, colsize, colalign in zip(
@@ -1335,7 +1335,7 @@
if col > 0 and self.LastToolTipCol != col:
self.LastToolTipCol = col
_param, param_infos = self.ModuleLibrary.MODULES_EXTRA_PARAMS[col - 1]
- wx.CallAfter(self.ModulesGrid.GetHeaderWindow().SetToolTipString,
+ wx.CallAfter(self.ModulesGrid.GetHeaderWindow().SetToolTip,
param_infos["description"])
event.Skip()
@@ -1359,13 +1359,14 @@
("DeleteButton", "remove_element", _("Remove file from database"), None)
])
self.DatabaseSizer.SetControlMinSize(wx.Size(0, 0))
- main_sizer.AddSizer(self.DatabaseSizer, border=10,
+ main_sizer.Add(self.DatabaseSizer, border=10,
flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT)
button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE)
- button_sizer.GetAffirmativeButton().SetLabel(_("Add file to project"))
- button_sizer.GetCancelButton().SetLabel(_("Close"))
- main_sizer.AddSizer(button_sizer, border=10,
+ # FIXME: find a way to change buttons label compatible with wxPython 4.x
+ # button_sizer.GetAffirmativeButton().SetLabel(_("Add file to project"))
+ # button_sizer.GetCancelButton().SetLabel(_("Close"))
+ main_sizer.Add(button_sizer, border=10,
flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
self.SetSizer(main_sizer)
--- a/etherlab/EtherCATManagementEditor.py Thu Sep 16 09:40:36 2021 +0200
+++ b/etherlab/EtherCATManagementEditor.py Fri Oct 01 17:44:52 2021 +0200
@@ -15,7 +15,7 @@
import wx
import wx.grid
-import wx.gizmos
+import wx.adv
import wx.lib.buttons
# --------------------------------------------------------------------
@@ -135,7 +135,7 @@
self.SizerDic["SlaveInfosDetailsInnerSizer"].AddMany([self.StaticTextDic[statictext_name],
self.TextCtrlDic[textctrl_name]])
- self.SizerDic["SlaveInfosDetailsBox"].AddSizer(self.SizerDic["SlaveInfosDetailsInnerSizer"])
+ self.SizerDic["SlaveInfosDetailsBox"].Add(self.SizerDic["SlaveInfosDetailsInnerSizer"])
self.SyncManagersGrid = CustomGrid(self, size=wx.Size(605, 155), style=wx.VSCROLL)
@@ -153,7 +153,7 @@
for button_name, button_id, button_label, button_tooltipstring, event_method, sub_item in buttons:
self.ButtonDic[button_name] = wx.Button(self, id=button_id, label=_(button_label))
self.ButtonDic[button_name].Bind(wx.EVT_BUTTON, event_method)
- self.ButtonDic[button_name].SetToolTipString(button_tooltipstring)
+ self.ButtonDic[button_name].SetToolTip(button_tooltipstring)
self.SizerDic["SlaveState_up_sizer"].Add(self.ButtonDic[button_name])
for statictext_name, statictext_label, textctrl_name in sub_item:
self.StaticTextDic[statictext_name] = wx.StaticText(self, label=_(statictext_label))
@@ -166,7 +166,7 @@
("StopTimerButton", "Stop State Monitoring", "Slave State Update Stop", self.CurrentStateThreadStop)]:
self.ButtonDic[button_name] = wx.Button(self, label=_(button_label))
self.ButtonDic[button_name].Bind(wx.EVT_BUTTON, event_method)
- self.ButtonDic[button_name].SetToolTipString(button_tooltipstring)
+ self.ButtonDic[button_name].SetToolTip(button_tooltipstring)
self.SizerDic["SlaveState_down_sizer"].Add(self.ButtonDic[button_name])
self.SizerDic["SlaveState_sizer"].AddMany([self.SizerDic["SlaveState_up_sizer"],
@@ -1729,7 +1729,7 @@
wx.Panel.__init__(self, parent, -1, size=(350, 500))
- self.Tree = wx.gizmos.TreeListCtrl(self, -1, size=(350, 500),
+ self.Tree = wx.adv.TreeListCtrl(self, -1, size=(350, 500),
style=(wx.TR_DEFAULT_STYLE |
wx.TR_FULL_ROW_HIGHLIGHT |
wx.TR_HIDE_ROOT |
@@ -2692,7 +2692,7 @@
self.TextCtrl[key] = wx.TextCtrl(self, size=wx.Size(130, 24), style=wx.TE_READONLY)
self.MasterStateSizer['innerMasterState'].AddMany([self.StaticText[key], self.TextCtrl[key]])
- self.MasterStateSizer['masterState'].AddSizer(self.MasterStateSizer['innerMasterState'])
+ self.MasterStateSizer['masterState'].Add(self.MasterStateSizer['innerMasterState'])
# ----------------------- Ethernet Network Card Information ---------------------------------------
for key, label in [
@@ -2705,7 +2705,7 @@
self.TextCtrl[key] = wx.TextCtrl(self, size=wx.Size(130, 24), style=wx.TE_READONLY)
self.MasterStateSizer['innerDeviceInfo'].AddMany([self.StaticText[key], self.TextCtrl[key]])
- self.MasterStateSizer['deviceInfo'].AddSizer(self.MasterStateSizer['innerDeviceInfo'])
+ self.MasterStateSizer['deviceInfo'].Add(self.MasterStateSizer['innerDeviceInfo'])
# ----------------------- Network Frame Information -----------------------------------------------
for key, label in [
@@ -2722,13 +2722,13 @@
self.TextCtrl[key][index] = wx.TextCtrl(self, size=wx.Size(130, 24), style=wx.TE_READONLY)
self.MasterStateSizer['innerFrameInfo'].Add(self.TextCtrl[key][index])
- self.MasterStateSizer['frameInfo'].AddSizer(self.MasterStateSizer['innerFrameInfo'])
+ self.MasterStateSizer['frameInfo'].Add(self.MasterStateSizer['innerFrameInfo'])
# ------------------------------- Slave Information -----------------------------------------------
self.SITreeListCtrl = SITreeListCtrl(self, self.Controler)
self.MasterStateSizer["innerSlaveInfo"].AddMany([self.SIUpdateButton,
self.SITreeListCtrl])
- self.MasterStateSizer["slaveInfo"].AddSizer(
+ self.MasterStateSizer["slaveInfo"].Add(
self.MasterStateSizer["innerSlaveInfo"])
# --------------------------------- Main Sizer ----------------------------------------------------
@@ -2743,7 +2743,7 @@
("main", [
"innerTop", "innerMiddle", "innerBottom"])]:
for key2 in sub:
- self.MasterStateSizer[key].AddSizer(self.MasterStateSizer[key2])
+ self.MasterStateSizer[key].Add(self.MasterStateSizer[key2])
self.SetSizer(self.MasterStateSizer["main"])
@@ -2798,7 +2798,7 @@
self.Controler=controler
- self.Tree = wx.gizmos.TreeListCtrl(self, -1, size=wx.Size(750,350),
+ self.Tree = wx.adv.TreeListCtrl(self, -1, size=wx.Size(750,350),
style=wx.TR_HAS_BUTTONS
|wx.TR_HIDE_ROOT
|wx.TR_ROW_LINES
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/exemples/first_steps/beremiz.xml Fri Oct 01 17:44:52 2021 +0200
@@ -0,0 +1,5 @@
+<?xml version='1.0' encoding='utf-8'?>
+<BeremizRoot xmlns:xsd="http://www.w3.org/2001/XMLSchema" URI_location="LOCAL://">
+ <TargetType/>
+ <Libraries Enable_Python_Library="false"/>
+</BeremizRoot>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/exemples/first_steps/plc.xml Fri Oct 01 17:44:52 2021 +0200
@@ -0,0 +1,1160 @@
+<?xml version='1.0' encoding='utf-8'?>
+<project xmlns:ns1="http://www.plcopen.org/xml/tc6_0201" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.plcopen.org/xml/tc6_0201">
+ <fileHeader companyName="Beremiz" productName="Beremiz" productVersion="1" creationDateTime="2016-10-24T18:09:22"/>
+ <contentHeader name="First Steps" modificationDateTime="2018-09-26T12:52:51">
+ <coordinateInfo>
+ <fbd>
+ <scaling x="0" y="0"/>
+ </fbd>
+ <ld>
+ <scaling x="0" y="0"/>
+ </ld>
+ <sfc>
+ <scaling x="0" y="0"/>
+ </sfc>
+ </coordinateInfo>
+ </contentHeader>
+ <types>
+ <dataTypes/>
+ <pous>
+ <pou name="AverageVal" pouType="function">
+ <interface>
+ <returnType>
+ <REAL/>
+ </returnType>
+ <inputVars>
+ <variable name="Cnt1">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ <variable name="Cnt2">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ <variable name="Cnt3">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ <variable name="Cnt4">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ <variable name="Cnt5">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ </inputVars>
+ <localVars>
+ <variable name="InputsNumber">
+ <type>
+ <REAL/>
+ </type>
+ <initialValue>
+ <simpleValue value="5.0"/>
+ </initialValue>
+ <documentation>
+ <xhtml:p><![CDATA[Количество входных значений]]></xhtml:p>
+ </documentation>
+ </variable>
+ </localVars>
+ </interface>
+ <body>
+ <ST>
+ <xhtml:p><![CDATA[AverageVal := INT_TO_REAL(Cnt1+Cnt2+Cnt3+Cnt4+Cnt5)/InputsNumber;]]></xhtml:p>
+ </ST>
+ </body>
+ </pou>
+ <pou name="plc_prg" pouType="program">
+ <interface>
+ <inputVars>
+ <variable name="Reset">
+ <type>
+ <BOOL/>
+ </type>
+ </variable>
+ </inputVars>
+ <outputVars>
+ <variable name="Cnt1">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ <variable name="Cnt2">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ <variable name="Cnt3">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ <variable name="Cnt4">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ <variable name="Cnt5">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ </outputVars>
+ <localVars>
+ <variable name="CounterST0">
+ <type>
+ <derived name="CounterST"/>
+ </type>
+ </variable>
+ <variable name="CounterFBD0">
+ <type>
+ <derived name="CounterFBD"/>
+ </type>
+ </variable>
+ <variable name="CounterSFC0">
+ <type>
+ <derived name="CounterSFC"/>
+ </type>
+ </variable>
+ <variable name="CounterIL0">
+ <type>
+ <derived name="CounterIL"/>
+ </type>
+ </variable>
+ <variable name="CounterLD0">
+ <type>
+ <derived name="CounterLD"/>
+ </type>
+ </variable>
+ <variable name="AVCnt">
+ <type>
+ <REAL/>
+ </type>
+ </variable>
+ </localVars>
+ </interface>
+ <body>
+ <FBD>
+ <block localId="1" typeName="CounterST" instanceName="CounterST0" executionOrderId="0" height="60" width="125">
+ <position x="207" y="53"/>
+ <inputVariables>
+ <variable formalParameter="Reset">
+ <connectionPointIn>
+ <relPosition x="0" y="40"/>
+ <connection refLocalId="2">
+ <position x="207" y="93"/>
+ <position x="114" y="93"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="125" y="40"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inVariable localId="2" executionOrderId="0" height="30" width="79" negated="false">
+ <position x="35" y="78"/>
+ <connectionPointOut>
+ <relPosition x="79" y="15"/>
+ </connectionPointOut>
+ <expression>Reset</expression>
+ </inVariable>
+ <block localId="4" typeName="CounterFBD" instanceName="CounterFBD0" executionOrderId="0" height="54" width="121">
+ <position x="211" y="146"/>
+ <inputVariables>
+ <variable formalParameter="Reset">
+ <connectionPointIn>
+ <relPosition x="0" y="37"/>
+ <connection refLocalId="13">
+ <position x="211" y="183"/>
+ <position x="115" y="183"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="121" y="37"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <comment localId="6" height="365" width="569">
+ <position x="620" y="130"/>
+ <content>
+ <xhtml:p><![CDATA[In this example function block with the same functionality
+is created using all five IEC 61131-3 programing languages:
+- IL;
+- FBD;
+- LD;
+- ST;
+- SFC.
+
+
+
+
+Function block is a counter with reset control input.
+If reset is True counter value is reset to the value defined by
+global configuration constant ResetCounterValue.
+If reset is False, counter is incremented every cycle.
+]]></xhtml:p>
+ </content>
+ </comment>
+ <block localId="7" typeName="CounterSFC" instanceName="CounterSFC0" executionOrderId="0" height="52" width="121">
+ <position x="211" y="237"/>
+ <inputVariables>
+ <variable formalParameter="Reset">
+ <connectionPointIn>
+ <relPosition x="0" y="36"/>
+ <connection refLocalId="12">
+ <position x="211" y="273"/>
+ <position x="103" y="273"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="121" y="36"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <block localId="9" typeName="CounterIL" instanceName="CounterIL0" executionOrderId="0" height="62" width="121">
+ <position x="211" y="322"/>
+ <inputVariables>
+ <variable formalParameter="Reset">
+ <connectionPointIn>
+ <relPosition x="0" y="41"/>
+ <connection refLocalId="10">
+ <position x="211" y="363"/>
+ <position x="101" y="363"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="121" y="41"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inVariable localId="10" executionOrderId="0" height="30" width="67" negated="false">
+ <position x="34" y="348"/>
+ <connectionPointOut>
+ <relPosition x="67" y="15"/>
+ </connectionPointOut>
+ <expression>Reset</expression>
+ </inVariable>
+ <inVariable localId="12" executionOrderId="0" height="30" width="67" negated="false">
+ <position x="36" y="258"/>
+ <connectionPointOut>
+ <relPosition x="67" y="15"/>
+ </connectionPointOut>
+ <expression>Reset</expression>
+ </inVariable>
+ <inVariable localId="13" executionOrderId="0" height="30" width="79" negated="false">
+ <position x="36" y="168"/>
+ <connectionPointOut>
+ <relPosition x="79" y="15"/>
+ </connectionPointOut>
+ <expression>Reset</expression>
+ </inVariable>
+ <block localId="14" typeName="CounterLD" instanceName="CounterLD0" executionOrderId="0" height="62" width="124">
+ <position x="210" y="412"/>
+ <inputVariables>
+ <variable formalParameter="Reset">
+ <connectionPointIn>
+ <relPosition x="0" y="41"/>
+ <connection refLocalId="16">
+ <position x="210" y="453"/>
+ <position x="100" y="453"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="Out">
+ <connectionPointOut>
+ <relPosition x="124" y="41"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inVariable localId="16" executionOrderId="0" height="30" width="64" negated="false">
+ <position x="36" y="438"/>
+ <connectionPointOut>
+ <relPosition x="64" y="15"/>
+ </connectionPointOut>
+ <expression>Reset</expression>
+ </inVariable>
+ <block localId="17" typeName="AverageVal" executionOrderId="0" height="470" width="100">
+ <position x="514" y="28"/>
+ <inputVariables>
+ <variable formalParameter="Cnt1">
+ <connectionPointIn>
+ <relPosition x="0" y="65"/>
+ <connection refLocalId="3">
+ <position x="514" y="93"/>
+ <position x="474" y="93"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="Cnt2">
+ <connectionPointIn>
+ <relPosition x="0" y="155"/>
+ <connection refLocalId="5">
+ <position x="514" y="183"/>
+ <position x="473" y="183"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="Cnt3">
+ <connectionPointIn>
+ <relPosition x="0" y="245"/>
+ <connection refLocalId="8">
+ <position x="514" y="273"/>
+ <position x="472" y="273"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="Cnt4">
+ <connectionPointIn>
+ <relPosition x="0" y="335"/>
+ <connection refLocalId="11">
+ <position x="514" y="363"/>
+ <position x="469" y="363"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="Cnt5">
+ <connectionPointIn>
+ <relPosition x="0" y="425"/>
+ <connection refLocalId="15">
+ <position x="514" y="453"/>
+ <position x="469" y="453"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="100" y="65"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <outVariable localId="18" executionOrderId="0" height="30" width="55" negated="false">
+ <position x="649" y="78"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="17" formalParameter="OUT">
+ <position x="649" y="93"/>
+ <position x="614" y="93"/>
+ </connection>
+ </connectionPointIn>
+ <expression>AVCnt</expression>
+ </outVariable>
+ <inOutVariable localId="3" executionOrderId="0" height="30" width="106" negatedOut="false" negatedIn="false">
+ <position x="368" y="78"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="1" formalParameter="OUT">
+ <position x="368" y="93"/>
+ <position x="332" y="93"/>
+ </connection>
+ </connectionPointIn>
+ <connectionPointOut>
+ <relPosition x="106" y="15"/>
+ </connectionPointOut>
+ <expression>Cnt1</expression>
+ </inOutVariable>
+ <inOutVariable localId="5" executionOrderId="0" height="30" width="103" negatedOut="false" negatedIn="false">
+ <position x="370" y="168"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="4" formalParameter="OUT">
+ <position x="370" y="183"/>
+ <position x="332" y="183"/>
+ </connection>
+ </connectionPointIn>
+ <connectionPointOut>
+ <relPosition x="103" y="15"/>
+ </connectionPointOut>
+ <expression>Cnt2</expression>
+ </inOutVariable>
+ <inOutVariable localId="8" executionOrderId="0" height="30" width="97" negatedOut="false" negatedIn="false">
+ <position x="375" y="258"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="7" formalParameter="OUT">
+ <position x="375" y="273"/>
+ <position x="332" y="273"/>
+ </connection>
+ </connectionPointIn>
+ <connectionPointOut>
+ <relPosition x="97" y="15"/>
+ </connectionPointOut>
+ <expression>Cnt3</expression>
+ </inOutVariable>
+ <inOutVariable localId="11" executionOrderId="0" height="30" width="91" negatedOut="false" negatedIn="false">
+ <position x="378" y="348"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="9" formalParameter="OUT">
+ <position x="378" y="363"/>
+ <position x="332" y="363"/>
+ </connection>
+ </connectionPointIn>
+ <connectionPointOut>
+ <relPosition x="91" y="15"/>
+ </connectionPointOut>
+ <expression>Cnt4</expression>
+ </inOutVariable>
+ <inOutVariable localId="15" executionOrderId="0" height="30" width="88" negatedOut="false" negatedIn="false">
+ <position x="381" y="438"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="14" formalParameter="Out">
+ <position x="381" y="453"/>
+ <position x="334" y="453"/>
+ </connection>
+ </connectionPointIn>
+ <connectionPointOut>
+ <relPosition x="88" y="15"/>
+ </connectionPointOut>
+ <expression>Cnt5</expression>
+ </inOutVariable>
+ </FBD>
+ </body>
+ </pou>
+ <pou name="CounterST" pouType="functionBlock">
+ <interface>
+ <inputVars>
+ <variable name="Reset">
+ <type>
+ <BOOL/>
+ </type>
+ </variable>
+ </inputVars>
+ <localVars>
+ <variable name="Cnt">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ </localVars>
+ <outputVars>
+ <variable name="OUT">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ </outputVars>
+ <externalVars constant="true">
+ <variable name="ResetCounterValue">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ </externalVars>
+ </interface>
+ <body>
+ <ST>
+ <xhtml:p><![CDATA[IF Reset THEN
+ Cnt := ResetCounterValue;
+ELSE
+ Cnt := Cnt + 1;
+END_IF;
+
+Out := Cnt;]]></xhtml:p>
+ </ST>
+ </body>
+ </pou>
+ <pou name="CounterFBD" pouType="functionBlock">
+ <interface>
+ <inputVars>
+ <variable name="Reset">
+ <type>
+ <BOOL/>
+ </type>
+ </variable>
+ </inputVars>
+ <outputVars>
+ <variable name="OUT">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ </outputVars>
+ <localVars>
+ <variable name="Cnt">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ </localVars>
+ <externalVars constant="true">
+ <variable name="ResetCounterValue">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ </externalVars>
+ </interface>
+ <body>
+ <FBD>
+ <inVariable localId="1" executionOrderId="0" height="30" width="61" negated="false">
+ <position x="321" y="58"/>
+ <connectionPointOut>
+ <relPosition x="61" y="15"/>
+ </connectionPointOut>
+ <expression>Reset</expression>
+ </inVariable>
+ <outVariable localId="2" executionOrderId="0" height="30" width="39" negated="false">
+ <position x="675" y="137"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="3">
+ <position x="675" y="152"/>
+ <position x="589" y="152"/>
+ </connection>
+ </connectionPointIn>
+ <expression>OUT</expression>
+ </outVariable>
+ <inOutVariable localId="3" executionOrderId="0" height="30" width="37" negatedOut="false" negatedIn="false">
+ <position x="557" y="137"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="7" formalParameter="OUT">
+ <position x="557" y="152"/>
+ <position x="527" y="152"/>
+ <position x="527" y="130"/>
+ <position x="517" y="130"/>
+ </connection>
+ </connectionPointIn>
+ <connectionPointOut>
+ <relPosition x="37" y="15"/>
+ </connectionPointOut>
+ <expression>Cnt</expression>
+ </inOutVariable>
+ <block localId="4" typeName="ADD" executionOrderId="0" height="80" width="69">
+ <position x="328" y="115"/>
+ <inputVariables>
+ <variable formalParameter="IN1">
+ <connectionPointIn>
+ <relPosition x="0" y="35"/>
+ <connection refLocalId="6">
+ <position x="328" y="150"/>
+ <position x="275" y="150"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN2">
+ <connectionPointIn>
+ <relPosition x="0" y="65"/>
+ <connection refLocalId="3">
+ <position x="328" y="180"/>
+ <position x="317" y="180"/>
+ <position x="317" y="213"/>
+ <position x="604" y="213"/>
+ <position x="604" y="152"/>
+ <position x="594" y="152"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="69" y="35"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inVariable localId="5" executionOrderId="0" height="30" width="163" negated="false">
+ <position x="222" y="256"/>
+ <connectionPointOut>
+ <relPosition x="163" y="15"/>
+ </connectionPointOut>
+ <expression>ResetCounterValue</expression>
+ </inVariable>
+ <inVariable localId="6" executionOrderId="0" height="30" width="21" negated="false">
+ <position x="254" y="135"/>
+ <connectionPointOut>
+ <relPosition x="21" y="15"/>
+ </connectionPointOut>
+ <expression>1</expression>
+ </inVariable>
+ <block localId="7" typeName="SEL" executionOrderId="0" height="80" width="69">
+ <position x="448" y="100"/>
+ <inputVariables>
+ <variable formalParameter="G">
+ <connectionPointIn>
+ <relPosition x="0" y="30"/>
+ <connection refLocalId="1">
+ <position x="448" y="130"/>
+ <position x="415" y="130"/>
+ <position x="415" y="73"/>
+ <position x="382" y="73"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN0">
+ <connectionPointIn>
+ <relPosition x="0" y="50"/>
+ <connection refLocalId="4" formalParameter="OUT">
+ <position x="448" y="150"/>
+ <position x="397" y="150"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN1">
+ <connectionPointIn>
+ <relPosition x="0" y="70"/>
+ <connection refLocalId="5">
+ <position x="448" y="170"/>
+ <position x="414" y="170"/>
+ <position x="414" y="271"/>
+ <position x="385" y="271"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="69" y="30"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ </FBD>
+ </body>
+ </pou>
+ <pou name="CounterSFC" pouType="functionBlock">
+ <interface>
+ <inputVars>
+ <variable name="Reset">
+ <type>
+ <BOOL/>
+ </type>
+ </variable>
+ </inputVars>
+ <outputVars>
+ <variable name="OUT">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ </outputVars>
+ <localVars>
+ <variable name="Cnt">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ </localVars>
+ <externalVars constant="true">
+ <variable name="ResetCounterValue">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ </externalVars>
+ </interface>
+ <actions/>
+ <body>
+ <SFC>
+ <step localId="1" name="Start" initialStep="true" height="34" width="90">
+ <position x="241" y="14"/>
+ <connectionPointOut formalParameter="">
+ <relPosition x="45" y="34"/>
+ </connectionPointOut>
+ </step>
+ <selectionDivergence localId="2" height="1" width="431">
+ <position x="70" y="86"/>
+ <connectionPointIn>
+ <relPosition x="216" y="0"/>
+ <connection refLocalId="1">
+ <position x="286" y="86"/>
+ <position x="286" y="42"/>
+ </connection>
+ </connectionPointIn>
+ <connectionPointOut formalParameter="">
+ <relPosition x="0" y="1"/>
+ </connectionPointOut>
+ <connectionPointOut formalParameter="">
+ <relPosition x="431" y="1"/>
+ </connectionPointOut>
+ </selectionDivergence>
+ <transition localId="3" height="2" width="20">
+ <position x="491" y="132"/>
+ <connectionPointIn>
+ <relPosition x="10" y="0"/>
+ <connection refLocalId="2">
+ <position x="501" y="132"/>
+ <position x="501" y="87"/>
+ </connection>
+ </connectionPointIn>
+ <connectionPointOut>
+ <relPosition x="10" y="2"/>
+ </connectionPointOut>
+ <condition>
+ <inline name="">
+ <ST>
+ <xhtml:p><![CDATA[Reset]]></xhtml:p>
+ </ST>
+ </inline>
+ </condition>
+ </transition>
+ <transition localId="4" height="2" width="20" executionOrderId="0">
+ <position x="60" y="135"/>
+ <connectionPointIn>
+ <relPosition x="10" y="0"/>
+ <connection refLocalId="2">
+ <position x="70" y="135"/>
+ <position x="70" y="87"/>
+ </connection>
+ </connectionPointIn>
+ <connectionPointOut>
+ <relPosition x="10" y="2"/>
+ </connectionPointOut>
+ <condition>
+ <inline name="">
+ <ST>
+ <xhtml:p><![CDATA[NOT Reset]]></xhtml:p>
+ </ST>
+ </inline>
+ </condition>
+ </transition>
+ <step localId="5" name="ResetCounter" initialStep="false" height="30" width="134">
+ <position x="434" y="190"/>
+ <connectionPointIn>
+ <relPosition x="67" y="0"/>
+ <connection refLocalId="3">
+ <position x="501" y="190"/>
+ <position x="501" y="134"/>
+ </connection>
+ </connectionPointIn>
+ <connectionPointOut formalParameter="">
+ <relPosition x="67" y="30"/>
+ </connectionPointOut>
+ <connectionPointOutAction formalParameter="">
+ <relPosition x="134" y="15"/>
+ </connectionPointOutAction>
+ </step>
+ <actionBlock localId="6" height="63" width="254">
+ <position x="641" y="190"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="5">
+ <position x="641" y="205"/>
+ <position x="568" y="205"/>
+ </connection>
+ </connectionPointIn>
+ <action localId="0">
+ <relPosition x="0" y="0"/>
+ <inline>
+ <ST>
+ <xhtml:p><![CDATA[Cnt := ResetCounterValue;]]></xhtml:p>
+ </ST>
+ </inline>
+ </action>
+ <action localId="0">
+ <relPosition x="0" y="0"/>
+ <inline>
+ <ST>
+ <xhtml:p><![CDATA[OUT := Cnt;]]></xhtml:p>
+ </ST>
+ </inline>
+ </action>
+ </actionBlock>
+ <step localId="7" name="Count" initialStep="false" height="30" width="85" executionOrderId="0">
+ <position x="28" y="191"/>
+ <connectionPointIn>
+ <relPosition x="42" y="0"/>
+ <connection refLocalId="4">
+ <position x="70" y="191"/>
+ <position x="70" y="137"/>
+ </connection>
+ </connectionPointIn>
+ <connectionPointOut formalParameter="">
+ <relPosition x="42" y="30"/>
+ </connectionPointOut>
+ <connectionPointOutAction formalParameter="">
+ <relPosition x="85" y="15"/>
+ </connectionPointOutAction>
+ </step>
+ <actionBlock localId="8" height="52" width="164" executionOrderId="0">
+ <position x="154" y="191"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="7">
+ <position x="154" y="206"/>
+ <position x="113" y="206"/>
+ </connection>
+ </connectionPointIn>
+ <action localId="0">
+ <relPosition x="0" y="0"/>
+ <inline>
+ <ST>
+ <xhtml:p><![CDATA[Cnt := Cnt + 1;]]></xhtml:p>
+ </ST>
+ </inline>
+ </action>
+ <action localId="0">
+ <relPosition x="0" y="0"/>
+ <inline>
+ <ST>
+ <xhtml:p><![CDATA[OUT := Cnt;]]></xhtml:p>
+ </ST>
+ </inline>
+ </action>
+ </actionBlock>
+ <selectionConvergence localId="10" height="1" width="431">
+ <position x="70" y="273"/>
+ <connectionPointIn>
+ <relPosition x="0" y="0"/>
+ <connection refLocalId="13">
+ <position x="70" y="273"/>
+ <position x="70" y="244"/>
+ </connection>
+ </connectionPointIn>
+ <connectionPointIn>
+ <relPosition x="431" y="0"/>
+ <connection refLocalId="14">
+ <position x="501" y="273"/>
+ <position x="501" y="250"/>
+ </connection>
+ </connectionPointIn>
+ <connectionPointOut>
+ <relPosition x="216" y="1"/>
+ </connectionPointOut>
+ </selectionConvergence>
+ <jumpStep localId="12" targetName="Start" height="13" width="12">
+ <position x="280" y="317"/>
+ <connectionPointIn>
+ <relPosition x="6" y="0"/>
+ <connection refLocalId="10">
+ <position x="286" y="317"/>
+ <position x="286" y="274"/>
+ </connection>
+ </connectionPointIn>
+ </jumpStep>
+ <transition localId="13" height="2" width="20" executionOrderId="0">
+ <position x="60" y="242"/>
+ <connectionPointIn>
+ <relPosition x="10" y="0"/>
+ <connection refLocalId="7">
+ <position x="70" y="242"/>
+ <position x="70" y="215"/>
+ </connection>
+ </connectionPointIn>
+ <connectionPointOut>
+ <relPosition x="10" y="2"/>
+ </connectionPointOut>
+ <condition>
+ <inline name="">
+ <ST>
+ <xhtml:p><![CDATA[Reset]]></xhtml:p>
+ </ST>
+ </inline>
+ </condition>
+ </transition>
+ <transition localId="14" height="2" width="20" executionOrderId="0">
+ <position x="491" y="248"/>
+ <connectionPointIn>
+ <relPosition x="10" y="0"/>
+ <connection refLocalId="5">
+ <position x="501" y="248"/>
+ <position x="501" y="220"/>
+ </connection>
+ </connectionPointIn>
+ <connectionPointOut>
+ <relPosition x="10" y="2"/>
+ </connectionPointOut>
+ <condition>
+ <inline name="">
+ <ST>
+ <xhtml:p><![CDATA[NOT Reset]]></xhtml:p>
+ </ST>
+ </inline>
+ </condition>
+ </transition>
+ </SFC>
+ </body>
+ </pou>
+ <pou name="CounterIL" pouType="functionBlock">
+ <interface>
+ <localVars>
+ <variable name="Cnt">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ </localVars>
+ <inputVars>
+ <variable name="Reset">
+ <type>
+ <BOOL/>
+ </type>
+ </variable>
+ </inputVars>
+ <outputVars>
+ <variable name="OUT">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ </outputVars>
+ <externalVars constant="true">
+ <variable name="ResetCounterValue">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ </externalVars>
+ </interface>
+ <body>
+ <IL>
+ <xhtml:p><![CDATA[LD Reset
+JMPC ResetCnt
+
+(* increment counter *)
+LD Cnt
+ADD 1
+JMP QuitFb
+
+ResetCnt:
+(* reset counter *)
+LD ResetCounterValue
+
+QuitFb:
+(* save results *)
+ST Cnt
+ST Out
+]]></xhtml:p>
+ </IL>
+ </body>
+ </pou>
+ <pou name="CounterLD" pouType="functionBlock">
+ <interface>
+ <inputVars>
+ <variable name="Reset">
+ <type>
+ <BOOL/>
+ </type>
+ </variable>
+ </inputVars>
+ <outputVars>
+ <variable name="Out">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ </outputVars>
+ <localVars>
+ <variable name="Cnt">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ </localVars>
+ <externalVars constant="true">
+ <variable name="ResetCounterValue">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ </externalVars>
+ </interface>
+ <body>
+ <LD>
+ <outVariable localId="2" executionOrderId="0" height="30" width="34" negated="false">
+ <position x="527" y="87"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="3">
+ <position x="527" y="102"/>
+ <position x="443" y="102"/>
+ </connection>
+ </connectionPointIn>
+ <expression>Out</expression>
+ </outVariable>
+ <inOutVariable localId="3" executionOrderId="0" height="30" width="34" negatedOut="false" negatedIn="false">
+ <position x="409" y="87"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="7" formalParameter="OUT">
+ <position x="409" y="102"/>
+ <position x="367" y="102"/>
+ </connection>
+ </connectionPointIn>
+ <connectionPointOut>
+ <relPosition x="34" y="15"/>
+ </connectionPointOut>
+ <expression>Cnt</expression>
+ </inOutVariable>
+ <block localId="4" typeName="ADD" executionOrderId="0" height="80" width="67">
+ <position x="180" y="87"/>
+ <inputVariables>
+ <variable formalParameter="IN1">
+ <connectionPointIn>
+ <relPosition x="0" y="35"/>
+ <connection refLocalId="6">
+ <position x="180" y="122"/>
+ <position x="127" y="122"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN2">
+ <connectionPointIn>
+ <relPosition x="0" y="65"/>
+ <connection refLocalId="3">
+ <position x="180" y="152"/>
+ <position x="169" y="152"/>
+ <position x="169" y="185"/>
+ <position x="453" y="185"/>
+ <position x="453" y="102"/>
+ <position x="443" y="102"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="67" y="35"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inVariable localId="5" executionOrderId="0" height="30" width="158" negated="false">
+ <position x="74" y="228"/>
+ <connectionPointOut>
+ <relPosition x="158" y="15"/>
+ </connectionPointOut>
+ <expression>ResetCounterValue</expression>
+ </inVariable>
+ <inVariable localId="6" executionOrderId="0" height="30" width="21" negated="false">
+ <position x="106" y="107"/>
+ <connectionPointOut>
+ <relPosition x="21" y="15"/>
+ </connectionPointOut>
+ <expression>1</expression>
+ </inVariable>
+ <block localId="7" typeName="SEL" executionOrderId="0" height="80" width="67">
+ <position x="300" y="72"/>
+ <inputVariables>
+ <variable formalParameter="G">
+ <connectionPointIn>
+ <relPosition x="0" y="30"/>
+ <connection refLocalId="9">
+ <position x="300" y="102"/>
+ <position x="266" y="102"/>
+ <position x="266" y="62"/>
+ <position x="134" y="62"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN0">
+ <connectionPointIn>
+ <relPosition x="0" y="50"/>
+ <connection refLocalId="4" formalParameter="OUT">
+ <position x="300" y="122"/>
+ <position x="247" y="122"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN1">
+ <connectionPointIn>
+ <relPosition x="0" y="70"/>
+ <connection refLocalId="5">
+ <position x="300" y="142"/>
+ <position x="266" y="142"/>
+ <position x="266" y="243"/>
+ <position x="232" y="243"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="67" y="30"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <leftPowerRail localId="8" height="40" width="3">
+ <position x="46" y="42"/>
+ <connectionPointOut formalParameter="">
+ <relPosition x="3" y="20"/>
+ </connectionPointOut>
+ </leftPowerRail>
+ <contact localId="9" height="15" width="21" negated="false">
+ <position x="113" y="54"/>
+ <connectionPointIn>
+ <relPosition x="0" y="8"/>
+ <connection refLocalId="8">
+ <position x="113" y="62"/>
+ <position x="49" y="62"/>
+ </connection>
+ </connectionPointIn>
+ <connectionPointOut>
+ <relPosition x="21" y="8"/>
+ </connectionPointOut>
+ <variable>Reset</variable>
+ </contact>
+ </LD>
+ </body>
+ </pou>
+ </pous>
+ </types>
+ <instances>
+ <configurations>
+ <configuration name="config">
+ <resource name="resource1">
+ <task name="plc_task" priority="1" interval="T#100ms">
+ <pouInstance name="plc_task_instance" typeName="plc_prg"/>
+ </task>
+ </resource>
+ <globalVars constant="true">
+ <variable name="ResetCounterValue">
+ <type>
+ <INT/>
+ </type>
+ <initialValue>
+ <simpleValue value="17"/>
+ </initialValue>
+ </variable>
+ </globalVars>
+ </configuration>
+ </configurations>
+ </instances>
+</project>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/exemples/python/beremiz.xml Fri Oct 01 17:44:52 2021 +0200
@@ -0,0 +1,5 @@
+<?xml version='1.0' encoding='utf-8'?>
+<BeremizRoot URI_location="LOCAL://">
+ <TargetType/>
+ <Libraries Enable_Python_Library="true"/>
+</BeremizRoot>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/exemples/python/c_code@c_ext/baseconfnode.xml Fri Oct 01 17:44:52 2021 +0200
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='utf-8'?>
+<BaseParams Name="c_code" IEC_Channel="1"/>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/exemples/python/c_code@c_ext/cfile.xml Fri Oct 01 17:44:52 2021 +0200
@@ -0,0 +1,75 @@
+<?xml version='1.0' encoding='utf-8'?>
+<CFile xmlns:xhtml="http://www.w3.org/1999/xhtml">
+ <includes>
+ <xhtml:p><![CDATA[
+]]></xhtml:p>
+ </includes>
+ <variables>
+ <variable name="TestInput" type="SINT" initial="0"/>
+ <variable name="TestOutput" type="SINT"/>
+ </variables>
+ <globals>
+ <xhtml:p><![CDATA[
+volatile long Lock=0;
+volatile char PtoC=1,CtoP=2;
+
+extern long AtomicCompareExchange(long*,long, long);
+extern char *PLC_ID;
+
+int Simple_C_Call(int val){
+ return val+1;
+}
+
+int Python_to_C_Call(char toC, char *fromC){
+ /* Code called by python should never touch to
+ variables modified by PLC thread directly
+
+ AtomicCompareExchange comes from
+ beremiz' runtime implementation */
+
+ int res = 0;
+ if(!AtomicCompareExchange((long*)&Lock, 0, 1)){
+ PtoC=toC;
+ *fromC=CtoP;
+ AtomicCompareExchange((long*)&Lock, 1, 0);
+ res=1;
+ }
+ printf("C code called by Python: toC %d fromC %d\n",toC,*fromC);
+ printf("PLC_ID id %s\n",PLC_ID);
+ return res;
+}
+
+int PLC_C_Call(char fromPLC, char *toPLC){
+ /* PLC also have to be realy carefull not to
+ conflict with asynchronous python access */
+ if(!AtomicCompareExchange((long*)&Lock, 0, 1)){
+ CtoP = fromPLC;
+ *toPLC = PtoC;
+ AtomicCompareExchange((long*)&Lock, 1, 0);
+ return 1;
+ }
+ return 0;
+}
+]]></xhtml:p>
+ </globals>
+ <initFunction>
+ <xhtml:p><![CDATA[
+]]></xhtml:p>
+ </initFunction>
+ <cleanUpFunction>
+ <xhtml:p><![CDATA[
+]]></xhtml:p>
+ </cleanUpFunction>
+ <retrieveFunction>
+ <xhtml:p><![CDATA[
+]]></xhtml:p>
+ </retrieveFunction>
+ <publishFunction>
+ <xhtml:p><![CDATA[
+if(!AtomicCompareExchange((long*)&Lock, 0, 1)){
+ TestInput = CtoP + PtoC + TestOutput;
+ AtomicCompareExchange((long*)&Lock, 1, 0);
+}
+]]></xhtml:p>
+ </publishFunction>
+</CFile>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/exemples/python/c_code@c_ext/confnode.xml Fri Oct 01 17:44:52 2021 +0200
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='utf-8'?>
+<CExtension CFLAGS="" LDFLAGS=""/>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/exemples/python/plc.xml Fri Oct 01 17:44:52 2021 +0200
@@ -0,0 +1,1644 @@
+<?xml version='1.0' encoding='utf-8'?>
+<project xmlns="http://www.plcopen.org/xml/tc6_0201" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xsi:schemaLocation="http://www.plcopen.org/xml/tc6_0201">
+ <fileHeader companyName="" productName="Beremiz" productVersion="0.0" creationDateTime="2008-12-14T16:21:19" contentDescription="This example shows many features in Beremiz: 1. How to implement python extensions. 2. How to implement basic C extension. 3. How to use C code in IEC POUs. 4. How to call C functions from python code. 5. How to avoid race conditions between IEC, C and python code. 6. How to convert betweet different IEC types. "/>
+ <contentHeader name="Beremiz Python Support Tests" modificationDateTime="2020-10-19T23:53:08">
+ <coordinateInfo>
+ <pageSize x="1024" y="1024"/>
+ <fbd>
+ <scaling x="5" y="5"/>
+ </fbd>
+ <ld>
+ <scaling x="5" y="5"/>
+ </ld>
+ <sfc>
+ <scaling x="5" y="5"/>
+ </sfc>
+ </coordinateInfo>
+ </contentHeader>
+ <types>
+ <dataTypes>
+ <dataType name="CPLX_TYPE">
+ <baseType>
+ <struct>
+ <variable name="FIRSTBYTE">
+ <type>
+ <SINT/>
+ </type>
+ </variable>
+ <variable name="SECONDBYTE">
+ <type>
+ <SINT/>
+ </type>
+ </variable>
+ </struct>
+ </baseType>
+ </dataType>
+ <dataType name="StateMachine">
+ <baseType>
+ <enum>
+ <values>
+ <value name="STANDBY"/>
+ <value name="START"/>
+ <value name="STOP"/>
+ </values>
+ </enum>
+ </baseType>
+ </dataType>
+ <dataType name="datatype0">
+ <baseType>
+ <BOOL/>
+ </baseType>
+ </dataType>
+ <dataType name="blups">
+ <baseType>
+ <array>
+ <dimension lower="0" upper="31"/>
+ <baseType>
+ <derived name="CPLX_TYPE"/>
+ </baseType>
+ </array>
+ </baseType>
+ </dataType>
+ </dataTypes>
+ <pous>
+ <pou name="main_pytest" pouType="program">
+ <interface>
+ <localVars>
+ <variable name="mux1_sel">
+ <type>
+ <INT/>
+ </type>
+ <initialValue>
+ <simpleValue value="3"/>
+ </initialValue>
+ <documentation>
+ <xhtml:p><![CDATA[blah]]></xhtml:p>
+ </documentation>
+ </variable>
+ <variable name="mux2_sel">
+ <type>
+ <INT/>
+ </type>
+ <initialValue>
+ <simpleValue value="3"/>
+ </initialValue>
+ </variable>
+ <variable name="pytest_var1">
+ <type>
+ <string/>
+ </type>
+ </variable>
+ <variable name="fefvsd">
+ <type>
+ <derived name="datatype0"/>
+ </type>
+ </variable>
+ <variable name="pytest_var2">
+ <type>
+ <BOOL/>
+ </type>
+ </variable>
+ <variable name="py1">
+ <type>
+ <derived name="python_eval"/>
+ </type>
+ </variable>
+ <variable name="Block1">
+ <type>
+ <derived name="python_eval"/>
+ </type>
+ </variable>
+ <variable name="Block2">
+ <type>
+ <derived name="python_eval"/>
+ </type>
+ </variable>
+ <variable name="Block3">
+ <type>
+ <derived name="python_eval"/>
+ </type>
+ </variable>
+ <variable name="pytest_var3">
+ <type>
+ <BOOL/>
+ </type>
+ </variable>
+ <variable name="FromC">
+ <type>
+ <SINT/>
+ </type>
+ </variable>
+ <variable name="C_Pragma0">
+ <type>
+ <derived name="C_Pragma"/>
+ </type>
+ </variable>
+ </localVars>
+ <externalVars>
+ <variable name="TestInput">
+ <type>
+ <SINT/>
+ </type>
+ </variable>
+ <variable name="TestOutput">
+ <type>
+ <SINT/>
+ </type>
+ </variable>
+ </externalVars>
+ <localVars>
+ <variable name="FromInput">
+ <type>
+ <SINT/>
+ </type>
+ </variable>
+ <variable name="Test_BCD">
+ <type>
+ <WORD/>
+ </type>
+ <initialValue>
+ <simpleValue value="151"/>
+ </initialValue>
+ </variable>
+ <variable name="Test_BCD_WRONG">
+ <type>
+ <WORD/>
+ </type>
+ <initialValue>
+ <simpleValue value="154"/>
+ </initialValue>
+ </variable>
+ <variable name="Test_BCD_CONVERTED">
+ <type>
+ <BOOL/>
+ </type>
+ </variable>
+ <variable name="Test_BCD_RESULT">
+ <type>
+ <UINT/>
+ </type>
+ </variable>
+ <variable name="Test_BCD_WRONG_RESULT">
+ <type>
+ <UINT/>
+ </type>
+ </variable>
+ <variable name="Test_DT">
+ <type>
+ <DT/>
+ </type>
+ <initialValue>
+ <simpleValue value="DT#2013-02-23-22:35:46"/>
+ </initialValue>
+ </variable>
+ <variable name="Test_TOD">
+ <type>
+ <TOD/>
+ </type>
+ </variable>
+ <variable name="Test_TOD_STRING">
+ <type>
+ <string/>
+ </type>
+ </variable>
+ <variable name="Test_Date">
+ <type>
+ <DATE/>
+ </type>
+ </variable>
+ <variable name="Test_String">
+ <type>
+ <string/>
+ </type>
+ <initialValue>
+ <simpleValue value="test"/>
+ </initialValue>
+ </variable>
+ <variable name="Test_Bool">
+ <type>
+ <BOOL/>
+ </type>
+ </variable>
+ </localVars>
+ <externalVars>
+ <variable name="Global_RS">
+ <type>
+ <derived name="RS"/>
+ </type>
+ </variable>
+ <variable name="TUTU">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ <variable name="TOTO">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ <variable name="Test_Python_Var">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ <variable name="Second_Python_Var">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ <variable name="Grumpf">
+ <type>
+ <string/>
+ </type>
+ </variable>
+ </externalVars>
+ <localVars>
+ <variable name="RTC0">
+ <type>
+ <derived name="RTC"/>
+ </type>
+ </variable>
+ </localVars>
+ <externalVars>
+ <variable name="SomeVarName">
+ <type>
+ <DINT/>
+ </type>
+ </variable>
+ </externalVars>
+ </interface>
+ <body>
+ <FBD>
+ <inVariable localId="4" height="30" width="160" executionOrderId="0" negated="false">
+ <position x="295" y="450"/>
+ <connectionPointOut>
+ <relPosition x="160" y="15"/>
+ </connectionPointOut>
+ <expression>'666'</expression>
+ </inVariable>
+ <block localId="5" width="125" height="80" typeName="python_eval" instanceName="py1" executionOrderId="0">
+ <position x="686" y="400"/>
+ <inputVariables>
+ <variable formalParameter="TRIG">
+ <connectionPointIn>
+ <relPosition x="0" y="35"/>
+ <connection refLocalId="7" formalParameter="OUT">
+ <position x="686" y="435"/>
+ <position x="285" y="435"/>
+ <position x="285" y="480"/>
+ <position x="250" y="480"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="CODE">
+ <connectionPointIn>
+ <relPosition x="0" y="65"/>
+ <connection refLocalId="4">
+ <position x="686" y="465"/>
+ <position x="455" y="465"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="ACK">
+ <connectionPointOut>
+ <relPosition x="125" y="35"/>
+ </connectionPointOut>
+ </variable>
+ <variable formalParameter="RESULT">
+ <connectionPointOut>
+ <relPosition x="125" y="65"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <block localId="7" width="70" height="45" typeName="NOT" executionOrderId="0">
+ <position x="180" y="450"/>
+ <inputVariables>
+ <variable formalParameter="IN">
+ <connectionPointIn>
+ <relPosition x="0" y="30"/>
+ <connection refLocalId="3">
+ <position x="180" y="480"/>
+ <position x="155" y="480"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="70" y="30"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inOutVariable localId="3" height="30" width="120" executionOrderId="0" negatedOut="false" negatedIn="false">
+ <position x="35" y="465"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="7" formalParameter="OUT">
+ <position x="35" y="480"/>
+ <position x="25" y="480"/>
+ <position x="25" y="440"/>
+ <position x="270" y="440"/>
+ <position x="270" y="480"/>
+ <position x="250" y="480"/>
+ </connection>
+ </connectionPointIn>
+ <connectionPointOut>
+ <relPosition x="120" y="15"/>
+ </connectionPointOut>
+ <expression>pytest_var2</expression>
+ </inOutVariable>
+ <block localId="8" width="125" height="80" typeName="python_eval" instanceName="Block1" executionOrderId="0">
+ <position x="686" y="545"/>
+ <inputVariables>
+ <variable formalParameter="TRIG">
+ <connectionPointIn>
+ <relPosition x="0" y="35"/>
+ <connection refLocalId="7" formalParameter="OUT">
+ <position x="686" y="580"/>
+ <position x="285" y="580"/>
+ <position x="285" y="480"/>
+ <position x="250" y="480"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="CODE">
+ <connectionPointIn>
+ <relPosition x="0" y="65"/>
+ <connection refLocalId="9">
+ <position x="686" y="610"/>
+ <position x="665" y="610"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="ACK">
+ <connectionPointOut>
+ <relPosition x="125" y="35"/>
+ </connectionPointOut>
+ </variable>
+ <variable formalParameter="RESULT">
+ <connectionPointOut>
+ <relPosition x="125" y="65"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inVariable localId="9" height="30" width="370" executionOrderId="0" negated="false">
+ <position x="295" y="595"/>
+ <connectionPointOut>
+ <relPosition x="370" y="15"/>
+ </connectionPointOut>
+ <expression>'sys.stdout.write("FBID :"+str(FBID)+"\n")'</expression>
+ </inVariable>
+ <inVariable localId="11" height="30" width="290" executionOrderId="0" negated="false">
+ <position x="295" y="735"/>
+ <connectionPointOut>
+ <relPosition x="290" y="15"/>
+ </connectionPointOut>
+ <expression>'PLCBinary.Simple_C_Call(5678)'</expression>
+ </inVariable>
+ <block localId="12" width="125" height="80" typeName="python_eval" instanceName="Block2" executionOrderId="0">
+ <position x="686" y="687"/>
+ <inputVariables>
+ <variable formalParameter="TRIG">
+ <connectionPointIn>
+ <relPosition x="0" y="33"/>
+ <connection refLocalId="7" formalParameter="OUT">
+ <position x="686" y="720"/>
+ <position x="285" y="720"/>
+ <position x="285" y="480"/>
+ <position x="250" y="480"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="CODE">
+ <connectionPointIn>
+ <relPosition x="0" y="63"/>
+ <connection refLocalId="11">
+ <position x="686" y="750"/>
+ <position x="585" y="750"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="ACK">
+ <connectionPointOut>
+ <relPosition x="125" y="33"/>
+ </connectionPointOut>
+ </variable>
+ <variable formalParameter="RESULT">
+ <connectionPointOut>
+ <relPosition x="125" y="63"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inVariable localId="14" height="30" width="290" executionOrderId="0" negated="false">
+ <position x="290" y="885"/>
+ <connectionPointOut>
+ <relPosition x="290" y="15"/>
+ </connectionPointOut>
+ <expression>'MyPythonFunc(42)'</expression>
+ </inVariable>
+ <block localId="15" width="125" height="80" typeName="python_eval" instanceName="Block3" executionOrderId="0">
+ <position x="686" y="837"/>
+ <inputVariables>
+ <variable formalParameter="TRIG">
+ <connectionPointIn>
+ <relPosition x="0" y="33"/>
+ <connection refLocalId="7" formalParameter="OUT">
+ <position x="686" y="870"/>
+ <position x="285" y="870"/>
+ <position x="285" y="480"/>
+ <position x="250" y="480"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="CODE">
+ <connectionPointIn>
+ <relPosition x="0" y="63"/>
+ <connection refLocalId="14">
+ <position x="686" y="900"/>
+ <position x="580" y="900"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="ACK">
+ <connectionPointOut>
+ <relPosition x="125" y="33"/>
+ </connectionPointOut>
+ </variable>
+ <variable formalParameter="RESULT">
+ <connectionPointOut>
+ <relPosition x="125" y="63"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <comment localId="16" height="90" width="680">
+ <position x="35" y="275"/>
+ <content>
+ <xhtml:p><![CDATA[This part of the example test that, despite of 2T period clock stimulating TRIG pin of pyth_eval blocks, blocks keep executing one after the other, in respect of execution order.]]></xhtml:p>
+ </content>
+ </comment>
+ <block localId="17" width="80" height="120" typeName="MUX" executionOrderId="0">
+ <position x="1101" y="790"/>
+ <inputVariables>
+ <variable formalParameter="K">
+ <connectionPointIn>
+ <relPosition x="0" y="30"/>
+ <connection refLocalId="18">
+ <position x="1101" y="820"/>
+ <position x="1076" y="820"/>
+ <position x="1076" y="810"/>
+ <position x="1060" y="810"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN0">
+ <connectionPointIn>
+ <relPosition x="0" y="50"/>
+ <connection refLocalId="5" formalParameter="RESULT">
+ <position x="1101" y="840"/>
+ <position x="941" y="840"/>
+ <position x="941" y="465"/>
+ <position x="811" y="465"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN1">
+ <connectionPointIn>
+ <relPosition x="0" y="70"/>
+ <connection refLocalId="8" formalParameter="RESULT">
+ <position x="1101" y="860"/>
+ <position x="926" y="860"/>
+ <position x="926" y="610"/>
+ <position x="811" y="610"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN2">
+ <connectionPointIn>
+ <relPosition x="0" y="90"/>
+ <connection refLocalId="12" formalParameter="RESULT">
+ <position x="1101" y="880"/>
+ <position x="911" y="880"/>
+ <position x="911" y="750"/>
+ <position x="811" y="750"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN3">
+ <connectionPointIn>
+ <relPosition x="0" y="110"/>
+ <connection refLocalId="15" formalParameter="RESULT">
+ <position x="1101" y="900"/>
+ <position x="811" y="900"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="80" y="30"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <outVariable localId="19" height="35" width="125" executionOrderId="0" negated="false">
+ <position x="1271" y="805"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="17" formalParameter="OUT">
+ <position x="1271" y="820"/>
+ <position x="1181" y="820"/>
+ </connection>
+ </connectionPointIn>
+ <expression>pytest_var1</expression>
+ </outVariable>
+ <block localId="21" width="80" height="120" typeName="MUX" executionOrderId="0">
+ <position x="1106" y="385"/>
+ <inputVariables>
+ <variable formalParameter="K">
+ <connectionPointIn>
+ <relPosition x="0" y="30"/>
+ <connection refLocalId="22">
+ <position x="1106" y="415"/>
+ <position x="1076" y="415"/>
+ <position x="1076" y="405"/>
+ <position x="1055" y="405"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN0">
+ <connectionPointIn>
+ <relPosition x="0" y="50"/>
+ <connection refLocalId="5" formalParameter="ACK">
+ <position x="1106" y="435"/>
+ <position x="811" y="435"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN1">
+ <connectionPointIn>
+ <relPosition x="0" y="70"/>
+ <connection refLocalId="8" formalParameter="ACK">
+ <position x="1106" y="455"/>
+ <position x="841" y="455"/>
+ <position x="841" y="580"/>
+ <position x="811" y="580"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN2">
+ <connectionPointIn>
+ <relPosition x="0" y="90"/>
+ <connection refLocalId="12" formalParameter="ACK">
+ <position x="1106" y="475"/>
+ <position x="856" y="475"/>
+ <position x="856" y="720"/>
+ <position x="811" y="720"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN3">
+ <connectionPointIn>
+ <relPosition x="0" y="110"/>
+ <connection refLocalId="15" formalParameter="ACK">
+ <position x="1106" y="495"/>
+ <position x="871" y="495"/>
+ <position x="871" y="870"/>
+ <position x="811" y="870"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="80" y="30"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inVariable localId="22" height="30" width="74" executionOrderId="0" negated="false">
+ <position x="981" y="390"/>
+ <connectionPointOut>
+ <relPosition x="74" y="15"/>
+ </connectionPointOut>
+ <expression>mux1_sel</expression>
+ </inVariable>
+ <outVariable localId="23" height="35" width="125" executionOrderId="0" negated="false">
+ <position x="1271" y="400"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="21" formalParameter="OUT">
+ <position x="1271" y="415"/>
+ <position x="1186" y="415"/>
+ </connection>
+ </connectionPointIn>
+ <expression>pytest_var3</expression>
+ </outVariable>
+ <outVariable localId="25" height="30" width="60" executionOrderId="0" negated="false">
+ <position x="320" y="1075"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="26" formalParameter="OUT">
+ <position x="320" y="1090"/>
+ <position x="265" y="1090"/>
+ </connection>
+ </connectionPointIn>
+ <expression>FromC</expression>
+ </outVariable>
+ <inVariable localId="1" height="30" width="30" executionOrderId="0" negated="false">
+ <position x="105" y="1075"/>
+ <connectionPointOut>
+ <relPosition x="30" y="15"/>
+ </connectionPointOut>
+ <expression>23</expression>
+ </inVariable>
+ <block localId="26" width="80" height="45" typeName="C_Pragma" instanceName="C_Pragma0" executionOrderId="0">
+ <position x="185" y="1060"/>
+ <inputVariables>
+ <variable formalParameter="IN">
+ <connectionPointIn>
+ <relPosition x="0" y="30"/>
+ <connection refLocalId="1">
+ <position x="185" y="1090"/>
+ <position x="135" y="1090"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="80" y="30"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inVariable localId="27" height="30" width="90" executionOrderId="0" negated="false">
+ <position x="100" y="1190"/>
+ <connectionPointOut>
+ <relPosition x="90" y="15"/>
+ </connectionPointOut>
+ <expression>TestInput</expression>
+ </inVariable>
+ <outVariable localId="28" height="30" width="105" executionOrderId="0" negated="false">
+ <position x="195" y="1125"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="2">
+ <position x="195" y="1140"/>
+ <position x="140" y="1140"/>
+ </connection>
+ </connectionPointIn>
+ <expression>TestOutput</expression>
+ </outVariable>
+ <outVariable localId="29" height="30" width="85" executionOrderId="0" negated="false">
+ <position x="215" y="1190"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="27">
+ <position x="215" y="1205"/>
+ <position x="190" y="1205"/>
+ </connection>
+ </connectionPointIn>
+ <expression>FromInput</expression>
+ </outVariable>
+ <inVariable localId="2" height="30" width="30" executionOrderId="0" negated="false">
+ <position x="110" y="1125"/>
+ <connectionPointOut>
+ <relPosition x="30" y="15"/>
+ </connectionPointOut>
+ <expression>10</expression>
+ </inVariable>
+ <comment localId="30" height="105" width="465">
+ <position x="50" y="925"/>
+ <content>
+ <xhtml:p><![CDATA[You will be ready to use beremiz with C and Python when you will understand why "FromInput" is equal to 75.
+Happy hacking! ]]></xhtml:p>
+ </content>
+ </comment>
+ <comment localId="31" height="90" width="345">
+ <position x="295" y="485"/>
+ <content>
+ <xhtml:p><![CDATA[Sleep here is bad. It blocks other py_eval instances. Whith a wxGlade GUI, GUI freeze for a second.]]></xhtml:p>
+ </content>
+ </comment>
+ <comment localId="6" height="80" width="345">
+ <position x="295" y="630"/>
+ <content>
+ <xhtml:p><![CDATA[Prints FBID to stdout of PLC runtime. FBID is a unique reference to py_eval instance.]]></xhtml:p>
+ </content>
+ </comment>
+ <comment localId="10" height="85" width="345">
+ <position x="295" y="770"/>
+ <content>
+ <xhtml:p><![CDATA[Simple_C_Call is declared in C_File "1.x:c_code". See python ctypes manual for details on typing.]]></xhtml:p>
+ </content>
+ </comment>
+ <comment localId="32" height="145" width="235">
+ <position x="25" y="505"/>
+ <content>
+ <xhtml:p><![CDATA[Fast clock, at least faster that sleep(1). See what happens when python takes time to answer : PLC continues.]]></xhtml:p>
+ </content>
+ </comment>
+ <outVariable localId="33" height="30" width="133" executionOrderId="0" negated="false">
+ <position x="580" y="1564"/>
+ <connectionPointIn>
+ <relPosition x="0" y="16"/>
+ <connection refLocalId="35" formalParameter="OUT">
+ <position x="580" y="1580"/>
+ <position x="371" y="1580"/>
+ </connection>
+ </connectionPointIn>
+ <expression>Test_BCD_RESULT</expression>
+ </outVariable>
+ <inVariable localId="34" height="30" width="75" executionOrderId="0" negated="false">
+ <position x="60" y="1564"/>
+ <connectionPointOut>
+ <relPosition x="75" y="16"/>
+ </connectionPointOut>
+ <expression>Test_BCD</expression>
+ </inVariable>
+ <block localId="35" width="106" height="60" typeName="BCD_TO_UINT" executionOrderId="0">
+ <position x="265" y="1539"/>
+ <inputVariables>
+ <variable formalParameter="IN">
+ <connectionPointIn>
+ <relPosition x="0" y="41"/>
+ <connection refLocalId="34">
+ <position x="265" y="1580"/>
+ <position x="135" y="1580"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="106" y="41"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inVariable localId="36" height="30" width="66" executionOrderId="0" negated="false">
+ <position x="60" y="1774"/>
+ <connectionPointOut>
+ <relPosition x="66" y="16"/>
+ </connectionPointOut>
+ <expression>Test_DT</expression>
+ </inVariable>
+ <block localId="37" width="255" height="45" typeName="DATE_AND_TIME_TO_TIME_OF_DAY" executionOrderId="0">
+ <position x="265" y="1759"/>
+ <inputVariables>
+ <variable formalParameter="IN">
+ <connectionPointIn>
+ <relPosition x="0" y="31"/>
+ <connection refLocalId="36">
+ <position x="265" y="1790"/>
+ <position x="125" y="1790"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="255" y="31"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <block localId="38" width="195" height="45" typeName="DATE_AND_TIME_TO_DATE" executionOrderId="0">
+ <position x="265" y="1834"/>
+ <inputVariables>
+ <variable formalParameter="IN">
+ <connectionPointIn>
+ <relPosition x="0" y="31"/>
+ <connection refLocalId="36">
+ <position x="265" y="1865"/>
+ <position x="242" y="1865"/>
+ <position x="242" y="1790"/>
+ <position x="125" y="1790"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="195" y="31"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <outVariable localId="40" height="30" width="82" executionOrderId="0" negated="false">
+ <position x="580" y="1849"/>
+ <connectionPointIn>
+ <relPosition x="0" y="16"/>
+ <connection refLocalId="38" formalParameter="OUT">
+ <position x="580" y="1865"/>
+ <position x="460" y="1865"/>
+ </connection>
+ </connectionPointIn>
+ <expression>Test_Date</expression>
+ </outVariable>
+ <outVariable localId="42" height="30" width="98" executionOrderId="0" negated="false">
+ <position x="465" y="1944"/>
+ <connectionPointIn>
+ <relPosition x="0" y="16"/>
+ <connection refLocalId="46" formalParameter="OUT">
+ <position x="465" y="1960"/>
+ <position x="395" y="1960"/>
+ </connection>
+ </connectionPointIn>
+ <expression>Test_String</expression>
+ </outVariable>
+ <outVariable localId="43" height="30" width="82" executionOrderId="0" negated="false">
+ <position x="465" y="2014"/>
+ <connectionPointIn>
+ <relPosition x="0" y="16"/>
+ <connection refLocalId="44" formalParameter="OUT">
+ <position x="465" y="2030"/>
+ <position x="400" y="2030"/>
+ </connection>
+ </connectionPointIn>
+ <expression>Test_Bool</expression>
+ </outVariable>
+ <block localId="44" width="135" height="45" typeName="STRING_TO_BOOL" executionOrderId="0">
+ <position x="265" y="1999"/>
+ <inputVariables>
+ <variable formalParameter="IN">
+ <connectionPointIn>
+ <relPosition x="0" y="31"/>
+ <connection refLocalId="45">
+ <position x="265" y="2030"/>
+ <position x="115" y="2030"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="135" y="31"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inVariable localId="45" height="30" width="58" executionOrderId="0" negated="false">
+ <position x="60" y="2014"/>
+ <connectionPointOut>
+ <relPosition x="58" y="16"/>
+ </connectionPointOut>
+ <expression>'True'</expression>
+ </inVariable>
+ <block localId="46" width="130" height="45" typeName="INT_TO_STRING" executionOrderId="0">
+ <position x="265" y="1929"/>
+ <inputVariables>
+ <variable formalParameter="IN">
+ <connectionPointIn>
+ <relPosition x="0" y="31"/>
+ <connection refLocalId="58">
+ <position x="265" y="1960"/>
+ <position x="205" y="1960"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="130" y="31"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inVariable localId="50" height="30" width="106" executionOrderId="0" negated="false">
+ <position x="75" y="2275"/>
+ <connectionPointOut>
+ <relPosition x="106" y="15"/>
+ </connectionPointOut>
+ <expression>Global_RS.Q1</expression>
+ </inVariable>
+ <block localId="51" width="70" height="85" typeName="AND" executionOrderId="0">
+ <position x="240" y="2255"/>
+ <inputVariables>
+ <variable formalParameter="IN1" negated="true">
+ <connectionPointIn>
+ <relPosition x="0" y="35"/>
+ <connection refLocalId="50">
+ <position x="240" y="2290"/>
+ <position x="180" y="2290"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN2">
+ <connectionPointIn>
+ <relPosition x="0" y="70"/>
+ <connection refLocalId="52">
+ <position x="240" y="2325"/>
+ <position x="180" y="2325"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="70" y="35"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inVariable localId="52" height="30" width="105" executionOrderId="0" negated="false">
+ <position x="75" y="2310"/>
+ <connectionPointOut>
+ <relPosition x="105" y="15"/>
+ </connectionPointOut>
+ <expression>BOOL#TRUE</expression>
+ </inVariable>
+ <outVariable localId="13" height="30" width="105" executionOrderId="0" negated="false">
+ <position x="385" y="2275"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="51" formalParameter="OUT">
+ <position x="385" y="2290"/>
+ <position x="310" y="2290"/>
+ </connection>
+ </connectionPointIn>
+ <expression>Global_RS.S</expression>
+ </outVariable>
+ <outVariable localId="20" height="30" width="106" executionOrderId="0" negated="false">
+ <position x="385" y="2390"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="41" formalParameter="OUT">
+ <position x="385" y="2405"/>
+ <position x="310" y="2405"/>
+ </connection>
+ </connectionPointIn>
+ <expression>Global_RS.R1</expression>
+ </outVariable>
+ <inVariable localId="24" height="30" width="106" executionOrderId="0" negated="false">
+ <position x="75" y="2390"/>
+ <connectionPointOut>
+ <relPosition x="106" y="15"/>
+ </connectionPointOut>
+ <expression>Global_RS.Q1</expression>
+ </inVariable>
+ <block localId="41" width="70" height="85" typeName="OR" executionOrderId="0">
+ <position x="240" y="2370"/>
+ <inputVariables>
+ <variable formalParameter="IN1">
+ <connectionPointIn>
+ <relPosition x="0" y="35"/>
+ <connection refLocalId="24">
+ <position x="240" y="2405"/>
+ <position x="180" y="2405"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN2">
+ <connectionPointIn>
+ <relPosition x="0" y="70"/>
+ <connection refLocalId="48">
+ <position x="240" y="2440"/>
+ <position x="180" y="2440"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="70" y="35"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inVariable localId="48" height="30" width="105" executionOrderId="0" negated="false">
+ <position x="75" y="2425"/>
+ <connectionPointOut>
+ <relPosition x="105" y="15"/>
+ </connectionPointOut>
+ <expression>BOOL#FALSE</expression>
+ </inVariable>
+ <outVariable localId="54" height="30" width="135" executionOrderId="0" negated="false">
+ <position x="930" y="1774"/>
+ <connectionPointIn>
+ <relPosition x="0" y="16"/>
+ <connection refLocalId="55" formalParameter="OUT">
+ <position x="930" y="1790"/>
+ <position x="855" y="1790"/>
+ </connection>
+ </connectionPointIn>
+ <expression>Test_TOD_STRING</expression>
+ </outVariable>
+ <block localId="55" width="125" height="45" typeName="TOD_TO_STRING" executionOrderId="0">
+ <position x="730" y="1759"/>
+ <inputVariables>
+ <variable formalParameter="IN">
+ <connectionPointIn>
+ <relPosition x="0" y="31"/>
+ <connection refLocalId="39">
+ <position x="730" y="1790"/>
+ <position x="655" y="1790"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="125" y="31"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inOutVariable localId="39" height="30" width="75" executionOrderId="0" negatedOut="false" negatedIn="false">
+ <position x="580" y="1774"/>
+ <connectionPointIn>
+ <relPosition x="0" y="16"/>
+ <connection refLocalId="37" formalParameter="OUT">
+ <position x="580" y="1790"/>
+ <position x="520" y="1790"/>
+ </connection>
+ </connectionPointIn>
+ <connectionPointOut>
+ <relPosition x="75" y="16"/>
+ </connectionPointOut>
+ <expression>Test_TOD</expression>
+ </inOutVariable>
+ <inVariable localId="49" height="30" width="30" executionOrderId="0" negated="false">
+ <position x="160" y="2510"/>
+ <connectionPointOut>
+ <relPosition x="30" y="15"/>
+ </connectionPointOut>
+ <expression>42</expression>
+ </inVariable>
+ <outVariable localId="57" height="30" width="50" executionOrderId="0" negated="false">
+ <position x="240" y="2510"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="49">
+ <position x="240" y="2525"/>
+ <position x="190" y="2525"/>
+ </connection>
+ </connectionPointIn>
+ <expression>TOTO</expression>
+ </outVariable>
+ <outVariable localId="56" height="30" width="50" executionOrderId="0" negated="false">
+ <position x="240" y="2550"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="49">
+ <position x="240" y="2565"/>
+ <position x="215" y="2565"/>
+ <position x="215" y="2525"/>
+ <position x="190" y="2525"/>
+ </connection>
+ </connectionPointIn>
+ <expression>TUTU</expression>
+ </outVariable>
+ <inVariable localId="58" height="30" width="146" executionOrderId="0" negated="false">
+ <position x="60" y="1944"/>
+ <connectionPointOut>
+ <relPosition x="146" y="16"/>
+ </connectionPointOut>
+ <expression>Second_Python_Var</expression>
+ </inVariable>
+ <inVariable localId="59" height="30" width="30" executionOrderId="0" negated="false">
+ <position x="100" y="1385"/>
+ <connectionPointOut>
+ <relPosition x="30" y="15"/>
+ </connectionPointOut>
+ <expression>1</expression>
+ </inVariable>
+ <block localId="61" typeName="function0" executionOrderId="0" height="45" width="111">
+ <position x="760" y="1170"/>
+ <inputVariables>
+ <variable formalParameter="LocalVar0">
+ <connectionPointIn>
+ <relPosition x="0" y="30"/>
+ <connection refLocalId="62">
+ <position x="760" y="1200"/>
+ <position x="723" y="1200"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="111" y="30"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <inVariable localId="62" executionOrderId="0" height="30" width="58" negated="false">
+ <position x="665" y="1185"/>
+ <connectionPointOut>
+ <relPosition x="58" y="15"/>
+ </connectionPointOut>
+ <expression>fefvsd</expression>
+ </inVariable>
+ <outVariable localId="63" executionOrderId="0" height="30" width="58" negated="false">
+ <position x="905" y="1185"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="61" formalParameter="OUT">
+ <position x="905" y="1200"/>
+ <position x="871" y="1200"/>
+ </connection>
+ </connectionPointIn>
+ <expression>fefvsd</expression>
+ </outVariable>
+ <comment localId="53" height="80" width="420">
+ <position x="75" y="2160"/>
+ <content>
+ <xhtml:p><![CDATA[Shows global variables access from resource configuration (res_pytest) and from project's configuration.]]></xhtml:p>
+ </content>
+ </comment>
+ <inVariable localId="18" height="30" width="74" executionOrderId="0" negated="false">
+ <position x="986" y="795"/>
+ <connectionPointOut>
+ <relPosition x="74" y="15"/>
+ </connectionPointOut>
+ <expression>mux2_sel</expression>
+ </inVariable>
+ <comment localId="60" height="45" width="930">
+ <position x="60" y="1480"/>
+ <content>
+ <xhtml:p><![CDATA[Here is shown how to convert values between different types (BCD, DT, TOD, STRING and others) using standard functions.]]></xhtml:p>
+ </content>
+ </comment>
+ <comment localId="64" height="55" width="300">
+ <position x="665" y="1095"/>
+ <content>
+ <xhtml:p><![CDATA[Example of usage of user-defined function.]]></xhtml:p>
+ </content>
+ </comment>
+ <comment localId="65" height="45" width="410">
+ <position x="55" y="1315"/>
+ <content>
+ <xhtml:p><![CDATA[Shows access variable defined in python extension. ]]></xhtml:p>
+ </content>
+ </comment>
+ <inVariable localId="66" height="30" width="137" executionOrderId="0" negated="false">
+ <position x="60" y="1685"/>
+ <connectionPointOut>
+ <relPosition x="137" y="15"/>
+ </connectionPointOut>
+ <expression>Test_BCD_WRONG</expression>
+ </inVariable>
+ <block localId="67" width="106" height="100" typeName="BCD_TO_UINT" executionOrderId="0">
+ <position x="265" y="1620"/>
+ <inputVariables>
+ <variable formalParameter="EN">
+ <connectionPointIn>
+ <relPosition x="0" y="40"/>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN">
+ <connectionPointIn>
+ <relPosition x="0" y="80"/>
+ <connection refLocalId="66">
+ <position x="265" y="1700"/>
+ <position x="255" y="1700"/>
+ <position x="255" y="1700"/>
+ <position x="345" y="1700"/>
+ <position x="345" y="1700"/>
+ <position x="197" y="1700"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="ENO">
+ <connectionPointOut>
+ <relPosition x="106" y="40"/>
+ </connectionPointOut>
+ </variable>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="106" y="80"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <outVariable localId="68" height="30" width="196" executionOrderId="0" negated="false">
+ <position x="580" y="1685"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="67" formalParameter="OUT">
+ <position x="580" y="1700"/>
+ <position x="371" y="1700"/>
+ </connection>
+ </connectionPointIn>
+ <expression>Test_BCD_WRONG_RESULT</expression>
+ </outVariable>
+ <comment localId="69" height="165" width="375">
+ <position x="795" y="1590"/>
+ <content>
+ <xhtml:p><![CDATA[Incorrect BCD number is not converted to UINT.
+
+151 (16#97) is good BCD number , but
+154 (16#9A) is not.
+
+Try this out and look at value of Test_BCD_CONVERTED variable.
+
+
+]]></xhtml:p>
+ </content>
+ </comment>
+ <outVariable localId="70" height="30" width="185" executionOrderId="0" negated="false">
+ <position x="580" y="1645"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="67" formalParameter="ENO">
+ <position x="580" y="1660"/>
+ <position x="370" y="1660"/>
+ </connection>
+ </connectionPointIn>
+ <expression>Test_BCD_CONVERTED</expression>
+ </outVariable>
+ <comment localId="71" height="215" width="680">
+ <position x="35" y="30"/>
+ <content>
+ <xhtml:p><![CDATA[This example shows many features in Beremiz:
+
+ 1. How to implement python extensions.
+ 2. How to implement basic C extension.
+ 3. How to use C code in IEC POUs.
+ 4. How to call C functions from python code.
+ 5. How to avoid race conditions between IEC, C and python code.
+ 6. How to convert betweet different IEC types.
+]]></xhtml:p>
+ </content>
+ </comment>
+ <outVariable localId="72" executionOrderId="0" height="30" width="60" negated="false">
+ <position x="1065" y="1970"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="76" formalParameter="OUT">
+ <position x="1065" y="1985"/>
+ <position x="1025" y="1985"/>
+ <position x="1025" y="1995"/>
+ <position x="985" y="1995"/>
+ </connection>
+ </connectionPointIn>
+ <expression>Grumpf</expression>
+ </outVariable>
+ <inVariable localId="73" executionOrderId="0" height="30" width="85" negated="false">
+ <position x="625" y="1940"/>
+ <connectionPointOut>
+ <relPosition x="85" y="15"/>
+ </connectionPointOut>
+ <expression>BOOL#TRUE</expression>
+ </inVariable>
+ <inVariable localId="74" executionOrderId="0" height="30" width="70" negated="false">
+ <position x="625" y="1975"/>
+ <connectionPointOut>
+ <relPosition x="70" y="15"/>
+ </connectionPointOut>
+ <expression>Test_DT</expression>
+ </inVariable>
+ <block localId="75" typeName="RTC" instanceName="RTC0" executionOrderId="0" height="90" width="65">
+ <position x="760" y="1925"/>
+ <inputVariables>
+ <variable formalParameter="IN">
+ <connectionPointIn>
+ <relPosition x="0" y="35"/>
+ <connection refLocalId="73">
+ <position x="760" y="1960"/>
+ <position x="735" y="1960"/>
+ <position x="735" y="1955"/>
+ <position x="710" y="1955"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="PDT">
+ <connectionPointIn>
+ <relPosition x="0" y="70"/>
+ <connection refLocalId="74">
+ <position x="760" y="1995"/>
+ <position x="727" y="1995"/>
+ <position x="727" y="1990"/>
+ <position x="695" y="1990"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="Q">
+ <connectionPointOut>
+ <relPosition x="65" y="35"/>
+ </connectionPointOut>
+ </variable>
+ <variable formalParameter="CDT">
+ <connectionPointOut>
+ <relPosition x="65" y="70"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <block localId="76" typeName="DT_TO_STRING" executionOrderId="0" height="40" width="110">
+ <position x="875" y="1965"/>
+ <inputVariables>
+ <variable formalParameter="IN">
+ <connectionPointIn>
+ <relPosition x="0" y="30"/>
+ <connection refLocalId="75" formalParameter="CDT">
+ <position x="875" y="1995"/>
+ <position x="825" y="1995"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="110" y="30"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <block localId="77" typeName="ADD" executionOrderId="0" height="60" width="65">
+ <position x="170" y="1370"/>
+ <inputVariables>
+ <variable formalParameter="IN1">
+ <connectionPointIn>
+ <relPosition x="0" y="30"/>
+ <connection refLocalId="59">
+ <position x="170" y="1400"/>
+ <position x="130" y="1400"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ <variable formalParameter="IN2">
+ <connectionPointIn>
+ <relPosition x="0" y="50"/>
+ <connection refLocalId="78">
+ <position x="170" y="1420"/>
+ <position x="160" y="1420"/>
+ <position x="160" y="1450"/>
+ <position x="390" y="1450"/>
+ <position x="390" y="1400"/>
+ <position x="380" y="1400"/>
+ </connection>
+ </connectionPointIn>
+ </variable>
+ </inputVariables>
+ <inOutVariables/>
+ <outputVariables>
+ <variable formalParameter="OUT">
+ <connectionPointOut>
+ <relPosition x="65" y="30"/>
+ </connectionPointOut>
+ </variable>
+ </outputVariables>
+ </block>
+ <outVariable localId="47" executionOrderId="0" height="30" width="130" negated="false">
+ <position x="625" y="1335"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="79">
+ <position x="625" y="1350"/>
+ <position x="590" y="1350"/>
+ </connection>
+ </connectionPointIn>
+ <expression>Test_Python_Var</expression>
+ </outVariable>
+ <inVariable localId="79" executionOrderId="0" height="25" width="30" negated="false">
+ <position x="560" y="1340"/>
+ <connectionPointOut>
+ <relPosition x="30" y="10"/>
+ </connectionPointOut>
+ <expression>23</expression>
+ </inVariable>
+ <inOutVariable localId="78" executionOrderId="0" height="30" width="100" negatedOut="false" negatedIn="false">
+ <position x="280" y="1385"/>
+ <connectionPointIn>
+ <relPosition x="0" y="15"/>
+ <connection refLocalId="77" formalParameter="OUT">
+ <position x="280" y="1400"/>
+ <position x="235" y="1400"/>
+ </connection>
+ </connectionPointIn>
+ <connectionPointOut>
+ <relPosition x="100" y="15"/>
+ </connectionPointOut>
+ <expression>SomeVarName</expression>
+ </inOutVariable>
+ </FBD>
+ </body>
+ </pou>
+ <pou name="C_Pragma" pouType="functionBlock">
+ <interface>
+ <outputVars>
+ <variable name="OUT">
+ <type>
+ <SINT/>
+ </type>
+ </variable>
+ </outputVars>
+ <inputVars>
+ <variable name="IN">
+ <type>
+ <SINT/>
+ </type>
+ </variable>
+ </inputVars>
+ <localVars>
+ <variable name="COORDS">
+ <type>
+ <array>
+ <dimension lower="0" upper="5"/>
+ <baseType>
+ <SINT/>
+ </baseType>
+ </array>
+ </type>
+ <initialValue>
+ <arrayValue>
+ <value>
+ <simpleValue value="54"/>
+ </value>
+ <value>
+ <simpleValue value="55"/>
+ </value>
+ <value>
+ <simpleValue value="56"/>
+ </value>
+ <value>
+ <simpleValue value="57"/>
+ </value>
+ <value>
+ <simpleValue value="58"/>
+ </value>
+ <value>
+ <simpleValue value="59"/>
+ </value>
+ </arrayValue>
+ </initialValue>
+ </variable>
+ <variable name="SMURF">
+ <type>
+ <derived name="CPLX_TYPE"/>
+ </type>
+ </variable>
+ </localVars>
+ <externalVars>
+ <variable name="Global_RS">
+ <type>
+ <derived name="RS"/>
+ </type>
+ </variable>
+ <variable name="Dudiduda">
+ <type>
+ <derived name="blups"/>
+ </type>
+ </variable>
+ </externalVars>
+ </interface>
+ <body>
+ <ST>
+ <xhtml:p><![CDATA[(* hereafter is a C pragma accessing FB interface in a clean way *)
+{{
+ char toPLC;
+ char fromPLC = GetFbVar(IN);
+ extern int PLC_C_Call(char, char *);
+ if(PLC_C_Call(fromPLC, &toPLC)){
+ SetFbVar(OUT, toPLC);
+ }
+ if(0){
+ /* that code demonstrate C access to complex types */
+ char somebyte = GetFbVar(COORDS, .table[3]);
+ SetFbVar(SMURF, somebyte, .FIRSTBYTE);
+ SetFbVar(COORDS, somebyte, .table[4]);
+ }
+}}
+(* If you do not use GetFbVar and SetFbVar macros, expect unexpected behaviour*)
+Global_RS();
+
+(* testing access to global struct array *)
+Dudiduda[2].FIRSTBYTE := 0;
+]]></xhtml:p>
+ </ST>
+ </body>
+ </pou>
+ <pou name="norm" pouType="function">
+ <interface>
+ <returnType>
+ <REAL/>
+ </returnType>
+ <inputVars>
+ <variable name="IN1">
+ <type>
+ <REAL/>
+ </type>
+ </variable>
+ <variable name="IN2">
+ <type>
+ <REAL/>
+ </type>
+ </variable>
+ </inputVars>
+ </interface>
+ <body>
+ <ST>
+ <xhtml:p><![CDATA[NORM := SQRT(IN1 * IN1 + IN2 * IN2);]]></xhtml:p>
+ </ST>
+ </body>
+ </pou>
+ <pou name="function0" pouType="function">
+ <interface>
+ <returnType>
+ <derived name="datatype0"/>
+ </returnType>
+ <inputVars>
+ <variable name="LocalVar0">
+ <type>
+ <derived name="datatype0"/>
+ </type>
+ </variable>
+ </inputVars>
+ </interface>
+ <body>
+ <ST>
+ <xhtml:p><![CDATA[function0 := LocalVar0;
+]]></xhtml:p>
+ </ST>
+ </body>
+ </pou>
+ </pous>
+ </types>
+ <instances>
+ <configurations>
+ <configuration name="config">
+ <resource name="res_pytest">
+ <task name="pytest_task" priority="0" interval="T#500ms"/>
+ <globalVars>
+ <variable name="TOTO">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ </globalVars>
+ <pouInstance name="pytest_instance" typeName="main_pytest"/>
+ </resource>
+ <globalVars>
+ <variable name="Global_RS">
+ <type>
+ <derived name="RS"/>
+ </type>
+ </variable>
+ <variable name="Dudiduda">
+ <type>
+ <derived name="blups"/>
+ </type>
+ </variable>
+ <variable name="TUTU">
+ <type>
+ <INT/>
+ </type>
+ </variable>
+ </globalVars>
+ </configuration>
+ </configurations>
+ </instances>
+</project>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/exemples/python/py_ext_0@py_ext/baseconfnode.xml Fri Oct 01 17:44:52 2021 +0200
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='utf-8'?>
+<BaseParams xmlns:xsd="http://www.w3.org/2001/XMLSchema" IEC_Channel="2" Name="py_ext_0"/>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/exemples/python/py_ext_0@py_ext/pyfile.xml Fri Oct 01 17:44:52 2021 +0200
@@ -0,0 +1,42 @@
+<?xml version='1.0' encoding='utf-8'?>
+<PyFile xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <variables>
+ <variable name="SomeVarName" type="DINT" onchange="MyFunc, SomeChange"/>
+ <variable name="Grumpf" type="STRING" initial="'mhoo'" onchange="MyFunc, MyOtherFunc"/>
+ </variables>
+ <globals>
+ <xhtml:p><![CDATA[
+print "All python PLC globals variables :", PLCGlobalsDesc
+print "Current extention name :", __ext_name__
+
+def MyFunc(*args):
+ print args
+
+def MyOtherFunc(*args):
+ print "other", args
+
+def SomeChange(*args):
+ print "count",OnChange.SomeVarName.count
+ print "first",OnChange.SomeVarName.first
+ print "last",OnChange.SomeVarName.last
+
+
+]]></xhtml:p>
+ </globals>
+ <init>
+ <xhtml:p><![CDATA[
+]]></xhtml:p>
+ </init>
+ <cleanup>
+ <xhtml:p><![CDATA[
+]]></xhtml:p>
+ </cleanup>
+ <start>
+ <xhtml:p><![CDATA[
+]]></xhtml:p>
+ </start>
+ <stop>
+ <xhtml:p><![CDATA[
+]]></xhtml:p>
+ </stop>
+</PyFile>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/exemples/python/python@py_ext/baseconfnode.xml Fri Oct 01 17:44:52 2021 +0200
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='utf-8'?>
+<BaseParams Name="python" IEC_Channel="0"/>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/exemples/python/python@py_ext/pyfile.xml Fri Oct 01 17:44:52 2021 +0200
@@ -0,0 +1,69 @@
+<?xml version='1.0' encoding='utf-8'?>
+<PyFile xmlns:xhtml="http://www.w3.org/1999/xhtml">
+ <variables>
+ <variable name="Test_Python_Var" type="INT" initial="4"/>
+ <variable name="Second_Python_Var" type="INT" initial="5"/>
+ </variables>
+ <globals>
+ <xhtml:p><![CDATA[
+import time,sys,ctypes
+Python_to_C_Call = PLCBinary.Python_to_C_Call
+Python_to_C_Call.restype = ctypes.c_int
+Python_to_C_Call.argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)]
+
+def MyPythonFunc(arg):
+ i = ctypes.c_int()
+ if(Python_to_C_Call(arg, i)):
+ res = i.value
+ print "toC:", arg, "from C:", res, "FBID:", FBID
+ else:
+ print "Failed Python_to_C_Call failed"
+ res = None
+ print "Python read PLC global :",PLCGlobals.Test_Python_Var
+ print "Python read PLC global Grumpf :",PLCGlobals.Grumpf
+ PLCGlobals.Second_Python_Var = 789
+ sys.stdout.flush()
+ return res
+
+async_error_test_code = """
+def badaboom():
+ tuple()[0]
+
+import wx
+def badaboomwx():
+ wx.CallAfter(badaboom)
+
+from threading import Timer
+a = Timer(3, badaboom)
+a.start()
+
+b = Timer(6, badaboomwx)
+b.start()
+"""
+]]></xhtml:p>
+ </globals>
+ <init>
+ <xhtml:p><![CDATA[
+global x, y
+x = 2
+y = 5
+print "py_runtime init:", x, ",", y
+]]></xhtml:p>
+ </init>
+ <cleanup>
+ <xhtml:p><![CDATA[
+print "py_runtime cleanup"
+]]></xhtml:p>
+ </cleanup>
+ <start>
+ <xhtml:p><![CDATA[
+global x, y
+print "py_runtime start", x * x + y * y
+]]></xhtml:p>
+ </start>
+ <stop>
+ <xhtml:p><![CDATA[
+print "py_runtime stop"
+]]></xhtml:p>
+ </stop>
+</PyFile>
--- a/graphics/FBD_Objects.py Thu Sep 16 09:40:36 2021 +0200
+++ b/graphics/FBD_Objects.py Fri Oct 01 17:44:52 2021 +0200
@@ -122,10 +122,10 @@
# Returns if the point given is in the bounding box
def HitTest(self, pt, connectors=True):
if self.Name != "":
- test_text = self.GetTextBoundingBox().InsideXY(pt.x, pt.y)
+ test_text = self.GetTextBoundingBox().Contains(pt.x, pt.y)
else:
test_text = False
- test_block = self.GetBlockBoundingBox(connectors).InsideXY(pt.x, pt.y)
+ test_block = self.GetBlockBoundingBox(connectors).Contains(pt.x, pt.y)
return test_text or test_block
# Returns the bounding box of the name outside the block
@@ -392,7 +392,7 @@
# pos = event.GetLogicalPosition(dc)
# for input in self.Inputs:
# rect = input.GetRedrawRect()
-# if rect.InsideXY(pos.x, pos.y):
+# if rect.Contains(pos.x, pos.y):
# print "Find input"
# tip = wx.TipWindow(self.Parent, "Test")
# tip.SetBoundingRect(rect)
--- a/graphics/GraphicCommons.py Thu Sep 16 09:40:36 2021 +0200
+++ b/graphics/GraphicCommons.py Fri Oct 01 17:44:52 2021 +0200
@@ -388,11 +388,11 @@
rect = self.BoundingBox
else:
rect = wx.Rect(self.Pos.x, self.Pos.y, self.Size[0], self.Size[1])
- return rect.InsideXY(pt.x, pt.y)
+ return rect.Contains(pt.x, pt.y)
# Returns if the point given is in the bounding box
def IsInSelection(self, rect):
- return rect.InsideXY(self.BoundingBox.x, self.BoundingBox.y) and rect.InsideXY(self.BoundingBox.x + self.BoundingBox.width, self.BoundingBox.y + self.BoundingBox.height)
+ return rect.Contains(self.BoundingBox.x, self.BoundingBox.y) and rect.Contains(self.BoundingBox.x + self.BoundingBox.width, self.BoundingBox.y + self.BoundingBox.height)
# Override this method for refreshing the bounding box
def RefreshBoundingBox(self):
@@ -448,7 +448,7 @@
intern_rect = wx.Rect(left + HANDLE_SIZE, top + HANDLE_SIZE, right - left - HANDLE_SIZE, bottom - top - HANDLE_SIZE)
# Verify that this element is selected
- if self.Selected and extern_rect.InsideXY(pt.x, pt.y) and not intern_rect.InsideXY(pt.x, pt.y):
+ if self.Selected and extern_rect.Contains(pt.x, pt.y) and not intern_rect.Contains(pt.x, pt.y):
# Find if point is on a handle horizontally
if left <= pt.x < left + HANDLE_SIZE:
handle_x = 1
@@ -1399,7 +1399,7 @@
width = ANCHOR_DISTANCE * 2 + abs(self.Direction[0]) * CONNECTOR_SIZE
height = ANCHOR_DISTANCE * 2 + abs(self.Direction[1]) * CONNECTOR_SIZE
rect = wx.Rect(x, y, width, height)
- inside = rect.InsideXY(pt.x, pt.y)
+ inside = rect.Contains(pt.x, pt.y)
return inside
@@ -1931,7 +1931,7 @@
# Calculate a rectangle around the segment
rect = wx.Rect(min(x1, x2) - ANCHOR_DISTANCE, min(y1, y2) - ANCHOR_DISTANCE,
abs(x1 - x2) + 2 * ANCHOR_DISTANCE, abs(y1 - y2) + 2 * ANCHOR_DISTANCE)
- test |= rect.InsideXY(pt.x, pt.y)
+ test |= rect.Contains(pt.x, pt.y)
return test
# Returns the wire start or end point if the point given is on one of them
@@ -1939,13 +1939,13 @@
# Test the wire start point
rect = wx.Rect(self.Points[0].x - ANCHOR_DISTANCE, self.Points[0].y - ANCHOR_DISTANCE,
2 * ANCHOR_DISTANCE, 2 * ANCHOR_DISTANCE)
- if rect.InsideXY(pt.x, pt.y):
+ if rect.Contains(pt.x, pt.y):
return 0
# Test the wire end point
if len(self.Points) > 1:
rect = wx.Rect(self.Points[-1].x - ANCHOR_DISTANCE, self.Points[-1].y - ANCHOR_DISTANCE,
2 * ANCHOR_DISTANCE, 2 * ANCHOR_DISTANCE)
- if rect.InsideXY(pt.x, pt.y):
+ if rect.Contains(pt.x, pt.y):
return -1
return None
@@ -1959,7 +1959,7 @@
# Calculate a rectangle around the segment
rect = wx.Rect(min(x1, x2) - ANCHOR_DISTANCE, min(y1, y2) - ANCHOR_DISTANCE,
abs(x1 - x2) + 2 * ANCHOR_DISTANCE, abs(y1 - y2) + 2 * ANCHOR_DISTANCE)
- if rect.InsideXY(pt.x, pt.y):
+ if rect.Contains(pt.x, pt.y):
return i, self.Segments[i]
return None
--- a/graphics/RubberBand.py Thu Sep 16 09:40:36 2021 +0200
+++ b/graphics/RubberBand.py Fri Oct 01 17:44:52 2021 +0200
@@ -94,7 +94,7 @@
# Change viewer mouse cursor to reflect a rubberband bounding box is
# edited
- self.DrawingSurface.SetCursor(wx.StockCursor(wx.CURSOR_CROSS))
+ self.DrawingSurface.SetCursor(wx.Cursor(wx.CURSOR_CROSS))
self.Redraw()
@@ -195,3 +195,25 @@
"""
# Erase last bbox and draw current bbox
self.DrawBoundingBoxes([self.CurrentBBox], dc)
+
+
+def PatchRubberBandForGTK3():
+ """
+ GTK3 implementation of DC doesn't support SetLogicalFuntion(XOR)
+ Then Rubberband can't be erased by just redrawing it on the same place
+ So this is a complete refresh instead, eating a lot of CPU.
+ """
+ def Redraw(self, dc=None):
+ self.Viewer.Refresh()
+ self.Draw()
+
+ RubberBand.Redraw = Redraw
+
+ def Erase(self, dc=None):
+ self.Viewer.Refresh()
+
+ RubberBand.Erase = Erase
+
+
+if "gtk3" in wx.PlatformInfo:
+ PatchRubberBandForGTK3()
--- a/graphics/SFC_Objects.py Thu Sep 16 09:40:36 2021 +0200
+++ b/graphics/SFC_Objects.py Fri Oct 01 17:44:52 2021 +0200
@@ -719,7 +719,7 @@
self.Pos.y + (self.Size[1] - text_height) // 2,
text_width,
text_height)
- test_text = text_bbx.InsideXY(pt.x, pt.y)
+ test_text = text_bbx.Contains(pt.x, pt.y)
else:
test_text = False
return test_text or Graphic_Element.HitTest(self, pt, connectors)
@@ -1204,7 +1204,7 @@
# Returns if the point given is in the bounding box
def HitTest(self, pt, connectors=True):
- return self.BoundingBox.InsideXY(pt.x, pt.y) or self.TestConnector(pt, exclude=False) is not None
+ return self.BoundingBox.Contains(pt.x, pt.y) or self.TestConnector(pt, exclude=False) is not None
# Refresh the divergence bounding box
def RefreshBoundingBox(self):
@@ -1592,7 +1592,7 @@
self.Pos.y + (self.Size[1] - text_height) // 2,
text_width,
text_height)
- return text_bbx.InsideXY(pt.x, pt.y) or Graphic_Element.HitTest(self, pt, connectors)
+ return text_bbx.Contains(pt.x, pt.y) or Graphic_Element.HitTest(self, pt, connectors)
# Refresh the jump bounding box
def RefreshBoundingBox(self):
--- a/runtime/PyroServer.py Thu Sep 16 09:40:36 2021 +0200
+++ b/runtime/PyroServer.py Fri Oct 01 17:44:52 2021 +0200
@@ -62,8 +62,15 @@
self.daemon.connect(pyro_obj, "PLCObject")
when_ready()
- self.piper, self.pipew = os.pipe()
- self.daemon.requestLoop(others=[self.piper], callback=lambda x: None)
+
+ # "pipe to self" trick to to accelerate runtime shutdown
+ # instead of waiting for arbitrary pyro timeout.
+ others = []
+ if not sys.platform.startswith('win'):
+ self.piper, self.pipew = os.pipe()
+ others.append(self.piper)
+
+ self.daemon.requestLoop(others=others, callback=lambda x: None)
self.piper, self.pipew = None, None
if hasattr(self, 'sock'):
self.daemon.sock.close()
@@ -76,8 +83,9 @@
self.continueloop = False
self.daemon.shutdown(True)
self.daemon.closedown()
- if self.pipew is not None:
- os.write(self.pipew, "goodbye")
+ if not sys.platform.startswith('win'):
+ if self.pipew is not None:
+ os.write(self.pipew, "goodbye")
def Publish(self):
self.servicepublisher = ServicePublisher("PYRO")
--- a/svghmi/analyse_widget.xslt Thu Sep 16 09:40:36 2021 +0200
+++ b/svghmi/analyse_widget.xslt Fri Oct 01 17:44:52 2021 +0200
@@ -339,9 +339,11 @@
</xsl:text>
<xsl:text>
</xsl:text>
- <xsl:text>It needs "text" (svg:text), "box" (svg:rect), "button" (svg:*),
-</xsl:text>
- <xsl:text>and "highlight" (svg:rect) labeled elements.
+ <xsl:text>It needs "text" (svg:text or svg:use referring to svg:text),
+</xsl:text>
+ <xsl:text>"box" (svg:rect), "button" (svg:*), and "highlight" (svg:rect)
+</xsl:text>
+ <xsl:text>labeled elements.
</xsl:text>
<xsl:text>
</xsl:text>
@@ -353,11 +355,19 @@
</xsl:text>
<xsl:text>
</xsl:text>
- <xsl:text>When only one argument is given, and argment contains "#langs" then list of
-</xsl:text>
- <xsl:text>texts is automatically set to the list of human-readable languages supported
-</xsl:text>
- <xsl:text>by this HMI.
+ <xsl:text>When only one argument is given and argment contains "#langs" then list of
+</xsl:text>
+ <xsl:text>texts is automatically set to the human-readable list of supported
+</xsl:text>
+ <xsl:text>languages by this HMI.
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>If "text" labeled element is of type svg:use and refers to a svg:text
+</xsl:text>
+ <xsl:text>element part of a TextList widget, no argument is expected. In that case
+</xsl:text>
+ <xsl:text>list of texts is set to TextList content.
</xsl:text>
</longdesc>
<shortdesc>
@@ -529,6 +539,30 @@
<type>
<xsl:value-of select="@type"/>
</type>
+ <longdesc>
+ <xsl:text>List widget is a svg:group, list items are labeled elements
+</xsl:text>
+ <xsl:text>in that group.
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>To use a List, clone (svg:use) one of the items inside the widget that
+</xsl:text>
+ <xsl:text>expects a List.
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>Positions of items are relative to each other, and they must all be in the
+</xsl:text>
+ <xsl:text>same place. In order to make editing easier it is therefore recommanded to
+</xsl:text>
+ <xsl:text>make stacked clones of svg elements spread nearby the list.
+</xsl:text>
+ </longdesc>
+ <shortdesc>
+ <xsl:text>A named list of named graphical elements</xsl:text>
+ </shortdesc>
+ <arg name="listname"/>
</xsl:template>
<xsl:template match="widget[@type='Meter']" mode="widget_desc">
<type>
@@ -567,12 +601,39 @@
<xsl:text>Value to display</xsl:text>
</path>
</xsl:template>
+ <xsl:template match="widget[@type='PathSlider']" mode="widget_desc">
+ <type>
+ <xsl:value-of select="@type"/>
+ </type>
+ <longdesc>
+ <xsl:text>PathSlider -
+</xsl:text>
+ </longdesc>
+ <shortdesc>
+ <xsl:text>Slide an SVG element along a path by dragging it</xsl:text>
+ </shortdesc>
+ <path name="value" accepts="HMI_INT,HMI_REAL">
+ <xsl:text>value</xsl:text>
+ </path>
+ <path name="min" count="optional" accepts="HMI_INT,HMI_REAL">
+ <xsl:text>min</xsl:text>
+ </path>
+ <path name="max" count="optional" accepts="HMI_INT,HMI_REAL">
+ <xsl:text>max</xsl:text>
+ </path>
+ <arg name="min" count="optional" accepts="int,real">
+ <xsl:text>minimum value</xsl:text>
+ </arg>
+ <arg name="max" count="optional" accepts="int,real">
+ <xsl:text>maximum value</xsl:text>
+ </arg>
+ </xsl:template>
<xsl:template match="widget[@type='ScrollBar']" mode="widget_desc">
<type>
<xsl:value-of select="@type"/>
</type>
<longdesc>
- <xsl:text>ScrollBar - documentation to be written
+ <xsl:text>ScrollBar - svg:rect based scrollbar
</xsl:text>
</longdesc>
<shortdesc>
@@ -634,6 +695,58 @@
<xsl:text>value to compare to labels</xsl:text>
</path>
</xsl:template>
+ <xsl:template match="widget[@type='TextList']" mode="widget_desc">
+ <type>
+ <xsl:value-of select="@type"/>
+ </type>
+ <longdesc>
+ <xsl:text>TextList widget is a svg:group, list items are labeled elements
+</xsl:text>
+ <xsl:text>in that group.
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>To use a TextList, clone (svg:use) one of the items inside the widget
+</xsl:text>
+ <xsl:text>that expects a TextList.
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>In this list, (translated) text content is what matters. Nevertheless
+</xsl:text>
+ <xsl:text>text style of the cloned item will be applied in client widget.
+</xsl:text>
+ </longdesc>
+ <shortdesc>
+ <xsl:text>A named list of ordered texts </xsl:text>
+ </shortdesc>
+ <arg name="listname"/>
+ </xsl:template>
+ <xsl:template match="widget[@type='TextStyleList']" mode="widget_desc">
+ <type>
+ <xsl:value-of select="@type"/>
+ </type>
+ <longdesc>
+ <xsl:text>TextStyleList widget is a svg:group, list items are labeled elements
+</xsl:text>
+ <xsl:text>in that group.
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>To use a TextStyleList, clone (svg:use) one of the items inside the widget
+</xsl:text>
+ <xsl:text>that expects a TextStyleList.
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>In this list, only style matters. Text content is ignored.
+</xsl:text>
+ </longdesc>
+ <shortdesc>
+ <xsl:text>A named list of named texts</xsl:text>
+ </shortdesc>
+ <arg name="listname"/>
+ </xsl:template>
<xsl:template match="widget[@type='ToggleButton']" mode="widget_desc">
<type>
<xsl:value-of select="@type"/>
--- a/svghmi/detachable_pages.ysl2 Thu Sep 16 09:40:36 2021 +0200
+++ b/svghmi/detachable_pages.ysl2 Fri Oct 01 17:44:52 2021 +0200
@@ -88,10 +88,7 @@
const "required_page_elements",
"func:required_elements($hmi_pages | $keypads)/ancestor-or-self::svg:*";
-const "hmi_lists_descs", "$parsed_widgets/widget[@type = 'List']";
-const "hmi_lists", "$hmi_elements[@id = $hmi_lists_descs/@id]";
-
-const "required_list_elements", "func:refered_elements($hmi_lists[@id = $required_page_elements/@id])";
+const "required_list_elements", "func:refered_elements(($hmi_lists | $hmi_textlists)[@id = $required_page_elements/@id])";
const "required_elements", "$defs | $required_list_elements | $required_page_elements";
--- a/svghmi/gen_index_xhtml.xslt Thu Sep 16 09:40:36 2021 +0200
+++ b/svghmi/gen_index_xhtml.xslt Fri Oct 01 17:44:52 2021 +0200
@@ -432,6 +432,29 @@
<xsl:variable name="candidates" select="$geometry[@Id != $elt/@id]"/>
<func:result select="$candidates[(@Id = $groups/@id and (func:intersect($g, .) = 9)) or (not(@Id = $groups/@id) and (func:intersect($g, .) > 0 ))]"/>
</func:function>
+ <xsl:variable name="hmi_lists_descs" select="$parsed_widgets/widget[@type = 'List']"/>
+ <xsl:variable name="hmi_lists" select="$hmi_elements[@id = $hmi_lists_descs/@id]"/>
+ <xsl:variable name="hmi_textlists_descs" select="$parsed_widgets/widget[@type = 'TextList']"/>
+ <xsl:variable name="hmi_textlists" select="$hmi_elements[@id = $hmi_textlists_descs/@id]"/>
+ <xsl:variable name="hmi_textstylelists_descs" select="$parsed_widgets/widget[@type = 'TextStyleList']"/>
+ <xsl:variable name="hmi_textstylelists" select="$hmi_elements[@id = $hmi_textstylelists_descs/@id]"/>
+ <xsl:variable name="textstylelist_related">
+ <xsl:for-each select="$hmi_textstylelists">
+ <list>
+ <xsl:attribute name="listid">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ <xsl:for-each select="func:refered_elements(.)">
+ <elt>
+ <xsl:attribute name="eltid">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ </elt>
+ </xsl:for-each>
+ </list>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="textstylelist_related_ns" select="exsl:node-set($textstylelist_related)"/>
<xsl:variable name="hmi_pages_descs" select="$parsed_widgets/widget[@type = 'Page']"/>
<xsl:variable name="hmi_pages" select="$hmi_elements[@id = $hmi_pages_descs/@id]"/>
<xsl:variable name="default_page">
@@ -526,9 +549,7 @@
</xsl:choose>
</func:function>
<xsl:variable name="required_page_elements" select="func:required_elements($hmi_pages | $keypads)/ancestor-or-self::svg:*"/>
- <xsl:variable name="hmi_lists_descs" select="$parsed_widgets/widget[@type = 'List']"/>
- <xsl:variable name="hmi_lists" select="$hmi_elements[@id = $hmi_lists_descs/@id]"/>
- <xsl:variable name="required_list_elements" select="func:refered_elements($hmi_lists[@id = $required_page_elements/@id])"/>
+ <xsl:variable name="required_list_elements" select="func:refered_elements(($hmi_lists | $hmi_textlists)[@id = $required_page_elements/@id])"/>
<xsl:variable name="required_elements" select="$defs | $required_list_elements | $required_page_elements"/>
<xsl:variable name="discardable_elements" select="//svg:*[not(@id = $required_elements/@id)]"/>
<func:function name="func:sumarized_elements">
@@ -3715,9 +3736,11 @@
</xsl:text>
<xsl:text>
</xsl:text>
- <xsl:text>It needs "text" (svg:text), "box" (svg:rect), "button" (svg:*),
-</xsl:text>
- <xsl:text>and "highlight" (svg:rect) labeled elements.
+ <xsl:text>It needs "text" (svg:text or svg:use referring to svg:text),
+</xsl:text>
+ <xsl:text>"box" (svg:rect), "button" (svg:*), and "highlight" (svg:rect)
+</xsl:text>
+ <xsl:text>labeled elements.
</xsl:text>
<xsl:text>
</xsl:text>
@@ -3729,11 +3752,19 @@
</xsl:text>
<xsl:text>
</xsl:text>
- <xsl:text>When only one argument is given, and argment contains "#langs" then list of
-</xsl:text>
- <xsl:text>texts is automatically set to the list of human-readable languages supported
-</xsl:text>
- <xsl:text>by this HMI.
+ <xsl:text>When only one argument is given and argment contains "#langs" then list of
+</xsl:text>
+ <xsl:text>texts is automatically set to the human-readable list of supported
+</xsl:text>
+ <xsl:text>languages by this HMI.
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>If "text" labeled element is of type svg:use and refers to a svg:text
+</xsl:text>
+ <xsl:text>element part of a TextList widget, no argument is expected. In that case
+</xsl:text>
+ <xsl:text>list of texts is set to TextList content.
</xsl:text>
</longdesc>
<shortdesc>
@@ -3759,6 +3790,8 @@
</xsl:text>
<xsl:text> init() {
</xsl:text>
+ <xsl:text> this.init_specific();
+</xsl:text>
<xsl:text> this.button_elt.onclick = this.on_button_click.bind(this);
</xsl:text>
<xsl:text> // Save original size of rectangle
@@ -3849,7 +3882,7 @@
</xsl:text>
<xsl:text> // if valid selection resolve content
</xsl:text>
- <xsl:text> display_str = this.content[value];
+ <xsl:text> display_str = gettext(this.content[value]);
</xsl:text>
<xsl:text> this.last_selection = value;
</xsl:text>
@@ -4061,7 +4094,7 @@
</xsl:text>
<xsl:text> let span=spans[c];
</xsl:text>
- <xsl:text> span.textContent = item;
+ <xsl:text> span.textContent = gettext(item);
</xsl:text>
<xsl:text> let sel = c;
</xsl:text>
@@ -4193,7 +4226,7 @@
</xsl:text>
<xsl:text> }else{
</xsl:text>
- <xsl:text> span.textContent = this.content[i];
+ <xsl:text> span.textContent = gettext(this.content[i]);
</xsl:text>
<xsl:text> let sel = i;
</xsl:text>
@@ -4411,16 +4444,54 @@
<xsl:call-template name="defs_by_labels">
<xsl:with-param name="hmi_element" select="$hmi_element"/>
<xsl:with-param name="labels">
- <xsl:text>text box button highlight</xsl:text>
+ <xsl:text>box button highlight</xsl:text>
</xsl:with-param>
</xsl:call-template>
- <xsl:text> content:</xsl:text>
+ <xsl:variable name="text_elt" select="$hmi_element//*[@inkscape:label='text'][1]"/>
+ <xsl:text>init_specific: function() {
+</xsl:text>
<xsl:choose>
<xsl:when test="count(arg) = 1 and arg[1]/@value = '#langs'">
- <xsl:text>langs</xsl:text>
+ <xsl:text> this.text_elt = id("</xsl:text>
+ <xsl:value-of select="$text_elt/@id"/>
+ <xsl:text>");
+</xsl:text>
+ <xsl:text> this.content = langs;
+</xsl:text>
+ </xsl:when>
+ <xsl:when test="count(arg) = 0">
+ <xsl:if test="not($text_elt[self::svg:use])">
+ <xsl:message terminate="yes">
+ <xsl:text>No argrument for HMI:DropDown widget id="</xsl:text>
+ <xsl:value-of select="$hmi_element/@id"/>
+ <xsl:text>" and "text" labeled element is not a svg:use element</xsl:text>
+ </xsl:message>
+ </xsl:if>
+ <xsl:variable name="real_text_elt" select="$result_widgets[@id = $hmi_element/@id]//*[@original=$text_elt/@id]/svg:text"/>
+ <xsl:text> this.text_elt = id("</xsl:text>
+ <xsl:value-of select="$real_text_elt/@id"/>
+ <xsl:text>");
+</xsl:text>
+ <xsl:variable name="from_list_id" select="substring-after($text_elt/@xlink:href,'#')"/>
+ <xsl:variable name="from_list" select="$hmi_textlists[(@id | */@id) = $from_list_id]"/>
+ <xsl:if test="count($from_list) = 0">
+ <xsl:message terminate="yes">
+ <xsl:text>HMI:DropDown widget id="</xsl:text>
+ <xsl:value-of select="$hmi_element/@id"/>
+ <xsl:text>" "text" labeled element does not point to a svg:text owned by a HMI:List widget</xsl:text>
+ </xsl:message>
+ </xsl:if>
+ <xsl:text> this.content = hmi_widgets["</xsl:text>
+ <xsl:value-of select="$from_list/@id"/>
+ <xsl:text>"].texts;
+</xsl:text>
</xsl:when>
<xsl:otherwise>
- <xsl:text>[
+ <xsl:text> this.text_elt = id("</xsl:text>
+ <xsl:value-of select="$text_elt/@id"/>
+ <xsl:text>");
+</xsl:text>
+ <xsl:text> this.content = [
</xsl:text>
<xsl:for-each select="arg">
<xsl:text>"</xsl:text>
@@ -4428,10 +4499,36 @@
<xsl:text>",
</xsl:text>
</xsl:for-each>
- <xsl:text> ]</xsl:text>
+ <xsl:text> ];
+</xsl:text>
</xsl:otherwise>
</xsl:choose>
- <xsl:text>,
+ <xsl:text>}
+</xsl:text>
+ </xsl:template>
+ <declarations:DropDown/>
+ <xsl:template match="declarations:DropDown">
+ <xsl:text>
+</xsl:text>
+ <xsl:text>/* </xsl:text>
+ <xsl:value-of select="local-name()"/>
+ <xsl:text> */
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>function gettext(o) {
+</xsl:text>
+ <xsl:text> if(typeof(o) == "string"){
+</xsl:text>
+ <xsl:text> return o;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> return svg_text_to_multiline(o);
+</xsl:text>
+ <xsl:text>};
+</xsl:text>
+ <xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="widget[@type='ForEach']" mode="widget_desc">
@@ -5116,25 +5213,6 @@
<xsl:text>.</xsl:text>
</xsl:message>
</xsl:template>
- <xsl:variable name="hmi_textstylelists_descs" select="$parsed_widgets/widget[@type = 'TextStyleList']"/>
- <xsl:variable name="hmi_textstylelists" select="$hmi_elements[@id = $hmi_textstylelists_descs/@id]"/>
- <xsl:variable name="textstylelist_related">
- <xsl:for-each select="$hmi_textstylelists">
- <list>
- <xsl:attribute name="listid">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- <xsl:for-each select="func:refered_elements(.)">
- <elt>
- <xsl:attribute name="eltid">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </elt>
- </xsl:for-each>
- </list>
- </xsl:for-each>
- </xsl:variable>
- <xsl:variable name="textstylelist_related_ns" select="exsl:node-set($textstylelist_related)"/>
<func:function name="func:json_expressions">
<xsl:param name="expressions"/>
<xsl:param name="label"/>
@@ -6009,6 +6087,30 @@
<type>
<xsl:value-of select="@type"/>
</type>
+ <longdesc>
+ <xsl:text>List widget is a svg:group, list items are labeled elements
+</xsl:text>
+ <xsl:text>in that group.
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>To use a List, clone (svg:use) one of the items inside the widget that
+</xsl:text>
+ <xsl:text>expects a List.
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>Positions of items are relative to each other, and they must all be in the
+</xsl:text>
+ <xsl:text>same place. In order to make editing easier it is therefore recommanded to
+</xsl:text>
+ <xsl:text>make stacked clones of svg elements spread nearby the list.
+</xsl:text>
+ </longdesc>
+ <shortdesc>
+ <xsl:text>A named list of named graphical elements</xsl:text>
+ </shortdesc>
+ <arg name="listname"/>
</xsl:template>
<xsl:template match="widget[@type='List']" mode="widget_defs">
<xsl:param name="hmi_element"/>
@@ -6025,25 +6127,6 @@
<xsl:text> },
</xsl:text>
</xsl:template>
- <xsl:template match="widget[@type='TextStyleList']" mode="widget_defs">
- <xsl:param name="hmi_element"/>
- </xsl:template>
- <xsl:template match="widget[@type='TextStyleList']" mode="widget_defs">
- <xsl:param name="hmi_element"/>
- <xsl:text> styles: {
-</xsl:text>
- <xsl:for-each select="$hmi_element/*[@inkscape:label]">
- <xsl:variable name="style" select="func:refered_elements(.)[self::svg:text]/@style"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="@inkscape:label"/>
- <xsl:text>: "</xsl:text>
- <xsl:value-of select="$style"/>
- <xsl:text>",
-</xsl:text>
- </xsl:for-each>
- <xsl:text> },
-</xsl:text>
- </xsl:template>
<xsl:template match="widget[@type='Meter']" mode="widget_desc">
<type>
<xsl:value-of select="@type"/>
@@ -6301,12 +6384,352 @@
<xsl:text> ],
</xsl:text>
</xsl:template>
+ <xsl:template match="widget[@type='PathSlider']" mode="widget_desc">
+ <type>
+ <xsl:value-of select="@type"/>
+ </type>
+ <longdesc>
+ <xsl:text>PathSlider -
+</xsl:text>
+ </longdesc>
+ <shortdesc>
+ <xsl:text>Slide an SVG element along a path by dragging it</xsl:text>
+ </shortdesc>
+ <path name="value" accepts="HMI_INT,HMI_REAL">
+ <xsl:text>value</xsl:text>
+ </path>
+ <path name="min" count="optional" accepts="HMI_INT,HMI_REAL">
+ <xsl:text>min</xsl:text>
+ </path>
+ <path name="max" count="optional" accepts="HMI_INT,HMI_REAL">
+ <xsl:text>max</xsl:text>
+ </path>
+ <arg name="min" count="optional" accepts="int,real">
+ <xsl:text>minimum value</xsl:text>
+ </arg>
+ <arg name="max" count="optional" accepts="int,real">
+ <xsl:text>maximum value</xsl:text>
+ </arg>
+ </xsl:template>
+ <xsl:template match="widget[@type='PathSlider']" mode="widget_class">
+ <xsl:text>class </xsl:text>
+ <xsl:text>PathSliderWidget</xsl:text>
+ <xsl:text> extends Widget{
+</xsl:text>
+ <xsl:text> frequency = 10;
+</xsl:text>
+ <xsl:text> position = undefined;
+</xsl:text>
+ <xsl:text> min = 0;
+</xsl:text>
+ <xsl:text> max = 100;
+</xsl:text>
+ <xsl:text> scannedPoints = [];
+</xsl:text>
+ <xsl:text> pathLength = undefined;
+</xsl:text>
+ <xsl:text> precision = undefined;
+</xsl:text>
+ <xsl:text> origPt = undefined;
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> scanPath() {
+</xsl:text>
+ <xsl:text> this.pathLength = this.path_elt.getTotalLength();
+</xsl:text>
+ <xsl:text> this.precision = Math.floor(this.pathLength / 10);
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> // save linear scan for coarse approximation
+</xsl:text>
+ <xsl:text> for (var scanLength = 0; scanLength <= this.pathLength; scanLength += this.precision) {
+</xsl:text>
+ <xsl:text> this.scannedPoints.push([this.path_elt.getPointAtLength(scanLength), scanLength]);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> [this.origPt,] = this.scannedPoints[0];
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> closestPoint(point) {
+</xsl:text>
+ <xsl:text> var bestPoint,
+</xsl:text>
+ <xsl:text> bestLength,
+</xsl:text>
+ <xsl:text> bestDistance = Infinity,
+</xsl:text>
+ <xsl:text> scanDistance;
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> // use linear scan for coarse approximation
+</xsl:text>
+ <xsl:text> for (let [scanPoint, scanLength] of this.scannedPoints){
+</xsl:text>
+ <xsl:text> if ((scanDistance = distance2(scanPoint)) < bestDistance) {
+</xsl:text>
+ <xsl:text> bestPoint = scanPoint,
+</xsl:text>
+ <xsl:text> bestLength = scanLength,
+</xsl:text>
+ <xsl:text> bestDistance = scanDistance;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> // binary search for more precise estimate
+</xsl:text>
+ <xsl:text> let precision = this.precision / 2;
+</xsl:text>
+ <xsl:text> while (precision > 0.5) {
+</xsl:text>
+ <xsl:text> var beforePoint,
+</xsl:text>
+ <xsl:text> afterPoint,
+</xsl:text>
+ <xsl:text> beforeLength,
+</xsl:text>
+ <xsl:text> afterLength,
+</xsl:text>
+ <xsl:text> beforeDistance,
+</xsl:text>
+ <xsl:text> afterDistance;
+</xsl:text>
+ <xsl:text> if ((beforeLength = bestLength - precision) >= 0 &&
+</xsl:text>
+ <xsl:text> (beforeDistance = distance2(beforePoint = this.path_elt.getPointAtLength(beforeLength))) < bestDistance) {
+</xsl:text>
+ <xsl:text> bestPoint = beforePoint,
+</xsl:text>
+ <xsl:text> bestLength = beforeLength,
+</xsl:text>
+ <xsl:text> bestDistance = beforeDistance;
+</xsl:text>
+ <xsl:text> } else if ((afterLength = bestLength + precision) <= this.pathLength &&
+</xsl:text>
+ <xsl:text> (afterDistance = distance2(afterPoint = this.path_elt.getPointAtLength(afterLength))) < bestDistance) {
+</xsl:text>
+ <xsl:text> bestPoint = afterPoint,
+</xsl:text>
+ <xsl:text> bestLength = afterLength,
+</xsl:text>
+ <xsl:text> bestDistance = afterDistance;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> precision /= 2;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> return [bestPoint, bestLength];
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> function distance2(p) {
+</xsl:text>
+ <xsl:text> var dx = p.x - point.x,
+</xsl:text>
+ <xsl:text> dy = p.y - point.y;
+</xsl:text>
+ <xsl:text> return dx * dx + dy * dy;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> dispatch(value,oldval, index) {
+</xsl:text>
+ <xsl:text> switch(index) {
+</xsl:text>
+ <xsl:text> case 0:
+</xsl:text>
+ <xsl:text> this.position = value;
+</xsl:text>
+ <xsl:text> break;
+</xsl:text>
+ <xsl:text> case 1:
+</xsl:text>
+ <xsl:text> this.min = value;
+</xsl:text>
+ <xsl:text> break;
+</xsl:text>
+ <xsl:text> case 2:
+</xsl:text>
+ <xsl:text> this.max = value;
+</xsl:text>
+ <xsl:text> break;
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> this.request_animate();
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> get_current_point(){
+</xsl:text>
+ <xsl:text> let currLength = this.pathLength * (this.position - this.min) / (this.max - this.min)
+</xsl:text>
+ <xsl:text> return this.path_elt.getPointAtLength(currLength);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> animate(){
+</xsl:text>
+ <xsl:text> if(this.position == undefined)
+</xsl:text>
+ <xsl:text> return;
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> let currPt = this.get_current_point();
+</xsl:text>
+ <xsl:text> this.cursor_transform.setTranslate(currPt.x - this.origPt.x, currPt.y - this.origPt.y);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> init() {
+</xsl:text>
+ <xsl:text> if(this.args.length == 2)
+</xsl:text>
+ <xsl:text> [this.min, this.max]=this.args;
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> this.scanPath();
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> this.cursor_transform = svg_root.createSVGTransform();
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> this.cursor_elt.transform.baseVal.appendItem(this.cursor_transform);
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> this.cursor_elt.onpointerdown = (e) => this.on_cursor_down(e);
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> this.bound_drag = this.drag.bind(this);
+</xsl:text>
+ <xsl:text> this.bound_drop = this.drop.bind(this);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> start_dragging_from_event(e){
+</xsl:text>
+ <xsl:text> let clientPoint = new DOMPoint(e.clientX, e.clientY);
+</xsl:text>
+ <xsl:text> let point = clientPoint.matrixTransform(this.invctm);
+</xsl:text>
+ <xsl:text> let currPt = this.get_current_point();
+</xsl:text>
+ <xsl:text> this.draggingOffset = new DOMPoint(point.x - currPt.x , point.y - currPt.y);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> apply_position_from_event(e){
+</xsl:text>
+ <xsl:text> let clientPoint = new DOMPoint(e.clientX, e.clientY);
+</xsl:text>
+ <xsl:text> let rawPoint = clientPoint.matrixTransform(this.invctm);
+</xsl:text>
+ <xsl:text> let point = new DOMPoint(rawPoint.x - this.draggingOffset.x , rawPoint.y - this.draggingOffset.y);
+</xsl:text>
+ <xsl:text> let [closestPoint, closestLength] = this.closestPoint(point);
+</xsl:text>
+ <xsl:text> let new_position = this.min + (this.max - this.min) * closestLength / this.pathLength;
+</xsl:text>
+ <xsl:text> this.position = Math.round(Math.max(Math.min(new_position, this.max), this.min));
+</xsl:text>
+ <xsl:text> this.apply_hmi_value(0, this.position);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> on_cursor_down(e){
+</xsl:text>
+ <xsl:text> // get scrollbar -> root transform
+</xsl:text>
+ <xsl:text> let ctm = this.path_elt.getCTM();
+</xsl:text>
+ <xsl:text> // root -> path transform
+</xsl:text>
+ <xsl:text> this.invctm = ctm.inverse();
+</xsl:text>
+ <xsl:text> this.start_dragging_from_event(e);
+</xsl:text>
+ <xsl:text> svg_root.addEventListener("pointerup", this.bound_drop, true);
+</xsl:text>
+ <xsl:text> svg_root.addEventListener("pointermove", this.bound_drag, true);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> drop(e) {
+</xsl:text>
+ <xsl:text> svg_root.removeEventListener("pointerup", this.bound_drop, true);
+</xsl:text>
+ <xsl:text> svg_root.removeEventListener("pointermove", this.bound_drag, true);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> drag(e) {
+</xsl:text>
+ <xsl:text> this.apply_position_from_event(e);
+</xsl:text>
+ <xsl:text> }
+</xsl:text>
+ <xsl:text>}
+</xsl:text>
+ </xsl:template>
+ <xsl:template match="widget[@type='PathSlider']" mode="widget_defs">
+ <xsl:param name="hmi_element"/>
+ <xsl:call-template name="defs_by_labels">
+ <xsl:with-param name="hmi_element" select="$hmi_element"/>
+ <xsl:with-param name="labels">
+ <xsl:text>cursor path</xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
<xsl:template match="widget[@type='ScrollBar']" mode="widget_desc">
<type>
<xsl:value-of select="@type"/>
</type>
<longdesc>
- <xsl:text>ScrollBar - documentation to be written
+ <xsl:text>ScrollBar - svg:rect based scrollbar
</xsl:text>
</longdesc>
<shortdesc>
@@ -6375,15 +6798,13 @@
</xsl:text>
<xsl:text> let range = this.range;
</xsl:text>
- <xsl:text> let size = Math.max(this.range * this.mincursize, Math.min(this.size, range));
+ <xsl:text> let size = Math.max(range * this.mincursize, Math.min(this.size, range));
</xsl:text>
<xsl:text> let maxh = this.range_elt.height.baseVal.value;
</xsl:text>
<xsl:text> let pixels = maxh;
</xsl:text>
- <xsl:text> let units = range;
-</xsl:text>
- <xsl:text> return [size, maxh, range, pixels, units];
+ <xsl:text> return [size, maxh, range, pixels];
</xsl:text>
<xsl:text> }
</xsl:text>
@@ -6395,11 +6816,11 @@
</xsl:text>
<xsl:text> return;
</xsl:text>
- <xsl:text> let [size, maxh, range, pixels, units] = this.get_ratios();
-</xsl:text>
- <xsl:text>
-</xsl:text>
- <xsl:text> let new_y = this.range_elt.y.baseVal.value + Math.round(Math.min(this.position,range-size) * pixels / units);
+ <xsl:text> let [size, maxh, range, pixels] = this.get_ratios();
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text> let new_y = this.range_elt.y.baseVal.value + Math.round(Math.min(this.position,range-size) * pixels / range);
</xsl:text>
<xsl:text> let new_height = Math.round(maxh * size/range);
</xsl:text>
@@ -6485,7 +6906,7 @@
</xsl:text>
<xsl:text> drag(e) {
</xsl:text>
- <xsl:text> let [size, maxh, range, pixels, units] = this.get_ratios();
+ <xsl:text> let [size, maxh, range, pixels] = this.get_ratios();
</xsl:text>
<xsl:text> if(pixels == 0) return;
</xsl:text>
@@ -6493,7 +6914,7 @@
</xsl:text>
<xsl:text> let movement = point.matrixTransform(this.invctm).y;
</xsl:text>
- <xsl:text> this.dragpos += movement * units / pixels;
+ <xsl:text> this.dragpos += movement * range / pixels;
</xsl:text>
<xsl:text> this.apply_position(this.dragpos);
</xsl:text>
@@ -7332,6 +7753,87 @@
<xsl:text> ],
</xsl:text>
</xsl:template>
+ <xsl:template match="widget[@type='TextList']" mode="widget_desc">
+ <type>
+ <xsl:value-of select="@type"/>
+ </type>
+ <longdesc>
+ <xsl:text>TextList widget is a svg:group, list items are labeled elements
+</xsl:text>
+ <xsl:text>in that group.
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>To use a TextList, clone (svg:use) one of the items inside the widget
+</xsl:text>
+ <xsl:text>that expects a TextList.
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>In this list, (translated) text content is what matters. Nevertheless
+</xsl:text>
+ <xsl:text>text style of the cloned item will be applied in client widget.
+</xsl:text>
+ </longdesc>
+ <shortdesc>
+ <xsl:text>A named list of ordered texts </xsl:text>
+ </shortdesc>
+ <arg name="listname"/>
+ </xsl:template>
+ <xsl:template match="widget[@type='TextList']" mode="widget_defs">
+ <xsl:param name="hmi_element"/>
+ <xsl:text> texts: [
+</xsl:text>
+ <xsl:for-each select="func:refered_elements($hmi_element/*[@inkscape:label])[self::svg:text]">
+ <xsl:text> id("</xsl:text>
+ <xsl:value-of select="@id"/>
+ <xsl:text>"),
+</xsl:text>
+ </xsl:for-each>
+ <xsl:text> ].reverse(),
+</xsl:text>
+ </xsl:template>
+ <xsl:template match="widget[@type='TextStyleList']" mode="widget_desc">
+ <type>
+ <xsl:value-of select="@type"/>
+ </type>
+ <longdesc>
+ <xsl:text>TextStyleList widget is a svg:group, list items are labeled elements
+</xsl:text>
+ <xsl:text>in that group.
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>To use a TextStyleList, clone (svg:use) one of the items inside the widget
+</xsl:text>
+ <xsl:text>that expects a TextStyleList.
+</xsl:text>
+ <xsl:text>
+</xsl:text>
+ <xsl:text>In this list, only style matters. Text content is ignored.
+</xsl:text>
+ </longdesc>
+ <shortdesc>
+ <xsl:text>A named list of named texts</xsl:text>
+ </shortdesc>
+ <arg name="listname"/>
+ </xsl:template>
+ <xsl:template match="widget[@type='TextStyleList']" mode="widget_defs">
+ <xsl:param name="hmi_element"/>
+ <xsl:text> styles: {
+</xsl:text>
+ <xsl:for-each select="$hmi_element/*[@inkscape:label]">
+ <xsl:variable name="style" select="func:refered_elements(.)[self::svg:text]/@style"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@inkscape:label"/>
+ <xsl:text>: "</xsl:text>
+ <xsl:value-of select="$style"/>
+ <xsl:text>",
+</xsl:text>
+ </xsl:for-each>
+ <xsl:text> },
+</xsl:text>
+ </xsl:template>
<xsl:template match="widget[@type='ToggleButton']" mode="widget_desc">
<type>
<xsl:value-of select="@type"/>
--- a/svghmi/gen_index_xhtml.ysl2 Thu Sep 16 09:40:36 2021 +0200
+++ b/svghmi/gen_index_xhtml.ysl2 Fri Oct 01 17:44:52 2021 +0200
@@ -49,6 +49,8 @@
include geometry.ysl2
+ include lists.ysl2
+
include detachable_pages.ysl2
include inline_svg.ysl2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/lists.ysl2 Fri Oct 01 17:44:52 2021 +0200
@@ -0,0 +1,33 @@
+// lists.ysl2
+//
+// compute list widget related constants
+// for details, refer to :
+// widget_list.ysl2
+// widget_textlist.ysl2
+// widget_textstulelist.ysl2
+
+
+// List widgets
+
+const "hmi_lists_descs", "$parsed_widgets/widget[@type = 'List']";
+const "hmi_lists", "$hmi_elements[@id = $hmi_lists_descs/@id]";
+
+
+// TextList widget
+
+const "hmi_textlists_descs", "$parsed_widgets/widget[@type = 'TextList']";
+const "hmi_textlists", "$hmi_elements[@id = $hmi_textlists_descs/@id]";
+
+// TextStyleList widgets
+
+const "hmi_textstylelists_descs", "$parsed_widgets/widget[@type = 'TextStyleList']";
+const "hmi_textstylelists", "$hmi_elements[@id = $hmi_textstylelists_descs/@id]";
+
+const "textstylelist_related" foreach "$hmi_textstylelists" list {
+ attrib "listid" value "@id";
+ foreach "func:refered_elements(.)" elt {
+ attrib "eltid" value "@id";
+ }
+}
+const "textstylelist_related_ns", "exsl:node-set($textstylelist_related)";
+
--- a/svghmi/svghmi.py Thu Sep 16 09:40:36 2021 +0200
+++ b/svghmi/svghmi.py Fri Oct 01 17:44:52 2021 +0200
@@ -292,14 +292,19 @@
return ret
+if wx.Platform == '__WXMSW__':
+ browser_launch_cmd="cmd.exe /c 'start msedge {url}'"
+else:
+ browser_launch_cmd="chromium {url}"
+
class SVGHMI(object):
XSD = """<?xml version="1.0" encoding="utf-8" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="SVGHMI">
<xsd:complexType>
- <xsd:attribute name="OnStart" type="xsd:string" use="optional" default="chromium {url}"/>
- <xsd:attribute name="OnStop" type="xsd:string" use="optional" default="echo 'please close chromium window at {url}'"/>
- <xsd:attribute name="OnWatchdog" type="xsd:string" use="optional" default="echo 'Watchdog for {name} !'"/>
+ <xsd:attribute name="OnStart" type="xsd:string" use="optional" default="%s"/>
+ <xsd:attribute name="OnStop" type="xsd:string" use="optional" default=""/>
+ <xsd:attribute name="OnWatchdog" type="xsd:string" use="optional" default=""/>
<xsd:attribute name="EnableWatchdog" type="xsd:boolean" use="optional" default="false"/>
<xsd:attribute name="WatchdogInitial" use="optional" default="30">
<xsd:simpleType>
@@ -331,7 +336,7 @@
</xsd:complexType>
</xsd:element>
</xsd:schema>
- """
+ """%browser_launch_cmd
EditorType = SVGHMIEditor
--- a/svghmi/svghmi_server.py Thu Sep 16 09:40:36 2021 +0200
+++ b/svghmi/svghmi_server.py Fri Oct 01 17:44:52 2021 +0200
@@ -241,6 +241,9 @@
svghmi_servers = {}
svghmi_send_thread = None
+# python's errno on windows seems to have no ENODATA
+ENODATA = errno.ENODATA if hasattr(errno,"ENODATA") else None
+
def SendThreadProc():
global svghmi_session_manager
size = ctypes.c_uint32()
@@ -255,7 +258,7 @@
if res == 0:
svghmi_session.sendMessage(
ctypes.string_at(ptr.value,size.value))
- elif res == errno.ENODATA:
+ elif res == ENODATA:
# this happens when there is no data after wakeup
# because of hmi data refresh period longer than
# PLC common ticktime
--- a/svghmi/ui.py Thu Sep 16 09:40:36 2021 +0200
+++ b/svghmi/ui.py Fri Oct 01 17:44:52 2021 +0200
@@ -57,13 +57,13 @@
display_name = ('{} (class={})'.format(c.name, c.hmiclass)) \
if c.hmiclass is not None else c.name
tc_child = self.AppendItem(current_tc_root, display_name)
- self.SetPyData(tc_child, c)
+ self.SetItemData(tc_child, c)
self._recurseTree(c,tc_child)
else:
display_name = '{} {}'.format(c.nodetype[4:], c.name)
tc_child = self.AppendItem(current_tc_root, display_name)
- self.SetPyData(tc_child, c)
+ self.SetItemData(tc_child, c)
def OnTreeNodeSelection(self, event):
items = self.GetSelections()
@@ -105,7 +105,7 @@
root_display_name = _("Please build to see HMI Tree") \
if hmi_tree_root is None else "HMI"
self.root = self.AddRoot(root_display_name)
- self.SetPyData(self.root, hmi_tree_root)
+ self.SetItemData(self.root, hmi_tree_root)
if hmi_tree_root is not None:
self._recurseTree(hmi_tree_root, self.root)
@@ -145,11 +145,11 @@
for d in dirlist:
current_tc_root = self.AppendItem(current_tc_root, d)
res.append(current_tc_root)
- self.SetPyData(current_tc_root, None)
+ self.SetItemData(current_tc_root, None)
dirlist = []
res.pop()
tc_child = self.AppendItem(current_tc_root, f)
- self.SetPyData(tc_child, p)
+ self.SetItemData(tc_child, p)
return res
def MakeTree(self, lib_dir = None):
@@ -162,7 +162,7 @@
root_display_name = _("Please select widget library directory") \
if lib_dir is None else os.path.basename(lib_dir)
self.root = self.AddRoot(root_display_name)
- self.SetPyData(self.root, None)
+ self.SetItemData(self.root, None)
if lib_dir is not None and os.path.exists(lib_dir):
self._recurseTree(lib_dir, self.root, [])
--- a/svghmi/widget_dropdown.ysl2 Thu Sep 16 09:40:36 2021 +0200
+++ b/svghmi/widget_dropdown.ysl2 Fri Oct 01 17:44:52 2021 +0200
@@ -7,16 +7,21 @@
DropDown widget let user select an entry in a list of texts, given as
arguments. Single variable path is index of selection.
- It needs "text" (svg:text), "box" (svg:rect), "button" (svg:*),
- and "highlight" (svg:rect) labeled elements.
+ It needs "text" (svg:text or svg:use referring to svg:text),
+ "box" (svg:rect), "button" (svg:*), and "highlight" (svg:rect)
+ labeled elements.
When user clicks on "button", "text" is duplicated to display enties in the
limit of available space in page, and "box" is extended to contain all
texts. "highlight" is moved over pre-selected entry.
- When only one argument is given, and argment contains "#langs" then list of
- texts is automatically set to the list of human-readable languages supported
- by this HMI.
+ When only one argument is given and argment contains "#langs" then list of
+ texts is automatically set to the human-readable list of supported
+ languages by this HMI.
+
+ If "text" labeled element is of type svg:use and refers to a svg:text
+ element part of a TextList widget, no argument is expected. In that case
+ list of texts is set to TextList content.
||
shortdesc > Let user select text entry in a drop-down menu
@@ -34,6 +39,7 @@
if(!this.opened) this.set_selection(value);
}
init() {
+ this.init_specific();
this.button_elt.onclick = this.on_button_click.bind(this);
// Save original size of rectangle
this.box_bbox = this.box_elt.getBBox()
@@ -79,7 +85,7 @@
let display_str;
if(value >= 0 && value < this.content.length){
// if valid selection resolve content
- display_str = this.content[value];
+ display_str = gettext(this.content[value]);
this.last_selection = value;
} else {
// otherwise show problem
@@ -185,7 +191,7 @@
let c = 0;
for(let item of this.content){
let span=spans[c];
- span.textContent = item;
+ span.textContent = gettext(item);
let sel = c;
this.make_clickable(span, (evt) => this.bound_on_selection_click(sel));
c++;
@@ -251,7 +257,7 @@
span.setAttribute("dx", (m.width - o.width)/2);
// otherwise normal content
}else{
- span.textContent = this.content[i];
+ span.textContent = gettext(this.content[i]);
let sel = i;
onclickfunc = (evt) => this.bound_on_selection_click(sel);
span.removeAttribute("dx");
@@ -360,19 +366,43 @@
}
widget_defs("DropDown") {
- labels("text box button highlight");
+ labels("box button highlight");
// It is assumed that list content conforms to Array interface.
- > content:
+ const "text_elt","$hmi_element//*[@inkscape:label='text'][1]";
+ | init_specific: function() {
choose{
// special case when used for language selection
when "count(arg) = 1 and arg[1]/@value = '#langs'" {
- > langs
+ | this.text_elt = id("«$text_elt/@id»");
+ | this.content = langs;
+ }
+ when "count(arg) = 0"{
+ if "not($text_elt[self::svg:use])"
+ error > No argrument for HMI:DropDown widget id="«$hmi_element/@id»" and "text" labeled element is not a svg:use element
+ const "real_text_elt","$result_widgets[@id = $hmi_element/@id]//*[@original=$text_elt/@id]/svg:text";
+ | this.text_elt = id("«$real_text_elt/@id»");
+ const "from_list_id", "substring-after($text_elt/@xlink:href,'#')";
+ const "from_list", "$hmi_textlists[(@id | */@id) = $from_list_id]";
+ if "count($from_list) = 0"
+ error > HMI:DropDown widget id="«$hmi_element/@id»" "text" labeled element does not point to a svg:text owned by a HMI:List widget
+ | this.content = hmi_widgets["«$from_list/@id»"].texts;
}
otherwise {
- > [\n
+ | this.text_elt = id("«$text_elt/@id»");
+ | this.content = [
foreach "arg" | "«@value»",
- > ]
+ | ];
}
}
- > ,\n
+ | }
}
+
+emit "declarations:DropDown"
+||
+function gettext(o) {
+ if(typeof(o) == "string"){
+ return o;
+ }
+ return svg_text_to_multiline(o);
+};
+||
--- a/svghmi/widget_jsontable.ysl2 Thu Sep 16 09:40:36 2021 +0200
+++ b/svghmi/widget_jsontable.ysl2 Fri Oct 01 17:44:52 2021 +0200
@@ -108,17 +108,6 @@
}
-const "hmi_textstylelists_descs", "$parsed_widgets/widget[@type = 'TextStyleList']";
-const "hmi_textstylelists", "$hmi_elements[@id = $hmi_textstylelists_descs/@id]";
-
-const "textstylelist_related" foreach "$hmi_textstylelists" list {
- attrib "listid" value "@id";
- foreach "func:refered_elements(.)" elt {
- attrib "eltid" value "@id";
- }
-}
-const "textstylelist_related_ns", "exsl:node-set($textstylelist_related)";
-
def "func:json_expressions" {
param "expressions";
param "label";
--- a/svghmi/widget_list.ysl2 Thu Sep 16 09:40:36 2021 +0200
+++ b/svghmi/widget_list.ysl2 Fri Oct 01 17:44:52 2021 +0200
@@ -1,6 +1,22 @@
// widget_list.ysl2
+
widget_desc("List") {
- // TODO
+ longdesc
+ ||
+ List widget is a svg:group, list items are labeled elements
+ in that group.
+
+ To use a List, clone (svg:use) one of the items inside the widget that
+ expects a List.
+
+ Positions of items are relative to each other, and they must all be in the
+ same place. In order to make editing easier it is therefore recommanded to
+ make stacked clones of svg elements spread nearby the list.
+ ||
+
+ shortdesc > A named list of named graphical elements
+
+ arg name="listname"
}
widget_defs("List") {
@@ -11,15 +27,3 @@
| },
}
-widget_defs("TextStyleList") {
- // TODO
-}
-
-widget_defs("TextStyleList") {
- | styles: {
- foreach "$hmi_element/*[@inkscape:label]" {
- const "style", "func:refered_elements(.)[self::svg:text]/@style";
- | «@inkscape:label»: "«$style»",
- }
- | },
-}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/widget_pathslider.ysl2 Fri Oct 01 17:44:52 2021 +0200
@@ -0,0 +1,173 @@
+// widget_pathslider.ysl2
+widget_desc("PathSlider") {
+ longdesc
+ ||
+ PathSlider -
+ ||
+
+ shortdesc > Slide an SVG element along a path by dragging it
+
+ path name="value" accepts="HMI_INT,HMI_REAL" > value
+ path name="min" count="optional" accepts="HMI_INT,HMI_REAL" > min
+ path name="max" count="optional" accepts="HMI_INT,HMI_REAL" > max
+
+ arg name="min" count="optional" accepts="int,real" > minimum value
+ arg name="max" count="optional" accepts="int,real" > maximum value
+}
+
+widget_class("PathSlider") {
+ ||
+ frequency = 10;
+ position = undefined;
+ min = 0;
+ max = 100;
+ scannedPoints = [];
+ pathLength = undefined;
+ precision = undefined;
+ origPt = undefined;
+
+
+ scanPath() {
+ this.pathLength = this.path_elt.getTotalLength();
+ this.precision = Math.floor(this.pathLength / 10);
+
+ // save linear scan for coarse approximation
+ for (var scanLength = 0; scanLength <= this.pathLength; scanLength += this.precision) {
+ this.scannedPoints.push([this.path_elt.getPointAtLength(scanLength), scanLength]);
+ }
+ [this.origPt,] = this.scannedPoints[0];
+ }
+
+ closestPoint(point) {
+ var bestPoint,
+ bestLength,
+ bestDistance = Infinity,
+ scanDistance;
+
+ // use linear scan for coarse approximation
+ for (let [scanPoint, scanLength] of this.scannedPoints){
+ if ((scanDistance = distance2(scanPoint)) < bestDistance) {
+ bestPoint = scanPoint,
+ bestLength = scanLength,
+ bestDistance = scanDistance;
+ }
+ }
+
+ // binary search for more precise estimate
+ let precision = this.precision / 2;
+ while (precision > 0.5) {
+ var beforePoint,
+ afterPoint,
+ beforeLength,
+ afterLength,
+ beforeDistance,
+ afterDistance;
+ if ((beforeLength = bestLength - precision) >= 0 &&
+ (beforeDistance = distance2(beforePoint = this.path_elt.getPointAtLength(beforeLength))) < bestDistance) {
+ bestPoint = beforePoint,
+ bestLength = beforeLength,
+ bestDistance = beforeDistance;
+ } else if ((afterLength = bestLength + precision) <= this.pathLength &&
+ (afterDistance = distance2(afterPoint = this.path_elt.getPointAtLength(afterLength))) < bestDistance) {
+ bestPoint = afterPoint,
+ bestLength = afterLength,
+ bestDistance = afterDistance;
+ }
+ precision /= 2;
+ }
+
+ return [bestPoint, bestLength];
+
+ function distance2(p) {
+ var dx = p.x - point.x,
+ dy = p.y - point.y;
+ return dx * dx + dy * dy;
+ }
+ }
+
+ dispatch(value,oldval, index) {
+ switch(index) {
+ case 0:
+ this.position = value;
+ break;
+ case 1:
+ this.min = value;
+ break;
+ case 2:
+ this.max = value;
+ break;
+ }
+
+ this.request_animate();
+ }
+
+ get_current_point(){
+ let currLength = this.pathLength * (this.position - this.min) / (this.max - this.min)
+ return this.path_elt.getPointAtLength(currLength);
+ }
+
+ animate(){
+ if(this.position == undefined)
+ return;
+
+ let currPt = this.get_current_point();
+ this.cursor_transform.setTranslate(currPt.x - this.origPt.x, currPt.y - this.origPt.y);
+ }
+
+ init() {
+ if(this.args.length == 2)
+ [this.min, this.max]=this.args;
+
+ this.scanPath();
+
+ this.cursor_transform = svg_root.createSVGTransform();
+
+ this.cursor_elt.transform.baseVal.appendItem(this.cursor_transform);
+
+ this.cursor_elt.onpointerdown = (e) => this.on_cursor_down(e);
+
+ this.bound_drag = this.drag.bind(this);
+ this.bound_drop = this.drop.bind(this);
+ }
+
+ start_dragging_from_event(e){
+ let clientPoint = new DOMPoint(e.clientX, e.clientY);
+ let point = clientPoint.matrixTransform(this.invctm);
+ let currPt = this.get_current_point();
+ this.draggingOffset = new DOMPoint(point.x - currPt.x , point.y - currPt.y);
+ }
+
+ apply_position_from_event(e){
+ let clientPoint = new DOMPoint(e.clientX, e.clientY);
+ let rawPoint = clientPoint.matrixTransform(this.invctm);
+ let point = new DOMPoint(rawPoint.x - this.draggingOffset.x , rawPoint.y - this.draggingOffset.y);
+ let [closestPoint, closestLength] = this.closestPoint(point);
+ let new_position = this.min + (this.max - this.min) * closestLength / this.pathLength;
+ this.position = Math.round(Math.max(Math.min(new_position, this.max), this.min));
+ this.apply_hmi_value(0, this.position);
+ }
+
+ on_cursor_down(e){
+ // get scrollbar -> root transform
+ let ctm = this.path_elt.getCTM();
+ // root -> path transform
+ this.invctm = ctm.inverse();
+ this.start_dragging_from_event(e);
+ svg_root.addEventListener("pointerup", this.bound_drop, true);
+ svg_root.addEventListener("pointermove", this.bound_drag, true);
+ }
+
+ drop(e) {
+ svg_root.removeEventListener("pointerup", this.bound_drop, true);
+ svg_root.removeEventListener("pointermove", this.bound_drag, true);
+ }
+
+ drag(e) {
+ this.apply_position_from_event(e);
+ }
+ ||
+}
+
+widget_defs("PathSlider") {
+ labels("cursor path");
+}
--- a/svghmi/widget_scrollbar.ysl2 Thu Sep 16 09:40:36 2021 +0200
+++ b/svghmi/widget_scrollbar.ysl2 Fri Oct 01 17:44:52 2021 +0200
@@ -2,7 +2,7 @@
widget_desc("ScrollBar") {
longdesc
||
- ScrollBar - documentation to be written
+ ScrollBar - svg:rect based scrollbar
||
shortdesc > ScrollBar
@@ -39,19 +39,18 @@
get_ratios() {
let range = this.range;
- let size = Math.max(this.range * this.mincursize, Math.min(this.size, range));
+ let size = Math.max(range * this.mincursize, Math.min(this.size, range));
let maxh = this.range_elt.height.baseVal.value;
let pixels = maxh;
- let units = range;
- return [size, maxh, range, pixels, units];
+ return [size, maxh, range, pixels];
}
animate(){
if(this.position == undefined || this.range == undefined || this.size == undefined)
return;
- let [size, maxh, range, pixels, units] = this.get_ratios();
+ let [size, maxh, range, pixels] = this.get_ratios();
- let new_y = this.range_elt.y.baseVal.value + Math.round(Math.min(this.position,range-size) * pixels / units);
+ let new_y = this.range_elt.y.baseVal.value + Math.round(Math.min(this.position,range-size) * pixels / range);
let new_height = Math.round(maxh * size/range);
this.cursor_elt.y.baseVal.value = new_y;
@@ -94,11 +93,11 @@
}
drag(e) {
- let [size, maxh, range, pixels, units] = this.get_ratios();
+ let [size, maxh, range, pixels] = this.get_ratios();
if(pixels == 0) return;
let point = new DOMPoint(e.movementX, e.movementY);
let movement = point.matrixTransform(this.invctm).y;
- this.dragpos += movement * units / pixels;
+ this.dragpos += movement * range / pixels;
this.apply_position(this.dragpos);
}
||
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/widget_textlist.ysl2 Fri Oct 01 17:44:52 2021 +0200
@@ -0,0 +1,28 @@
+// widget_textlist.ysl2
+
+widget_desc("TextList") {
+ longdesc
+ ||
+ TextList widget is a svg:group, list items are labeled elements
+ in that group.
+
+ To use a TextList, clone (svg:use) one of the items inside the widget
+ that expects a TextList.
+
+ In this list, (translated) text content is what matters. Nevertheless
+ text style of the cloned item will be applied in client widget.
+ ||
+
+ shortdesc > A named list of ordered texts
+
+ arg name="listname"
+}
+
+widget_defs("TextList") {
+ | texts: [
+ foreach "func:refered_elements($hmi_element/*[@inkscape:label])[self::svg:text]" {
+ | id("«@id»"),
+ }
+ // could find a proper way in xpath to reverse()
+ | ].reverse(),
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/widget_textstylelist.ysl2 Fri Oct 01 17:44:52 2021 +0200
@@ -0,0 +1,28 @@
+// widget_textstylelist.ysl2
+
+widget_desc("TextStyleList") {
+ longdesc
+ ||
+ TextStyleList widget is a svg:group, list items are labeled elements
+ in that group.
+
+ To use a TextStyleList, clone (svg:use) one of the items inside the widget
+ that expects a TextStyleList.
+
+ In this list, only style matters. Text content is ignored.
+ ||
+
+ shortdesc > A named list of named texts
+
+ arg name="listname"
+}
+
+widget_defs("TextStyleList") {
+ | styles: {
+ foreach "$hmi_element/*[@inkscape:label]" {
+ const "style", "func:refered_elements(.)[self::svg:text]/@style";
+ | «@inkscape:label»: "«$style»",
+ }
+ | },
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/svghmi/widgetlib/dropdown.svg Fri Oct 01 17:44:52 2021 +0200
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="210mm"
+ height="297mm"
+ viewBox="0 0 210 297"
+ version="1.1"
+ id="svg1109"
+ inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
+ sodipodi:docname="dropdown.svg">
+ <defs
+ id="defs1103" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.35"
+ inkscape:cx="48.571429"
+ inkscape:cy="537.14286"
+ inkscape:document-units="mm"
+ inkscape:current-layer="svg1109"
+ showgrid="false"
+ inkscape:window-width="3840"
+ inkscape:window-height="2096"
+ inkscape:window-x="1600"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata1106">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="g14237"
+ inkscape:label="HMI:DropDown:1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27@/SELECTION"
+ transform="matrix(0.21561215,0,0,0.21561215,-108.35425,-53.167319)"
+ style="stroke-width:0.35083869">
+ <rect
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#53676c;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.75419343;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ id="rect14212"
+ width="391.99988"
+ height="130.9433"
+ x="864.00842"
+ y="923.98993"
+ rx="2.4558709"
+ ry="2.4558709"
+ inkscape:label="box" />
+ <rect
+ inkscape:label="highlight"
+ ry="2.4558709"
+ rx="2.4558709"
+ y="943.10553"
+ x="864.00842"
+ height="92.71212"
+ width="391.99988"
+ id="rect5497"
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#0000ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.75419331;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
+ <text
+ id="text14183"
+ y="1011.9975"
+ x="881.44226"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:80px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#d42aff;fill-opacity:1;stroke:none;stroke-width:0.35083869px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"
+ inkscape:label="text"><tspan
+ style="text-align:start;text-anchor:start;fill:#d42aff;stroke-width:0.35083869px"
+ y="1011.9975"
+ x="881.44226"
+ sodipodi:role="line"
+ id="tspan421">sel_0</tspan></text>
+ <path
+ sodipodi:type="star"
+ style="opacity:1;vector-effect:none;fill:#a7a5a6;fill-opacity:1;stroke:none;stroke-width:0.12376806;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path424"
+ sodipodi:sides="3"
+ sodipodi:cx="1200.5"
+ sodipodi:cy="975"
+ sodipodi:r1="43.683521"
+ sodipodi:r2="21.841761"
+ sodipodi:arg1="1.5707963"
+ sodipodi:arg2="2.6179939"
+ inkscape:flatsided="false"
+ inkscape:rounded="0"
+ inkscape:randomized="0"
+ d="m 1200.5,1018.6835 -18.9155,-32.76262 -18.9155,-32.76264 37.831,0 37.831,0 -18.9155,32.76264 z"
+ inkscape:transform-center-y="10.92088"
+ inkscape:label="button" />
+ </g>
+</svg>
--- a/tests/first_steps/beremiz.xml Thu Sep 16 09:40:36 2021 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<BeremizRoot xmlns:xsd="http://www.w3.org/2001/XMLSchema" URI_location="LOCAL://">
- <TargetType/>
- <Libraries Enable_Python_Library="false"/>
-</BeremizRoot>
--- a/tests/first_steps/plc.xml Thu Sep 16 09:40:36 2021 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1160 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<project xmlns:ns1="http://www.plcopen.org/xml/tc6_0201" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.plcopen.org/xml/tc6_0201">
- <fileHeader companyName="Beremiz" productName="Beremiz" productVersion="1" creationDateTime="2016-10-24T18:09:22"/>
- <contentHeader name="First Steps" modificationDateTime="2018-09-26T12:52:51">
- <coordinateInfo>
- <fbd>
- <scaling x="0" y="0"/>
- </fbd>
- <ld>
- <scaling x="0" y="0"/>
- </ld>
- <sfc>
- <scaling x="0" y="0"/>
- </sfc>
- </coordinateInfo>
- </contentHeader>
- <types>
- <dataTypes/>
- <pous>
- <pou name="AverageVal" pouType="function">
- <interface>
- <returnType>
- <REAL/>
- </returnType>
- <inputVars>
- <variable name="Cnt1">
- <type>
- <INT/>
- </type>
- </variable>
- <variable name="Cnt2">
- <type>
- <INT/>
- </type>
- </variable>
- <variable name="Cnt3">
- <type>
- <INT/>
- </type>
- </variable>
- <variable name="Cnt4">
- <type>
- <INT/>
- </type>
- </variable>
- <variable name="Cnt5">
- <type>
- <INT/>
- </type>
- </variable>
- </inputVars>
- <localVars>
- <variable name="InputsNumber">
- <type>
- <REAL/>
- </type>
- <initialValue>
- <simpleValue value="5.0"/>
- </initialValue>
- <documentation>
- <xhtml:p><![CDATA[Количество входных значений]]></xhtml:p>
- </documentation>
- </variable>
- </localVars>
- </interface>
- <body>
- <ST>
- <xhtml:p><![CDATA[AverageVal := INT_TO_REAL(Cnt1+Cnt2+Cnt3+Cnt4+Cnt5)/InputsNumber;]]></xhtml:p>
- </ST>
- </body>
- </pou>
- <pou name="plc_prg" pouType="program">
- <interface>
- <inputVars>
- <variable name="Reset">
- <type>
- <BOOL/>
- </type>
- </variable>
- </inputVars>
- <outputVars>
- <variable name="Cnt1">
- <type>
- <INT/>
- </type>
- </variable>
- <variable name="Cnt2">
- <type>
- <INT/>
- </type>
- </variable>
- <variable name="Cnt3">
- <type>
- <INT/>
- </type>
- </variable>
- <variable name="Cnt4">
- <type>
- <INT/>
- </type>
- </variable>
- <variable name="Cnt5">
- <type>
- <INT/>
- </type>
- </variable>
- </outputVars>
- <localVars>
- <variable name="CounterST0">
- <type>
- <derived name="CounterST"/>
- </type>
- </variable>
- <variable name="CounterFBD0">
- <type>
- <derived name="CounterFBD"/>
- </type>
- </variable>
- <variable name="CounterSFC0">
- <type>
- <derived name="CounterSFC"/>
- </type>
- </variable>
- <variable name="CounterIL0">
- <type>
- <derived name="CounterIL"/>
- </type>
- </variable>
- <variable name="CounterLD0">
- <type>
- <derived name="CounterLD"/>
- </type>
- </variable>
- <variable name="AVCnt">
- <type>
- <REAL/>
- </type>
- </variable>
- </localVars>
- </interface>
- <body>
- <FBD>
- <block localId="1" typeName="CounterST" instanceName="CounterST0" executionOrderId="0" height="60" width="125">
- <position x="207" y="53"/>
- <inputVariables>
- <variable formalParameter="Reset">
- <connectionPointIn>
- <relPosition x="0" y="40"/>
- <connection refLocalId="2">
- <position x="207" y="93"/>
- <position x="114" y="93"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="125" y="40"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <inVariable localId="2" executionOrderId="0" height="30" width="79" negated="false">
- <position x="35" y="78"/>
- <connectionPointOut>
- <relPosition x="79" y="15"/>
- </connectionPointOut>
- <expression>Reset</expression>
- </inVariable>
- <block localId="4" typeName="CounterFBD" instanceName="CounterFBD0" executionOrderId="0" height="54" width="121">
- <position x="211" y="146"/>
- <inputVariables>
- <variable formalParameter="Reset">
- <connectionPointIn>
- <relPosition x="0" y="37"/>
- <connection refLocalId="13">
- <position x="211" y="183"/>
- <position x="115" y="183"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="121" y="37"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <comment localId="6" height="365" width="569">
- <position x="620" y="130"/>
- <content>
- <xhtml:p><![CDATA[In this example function block with the same functionality
-is created using all five IEC 61131-3 programing languages:
-- IL;
-- FBD;
-- LD;
-- ST;
-- SFC.
-
-
-
-
-Function block is a counter with reset control input.
-If reset is True counter value is reset to the value defined by
-global configuration constant ResetCounterValue.
-If reset is False, counter is incremented every cycle.
-]]></xhtml:p>
- </content>
- </comment>
- <block localId="7" typeName="CounterSFC" instanceName="CounterSFC0" executionOrderId="0" height="52" width="121">
- <position x="211" y="237"/>
- <inputVariables>
- <variable formalParameter="Reset">
- <connectionPointIn>
- <relPosition x="0" y="36"/>
- <connection refLocalId="12">
- <position x="211" y="273"/>
- <position x="103" y="273"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="121" y="36"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <block localId="9" typeName="CounterIL" instanceName="CounterIL0" executionOrderId="0" height="62" width="121">
- <position x="211" y="322"/>
- <inputVariables>
- <variable formalParameter="Reset">
- <connectionPointIn>
- <relPosition x="0" y="41"/>
- <connection refLocalId="10">
- <position x="211" y="363"/>
- <position x="101" y="363"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="121" y="41"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <inVariable localId="10" executionOrderId="0" height="30" width="67" negated="false">
- <position x="34" y="348"/>
- <connectionPointOut>
- <relPosition x="67" y="15"/>
- </connectionPointOut>
- <expression>Reset</expression>
- </inVariable>
- <inVariable localId="12" executionOrderId="0" height="30" width="67" negated="false">
- <position x="36" y="258"/>
- <connectionPointOut>
- <relPosition x="67" y="15"/>
- </connectionPointOut>
- <expression>Reset</expression>
- </inVariable>
- <inVariable localId="13" executionOrderId="0" height="30" width="79" negated="false">
- <position x="36" y="168"/>
- <connectionPointOut>
- <relPosition x="79" y="15"/>
- </connectionPointOut>
- <expression>Reset</expression>
- </inVariable>
- <block localId="14" typeName="CounterLD" instanceName="CounterLD0" executionOrderId="0" height="62" width="124">
- <position x="210" y="412"/>
- <inputVariables>
- <variable formalParameter="Reset">
- <connectionPointIn>
- <relPosition x="0" y="41"/>
- <connection refLocalId="16">
- <position x="210" y="453"/>
- <position x="100" y="453"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="Out">
- <connectionPointOut>
- <relPosition x="124" y="41"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <inVariable localId="16" executionOrderId="0" height="30" width="64" negated="false">
- <position x="36" y="438"/>
- <connectionPointOut>
- <relPosition x="64" y="15"/>
- </connectionPointOut>
- <expression>Reset</expression>
- </inVariable>
- <block localId="17" typeName="AverageVal" executionOrderId="0" height="470" width="100">
- <position x="514" y="28"/>
- <inputVariables>
- <variable formalParameter="Cnt1">
- <connectionPointIn>
- <relPosition x="0" y="65"/>
- <connection refLocalId="3">
- <position x="514" y="93"/>
- <position x="474" y="93"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="Cnt2">
- <connectionPointIn>
- <relPosition x="0" y="155"/>
- <connection refLocalId="5">
- <position x="514" y="183"/>
- <position x="473" y="183"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="Cnt3">
- <connectionPointIn>
- <relPosition x="0" y="245"/>
- <connection refLocalId="8">
- <position x="514" y="273"/>
- <position x="472" y="273"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="Cnt4">
- <connectionPointIn>
- <relPosition x="0" y="335"/>
- <connection refLocalId="11">
- <position x="514" y="363"/>
- <position x="469" y="363"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="Cnt5">
- <connectionPointIn>
- <relPosition x="0" y="425"/>
- <connection refLocalId="15">
- <position x="514" y="453"/>
- <position x="469" y="453"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="100" y="65"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <outVariable localId="18" executionOrderId="0" height="30" width="55" negated="false">
- <position x="649" y="78"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="17" formalParameter="OUT">
- <position x="649" y="93"/>
- <position x="614" y="93"/>
- </connection>
- </connectionPointIn>
- <expression>AVCnt</expression>
- </outVariable>
- <inOutVariable localId="3" executionOrderId="0" height="30" width="106" negatedOut="false" negatedIn="false">
- <position x="368" y="78"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="1" formalParameter="OUT">
- <position x="368" y="93"/>
- <position x="332" y="93"/>
- </connection>
- </connectionPointIn>
- <connectionPointOut>
- <relPosition x="106" y="15"/>
- </connectionPointOut>
- <expression>Cnt1</expression>
- </inOutVariable>
- <inOutVariable localId="5" executionOrderId="0" height="30" width="103" negatedOut="false" negatedIn="false">
- <position x="370" y="168"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="4" formalParameter="OUT">
- <position x="370" y="183"/>
- <position x="332" y="183"/>
- </connection>
- </connectionPointIn>
- <connectionPointOut>
- <relPosition x="103" y="15"/>
- </connectionPointOut>
- <expression>Cnt2</expression>
- </inOutVariable>
- <inOutVariable localId="8" executionOrderId="0" height="30" width="97" negatedOut="false" negatedIn="false">
- <position x="375" y="258"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="7" formalParameter="OUT">
- <position x="375" y="273"/>
- <position x="332" y="273"/>
- </connection>
- </connectionPointIn>
- <connectionPointOut>
- <relPosition x="97" y="15"/>
- </connectionPointOut>
- <expression>Cnt3</expression>
- </inOutVariable>
- <inOutVariable localId="11" executionOrderId="0" height="30" width="91" negatedOut="false" negatedIn="false">
- <position x="378" y="348"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="9" formalParameter="OUT">
- <position x="378" y="363"/>
- <position x="332" y="363"/>
- </connection>
- </connectionPointIn>
- <connectionPointOut>
- <relPosition x="91" y="15"/>
- </connectionPointOut>
- <expression>Cnt4</expression>
- </inOutVariable>
- <inOutVariable localId="15" executionOrderId="0" height="30" width="88" negatedOut="false" negatedIn="false">
- <position x="381" y="438"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="14" formalParameter="Out">
- <position x="381" y="453"/>
- <position x="334" y="453"/>
- </connection>
- </connectionPointIn>
- <connectionPointOut>
- <relPosition x="88" y="15"/>
- </connectionPointOut>
- <expression>Cnt5</expression>
- </inOutVariable>
- </FBD>
- </body>
- </pou>
- <pou name="CounterST" pouType="functionBlock">
- <interface>
- <inputVars>
- <variable name="Reset">
- <type>
- <BOOL/>
- </type>
- </variable>
- </inputVars>
- <localVars>
- <variable name="Cnt">
- <type>
- <INT/>
- </type>
- </variable>
- </localVars>
- <outputVars>
- <variable name="OUT">
- <type>
- <INT/>
- </type>
- </variable>
- </outputVars>
- <externalVars constant="true">
- <variable name="ResetCounterValue">
- <type>
- <INT/>
- </type>
- </variable>
- </externalVars>
- </interface>
- <body>
- <ST>
- <xhtml:p><![CDATA[IF Reset THEN
- Cnt := ResetCounterValue;
-ELSE
- Cnt := Cnt + 1;
-END_IF;
-
-Out := Cnt;]]></xhtml:p>
- </ST>
- </body>
- </pou>
- <pou name="CounterFBD" pouType="functionBlock">
- <interface>
- <inputVars>
- <variable name="Reset">
- <type>
- <BOOL/>
- </type>
- </variable>
- </inputVars>
- <outputVars>
- <variable name="OUT">
- <type>
- <INT/>
- </type>
- </variable>
- </outputVars>
- <localVars>
- <variable name="Cnt">
- <type>
- <INT/>
- </type>
- </variable>
- </localVars>
- <externalVars constant="true">
- <variable name="ResetCounterValue">
- <type>
- <INT/>
- </type>
- </variable>
- </externalVars>
- </interface>
- <body>
- <FBD>
- <inVariable localId="1" executionOrderId="0" height="30" width="61" negated="false">
- <position x="321" y="58"/>
- <connectionPointOut>
- <relPosition x="61" y="15"/>
- </connectionPointOut>
- <expression>Reset</expression>
- </inVariable>
- <outVariable localId="2" executionOrderId="0" height="30" width="39" negated="false">
- <position x="675" y="137"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="3">
- <position x="675" y="152"/>
- <position x="589" y="152"/>
- </connection>
- </connectionPointIn>
- <expression>OUT</expression>
- </outVariable>
- <inOutVariable localId="3" executionOrderId="0" height="30" width="37" negatedOut="false" negatedIn="false">
- <position x="557" y="137"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="7" formalParameter="OUT">
- <position x="557" y="152"/>
- <position x="527" y="152"/>
- <position x="527" y="130"/>
- <position x="517" y="130"/>
- </connection>
- </connectionPointIn>
- <connectionPointOut>
- <relPosition x="37" y="15"/>
- </connectionPointOut>
- <expression>Cnt</expression>
- </inOutVariable>
- <block localId="4" typeName="ADD" executionOrderId="0" height="80" width="69">
- <position x="328" y="115"/>
- <inputVariables>
- <variable formalParameter="IN1">
- <connectionPointIn>
- <relPosition x="0" y="35"/>
- <connection refLocalId="6">
- <position x="328" y="150"/>
- <position x="275" y="150"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="IN2">
- <connectionPointIn>
- <relPosition x="0" y="65"/>
- <connection refLocalId="3">
- <position x="328" y="180"/>
- <position x="317" y="180"/>
- <position x="317" y="213"/>
- <position x="604" y="213"/>
- <position x="604" y="152"/>
- <position x="594" y="152"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="69" y="35"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <inVariable localId="5" executionOrderId="0" height="30" width="163" negated="false">
- <position x="222" y="256"/>
- <connectionPointOut>
- <relPosition x="163" y="15"/>
- </connectionPointOut>
- <expression>ResetCounterValue</expression>
- </inVariable>
- <inVariable localId="6" executionOrderId="0" height="30" width="21" negated="false">
- <position x="254" y="135"/>
- <connectionPointOut>
- <relPosition x="21" y="15"/>
- </connectionPointOut>
- <expression>1</expression>
- </inVariable>
- <block localId="7" typeName="SEL" executionOrderId="0" height="80" width="69">
- <position x="448" y="100"/>
- <inputVariables>
- <variable formalParameter="G">
- <connectionPointIn>
- <relPosition x="0" y="30"/>
- <connection refLocalId="1">
- <position x="448" y="130"/>
- <position x="415" y="130"/>
- <position x="415" y="73"/>
- <position x="382" y="73"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="IN0">
- <connectionPointIn>
- <relPosition x="0" y="50"/>
- <connection refLocalId="4" formalParameter="OUT">
- <position x="448" y="150"/>
- <position x="397" y="150"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="IN1">
- <connectionPointIn>
- <relPosition x="0" y="70"/>
- <connection refLocalId="5">
- <position x="448" y="170"/>
- <position x="414" y="170"/>
- <position x="414" y="271"/>
- <position x="385" y="271"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="69" y="30"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- </FBD>
- </body>
- </pou>
- <pou name="CounterSFC" pouType="functionBlock">
- <interface>
- <inputVars>
- <variable name="Reset">
- <type>
- <BOOL/>
- </type>
- </variable>
- </inputVars>
- <outputVars>
- <variable name="OUT">
- <type>
- <INT/>
- </type>
- </variable>
- </outputVars>
- <localVars>
- <variable name="Cnt">
- <type>
- <INT/>
- </type>
- </variable>
- </localVars>
- <externalVars constant="true">
- <variable name="ResetCounterValue">
- <type>
- <INT/>
- </type>
- </variable>
- </externalVars>
- </interface>
- <actions/>
- <body>
- <SFC>
- <step localId="1" name="Start" initialStep="true" height="34" width="90">
- <position x="241" y="14"/>
- <connectionPointOut formalParameter="">
- <relPosition x="45" y="34"/>
- </connectionPointOut>
- </step>
- <selectionDivergence localId="2" height="1" width="431">
- <position x="70" y="86"/>
- <connectionPointIn>
- <relPosition x="216" y="0"/>
- <connection refLocalId="1">
- <position x="286" y="86"/>
- <position x="286" y="42"/>
- </connection>
- </connectionPointIn>
- <connectionPointOut formalParameter="">
- <relPosition x="0" y="1"/>
- </connectionPointOut>
- <connectionPointOut formalParameter="">
- <relPosition x="431" y="1"/>
- </connectionPointOut>
- </selectionDivergence>
- <transition localId="3" height="2" width="20">
- <position x="491" y="132"/>
- <connectionPointIn>
- <relPosition x="10" y="0"/>
- <connection refLocalId="2">
- <position x="501" y="132"/>
- <position x="501" y="87"/>
- </connection>
- </connectionPointIn>
- <connectionPointOut>
- <relPosition x="10" y="2"/>
- </connectionPointOut>
- <condition>
- <inline name="">
- <ST>
- <xhtml:p><![CDATA[Reset]]></xhtml:p>
- </ST>
- </inline>
- </condition>
- </transition>
- <transition localId="4" height="2" width="20" executionOrderId="0">
- <position x="60" y="135"/>
- <connectionPointIn>
- <relPosition x="10" y="0"/>
- <connection refLocalId="2">
- <position x="70" y="135"/>
- <position x="70" y="87"/>
- </connection>
- </connectionPointIn>
- <connectionPointOut>
- <relPosition x="10" y="2"/>
- </connectionPointOut>
- <condition>
- <inline name="">
- <ST>
- <xhtml:p><![CDATA[NOT Reset]]></xhtml:p>
- </ST>
- </inline>
- </condition>
- </transition>
- <step localId="5" name="ResetCounter" initialStep="false" height="30" width="134">
- <position x="434" y="190"/>
- <connectionPointIn>
- <relPosition x="67" y="0"/>
- <connection refLocalId="3">
- <position x="501" y="190"/>
- <position x="501" y="134"/>
- </connection>
- </connectionPointIn>
- <connectionPointOut formalParameter="">
- <relPosition x="67" y="30"/>
- </connectionPointOut>
- <connectionPointOutAction formalParameter="">
- <relPosition x="134" y="15"/>
- </connectionPointOutAction>
- </step>
- <actionBlock localId="6" height="63" width="254">
- <position x="641" y="190"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="5">
- <position x="641" y="205"/>
- <position x="568" y="205"/>
- </connection>
- </connectionPointIn>
- <action localId="0">
- <relPosition x="0" y="0"/>
- <inline>
- <ST>
- <xhtml:p><![CDATA[Cnt := ResetCounterValue;]]></xhtml:p>
- </ST>
- </inline>
- </action>
- <action localId="0">
- <relPosition x="0" y="0"/>
- <inline>
- <ST>
- <xhtml:p><![CDATA[OUT := Cnt;]]></xhtml:p>
- </ST>
- </inline>
- </action>
- </actionBlock>
- <step localId="7" name="Count" initialStep="false" height="30" width="85" executionOrderId="0">
- <position x="28" y="191"/>
- <connectionPointIn>
- <relPosition x="42" y="0"/>
- <connection refLocalId="4">
- <position x="70" y="191"/>
- <position x="70" y="137"/>
- </connection>
- </connectionPointIn>
- <connectionPointOut formalParameter="">
- <relPosition x="42" y="30"/>
- </connectionPointOut>
- <connectionPointOutAction formalParameter="">
- <relPosition x="85" y="15"/>
- </connectionPointOutAction>
- </step>
- <actionBlock localId="8" height="52" width="164" executionOrderId="0">
- <position x="154" y="191"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="7">
- <position x="154" y="206"/>
- <position x="113" y="206"/>
- </connection>
- </connectionPointIn>
- <action localId="0">
- <relPosition x="0" y="0"/>
- <inline>
- <ST>
- <xhtml:p><![CDATA[Cnt := Cnt + 1;]]></xhtml:p>
- </ST>
- </inline>
- </action>
- <action localId="0">
- <relPosition x="0" y="0"/>
- <inline>
- <ST>
- <xhtml:p><![CDATA[OUT := Cnt;]]></xhtml:p>
- </ST>
- </inline>
- </action>
- </actionBlock>
- <selectionConvergence localId="10" height="1" width="431">
- <position x="70" y="273"/>
- <connectionPointIn>
- <relPosition x="0" y="0"/>
- <connection refLocalId="13">
- <position x="70" y="273"/>
- <position x="70" y="244"/>
- </connection>
- </connectionPointIn>
- <connectionPointIn>
- <relPosition x="431" y="0"/>
- <connection refLocalId="14">
- <position x="501" y="273"/>
- <position x="501" y="250"/>
- </connection>
- </connectionPointIn>
- <connectionPointOut>
- <relPosition x="216" y="1"/>
- </connectionPointOut>
- </selectionConvergence>
- <jumpStep localId="12" targetName="Start" height="13" width="12">
- <position x="280" y="317"/>
- <connectionPointIn>
- <relPosition x="6" y="0"/>
- <connection refLocalId="10">
- <position x="286" y="317"/>
- <position x="286" y="274"/>
- </connection>
- </connectionPointIn>
- </jumpStep>
- <transition localId="13" height="2" width="20" executionOrderId="0">
- <position x="60" y="242"/>
- <connectionPointIn>
- <relPosition x="10" y="0"/>
- <connection refLocalId="7">
- <position x="70" y="242"/>
- <position x="70" y="215"/>
- </connection>
- </connectionPointIn>
- <connectionPointOut>
- <relPosition x="10" y="2"/>
- </connectionPointOut>
- <condition>
- <inline name="">
- <ST>
- <xhtml:p><![CDATA[Reset]]></xhtml:p>
- </ST>
- </inline>
- </condition>
- </transition>
- <transition localId="14" height="2" width="20" executionOrderId="0">
- <position x="491" y="248"/>
- <connectionPointIn>
- <relPosition x="10" y="0"/>
- <connection refLocalId="5">
- <position x="501" y="248"/>
- <position x="501" y="220"/>
- </connection>
- </connectionPointIn>
- <connectionPointOut>
- <relPosition x="10" y="2"/>
- </connectionPointOut>
- <condition>
- <inline name="">
- <ST>
- <xhtml:p><![CDATA[NOT Reset]]></xhtml:p>
- </ST>
- </inline>
- </condition>
- </transition>
- </SFC>
- </body>
- </pou>
- <pou name="CounterIL" pouType="functionBlock">
- <interface>
- <localVars>
- <variable name="Cnt">
- <type>
- <INT/>
- </type>
- </variable>
- </localVars>
- <inputVars>
- <variable name="Reset">
- <type>
- <BOOL/>
- </type>
- </variable>
- </inputVars>
- <outputVars>
- <variable name="OUT">
- <type>
- <INT/>
- </type>
- </variable>
- </outputVars>
- <externalVars constant="true">
- <variable name="ResetCounterValue">
- <type>
- <INT/>
- </type>
- </variable>
- </externalVars>
- </interface>
- <body>
- <IL>
- <xhtml:p><![CDATA[LD Reset
-JMPC ResetCnt
-
-(* increment counter *)
-LD Cnt
-ADD 1
-JMP QuitFb
-
-ResetCnt:
-(* reset counter *)
-LD ResetCounterValue
-
-QuitFb:
-(* save results *)
-ST Cnt
-ST Out
-]]></xhtml:p>
- </IL>
- </body>
- </pou>
- <pou name="CounterLD" pouType="functionBlock">
- <interface>
- <inputVars>
- <variable name="Reset">
- <type>
- <BOOL/>
- </type>
- </variable>
- </inputVars>
- <outputVars>
- <variable name="Out">
- <type>
- <INT/>
- </type>
- </variable>
- </outputVars>
- <localVars>
- <variable name="Cnt">
- <type>
- <INT/>
- </type>
- </variable>
- </localVars>
- <externalVars constant="true">
- <variable name="ResetCounterValue">
- <type>
- <INT/>
- </type>
- </variable>
- </externalVars>
- </interface>
- <body>
- <LD>
- <outVariable localId="2" executionOrderId="0" height="30" width="34" negated="false">
- <position x="527" y="87"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="3">
- <position x="527" y="102"/>
- <position x="443" y="102"/>
- </connection>
- </connectionPointIn>
- <expression>Out</expression>
- </outVariable>
- <inOutVariable localId="3" executionOrderId="0" height="30" width="34" negatedOut="false" negatedIn="false">
- <position x="409" y="87"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="7" formalParameter="OUT">
- <position x="409" y="102"/>
- <position x="367" y="102"/>
- </connection>
- </connectionPointIn>
- <connectionPointOut>
- <relPosition x="34" y="15"/>
- </connectionPointOut>
- <expression>Cnt</expression>
- </inOutVariable>
- <block localId="4" typeName="ADD" executionOrderId="0" height="80" width="67">
- <position x="180" y="87"/>
- <inputVariables>
- <variable formalParameter="IN1">
- <connectionPointIn>
- <relPosition x="0" y="35"/>
- <connection refLocalId="6">
- <position x="180" y="122"/>
- <position x="127" y="122"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="IN2">
- <connectionPointIn>
- <relPosition x="0" y="65"/>
- <connection refLocalId="3">
- <position x="180" y="152"/>
- <position x="169" y="152"/>
- <position x="169" y="185"/>
- <position x="453" y="185"/>
- <position x="453" y="102"/>
- <position x="443" y="102"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="67" y="35"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <inVariable localId="5" executionOrderId="0" height="30" width="158" negated="false">
- <position x="74" y="228"/>
- <connectionPointOut>
- <relPosition x="158" y="15"/>
- </connectionPointOut>
- <expression>ResetCounterValue</expression>
- </inVariable>
- <inVariable localId="6" executionOrderId="0" height="30" width="21" negated="false">
- <position x="106" y="107"/>
- <connectionPointOut>
- <relPosition x="21" y="15"/>
- </connectionPointOut>
- <expression>1</expression>
- </inVariable>
- <block localId="7" typeName="SEL" executionOrderId="0" height="80" width="67">
- <position x="300" y="72"/>
- <inputVariables>
- <variable formalParameter="G">
- <connectionPointIn>
- <relPosition x="0" y="30"/>
- <connection refLocalId="9">
- <position x="300" y="102"/>
- <position x="266" y="102"/>
- <position x="266" y="62"/>
- <position x="134" y="62"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="IN0">
- <connectionPointIn>
- <relPosition x="0" y="50"/>
- <connection refLocalId="4" formalParameter="OUT">
- <position x="300" y="122"/>
- <position x="247" y="122"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="IN1">
- <connectionPointIn>
- <relPosition x="0" y="70"/>
- <connection refLocalId="5">
- <position x="300" y="142"/>
- <position x="266" y="142"/>
- <position x="266" y="243"/>
- <position x="232" y="243"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="67" y="30"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <leftPowerRail localId="8" height="40" width="3">
- <position x="46" y="42"/>
- <connectionPointOut formalParameter="">
- <relPosition x="3" y="20"/>
- </connectionPointOut>
- </leftPowerRail>
- <contact localId="9" height="15" width="21" negated="false">
- <position x="113" y="54"/>
- <connectionPointIn>
- <relPosition x="0" y="8"/>
- <connection refLocalId="8">
- <position x="113" y="62"/>
- <position x="49" y="62"/>
- </connection>
- </connectionPointIn>
- <connectionPointOut>
- <relPosition x="21" y="8"/>
- </connectionPointOut>
- <variable>Reset</variable>
- </contact>
- </LD>
- </body>
- </pou>
- </pous>
- </types>
- <instances>
- <configurations>
- <configuration name="config">
- <resource name="resource1">
- <task name="plc_task" priority="1" interval="T#100ms">
- <pouInstance name="plc_task_instance" typeName="plc_prg"/>
- </task>
- </resource>
- <globalVars constant="true">
- <variable name="ResetCounterValue">
- <type>
- <INT/>
- </type>
- <initialValue>
- <simpleValue value="17"/>
- </initialValue>
- </variable>
- </globalVars>
- </configuration>
- </configurations>
- </instances>
-</project>
--- a/tests/python/beremiz.xml Thu Sep 16 09:40:36 2021 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<BeremizRoot URI_location="LOCAL://">
- <TargetType/>
- <Libraries Enable_Python_Library="true"/>
-</BeremizRoot>
--- a/tests/python/c_code@c_ext/baseconfnode.xml Thu Sep 16 09:40:36 2021 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<BaseParams Name="c_code" IEC_Channel="1"/>
--- a/tests/python/c_code@c_ext/cfile.xml Thu Sep 16 09:40:36 2021 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<CFile xmlns:xhtml="http://www.w3.org/1999/xhtml">
- <includes>
- <xhtml:p><![CDATA[
-]]></xhtml:p>
- </includes>
- <variables>
- <variable name="TestInput" type="SINT" initial="0"/>
- <variable name="TestOutput" type="SINT"/>
- </variables>
- <globals>
- <xhtml:p><![CDATA[
-volatile long Lock=0;
-volatile char PtoC=1,CtoP=2;
-
-extern long AtomicCompareExchange(long*,long, long);
-extern char *PLC_ID;
-
-int Simple_C_Call(int val){
- return val+1;
-}
-
-int Python_to_C_Call(char toC, char *fromC){
- /* Code called by python should never touch to
- variables modified by PLC thread directly
-
- AtomicCompareExchange comes from
- beremiz' runtime implementation */
-
- int res = 0;
- if(!AtomicCompareExchange((long*)&Lock, 0, 1)){
- PtoC=toC;
- *fromC=CtoP;
- AtomicCompareExchange((long*)&Lock, 1, 0);
- res=1;
- }
- printf("C code called by Python: toC %d fromC %d\n",toC,*fromC);
- printf("PLC_ID id %s\n",PLC_ID);
- return res;
-}
-
-int PLC_C_Call(char fromPLC, char *toPLC){
- /* PLC also have to be realy carefull not to
- conflict with asynchronous python access */
- if(!AtomicCompareExchange((long*)&Lock, 0, 1)){
- CtoP = fromPLC;
- *toPLC = PtoC;
- AtomicCompareExchange((long*)&Lock, 1, 0);
- return 1;
- }
- return 0;
-}
-]]></xhtml:p>
- </globals>
- <initFunction>
- <xhtml:p><![CDATA[
-]]></xhtml:p>
- </initFunction>
- <cleanUpFunction>
- <xhtml:p><![CDATA[
-]]></xhtml:p>
- </cleanUpFunction>
- <retrieveFunction>
- <xhtml:p><![CDATA[
-]]></xhtml:p>
- </retrieveFunction>
- <publishFunction>
- <xhtml:p><![CDATA[
-if(!AtomicCompareExchange((long*)&Lock, 0, 1)){
- TestInput = CtoP + PtoC + TestOutput;
- AtomicCompareExchange((long*)&Lock, 1, 0);
-}
-]]></xhtml:p>
- </publishFunction>
-</CFile>
--- a/tests/python/c_code@c_ext/confnode.xml Thu Sep 16 09:40:36 2021 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<CExtension CFLAGS="" LDFLAGS=""/>
--- a/tests/python/plc.xml Thu Sep 16 09:40:36 2021 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1644 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<project xmlns="http://www.plcopen.org/xml/tc6_0201" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xsi:schemaLocation="http://www.plcopen.org/xml/tc6_0201">
- <fileHeader companyName="" productName="Beremiz" productVersion="0.0" creationDateTime="2008-12-14T16:21:19" contentDescription="This example shows many features in Beremiz: 1. How to implement python extensions. 2. How to implement basic C extension. 3. How to use C code in IEC POUs. 4. How to call C functions from python code. 5. How to avoid race conditions between IEC, C and python code. 6. How to convert betweet different IEC types. "/>
- <contentHeader name="Beremiz Python Support Tests" modificationDateTime="2020-10-19T23:53:08">
- <coordinateInfo>
- <pageSize x="1024" y="1024"/>
- <fbd>
- <scaling x="5" y="5"/>
- </fbd>
- <ld>
- <scaling x="5" y="5"/>
- </ld>
- <sfc>
- <scaling x="5" y="5"/>
- </sfc>
- </coordinateInfo>
- </contentHeader>
- <types>
- <dataTypes>
- <dataType name="CPLX_TYPE">
- <baseType>
- <struct>
- <variable name="FIRSTBYTE">
- <type>
- <SINT/>
- </type>
- </variable>
- <variable name="SECONDBYTE">
- <type>
- <SINT/>
- </type>
- </variable>
- </struct>
- </baseType>
- </dataType>
- <dataType name="StateMachine">
- <baseType>
- <enum>
- <values>
- <value name="STANDBY"/>
- <value name="START"/>
- <value name="STOP"/>
- </values>
- </enum>
- </baseType>
- </dataType>
- <dataType name="datatype0">
- <baseType>
- <BOOL/>
- </baseType>
- </dataType>
- <dataType name="blups">
- <baseType>
- <array>
- <dimension lower="0" upper="31"/>
- <baseType>
- <derived name="CPLX_TYPE"/>
- </baseType>
- </array>
- </baseType>
- </dataType>
- </dataTypes>
- <pous>
- <pou name="main_pytest" pouType="program">
- <interface>
- <localVars>
- <variable name="mux1_sel">
- <type>
- <INT/>
- </type>
- <initialValue>
- <simpleValue value="3"/>
- </initialValue>
- <documentation>
- <xhtml:p><![CDATA[blah]]></xhtml:p>
- </documentation>
- </variable>
- <variable name="mux2_sel">
- <type>
- <INT/>
- </type>
- <initialValue>
- <simpleValue value="3"/>
- </initialValue>
- </variable>
- <variable name="pytest_var1">
- <type>
- <string/>
- </type>
- </variable>
- <variable name="fefvsd">
- <type>
- <derived name="datatype0"/>
- </type>
- </variable>
- <variable name="pytest_var2">
- <type>
- <BOOL/>
- </type>
- </variable>
- <variable name="py1">
- <type>
- <derived name="python_eval"/>
- </type>
- </variable>
- <variable name="Block1">
- <type>
- <derived name="python_eval"/>
- </type>
- </variable>
- <variable name="Block2">
- <type>
- <derived name="python_eval"/>
- </type>
- </variable>
- <variable name="Block3">
- <type>
- <derived name="python_eval"/>
- </type>
- </variable>
- <variable name="pytest_var3">
- <type>
- <BOOL/>
- </type>
- </variable>
- <variable name="FromC">
- <type>
- <SINT/>
- </type>
- </variable>
- <variable name="C_Pragma0">
- <type>
- <derived name="C_Pragma"/>
- </type>
- </variable>
- </localVars>
- <externalVars>
- <variable name="TestInput">
- <type>
- <SINT/>
- </type>
- </variable>
- <variable name="TestOutput">
- <type>
- <SINT/>
- </type>
- </variable>
- </externalVars>
- <localVars>
- <variable name="FromInput">
- <type>
- <SINT/>
- </type>
- </variable>
- <variable name="Test_BCD">
- <type>
- <WORD/>
- </type>
- <initialValue>
- <simpleValue value="151"/>
- </initialValue>
- </variable>
- <variable name="Test_BCD_WRONG">
- <type>
- <WORD/>
- </type>
- <initialValue>
- <simpleValue value="154"/>
- </initialValue>
- </variable>
- <variable name="Test_BCD_CONVERTED">
- <type>
- <BOOL/>
- </type>
- </variable>
- <variable name="Test_BCD_RESULT">
- <type>
- <UINT/>
- </type>
- </variable>
- <variable name="Test_BCD_WRONG_RESULT">
- <type>
- <UINT/>
- </type>
- </variable>
- <variable name="Test_DT">
- <type>
- <DT/>
- </type>
- <initialValue>
- <simpleValue value="DT#2013-02-23-22:35:46"/>
- </initialValue>
- </variable>
- <variable name="Test_TOD">
- <type>
- <TOD/>
- </type>
- </variable>
- <variable name="Test_TOD_STRING">
- <type>
- <string/>
- </type>
- </variable>
- <variable name="Test_Date">
- <type>
- <DATE/>
- </type>
- </variable>
- <variable name="Test_String">
- <type>
- <string/>
- </type>
- <initialValue>
- <simpleValue value="test"/>
- </initialValue>
- </variable>
- <variable name="Test_Bool">
- <type>
- <BOOL/>
- </type>
- </variable>
- </localVars>
- <externalVars>
- <variable name="Global_RS">
- <type>
- <derived name="RS"/>
- </type>
- </variable>
- <variable name="TUTU">
- <type>
- <INT/>
- </type>
- </variable>
- <variable name="TOTO">
- <type>
- <INT/>
- </type>
- </variable>
- <variable name="Test_Python_Var">
- <type>
- <INT/>
- </type>
- </variable>
- <variable name="Second_Python_Var">
- <type>
- <INT/>
- </type>
- </variable>
- <variable name="Grumpf">
- <type>
- <string/>
- </type>
- </variable>
- </externalVars>
- <localVars>
- <variable name="RTC0">
- <type>
- <derived name="RTC"/>
- </type>
- </variable>
- </localVars>
- <externalVars>
- <variable name="SomeVarName">
- <type>
- <DINT/>
- </type>
- </variable>
- </externalVars>
- </interface>
- <body>
- <FBD>
- <inVariable localId="4" height="30" width="160" executionOrderId="0" negated="false">
- <position x="295" y="450"/>
- <connectionPointOut>
- <relPosition x="160" y="15"/>
- </connectionPointOut>
- <expression>'666'</expression>
- </inVariable>
- <block localId="5" width="125" height="80" typeName="python_eval" instanceName="py1" executionOrderId="0">
- <position x="686" y="400"/>
- <inputVariables>
- <variable formalParameter="TRIG">
- <connectionPointIn>
- <relPosition x="0" y="35"/>
- <connection refLocalId="7" formalParameter="OUT">
- <position x="686" y="435"/>
- <position x="285" y="435"/>
- <position x="285" y="480"/>
- <position x="250" y="480"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="CODE">
- <connectionPointIn>
- <relPosition x="0" y="65"/>
- <connection refLocalId="4">
- <position x="686" y="465"/>
- <position x="455" y="465"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="ACK">
- <connectionPointOut>
- <relPosition x="125" y="35"/>
- </connectionPointOut>
- </variable>
- <variable formalParameter="RESULT">
- <connectionPointOut>
- <relPosition x="125" y="65"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <block localId="7" width="70" height="45" typeName="NOT" executionOrderId="0">
- <position x="180" y="450"/>
- <inputVariables>
- <variable formalParameter="IN">
- <connectionPointIn>
- <relPosition x="0" y="30"/>
- <connection refLocalId="3">
- <position x="180" y="480"/>
- <position x="155" y="480"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="70" y="30"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <inOutVariable localId="3" height="30" width="120" executionOrderId="0" negatedOut="false" negatedIn="false">
- <position x="35" y="465"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="7" formalParameter="OUT">
- <position x="35" y="480"/>
- <position x="25" y="480"/>
- <position x="25" y="440"/>
- <position x="270" y="440"/>
- <position x="270" y="480"/>
- <position x="250" y="480"/>
- </connection>
- </connectionPointIn>
- <connectionPointOut>
- <relPosition x="120" y="15"/>
- </connectionPointOut>
- <expression>pytest_var2</expression>
- </inOutVariable>
- <block localId="8" width="125" height="80" typeName="python_eval" instanceName="Block1" executionOrderId="0">
- <position x="686" y="545"/>
- <inputVariables>
- <variable formalParameter="TRIG">
- <connectionPointIn>
- <relPosition x="0" y="35"/>
- <connection refLocalId="7" formalParameter="OUT">
- <position x="686" y="580"/>
- <position x="285" y="580"/>
- <position x="285" y="480"/>
- <position x="250" y="480"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="CODE">
- <connectionPointIn>
- <relPosition x="0" y="65"/>
- <connection refLocalId="9">
- <position x="686" y="610"/>
- <position x="665" y="610"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="ACK">
- <connectionPointOut>
- <relPosition x="125" y="35"/>
- </connectionPointOut>
- </variable>
- <variable formalParameter="RESULT">
- <connectionPointOut>
- <relPosition x="125" y="65"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <inVariable localId="9" height="30" width="370" executionOrderId="0" negated="false">
- <position x="295" y="595"/>
- <connectionPointOut>
- <relPosition x="370" y="15"/>
- </connectionPointOut>
- <expression>'sys.stdout.write("FBID :"+str(FBID)+"\n")'</expression>
- </inVariable>
- <inVariable localId="11" height="30" width="290" executionOrderId="0" negated="false">
- <position x="295" y="735"/>
- <connectionPointOut>
- <relPosition x="290" y="15"/>
- </connectionPointOut>
- <expression>'PLCBinary.Simple_C_Call(5678)'</expression>
- </inVariable>
- <block localId="12" width="125" height="80" typeName="python_eval" instanceName="Block2" executionOrderId="0">
- <position x="686" y="687"/>
- <inputVariables>
- <variable formalParameter="TRIG">
- <connectionPointIn>
- <relPosition x="0" y="33"/>
- <connection refLocalId="7" formalParameter="OUT">
- <position x="686" y="720"/>
- <position x="285" y="720"/>
- <position x="285" y="480"/>
- <position x="250" y="480"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="CODE">
- <connectionPointIn>
- <relPosition x="0" y="63"/>
- <connection refLocalId="11">
- <position x="686" y="750"/>
- <position x="585" y="750"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="ACK">
- <connectionPointOut>
- <relPosition x="125" y="33"/>
- </connectionPointOut>
- </variable>
- <variable formalParameter="RESULT">
- <connectionPointOut>
- <relPosition x="125" y="63"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <inVariable localId="14" height="30" width="290" executionOrderId="0" negated="false">
- <position x="290" y="885"/>
- <connectionPointOut>
- <relPosition x="290" y="15"/>
- </connectionPointOut>
- <expression>'MyPythonFunc(42)'</expression>
- </inVariable>
- <block localId="15" width="125" height="80" typeName="python_eval" instanceName="Block3" executionOrderId="0">
- <position x="686" y="837"/>
- <inputVariables>
- <variable formalParameter="TRIG">
- <connectionPointIn>
- <relPosition x="0" y="33"/>
- <connection refLocalId="7" formalParameter="OUT">
- <position x="686" y="870"/>
- <position x="285" y="870"/>
- <position x="285" y="480"/>
- <position x="250" y="480"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="CODE">
- <connectionPointIn>
- <relPosition x="0" y="63"/>
- <connection refLocalId="14">
- <position x="686" y="900"/>
- <position x="580" y="900"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="ACK">
- <connectionPointOut>
- <relPosition x="125" y="33"/>
- </connectionPointOut>
- </variable>
- <variable formalParameter="RESULT">
- <connectionPointOut>
- <relPosition x="125" y="63"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <comment localId="16" height="90" width="680">
- <position x="35" y="275"/>
- <content>
- <xhtml:p><![CDATA[This part of the example test that, despite of 2T period clock stimulating TRIG pin of pyth_eval blocks, blocks keep executing one after the other, in respect of execution order.]]></xhtml:p>
- </content>
- </comment>
- <block localId="17" width="80" height="120" typeName="MUX" executionOrderId="0">
- <position x="1101" y="790"/>
- <inputVariables>
- <variable formalParameter="K">
- <connectionPointIn>
- <relPosition x="0" y="30"/>
- <connection refLocalId="18">
- <position x="1101" y="820"/>
- <position x="1076" y="820"/>
- <position x="1076" y="810"/>
- <position x="1060" y="810"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="IN0">
- <connectionPointIn>
- <relPosition x="0" y="50"/>
- <connection refLocalId="5" formalParameter="RESULT">
- <position x="1101" y="840"/>
- <position x="941" y="840"/>
- <position x="941" y="465"/>
- <position x="811" y="465"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="IN1">
- <connectionPointIn>
- <relPosition x="0" y="70"/>
- <connection refLocalId="8" formalParameter="RESULT">
- <position x="1101" y="860"/>
- <position x="926" y="860"/>
- <position x="926" y="610"/>
- <position x="811" y="610"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="IN2">
- <connectionPointIn>
- <relPosition x="0" y="90"/>
- <connection refLocalId="12" formalParameter="RESULT">
- <position x="1101" y="880"/>
- <position x="911" y="880"/>
- <position x="911" y="750"/>
- <position x="811" y="750"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="IN3">
- <connectionPointIn>
- <relPosition x="0" y="110"/>
- <connection refLocalId="15" formalParameter="RESULT">
- <position x="1101" y="900"/>
- <position x="811" y="900"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="80" y="30"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <outVariable localId="19" height="35" width="125" executionOrderId="0" negated="false">
- <position x="1271" y="805"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="17" formalParameter="OUT">
- <position x="1271" y="820"/>
- <position x="1181" y="820"/>
- </connection>
- </connectionPointIn>
- <expression>pytest_var1</expression>
- </outVariable>
- <block localId="21" width="80" height="120" typeName="MUX" executionOrderId="0">
- <position x="1106" y="385"/>
- <inputVariables>
- <variable formalParameter="K">
- <connectionPointIn>
- <relPosition x="0" y="30"/>
- <connection refLocalId="22">
- <position x="1106" y="415"/>
- <position x="1076" y="415"/>
- <position x="1076" y="405"/>
- <position x="1055" y="405"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="IN0">
- <connectionPointIn>
- <relPosition x="0" y="50"/>
- <connection refLocalId="5" formalParameter="ACK">
- <position x="1106" y="435"/>
- <position x="811" y="435"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="IN1">
- <connectionPointIn>
- <relPosition x="0" y="70"/>
- <connection refLocalId="8" formalParameter="ACK">
- <position x="1106" y="455"/>
- <position x="841" y="455"/>
- <position x="841" y="580"/>
- <position x="811" y="580"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="IN2">
- <connectionPointIn>
- <relPosition x="0" y="90"/>
- <connection refLocalId="12" formalParameter="ACK">
- <position x="1106" y="475"/>
- <position x="856" y="475"/>
- <position x="856" y="720"/>
- <position x="811" y="720"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="IN3">
- <connectionPointIn>
- <relPosition x="0" y="110"/>
- <connection refLocalId="15" formalParameter="ACK">
- <position x="1106" y="495"/>
- <position x="871" y="495"/>
- <position x="871" y="870"/>
- <position x="811" y="870"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="80" y="30"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <inVariable localId="22" height="30" width="74" executionOrderId="0" negated="false">
- <position x="981" y="390"/>
- <connectionPointOut>
- <relPosition x="74" y="15"/>
- </connectionPointOut>
- <expression>mux1_sel</expression>
- </inVariable>
- <outVariable localId="23" height="35" width="125" executionOrderId="0" negated="false">
- <position x="1271" y="400"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="21" formalParameter="OUT">
- <position x="1271" y="415"/>
- <position x="1186" y="415"/>
- </connection>
- </connectionPointIn>
- <expression>pytest_var3</expression>
- </outVariable>
- <outVariable localId="25" height="30" width="60" executionOrderId="0" negated="false">
- <position x="320" y="1075"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="26" formalParameter="OUT">
- <position x="320" y="1090"/>
- <position x="265" y="1090"/>
- </connection>
- </connectionPointIn>
- <expression>FromC</expression>
- </outVariable>
- <inVariable localId="1" height="30" width="30" executionOrderId="0" negated="false">
- <position x="105" y="1075"/>
- <connectionPointOut>
- <relPosition x="30" y="15"/>
- </connectionPointOut>
- <expression>23</expression>
- </inVariable>
- <block localId="26" width="80" height="45" typeName="C_Pragma" instanceName="C_Pragma0" executionOrderId="0">
- <position x="185" y="1060"/>
- <inputVariables>
- <variable formalParameter="IN">
- <connectionPointIn>
- <relPosition x="0" y="30"/>
- <connection refLocalId="1">
- <position x="185" y="1090"/>
- <position x="135" y="1090"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="80" y="30"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <inVariable localId="27" height="30" width="90" executionOrderId="0" negated="false">
- <position x="100" y="1190"/>
- <connectionPointOut>
- <relPosition x="90" y="15"/>
- </connectionPointOut>
- <expression>TestInput</expression>
- </inVariable>
- <outVariable localId="28" height="30" width="105" executionOrderId="0" negated="false">
- <position x="195" y="1125"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="2">
- <position x="195" y="1140"/>
- <position x="140" y="1140"/>
- </connection>
- </connectionPointIn>
- <expression>TestOutput</expression>
- </outVariable>
- <outVariable localId="29" height="30" width="85" executionOrderId="0" negated="false">
- <position x="215" y="1190"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="27">
- <position x="215" y="1205"/>
- <position x="190" y="1205"/>
- </connection>
- </connectionPointIn>
- <expression>FromInput</expression>
- </outVariable>
- <inVariable localId="2" height="30" width="30" executionOrderId="0" negated="false">
- <position x="110" y="1125"/>
- <connectionPointOut>
- <relPosition x="30" y="15"/>
- </connectionPointOut>
- <expression>10</expression>
- </inVariable>
- <comment localId="30" height="105" width="465">
- <position x="50" y="925"/>
- <content>
- <xhtml:p><![CDATA[You will be ready to use beremiz with C and Python when you will understand why "FromInput" is equal to 75.
-Happy hacking! ]]></xhtml:p>
- </content>
- </comment>
- <comment localId="31" height="90" width="345">
- <position x="295" y="485"/>
- <content>
- <xhtml:p><![CDATA[Sleep here is bad. It blocks other py_eval instances. Whith a wxGlade GUI, GUI freeze for a second.]]></xhtml:p>
- </content>
- </comment>
- <comment localId="6" height="80" width="345">
- <position x="295" y="630"/>
- <content>
- <xhtml:p><![CDATA[Prints FBID to stdout of PLC runtime. FBID is a unique reference to py_eval instance.]]></xhtml:p>
- </content>
- </comment>
- <comment localId="10" height="85" width="345">
- <position x="295" y="770"/>
- <content>
- <xhtml:p><![CDATA[Simple_C_Call is declared in C_File "1.x:c_code". See python ctypes manual for details on typing.]]></xhtml:p>
- </content>
- </comment>
- <comment localId="32" height="145" width="235">
- <position x="25" y="505"/>
- <content>
- <xhtml:p><![CDATA[Fast clock, at least faster that sleep(1). See what happens when python takes time to answer : PLC continues.]]></xhtml:p>
- </content>
- </comment>
- <outVariable localId="33" height="30" width="133" executionOrderId="0" negated="false">
- <position x="580" y="1564"/>
- <connectionPointIn>
- <relPosition x="0" y="16"/>
- <connection refLocalId="35" formalParameter="OUT">
- <position x="580" y="1580"/>
- <position x="371" y="1580"/>
- </connection>
- </connectionPointIn>
- <expression>Test_BCD_RESULT</expression>
- </outVariable>
- <inVariable localId="34" height="30" width="75" executionOrderId="0" negated="false">
- <position x="60" y="1564"/>
- <connectionPointOut>
- <relPosition x="75" y="16"/>
- </connectionPointOut>
- <expression>Test_BCD</expression>
- </inVariable>
- <block localId="35" width="106" height="60" typeName="BCD_TO_UINT" executionOrderId="0">
- <position x="265" y="1539"/>
- <inputVariables>
- <variable formalParameter="IN">
- <connectionPointIn>
- <relPosition x="0" y="41"/>
- <connection refLocalId="34">
- <position x="265" y="1580"/>
- <position x="135" y="1580"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="106" y="41"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <inVariable localId="36" height="30" width="66" executionOrderId="0" negated="false">
- <position x="60" y="1774"/>
- <connectionPointOut>
- <relPosition x="66" y="16"/>
- </connectionPointOut>
- <expression>Test_DT</expression>
- </inVariable>
- <block localId="37" width="255" height="45" typeName="DATE_AND_TIME_TO_TIME_OF_DAY" executionOrderId="0">
- <position x="265" y="1759"/>
- <inputVariables>
- <variable formalParameter="IN">
- <connectionPointIn>
- <relPosition x="0" y="31"/>
- <connection refLocalId="36">
- <position x="265" y="1790"/>
- <position x="125" y="1790"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="255" y="31"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <block localId="38" width="195" height="45" typeName="DATE_AND_TIME_TO_DATE" executionOrderId="0">
- <position x="265" y="1834"/>
- <inputVariables>
- <variable formalParameter="IN">
- <connectionPointIn>
- <relPosition x="0" y="31"/>
- <connection refLocalId="36">
- <position x="265" y="1865"/>
- <position x="242" y="1865"/>
- <position x="242" y="1790"/>
- <position x="125" y="1790"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="195" y="31"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <outVariable localId="40" height="30" width="82" executionOrderId="0" negated="false">
- <position x="580" y="1849"/>
- <connectionPointIn>
- <relPosition x="0" y="16"/>
- <connection refLocalId="38" formalParameter="OUT">
- <position x="580" y="1865"/>
- <position x="460" y="1865"/>
- </connection>
- </connectionPointIn>
- <expression>Test_Date</expression>
- </outVariable>
- <outVariable localId="42" height="30" width="98" executionOrderId="0" negated="false">
- <position x="465" y="1944"/>
- <connectionPointIn>
- <relPosition x="0" y="16"/>
- <connection refLocalId="46" formalParameter="OUT">
- <position x="465" y="1960"/>
- <position x="395" y="1960"/>
- </connection>
- </connectionPointIn>
- <expression>Test_String</expression>
- </outVariable>
- <outVariable localId="43" height="30" width="82" executionOrderId="0" negated="false">
- <position x="465" y="2014"/>
- <connectionPointIn>
- <relPosition x="0" y="16"/>
- <connection refLocalId="44" formalParameter="OUT">
- <position x="465" y="2030"/>
- <position x="400" y="2030"/>
- </connection>
- </connectionPointIn>
- <expression>Test_Bool</expression>
- </outVariable>
- <block localId="44" width="135" height="45" typeName="STRING_TO_BOOL" executionOrderId="0">
- <position x="265" y="1999"/>
- <inputVariables>
- <variable formalParameter="IN">
- <connectionPointIn>
- <relPosition x="0" y="31"/>
- <connection refLocalId="45">
- <position x="265" y="2030"/>
- <position x="115" y="2030"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="135" y="31"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <inVariable localId="45" height="30" width="58" executionOrderId="0" negated="false">
- <position x="60" y="2014"/>
- <connectionPointOut>
- <relPosition x="58" y="16"/>
- </connectionPointOut>
- <expression>'True'</expression>
- </inVariable>
- <block localId="46" width="130" height="45" typeName="INT_TO_STRING" executionOrderId="0">
- <position x="265" y="1929"/>
- <inputVariables>
- <variable formalParameter="IN">
- <connectionPointIn>
- <relPosition x="0" y="31"/>
- <connection refLocalId="58">
- <position x="265" y="1960"/>
- <position x="205" y="1960"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="130" y="31"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <inVariable localId="50" height="30" width="106" executionOrderId="0" negated="false">
- <position x="75" y="2275"/>
- <connectionPointOut>
- <relPosition x="106" y="15"/>
- </connectionPointOut>
- <expression>Global_RS.Q1</expression>
- </inVariable>
- <block localId="51" width="70" height="85" typeName="AND" executionOrderId="0">
- <position x="240" y="2255"/>
- <inputVariables>
- <variable formalParameter="IN1" negated="true">
- <connectionPointIn>
- <relPosition x="0" y="35"/>
- <connection refLocalId="50">
- <position x="240" y="2290"/>
- <position x="180" y="2290"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="IN2">
- <connectionPointIn>
- <relPosition x="0" y="70"/>
- <connection refLocalId="52">
- <position x="240" y="2325"/>
- <position x="180" y="2325"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="70" y="35"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <inVariable localId="52" height="30" width="105" executionOrderId="0" negated="false">
- <position x="75" y="2310"/>
- <connectionPointOut>
- <relPosition x="105" y="15"/>
- </connectionPointOut>
- <expression>BOOL#TRUE</expression>
- </inVariable>
- <outVariable localId="13" height="30" width="105" executionOrderId="0" negated="false">
- <position x="385" y="2275"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="51" formalParameter="OUT">
- <position x="385" y="2290"/>
- <position x="310" y="2290"/>
- </connection>
- </connectionPointIn>
- <expression>Global_RS.S</expression>
- </outVariable>
- <outVariable localId="20" height="30" width="106" executionOrderId="0" negated="false">
- <position x="385" y="2390"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="41" formalParameter="OUT">
- <position x="385" y="2405"/>
- <position x="310" y="2405"/>
- </connection>
- </connectionPointIn>
- <expression>Global_RS.R1</expression>
- </outVariable>
- <inVariable localId="24" height="30" width="106" executionOrderId="0" negated="false">
- <position x="75" y="2390"/>
- <connectionPointOut>
- <relPosition x="106" y="15"/>
- </connectionPointOut>
- <expression>Global_RS.Q1</expression>
- </inVariable>
- <block localId="41" width="70" height="85" typeName="OR" executionOrderId="0">
- <position x="240" y="2370"/>
- <inputVariables>
- <variable formalParameter="IN1">
- <connectionPointIn>
- <relPosition x="0" y="35"/>
- <connection refLocalId="24">
- <position x="240" y="2405"/>
- <position x="180" y="2405"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="IN2">
- <connectionPointIn>
- <relPosition x="0" y="70"/>
- <connection refLocalId="48">
- <position x="240" y="2440"/>
- <position x="180" y="2440"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="70" y="35"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <inVariable localId="48" height="30" width="105" executionOrderId="0" negated="false">
- <position x="75" y="2425"/>
- <connectionPointOut>
- <relPosition x="105" y="15"/>
- </connectionPointOut>
- <expression>BOOL#FALSE</expression>
- </inVariable>
- <outVariable localId="54" height="30" width="135" executionOrderId="0" negated="false">
- <position x="930" y="1774"/>
- <connectionPointIn>
- <relPosition x="0" y="16"/>
- <connection refLocalId="55" formalParameter="OUT">
- <position x="930" y="1790"/>
- <position x="855" y="1790"/>
- </connection>
- </connectionPointIn>
- <expression>Test_TOD_STRING</expression>
- </outVariable>
- <block localId="55" width="125" height="45" typeName="TOD_TO_STRING" executionOrderId="0">
- <position x="730" y="1759"/>
- <inputVariables>
- <variable formalParameter="IN">
- <connectionPointIn>
- <relPosition x="0" y="31"/>
- <connection refLocalId="39">
- <position x="730" y="1790"/>
- <position x="655" y="1790"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="125" y="31"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <inOutVariable localId="39" height="30" width="75" executionOrderId="0" negatedOut="false" negatedIn="false">
- <position x="580" y="1774"/>
- <connectionPointIn>
- <relPosition x="0" y="16"/>
- <connection refLocalId="37" formalParameter="OUT">
- <position x="580" y="1790"/>
- <position x="520" y="1790"/>
- </connection>
- </connectionPointIn>
- <connectionPointOut>
- <relPosition x="75" y="16"/>
- </connectionPointOut>
- <expression>Test_TOD</expression>
- </inOutVariable>
- <inVariable localId="49" height="30" width="30" executionOrderId="0" negated="false">
- <position x="160" y="2510"/>
- <connectionPointOut>
- <relPosition x="30" y="15"/>
- </connectionPointOut>
- <expression>42</expression>
- </inVariable>
- <outVariable localId="57" height="30" width="50" executionOrderId="0" negated="false">
- <position x="240" y="2510"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="49">
- <position x="240" y="2525"/>
- <position x="190" y="2525"/>
- </connection>
- </connectionPointIn>
- <expression>TOTO</expression>
- </outVariable>
- <outVariable localId="56" height="30" width="50" executionOrderId="0" negated="false">
- <position x="240" y="2550"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="49">
- <position x="240" y="2565"/>
- <position x="215" y="2565"/>
- <position x="215" y="2525"/>
- <position x="190" y="2525"/>
- </connection>
- </connectionPointIn>
- <expression>TUTU</expression>
- </outVariable>
- <inVariable localId="58" height="30" width="146" executionOrderId="0" negated="false">
- <position x="60" y="1944"/>
- <connectionPointOut>
- <relPosition x="146" y="16"/>
- </connectionPointOut>
- <expression>Second_Python_Var</expression>
- </inVariable>
- <inVariable localId="59" height="30" width="30" executionOrderId="0" negated="false">
- <position x="100" y="1385"/>
- <connectionPointOut>
- <relPosition x="30" y="15"/>
- </connectionPointOut>
- <expression>1</expression>
- </inVariable>
- <block localId="61" typeName="function0" executionOrderId="0" height="45" width="111">
- <position x="760" y="1170"/>
- <inputVariables>
- <variable formalParameter="LocalVar0">
- <connectionPointIn>
- <relPosition x="0" y="30"/>
- <connection refLocalId="62">
- <position x="760" y="1200"/>
- <position x="723" y="1200"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="111" y="30"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <inVariable localId="62" executionOrderId="0" height="30" width="58" negated="false">
- <position x="665" y="1185"/>
- <connectionPointOut>
- <relPosition x="58" y="15"/>
- </connectionPointOut>
- <expression>fefvsd</expression>
- </inVariable>
- <outVariable localId="63" executionOrderId="0" height="30" width="58" negated="false">
- <position x="905" y="1185"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="61" formalParameter="OUT">
- <position x="905" y="1200"/>
- <position x="871" y="1200"/>
- </connection>
- </connectionPointIn>
- <expression>fefvsd</expression>
- </outVariable>
- <comment localId="53" height="80" width="420">
- <position x="75" y="2160"/>
- <content>
- <xhtml:p><![CDATA[Shows global variables access from resource configuration (res_pytest) and from project's configuration.]]></xhtml:p>
- </content>
- </comment>
- <inVariable localId="18" height="30" width="74" executionOrderId="0" negated="false">
- <position x="986" y="795"/>
- <connectionPointOut>
- <relPosition x="74" y="15"/>
- </connectionPointOut>
- <expression>mux2_sel</expression>
- </inVariable>
- <comment localId="60" height="45" width="930">
- <position x="60" y="1480"/>
- <content>
- <xhtml:p><![CDATA[Here is shown how to convert values between different types (BCD, DT, TOD, STRING and others) using standard functions.]]></xhtml:p>
- </content>
- </comment>
- <comment localId="64" height="55" width="300">
- <position x="665" y="1095"/>
- <content>
- <xhtml:p><![CDATA[Example of usage of user-defined function.]]></xhtml:p>
- </content>
- </comment>
- <comment localId="65" height="45" width="410">
- <position x="55" y="1315"/>
- <content>
- <xhtml:p><![CDATA[Shows access variable defined in python extension. ]]></xhtml:p>
- </content>
- </comment>
- <inVariable localId="66" height="30" width="137" executionOrderId="0" negated="false">
- <position x="60" y="1685"/>
- <connectionPointOut>
- <relPosition x="137" y="15"/>
- </connectionPointOut>
- <expression>Test_BCD_WRONG</expression>
- </inVariable>
- <block localId="67" width="106" height="100" typeName="BCD_TO_UINT" executionOrderId="0">
- <position x="265" y="1620"/>
- <inputVariables>
- <variable formalParameter="EN">
- <connectionPointIn>
- <relPosition x="0" y="40"/>
- </connectionPointIn>
- </variable>
- <variable formalParameter="IN">
- <connectionPointIn>
- <relPosition x="0" y="80"/>
- <connection refLocalId="66">
- <position x="265" y="1700"/>
- <position x="255" y="1700"/>
- <position x="255" y="1700"/>
- <position x="345" y="1700"/>
- <position x="345" y="1700"/>
- <position x="197" y="1700"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="ENO">
- <connectionPointOut>
- <relPosition x="106" y="40"/>
- </connectionPointOut>
- </variable>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="106" y="80"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <outVariable localId="68" height="30" width="196" executionOrderId="0" negated="false">
- <position x="580" y="1685"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="67" formalParameter="OUT">
- <position x="580" y="1700"/>
- <position x="371" y="1700"/>
- </connection>
- </connectionPointIn>
- <expression>Test_BCD_WRONG_RESULT</expression>
- </outVariable>
- <comment localId="69" height="165" width="375">
- <position x="795" y="1590"/>
- <content>
- <xhtml:p><![CDATA[Incorrect BCD number is not converted to UINT.
-
-151 (16#97) is good BCD number , but
-154 (16#9A) is not.
-
-Try this out and look at value of Test_BCD_CONVERTED variable.
-
-
-]]></xhtml:p>
- </content>
- </comment>
- <outVariable localId="70" height="30" width="185" executionOrderId="0" negated="false">
- <position x="580" y="1645"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="67" formalParameter="ENO">
- <position x="580" y="1660"/>
- <position x="370" y="1660"/>
- </connection>
- </connectionPointIn>
- <expression>Test_BCD_CONVERTED</expression>
- </outVariable>
- <comment localId="71" height="215" width="680">
- <position x="35" y="30"/>
- <content>
- <xhtml:p><![CDATA[This example shows many features in Beremiz:
-
- 1. How to implement python extensions.
- 2. How to implement basic C extension.
- 3. How to use C code in IEC POUs.
- 4. How to call C functions from python code.
- 5. How to avoid race conditions between IEC, C and python code.
- 6. How to convert betweet different IEC types.
-]]></xhtml:p>
- </content>
- </comment>
- <outVariable localId="72" executionOrderId="0" height="30" width="60" negated="false">
- <position x="1065" y="1970"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="76" formalParameter="OUT">
- <position x="1065" y="1985"/>
- <position x="1025" y="1985"/>
- <position x="1025" y="1995"/>
- <position x="985" y="1995"/>
- </connection>
- </connectionPointIn>
- <expression>Grumpf</expression>
- </outVariable>
- <inVariable localId="73" executionOrderId="0" height="30" width="85" negated="false">
- <position x="625" y="1940"/>
- <connectionPointOut>
- <relPosition x="85" y="15"/>
- </connectionPointOut>
- <expression>BOOL#TRUE</expression>
- </inVariable>
- <inVariable localId="74" executionOrderId="0" height="30" width="70" negated="false">
- <position x="625" y="1975"/>
- <connectionPointOut>
- <relPosition x="70" y="15"/>
- </connectionPointOut>
- <expression>Test_DT</expression>
- </inVariable>
- <block localId="75" typeName="RTC" instanceName="RTC0" executionOrderId="0" height="90" width="65">
- <position x="760" y="1925"/>
- <inputVariables>
- <variable formalParameter="IN">
- <connectionPointIn>
- <relPosition x="0" y="35"/>
- <connection refLocalId="73">
- <position x="760" y="1960"/>
- <position x="735" y="1960"/>
- <position x="735" y="1955"/>
- <position x="710" y="1955"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="PDT">
- <connectionPointIn>
- <relPosition x="0" y="70"/>
- <connection refLocalId="74">
- <position x="760" y="1995"/>
- <position x="727" y="1995"/>
- <position x="727" y="1990"/>
- <position x="695" y="1990"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="Q">
- <connectionPointOut>
- <relPosition x="65" y="35"/>
- </connectionPointOut>
- </variable>
- <variable formalParameter="CDT">
- <connectionPointOut>
- <relPosition x="65" y="70"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <block localId="76" typeName="DT_TO_STRING" executionOrderId="0" height="40" width="110">
- <position x="875" y="1965"/>
- <inputVariables>
- <variable formalParameter="IN">
- <connectionPointIn>
- <relPosition x="0" y="30"/>
- <connection refLocalId="75" formalParameter="CDT">
- <position x="875" y="1995"/>
- <position x="825" y="1995"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="110" y="30"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <block localId="77" typeName="ADD" executionOrderId="0" height="60" width="65">
- <position x="170" y="1370"/>
- <inputVariables>
- <variable formalParameter="IN1">
- <connectionPointIn>
- <relPosition x="0" y="30"/>
- <connection refLocalId="59">
- <position x="170" y="1400"/>
- <position x="130" y="1400"/>
- </connection>
- </connectionPointIn>
- </variable>
- <variable formalParameter="IN2">
- <connectionPointIn>
- <relPosition x="0" y="50"/>
- <connection refLocalId="78">
- <position x="170" y="1420"/>
- <position x="160" y="1420"/>
- <position x="160" y="1450"/>
- <position x="390" y="1450"/>
- <position x="390" y="1400"/>
- <position x="380" y="1400"/>
- </connection>
- </connectionPointIn>
- </variable>
- </inputVariables>
- <inOutVariables/>
- <outputVariables>
- <variable formalParameter="OUT">
- <connectionPointOut>
- <relPosition x="65" y="30"/>
- </connectionPointOut>
- </variable>
- </outputVariables>
- </block>
- <outVariable localId="47" executionOrderId="0" height="30" width="130" negated="false">
- <position x="625" y="1335"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="79">
- <position x="625" y="1350"/>
- <position x="590" y="1350"/>
- </connection>
- </connectionPointIn>
- <expression>Test_Python_Var</expression>
- </outVariable>
- <inVariable localId="79" executionOrderId="0" height="25" width="30" negated="false">
- <position x="560" y="1340"/>
- <connectionPointOut>
- <relPosition x="30" y="10"/>
- </connectionPointOut>
- <expression>23</expression>
- </inVariable>
- <inOutVariable localId="78" executionOrderId="0" height="30" width="100" negatedOut="false" negatedIn="false">
- <position x="280" y="1385"/>
- <connectionPointIn>
- <relPosition x="0" y="15"/>
- <connection refLocalId="77" formalParameter="OUT">
- <position x="280" y="1400"/>
- <position x="235" y="1400"/>
- </connection>
- </connectionPointIn>
- <connectionPointOut>
- <relPosition x="100" y="15"/>
- </connectionPointOut>
- <expression>SomeVarName</expression>
- </inOutVariable>
- </FBD>
- </body>
- </pou>
- <pou name="C_Pragma" pouType="functionBlock">
- <interface>
- <outputVars>
- <variable name="OUT">
- <type>
- <SINT/>
- </type>
- </variable>
- </outputVars>
- <inputVars>
- <variable name="IN">
- <type>
- <SINT/>
- </type>
- </variable>
- </inputVars>
- <localVars>
- <variable name="COORDS">
- <type>
- <array>
- <dimension lower="0" upper="5"/>
- <baseType>
- <SINT/>
- </baseType>
- </array>
- </type>
- <initialValue>
- <arrayValue>
- <value>
- <simpleValue value="54"/>
- </value>
- <value>
- <simpleValue value="55"/>
- </value>
- <value>
- <simpleValue value="56"/>
- </value>
- <value>
- <simpleValue value="57"/>
- </value>
- <value>
- <simpleValue value="58"/>
- </value>
- <value>
- <simpleValue value="59"/>
- </value>
- </arrayValue>
- </initialValue>
- </variable>
- <variable name="SMURF">
- <type>
- <derived name="CPLX_TYPE"/>
- </type>
- </variable>
- </localVars>
- <externalVars>
- <variable name="Global_RS">
- <type>
- <derived name="RS"/>
- </type>
- </variable>
- <variable name="Dudiduda">
- <type>
- <derived name="blups"/>
- </type>
- </variable>
- </externalVars>
- </interface>
- <body>
- <ST>
- <xhtml:p><![CDATA[(* hereafter is a C pragma accessing FB interface in a clean way *)
-{{
- char toPLC;
- char fromPLC = GetFbVar(IN);
- extern int PLC_C_Call(char, char *);
- if(PLC_C_Call(fromPLC, &toPLC)){
- SetFbVar(OUT, toPLC);
- }
- if(0){
- /* that code demonstrate C access to complex types */
- char somebyte = GetFbVar(COORDS, .table[3]);
- SetFbVar(SMURF, somebyte, .FIRSTBYTE);
- SetFbVar(COORDS, somebyte, .table[4]);
- }
-}}
-(* If you do not use GetFbVar and SetFbVar macros, expect unexpected behaviour*)
-Global_RS();
-
-(* testing access to global struct array *)
-Dudiduda[2].FIRSTBYTE := 0;
-]]></xhtml:p>
- </ST>
- </body>
- </pou>
- <pou name="norm" pouType="function">
- <interface>
- <returnType>
- <REAL/>
- </returnType>
- <inputVars>
- <variable name="IN1">
- <type>
- <REAL/>
- </type>
- </variable>
- <variable name="IN2">
- <type>
- <REAL/>
- </type>
- </variable>
- </inputVars>
- </interface>
- <body>
- <ST>
- <xhtml:p><![CDATA[NORM := SQRT(IN1 * IN1 + IN2 * IN2);]]></xhtml:p>
- </ST>
- </body>
- </pou>
- <pou name="function0" pouType="function">
- <interface>
- <returnType>
- <derived name="datatype0"/>
- </returnType>
- <inputVars>
- <variable name="LocalVar0">
- <type>
- <derived name="datatype0"/>
- </type>
- </variable>
- </inputVars>
- </interface>
- <body>
- <ST>
- <xhtml:p><![CDATA[function0 := LocalVar0;
-]]></xhtml:p>
- </ST>
- </body>
- </pou>
- </pous>
- </types>
- <instances>
- <configurations>
- <configuration name="config">
- <resource name="res_pytest">
- <task name="pytest_task" priority="0" interval="T#500ms"/>
- <globalVars>
- <variable name="TOTO">
- <type>
- <INT/>
- </type>
- </variable>
- </globalVars>
- <pouInstance name="pytest_instance" typeName="main_pytest"/>
- </resource>
- <globalVars>
- <variable name="Global_RS">
- <type>
- <derived name="RS"/>
- </type>
- </variable>
- <variable name="Dudiduda">
- <type>
- <derived name="blups"/>
- </type>
- </variable>
- <variable name="TUTU">
- <type>
- <INT/>
- </type>
- </variable>
- </globalVars>
- </configuration>
- </configurations>
- </instances>
-</project>
--- a/tests/python/py_ext_0@py_ext/baseconfnode.xml Thu Sep 16 09:40:36 2021 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<BaseParams xmlns:xsd="http://www.w3.org/2001/XMLSchema" IEC_Channel="2" Name="py_ext_0"/>
--- a/tests/python/py_ext_0@py_ext/pyfile.xml Thu Sep 16 09:40:36 2021 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<PyFile xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <variables>
- <variable name="SomeVarName" type="DINT" onchange="MyFunc, SomeChange"/>
- <variable name="Grumpf" type="STRING" initial="'mhoo'" onchange="MyFunc, MyOtherFunc"/>
- </variables>
- <globals>
- <xhtml:p><![CDATA[
-print "All python PLC globals variables :", PLCGlobalsDesc
-print "Current extention name :", __ext_name__
-
-def MyFunc(*args):
- print args
-
-def MyOtherFunc(*args):
- print "other", args
-
-def SomeChange(*args):
- print "count",OnChange.SomeVarName.count
- print "first",OnChange.SomeVarName.first
- print "last",OnChange.SomeVarName.last
-
-
-]]></xhtml:p>
- </globals>
- <init>
- <xhtml:p><![CDATA[
-]]></xhtml:p>
- </init>
- <cleanup>
- <xhtml:p><![CDATA[
-]]></xhtml:p>
- </cleanup>
- <start>
- <xhtml:p><![CDATA[
-]]></xhtml:p>
- </start>
- <stop>
- <xhtml:p><![CDATA[
-]]></xhtml:p>
- </stop>
-</PyFile>
--- a/tests/python/python@py_ext/baseconfnode.xml Thu Sep 16 09:40:36 2021 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<BaseParams Name="python" IEC_Channel="0"/>
--- a/tests/python/python@py_ext/pyfile.xml Thu Sep 16 09:40:36 2021 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<PyFile xmlns:xhtml="http://www.w3.org/1999/xhtml">
- <variables>
- <variable name="Test_Python_Var" type="INT" initial="4"/>
- <variable name="Second_Python_Var" type="INT" initial="5"/>
- </variables>
- <globals>
- <xhtml:p><![CDATA[
-import time,sys,ctypes
-Python_to_C_Call = PLCBinary.Python_to_C_Call
-Python_to_C_Call.restype = ctypes.c_int
-Python_to_C_Call.argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)]
-
-def MyPythonFunc(arg):
- i = ctypes.c_int()
- if(Python_to_C_Call(arg, i)):
- res = i.value
- print "toC:", arg, "from C:", res, "FBID:", FBID
- else:
- print "Failed Python_to_C_Call failed"
- res = None
- print "Python read PLC global :",PLCGlobals.Test_Python_Var
- print "Python read PLC global Grumpf :",PLCGlobals.Grumpf
- PLCGlobals.Second_Python_Var = 789
- sys.stdout.flush()
- return res
-
-async_error_test_code = """
-def badaboom():
- tuple()[0]
-
-import wx
-def badaboomwx():
- wx.CallAfter(badaboom)
-
-from threading import Timer
-a = Timer(3, badaboom)
-a.start()
-
-b = Timer(6, badaboomwx)
-b.start()
-"""
-]]></xhtml:p>
- </globals>
- <init>
- <xhtml:p><![CDATA[
-global x, y
-x = 2
-y = 5
-print "py_runtime init:", x, ",", y
-]]></xhtml:p>
- </init>
- <cleanup>
- <xhtml:p><![CDATA[
-print "py_runtime cleanup"
-]]></xhtml:p>
- </cleanup>
- <start>
- <xhtml:p><![CDATA[
-global x, y
-print "py_runtime start", x * x + y * y
-]]></xhtml:p>
- </start>
- <stop>
- <xhtml:p><![CDATA[
-print "py_runtime stop"
-]]></xhtml:p>
- </stop>
-</PyFile>
--- a/tests/svghmi/svghmi_0@svghmi/svghmi.svg Thu Sep 16 09:40:36 2021 +0200
+++ b/tests/svghmi/svghmi_0@svghmi/svghmi.svg Fri Oct 01 17:44:52 2021 +0200
@@ -125,15 +125,15 @@
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:document-units="px"
- inkscape:current-layer="g1499-7"
+ inkscape:current-layer="hmi0"
showgrid="false"
units="px"
- inkscape:zoom="0.84355633"
- inkscape:cx="1857.6296"
- inkscape:cy="687.32797"
- inkscape:window-width="1600"
- inkscape:window-height="836"
- inkscape:window-x="0"
+ inkscape:zoom="0.84355635"
+ inkscape:cx="956.92617"
+ inkscape:cy="-289.32713"
+ inkscape:window-width="3840"
+ inkscape:window-height="2096"
+ inkscape:window-x="3200"
inkscape:window-y="27"
inkscape:window-maximized="1"
showguides="true"
@@ -3632,13 +3632,13 @@
height="95.723877"
width="245.44583"
id="rect1479-7"
- style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.28600003;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:#ff6600;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate;font-variant-east_asian:normal" />
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.28600003;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:#ff6600;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
</g>
<g
id="g1906"
inkscape:label="inactive">
<rect
- style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#3d3d3d;fill-opacity:1;fill-rule:nonzero;stroke:#ff6600;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate;font-variant-east_asian:normal"
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#3d3d3d;fill-opacity:1;fill-rule:nonzero;stroke:#ff6600;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect1904"
width="245.44583"
height="95.723877"
@@ -7473,4 +7473,264 @@
style="text-align:center;text-anchor:middle;fill:#ff6600;stroke-width:0.99999994px">up</tspan></text>
</g>
</g>
+ <rect
+ inkscape:label="HMI:Page:DropDownPage"
+ y="780"
+ x="1480"
+ height="720"
+ width="1280"
+ id="rect1081"
+ style="color:#000000;fill:#4d4d4d" />
+ <g
+ style="stroke-width:0.35083869"
+ transform="matrix(0.81491208,0,0,0.81491208,1123.6641,269.69509)"
+ inkscape:label="HMI:DropDown@/SELECTION"
+ id="g1093">
+ <rect
+ inkscape:label="box"
+ ry="2.4558709"
+ rx="2.4558709"
+ y="923.98993"
+ x="864.00842"
+ height="130.9433"
+ width="391.99988"
+ id="rect1083"
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#53676c;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.75419343;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
+ <rect
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#0000ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.75419331;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ id="rect1085"
+ width="391.99988"
+ height="92.71212"
+ x="864.00842"
+ y="943.10553"
+ rx="2.4558709"
+ ry="2.4558709"
+ inkscape:label="highlight" />
+ <path
+ inkscape:label="button"
+ inkscape:transform-center-y="10.92088"
+ d="m 1200.5,1018.6835 -18.9155,-32.76262 -18.9155,-32.76264 37.831,0 37.831,0 -18.9155,32.76264 z"
+ inkscape:randomized="0"
+ inkscape:rounded="0"
+ inkscape:flatsided="false"
+ sodipodi:arg2="2.6179939"
+ sodipodi:arg1="1.5707963"
+ sodipodi:r2="21.841761"
+ sodipodi:r1="43.683521"
+ sodipodi:cy="975"
+ sodipodi:cx="1200.5"
+ sodipodi:sides="3"
+ id="path1091"
+ style="opacity:1;vector-effect:none;fill:#a7a5a6;fill-opacity:1;stroke:none;stroke-width:0.12376806;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ sodipodi:type="star" />
+ <use
+ transform="matrix(1.0859809,0,0,1.0859809,-531.04917,1248.2618)"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:80px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#d42aff;fill-opacity:1;stroke:none;stroke-width:1.40335476px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="0"
+ y="0"
+ xlink:href="#text879-6"
+ id="use1109"
+ width="100%"
+ height="100%"
+ inkscape:label="text" />
+ </g>
+ <g
+ id="g4282-3"
+ inkscape:label="HMI:Jump:Home"
+ transform="translate(1463.5642,-564.57759)">
+ <g
+ id="g4274-6"
+ inkscape:label="button">
+ <path
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:#ff6600;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 1217.4113,1410.4016 -22,24.5657 c -10.7925,12.0511 6.1317,35.5791 -13.5791,35.5791 h -174.2877 c -19.71078,0 -2.7866,-23.528 -13.57905,-35.5791 l -22,-24.5657 127.74845,-48.4334 z"
+ id="path4272-7"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cssssccc" />
+ </g>
+ <g
+ id="g4280-5"
+ inkscape:label="text">
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.99999994px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="1090.7626"
+ y="1436.9814"
+ id="text4278-3"
+ inkscape:label="home_jmp"><tspan
+ sodipodi:role="line"
+ id="tspan4276-5"
+ x="1090.7626"
+ y="1436.9814"
+ style="text-align:center;text-anchor:middle;fill:#ff6600;stroke-width:0.99999994px">Home</tspan></text>
+ </g>
+ </g>
+ <g
+ transform="matrix(0.57180538,0,0,0.57180538,512.09037,-234.29183)"
+ inkscape:label="HMI:Jump:DropDownPage"
+ id="g2198-6">
+ <g
+ inkscape:label="button"
+ id="g2190-2">
+ <rect
+ inkscape:label="button"
+ ry="35.579063"
+ y="594.82263"
+ x="971.96545"
+ height="95.723877"
+ width="245.44583"
+ id="rect2188-9"
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:#ff6600;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ rx="35.579063" />
+ </g>
+ <g
+ inkscape:label="text"
+ id="g2196-1">
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;fill:#ff6600;fill-opacity:1;stroke:none;stroke-width:0.99999994px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="1090.7626"
+ y="656.98151"
+ id="text2194-2"
+ inkscape:label="setting_jmp"><tspan
+ sodipodi:role="line"
+ id="tspan2192-7"
+ x="1090.7626"
+ y="656.98151"
+ style="text-align:center;text-anchor:middle;fill:#ff6600;stroke-width:0.99999994px">DropDown</tspan></text>
+ </g>
+ </g>
+ <g
+ id="g893-0"
+ inkscape:label="HMI:TextList:TestTextList"
+ transform="matrix(3.539916,0,0,3.539916,-1740.4841,1980.5529)"
+ style="stroke-width:0.28249258">
+ <text
+ inkscape:label="Trois"
+ id="text1382-7-9"
+ y="-171.54395"
+ x="1298.9102"
+ xml:space="preserve"
+ style="stroke-width:0.28249258"><tspan
+ y="-171.54395"
+ x="1298.9102"
+ id="tspan1380-5-3"
+ sodipodi:role="line"
+ style="stroke-width:0.28249258">Three</tspan></text>
+ <text
+ xml:space="preserve"
+ x="1298.9102"
+ y="-191.54395"
+ id="text875-6"
+ inkscape:label="Deux"
+ style="stroke-width:0.28249258"><tspan
+ sodipodi:role="line"
+ id="tspan873-0"
+ x="1298.9102"
+ y="-191.54395"
+ style="stroke-width:0.28249258">Two</tspan></text>
+ <text
+ inkscape:label="Un"
+ id="text879-6"
+ y="-211.54395"
+ x="1298.9102"
+ xml:space="preserve"
+ style="stroke-width:0.28249258"><tspan
+ y="-211.54395"
+ x="1298.9102"
+ id="tspan877-2"
+ sodipodi:role="line"
+ style="stroke-width:0.28249258">One</tspan></text>
+ <text
+ xml:space="preserve"
+ x="1298.9102"
+ y="-231.54395"
+ id="text883-6"
+ inkscape:label="Zero"
+ style="stroke-width:0.28249258"><tspan
+ sodipodi:role="line"
+ id="tspan881-1"
+ x="1298.9102"
+ y="-231.54395"
+ style="stroke-width:0.28249258">Zero</tspan></text>
+ </g>
+ <g
+ transform="matrix(0.28590269,0,0,0.28590269,1653.6069,1022.1289)"
+ id="g1120"
+ inkscape:label="HMI:Input@/SELECTION">
+ <text
+ inkscape:label="value"
+ id="text1110"
+ y="218.24219"
+ x="216.32812"
+ style="font-style:normal;font-weight:normal;font-size:160px;line-height:125%;font-family:sans-serif;text-align:end;letter-spacing:0px;word-spacing:0px;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ style="text-align:end;text-anchor:end;stroke-width:1px"
+ y="218.24219"
+ x="216.32812"
+ id="tspan1108"
+ sodipodi:role="line">8</tspan></text>
+ <path
+ inkscape:label="-1"
+ inkscape:transform-center-y="7.4781812"
+ d="m 302.6459,-210.03172 -51.81035,0 25.90517,-44.86908 z"
+ inkscape:randomized="0"
+ inkscape:rounded="0"
+ inkscape:flatsided="true"
+ sodipodi:arg2="1.5707963"
+ sodipodi:arg1="0.52359878"
+ sodipodi:r2="14.956361"
+ sodipodi:r1="29.912722"
+ sodipodi:cy="-224.98808"
+ sodipodi:cx="276.74072"
+ sodipodi:sides="3"
+ id="path1112"
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:#ff6600;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ sodipodi:type="star"
+ transform="scale(1,-1)" />
+ <rect
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ff00ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ id="rect1114"
+ width="407.7037"
+ height="128"
+ x="-174.94055"
+ y="95.40741"
+ onclick=""
+ inkscape:label="edit" />
+ <path
+ sodipodi:type="star"
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:#ff6600;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ id="path1116"
+ sodipodi:sides="3"
+ sodipodi:cx="276.74072"
+ sodipodi:cy="96.444443"
+ sodipodi:r1="29.912722"
+ sodipodi:r2="14.956361"
+ sodipodi:arg1="0.52359878"
+ sodipodi:arg2="1.5707963"
+ inkscape:flatsided="true"
+ inkscape:rounded="0"
+ inkscape:randomized="0"
+ d="m 302.6459,111.4008 -51.81035,0 25.90517,-44.869079 z"
+ inkscape:transform-center-y="-7.4781804"
+ inkscape:label="+1" />
+ <path
+ inkscape:transform-center-x="1.0089177e-06"
+ sodipodi:type="star"
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:#ff6600;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ id="path1118"
+ sodipodi:sides="4"
+ sodipodi:cx="276.74072"
+ sodipodi:cy="160.71626"
+ sodipodi:r1="41.281136"
+ sodipodi:r2="21.657967"
+ sodipodi:arg1="0.77793027"
+ sodipodi:arg2="1.5633284"
+ inkscape:flatsided="true"
+ inkscape:rounded="0"
+ inkscape:randomized="0"
+ d="m 306.14807,189.68763 -58.37872,0.43598 -0.43597,-58.37872 58.37871,-0.43597 z"
+ inkscape:transform-center-y="-10.828983"
+ inkscape:label="=0" />
+ </g>
</svg>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/svghmi_pathslider/beremiz.xml Fri Oct 01 17:44:52 2021 +0200
@@ -0,0 +1,5 @@
+<?xml version='1.0' encoding='utf-8'?>
+<BeremizRoot xmlns:xsd="http://www.w3.org/2001/XMLSchema" URI_location="LOCAL://">
+ <TargetType/>
+ <Libraries Enable_SVGHMI_Library="true"/>
+</BeremizRoot>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/svghmi_pathslider/plc.xml Fri Oct 01 17:44:52 2021 +0200
@@ -0,0 +1,73 @@
+<?xml version='1.0' encoding='utf-8'?>
+<project xmlns:ns1="http://www.plcopen.org/xml/tc6_0201" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.plcopen.org/xml/tc6_0201">
+ <fileHeader companyName="Unknown" productName="Unnamed" productVersion="1" creationDateTime="2019-08-06T14:23:42"/>
+ <contentHeader name="Unnamed" modificationDateTime="2021-09-10T14:17:04">
+ <coordinateInfo>
+ <fbd>
+ <scaling x="5" y="5"/>
+ </fbd>
+ <ld>
+ <scaling x="0" y="0"/>
+ </ld>
+ <sfc>
+ <scaling x="0" y="0"/>
+ </sfc>
+ </coordinateInfo>
+ </contentHeader>
+ <types>
+ <dataTypes/>
+ <pous>
+ <pou name="MainStuff" pouType="program">
+ <interface>
+ <localVars>
+ <variable name="var0">
+ <type>
+ <derived name="HMI_INT"/>
+ </type>
+ </variable>
+ <variable name="var1">
+ <type>
+ <derived name="HMI_INT"/>
+ </type>
+ </variable>
+ </localVars>
+ </interface>
+ <body>
+ <FBD>
+ <inVariable localId="5" executionOrderId="0" height="30" width="125" negated="false">
+ <position x="445" y="65"/>
+ <connectionPointOut>
+ <relPosition x="125" y="15"/>
+ </connectionPointOut>
+ <expression>var0</expression>
+ </inVariable>
+ <outVariable localId="10" executionOrderId="0" height="25" width="85" negated="false">
+ <position x="710" y="105"/>
+ <connectionPointIn>
+ <relPosition x="0" y="10"/>
+ <connection refLocalId="5">
+ <position x="710" y="115"/>
+ <position x="640" y="115"/>
+ <position x="640" y="80"/>
+ <position x="570" y="80"/>
+ </connection>
+ </connectionPointIn>
+ <expression>var1</expression>
+ </outVariable>
+ </FBD>
+ </body>
+ </pou>
+ </pous>
+ </types>
+ <instances>
+ <configurations>
+ <configuration name="config">
+ <resource name="resource1">
+ <task name="task0" priority="0" interval="T#20ms">
+ <pouInstance name="instance0" typeName="MainStuff"/>
+ </task>
+ </resource>
+ </configuration>
+ </configurations>
+ </instances>
+</project>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/svghmi_pathslider/svghmi_0@svghmi/baseconfnode.xml Fri Oct 01 17:44:52 2021 +0200
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='utf-8'?>
+<BaseParams xmlns:xsd="http://www.w3.org/2001/XMLSchema" IEC_Channel="0" Name="svghmi_0"/>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/svghmi_pathslider/svghmi_0@svghmi/confnode.xml Fri Oct 01 17:44:52 2021 +0200
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SVGHMI xmlns:xsd="http://www.w3.org/2001/XMLSchema" WatchdogInitial="10" WatchdogInterval="5"/>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/svghmi_pathslider/svghmi_0@svghmi/messages.pot Fri Oct 01 17:44:52 2021 +0200
@@ -0,0 +1,17 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR ORGANIZATION
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2021-02-12 21:55+CET\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: SVGHMI 1.0\n"
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/svghmi_pathslider/svghmi_0@svghmi/svghmi.svg Fri Oct 01 17:44:52 2021 +0200
@@ -0,0 +1,882 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
+ sodipodi:docname="svghmi.svg"
+ id="hmi0"
+ version="1.1"
+ viewBox="0 0 1280 720"
+ height="720"
+ width="1280">
+ <metadata
+ id="metadata4542">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs2">
+ <marker
+ inkscape:stockid="SquareL"
+ orient="auto"
+ refY="0.0"
+ refX="0.0"
+ id="SquareL"
+ style="overflow:visible"
+ inkscape:isstock="true">
+ <path
+ id="path1054"
+ d="M -5.0,-5.0 L -5.0,5.0 L 5.0,5.0 L 5.0,-5.0 L -5.0,-5.0 z "
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
+ transform="scale(0.8)" />
+ </marker>
+ <linearGradient
+ id="linearGradient34303"
+ osb:paint="solid">
+ <stop
+ style="stop-color:#000000;stop-opacity:1;"
+ offset="0"
+ id="stop34301" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient20537"
+ osb:paint="solid">
+ <stop
+ style="stop-color:#000000;stop-opacity:1;"
+ offset="0"
+ id="stop20535" />
+ </linearGradient>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:document-units="px"
+ inkscape:current-layer="hmi0"
+ showgrid="false"
+ units="px"
+ inkscape:zoom="1.8101934"
+ inkscape:cx="616.36085"
+ inkscape:cy="455.0488"
+ inkscape:window-width="2188"
+ inkscape:window-height="1534"
+ inkscape:window-x="3675"
+ inkscape:window-y="324"
+ inkscape:window-maximized="0"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ inkscape:snap-global="true"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-nodes="true" />
+ <g
+ inkscape:label="HMI:Keypad:HMI_INT:HMI_REAL"
+ id="g2432"
+ style="fill-rule:evenodd;stroke-width:0.47631353"
+ transform="matrix(3.3549332,0,0,3.14525,-181.87457,2336.0198)">
+ <path
+ sodipodi:nodetypes="ccccc"
+ inkscape:label="Background"
+ inkscape:connector-curvature="0"
+ id="path2136"
+ d="M 54.211099,1.2654702 H 435.73881 V 230.18209 H 54.211099 Z"
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.6;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.16776976;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
+ <rect
+ ry="3.8152773"
+ rx="3.8152773"
+ y="15.77106"
+ x="64.024963"
+ height="30.150299"
+ width="361.89996"
+ id="rect2426"
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#fffff5;fill-opacity:1;fill-rule:nonzero;stroke:#202326;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ inkscape:label="Field" />
+ <text
+ id="text2430"
+ y="37.408375"
+ x="72.50132"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:19.0763855px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.47690967px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"
+ inkscape:label="Value"><tspan
+ style="text-align:start;text-anchor:start;stroke-width:0.47690967px"
+ y="37.408375"
+ x="72.50132"
+ id="tspan2428"
+ sodipodi:role="line">number</tspan></text>
+ <g
+ style="fill-rule:evenodd;stroke-width:0.13585199"
+ inkscape:label="Enter"
+ id="g4947"
+ transform="matrix(1.6700128,0,0,1.6700128,-826.83854,-145.60855)">
+ <path
+ style="opacity:1;vector-effect:none;fill:#4f4c4d;fill-opacity:1;stroke:none;stroke-width:0.10074362;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path193"
+ d="m 750,175 c 0,-2 -1,-3 -3,-3 h -20 c -1,0 -3,1 -3,3 v 43 c 0,1 2,2 3,2 h 20 c 2,0 3,-1 3,-2 z"
+ inkscape:connector-curvature="0" />
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.99999988;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m -1244.2949,1166.5938 v 15.791 h -38.6875 v -2.9981 l -6.9199,4 6.9199,4 v -2.998 h 40.6836 v -17.7949 z"
+ transform="matrix(0.28557246,0,0,0.28557246,1098.7155,-140.51013)"
+ id="path6545-4"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ style="fill-rule:evenodd;stroke-width:0.13585199"
+ inkscape:label="Keys"
+ id="g4993"
+ transform="matrix(1.6700128,0,0,1.6700128,-826.83854,-145.60855)">
+ <g
+ style="stroke-width:0.13585199"
+ inkscape:label="7"
+ id="g4892">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 638,120 h 20 c 2,0 3,2 3,3 v 18 c 0,2 -1,3 -3,3 h -20 c -1,0 -3,-1 -3,-3 v -18 c 0,-1 2,-3 3,-3 z"
+ id="path163"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ id="text331"
+ y="129.38269"
+ x="636.4165"
+ transform="scale(1.0007154,0.99928514)">7</text>
+ </g>
+ <g
+ style="stroke-width:0.13585199"
+ inkscape:label="4"
+ id="g4907">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 638,146 h 20 c 2,0 3,1 3,3 v 18 c 0,2 -1,3 -3,3 h -20 c -1,0 -3,-1 -3,-3 v -18 c 0,-2 2,-3 3,-3 z"
+ id="path169"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ id="text335"
+ y="154.10822"
+ x="636.4165"
+ transform="scale(1.0007154,0.99928514)">4</text>
+ </g>
+ <g
+ style="stroke-width:0.13585199"
+ inkscape:label="1"
+ id="g4922">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 638,172 h 20 c 2,0 3,1 3,3 v 17 c 0,1 -1,3 -3,3 h -20 c -1,0 -3,-2 -3,-3 v -17 c 0,-2 2,-3 3,-3 z"
+ id="path175"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ id="text339"
+ y="179.82285"
+ x="636.4165"
+ transform="scale(1.0007154,0.99928514)">1</text>
+ </g>
+ <g
+ style="stroke-width:0.13585199"
+ inkscape:label="8"
+ id="g4897">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 668,120 h 19 c 2,0 3,2 3,3 v 18 c 0,2 -1,3 -3,3 h -19 c -1,0 -3,-1 -3,-3 v -18 c 0,-1 2,-3 3,-3 z"
+ id="path165"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ id="text347"
+ y="129.38269"
+ x="667.07562"
+ transform="scale(1.0007154,0.99928514)">8</text>
+ </g>
+ <g
+ style="stroke-width:0.13585199"
+ inkscape:label="5"
+ id="g4912">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 668,146 h 19 c 2,0 3,1 3,3 v 18 c 0,2 -1,3 -3,3 h -19 c -1,0 -3,-1 -3,-3 v -18 c 0,-2 2,-3 3,-3 z"
+ id="path171"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ id="text351"
+ y="154.10822"
+ x="667.07562"
+ transform="scale(1.0007154,0.99928514)">5</text>
+ </g>
+ <g
+ style="stroke-width:0.13585199"
+ inkscape:label="2"
+ id="g4927">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 668,172 h 19 c 2,0 3,1 3,3 v 17 c 0,1 -1,3 -3,3 h -19 c -1,0 -3,-2 -3,-3 v -17 c 0,-2 2,-3 3,-3 z"
+ id="path177"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ id="text355"
+ y="179.82285"
+ x="667.07562"
+ transform="scale(1.0007154,0.99928514)">2</text>
+ </g>
+ <g
+ style="stroke-width:0.13585199"
+ inkscape:label="9"
+ id="g4902">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 697,120 h 20 c 2,0 3,2 3,3 v 18 c 0,2 -1,3 -3,3 h -20 c -1,0 -3,-1 -3,-3 v -18 c 0,-1 2,-3 3,-3 z"
+ id="path167"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ id="text363"
+ y="129.38269"
+ x="695.75708"
+ transform="scale(1.0007154,0.99928514)">9</text>
+ </g>
+ <g
+ style="stroke-width:0.13585199"
+ inkscape:label="6"
+ id="g4917">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 697,146 h 20 c 2,0 3,1 3,3 v 18 c 0,2 -1,3 -3,3 h -20 c -1,0 -3,-1 -3,-3 v -18 c 0,-2 2,-3 3,-3 z"
+ id="path173"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ id="text367"
+ y="154.10822"
+ x="695.75708"
+ transform="scale(1.0007154,0.99928514)">6</text>
+ </g>
+ <g
+ style="stroke-width:0.13585199"
+ inkscape:label="3"
+ id="g4932">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 697,172 h 20 c 2,0 3,1 3,3 v 17 c 0,1 -1,3 -3,3 h -20 c -1,0 -3,-2 -3,-3 v -17 c 0,-2 2,-3 3,-3 z"
+ id="path179"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ id="text371"
+ y="179.82285"
+ x="695.75708"
+ transform="scale(1.0007154,0.99928514)">3</text>
+ </g>
+ <g
+ style="stroke-width:0.13585199"
+ inkscape:label="0"
+ id="g4937">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 638,220 c -1,0 -3,-1 -3,-2 v -19 c 0,-1 2,-2 3,-2 h 49 c 2,0 3,1 3,2 v 19 c 0,1 -1,2 -3,2 z"
+ id="path373"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ id="text377"
+ y="205.53712"
+ x="636.4165"
+ transform="scale(1.0007154,0.99928514)">0</text>
+ </g>
+ </g>
+ <g
+ id="g3113"
+ inkscape:label="Esc"
+ transform="translate(-318.22576)">
+ <path
+ style="opacity:1;vector-effect:none;fill:#4f4c4d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.16824313;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path167-3"
+ d="m 387.26079,54.792986 h 33.40019 c 3.34,0 5.01006,3.34003 5.01006,5.010045 v 30.060225 c 0,3.340029 -1.67006,5.010032 -5.01006,5.010032 h -33.40019 c -1.67006,0 -5.01007,-1.670003 -5.01007,-5.010032 V 59.803031 c 0,-1.670015 3.34001,-5.010045 5.01007,-5.010045 z"
+ inkscape:connector-curvature="0" />
+ <text
+ x="394.42801"
+ y="78.632088"
+ id="text469-4"
+ style="font-weight:normal;font-size:10.63882256px;font-family:Arial;fill:#ffffff;fill-rule:evenodd;stroke-width:0.36866826"
+ transform="scale(1.0007154,0.99928511)">Esc</text>
+ </g>
+ <g
+ id="g3109"
+ inkscape:label="BackSpace"
+ transform="translate(0,-43.420332)">
+ <path
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.16824308;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path173-1"
+ d="m 387.26079,98.213318 h 33.40019 c 3.34,0 5.01006,1.670013 5.01006,5.010032 v 30.06024 c 0,3.34002 -1.67006,5.01003 -5.01006,5.01003 h -33.40019 c -1.67006,0 -5.01007,-1.67001 -5.01007,-5.01003 v -30.06024 c 0,-3.340019 3.34001,-5.010032 5.01007,-5.010032 z"
+ inkscape:connector-curvature="0" />
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#2b2828;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m -1278.9668,1041.3047 -6.9199,4 6.9199,4 v -3 h 33.416 v -1.9981 h -33.416 z"
+ transform="matrix(0.47690966,0,0,0.47690966,1008.0304,-380.26227)"
+ id="path11623-1-0-2"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ id="g787"
+ inkscape:label="Sign"
+ style="fill-rule:evenodd;stroke-width:0.13585199"
+ transform="matrix(1.6700128,0,0,1.6700128,-678.20742,-102.18822)">
+ <path
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path781"
+ d="m 638,120 h 20 c 2,0 3,2 3,3 v 18 c 0,2 -1,3 -3,3 h -20 c -1,0 -3,-1 -3,-3 v -18 c 0,-1 2,-3 3,-3 z"
+ inkscape:connector-curvature="0" />
+ <text
+ x="642.1239"
+ y="135.09822"
+ id="text783"
+ style="font-weight:normal;font-size:9.28803921px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ transform="scale(1.0007154,0.99928514)">+/-</text>
+ </g>
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.31375408px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.30784383px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="252.9579"
+ y="12.333653"
+ id="text509"
+ transform="scale(0.96824589,1.0327955)"
+ inkscape:label="Info"><tspan
+ sodipodi:role="line"
+ id="tspan507"
+ x="252.9579"
+ y="12.333653"
+ style="stroke-width:0.30784383px">information</tspan></text>
+ <g
+ transform="matrix(1.6700128,0,0,1.6700128,-826.83854,-145.60856)"
+ style="fill-rule:evenodd;stroke-width:0.13585199"
+ id="g4942"
+ inkscape:label="NumDot">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 697,197 h 20 c 2,0 3,1 3,2 v 19 c 0,1 -1,2 -3,2 h -20 c -1,0 -3,-1 -3,-2 v -19 c 0,-1 2,-2 3,-2 z"
+ id="path181"
+ style="opacity:1;vector-effect:none;fill:#d3d2d2;fill-opacity:1;stroke:none;stroke-width:0.10074359;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ style="font-weight:normal;font-size:6.96602964px;font-family:Arial;fill:#2b2828;stroke-width:0.10514989"
+ id="text771"
+ y="204.54802"
+ x="696.7464"
+ transform="scale(1.0007154,0.99928514)">.</text>
+ </g>
+ </g>
+ <rect
+ style="color:#000000;fill:#ffffff"
+ id="page0"
+ width="1280"
+ height="720"
+ x="0"
+ y="0"
+ inkscape:label="HMI:Page:Home" />
+ <g
+ id="g1913"
+ inkscape:label="HMI:Input@.max"
+ transform="translate(80,100)">
+ <rect
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ id="rect4827"
+ width="165.96402"
+ height="78.240181"
+ x="203.89867"
+ y="501.87585"
+ rx="7"
+ ry="7"
+ inkscape:label="edit" />
+ <text
+ id="text405"
+ y="551.66504"
+ x="275.02609"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"
+ inkscape:label="value"><tspan
+ y="551.66504"
+ x="275.02609"
+ id="tspan403"
+ sodipodi:role="line">1234</tspan></text>
+ <g
+ id="g1905"
+ inkscape:label="-1"
+ transform="translate(-314.79908,-17.189114)">
+ <rect
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ id="rect407"
+ width="99.578415"
+ height="88.909302"
+ x="392.38638"
+ y="513.73041"
+ rx="7"
+ ry="7" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="441.65189"
+ y="566.1087"
+ id="text1558"><tspan
+ sodipodi:role="line"
+ id="tspan1556"
+ x="441.65189"
+ y="566.1087">-1</tspan></text>
+ </g>
+ <g
+ transform="translate(-434.79908,-17.189114)"
+ inkscape:label="-10"
+ id="g4394">
+ <rect
+ ry="7"
+ rx="7"
+ y="513.73041"
+ x="392.38638"
+ height="88.909302"
+ width="99.578415"
+ id="rect4388"
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
+ <text
+ id="text4392"
+ y="566.1087"
+ x="441.65189"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ y="566.1087"
+ x="441.65189"
+ id="tspan4390"
+ sodipodi:role="line">-10</tspan></text>
+ </g>
+ <g
+ transform="translate(11.20092,-17.189114)"
+ inkscape:label="+1"
+ id="g4402">
+ <rect
+ ry="7"
+ rx="7"
+ y="513.73041"
+ x="392.38638"
+ height="88.909302"
+ width="99.578415"
+ id="rect4396"
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
+ <text
+ id="text4400"
+ y="566.1087"
+ x="441.65189"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ y="566.1087"
+ x="441.65189"
+ id="tspan4398"
+ sodipodi:role="line">+1</tspan></text>
+ </g>
+ <g
+ id="g4410"
+ inkscape:label="+10"
+ transform="translate(131.20092,-17.189114)">
+ <rect
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ id="rect4404"
+ width="99.578415"
+ height="88.909302"
+ x="392.38638"
+ y="513.73041"
+ rx="7"
+ ry="7" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="441.65189"
+ y="566.1087"
+ id="text4408"><tspan
+ sodipodi:role="line"
+ id="tspan4406"
+ x="441.65189"
+ y="566.1087">+10</tspan></text>
+ </g>
+ </g>
+ <g
+ transform="translate(80,-60)"
+ inkscape:label="HMI:Input@.min"
+ id="g4450">
+ <rect
+ inkscape:label="edit"
+ ry="7"
+ rx="7"
+ y="501.87585"
+ x="203.89867"
+ height="78.240181"
+ width="165.96402"
+ id="rect4412"
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
+ <text
+ inkscape:label="value"
+ xml:space="preserve"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="275.02609"
+ y="551.66504"
+ id="text4416"><tspan
+ sodipodi:role="line"
+ id="tspan4414"
+ x="275.02609"
+ y="551.66504">1234</tspan></text>
+ <g
+ transform="translate(-314.79908,-17.189114)"
+ inkscape:label="-1"
+ id="g4424">
+ <rect
+ ry="7"
+ rx="7"
+ y="513.73041"
+ x="392.38638"
+ height="88.909302"
+ width="99.578415"
+ id="rect4418"
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
+ <text
+ id="text4422"
+ y="566.1087"
+ x="441.65189"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ y="566.1087"
+ x="441.65189"
+ id="tspan4420"
+ sodipodi:role="line">-1</tspan></text>
+ </g>
+ <g
+ id="g4432"
+ inkscape:label="-10"
+ transform="translate(-434.79908,-17.189114)">
+ <rect
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ id="rect4426"
+ width="99.578415"
+ height="88.909302"
+ x="392.38638"
+ y="513.73041"
+ rx="7"
+ ry="7" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="441.65189"
+ y="566.1087"
+ id="text4430"><tspan
+ sodipodi:role="line"
+ id="tspan4428"
+ x="441.65189"
+ y="566.1087">-10</tspan></text>
+ </g>
+ <g
+ id="g4440"
+ inkscape:label="+1"
+ transform="translate(11.20092,-17.189114)">
+ <rect
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ id="rect4434"
+ width="99.578415"
+ height="88.909302"
+ x="392.38638"
+ y="513.73041"
+ rx="7"
+ ry="7" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="441.65189"
+ y="566.1087"
+ id="text4438"><tspan
+ sodipodi:role="line"
+ id="tspan4436"
+ x="441.65189"
+ y="566.1087">+1</tspan></text>
+ </g>
+ <g
+ transform="translate(131.20092,-17.189114)"
+ inkscape:label="+10"
+ id="g4448">
+ <rect
+ ry="7"
+ rx="7"
+ y="513.73041"
+ x="392.38638"
+ height="88.909302"
+ width="99.578415"
+ id="rect4442"
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
+ <text
+ id="text4446"
+ y="566.1087"
+ x="441.65189"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ y="566.1087"
+ x="441.65189"
+ id="tspan4444"
+ sodipodi:role="line">+10</tspan></text>
+ </g>
+ </g>
+ <g
+ id="g4490"
+ inkscape:label="HMI:Input@.position"
+ transform="translate(80,-220)">
+ <rect
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ id="rect4452"
+ width="165.96402"
+ height="78.240181"
+ x="203.89867"
+ y="501.87585"
+ rx="7"
+ ry="7"
+ inkscape:label="edit" />
+ <text
+ id="text4456"
+ y="551.66504"
+ x="275.02609"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"
+ inkscape:label="value"><tspan
+ y="551.66504"
+ x="275.02609"
+ id="tspan4454"
+ sodipodi:role="line">1234</tspan></text>
+ <g
+ id="g4464"
+ inkscape:label="-1"
+ transform="translate(-314.79908,-17.189114)">
+ <rect
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ id="rect4458"
+ width="99.578415"
+ height="88.909302"
+ x="392.38638"
+ y="513.73041"
+ rx="7"
+ ry="7" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="441.65189"
+ y="566.1087"
+ id="text4462"><tspan
+ sodipodi:role="line"
+ id="tspan4460"
+ x="441.65189"
+ y="566.1087">-1</tspan></text>
+ </g>
+ <g
+ transform="translate(-434.79908,-17.189114)"
+ inkscape:label="-10"
+ id="g4472">
+ <rect
+ ry="7"
+ rx="7"
+ y="513.73041"
+ x="392.38638"
+ height="88.909302"
+ width="99.578415"
+ id="rect4466"
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
+ <text
+ id="text4470"
+ y="566.1087"
+ x="441.65189"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ y="566.1087"
+ x="441.65189"
+ id="tspan4468"
+ sodipodi:role="line">-10</tspan></text>
+ </g>
+ <g
+ transform="translate(11.20092,-17.189114)"
+ inkscape:label="+1"
+ id="g4480">
+ <rect
+ ry="7"
+ rx="7"
+ y="513.73041"
+ x="392.38638"
+ height="88.909302"
+ width="99.578415"
+ id="rect4474"
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
+ <text
+ id="text4478"
+ y="566.1087"
+ x="441.65189"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ y="566.1087"
+ x="441.65189"
+ id="tspan4476"
+ sodipodi:role="line">+1</tspan></text>
+ </g>
+ <g
+ id="g4488"
+ inkscape:label="+10"
+ transform="translate(131.20092,-17.189114)">
+ <rect
+ style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ id="rect4482"
+ width="99.578415"
+ height="88.909302"
+ x="392.38638"
+ y="513.73041"
+ rx="7"
+ ry="7" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="441.65189"
+ y="566.1087"
+ id="text4486"><tspan
+ sodipodi:role="line"
+ id="tspan4484"
+ x="441.65189"
+ y="566.1087">+10</tspan></text>
+ </g>
+ </g>
+ <g
+ id="g4877"
+ inkscape:label="HMI:VarInit:50@.position" />
+ <g
+ inkscape:label="HMI:VarInit:99@.max"
+ id="g4879" />
+ <g
+ id="g4881"
+ inkscape:label="HMI:VarInit:1@.min" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none"
+ x="277.58728"
+ y="276.54129"
+ id="text941"><tspan
+ sodipodi:role="line"
+ id="tspan939"
+ x="277.58728"
+ y="276.54129">Position</tspan></text>
+ <text
+ id="text945"
+ y="436.54129"
+ x="277.58728"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none"
+ xml:space="preserve"><tspan
+ y="436.54129"
+ x="277.58728"
+ sodipodi:role="line"
+ id="tspan964">Min</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none"
+ x="277.58728"
+ y="596.54126"
+ id="text949"><tspan
+ sodipodi:role="line"
+ x="277.58728"
+ y="596.54126"
+ id="tspan968">Max</tspan></text>
+ <g
+ id="g962"
+ inkscape:label="HMI:PathSlider@.position@.min@.max">
+ <path
+ inkscape:connector-curvature="0"
+ id="path148"
+ d="m 955.14658,26.15147 211.57962,92.25534"
+ style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ inkscape:label="path" />
+ <path
+ d="m 966.53287,44.309416 -13.21418,-7.228051 -13.44562,6.787834 2.79088,-14.801024 -10.61054,-10.689986 14.93904,-1.919484 6.88794,-13.3946089 6.44196,13.6147169 14.86752,2.411663 -10.95769,10.333842 z"
+ inkscape:randomized="0"
+ inkscape:rounded="0"
+ inkscape:flatsided="false"
+ sodipodi:arg2="1.5873072"
+ sodipodi:arg1="0.9589887"
+ sodipodi:r2="11.340635"
+ sodipodi:r1="22.681271"
+ sodipodi:cy="25.742275"
+ sodipodi:cx="953.50592"
+ sodipodi:sides="5"
+ id="path153"
+ style="opacity:1;vector-effect:none;fill:#ff7903;fill-opacity:0.5288889;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ sodipodi:type="star"
+ inkscape:label="cursor" />
+ </g>
+ <g
+ inkscape:label="HMI:PathSlider@.position@.min@.max"
+ id="g976"
+ transform="translate(0,280)">
+ <path
+ style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 955.14658,26.15147 C 851.13467,-192.73963 1041.4811,9.3909254 1166.7262,118.40681"
+ id="path972"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc"
+ inkscape:label="path" />
+ <path
+ sodipodi:type="star"
+ style="opacity:1;vector-effect:none;fill:#ff7903;fill-opacity:0.5288889;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ id="path974"
+ sodipodi:sides="5"
+ sodipodi:cx="953.50592"
+ sodipodi:cy="25.742275"
+ sodipodi:r1="22.681271"
+ sodipodi:r2="11.340635"
+ sodipodi:arg1="0.9589887"
+ sodipodi:arg2="1.5873072"
+ inkscape:flatsided="false"
+ inkscape:rounded="0"
+ inkscape:randomized="0"
+ d="m 966.53287,44.309416 -13.21418,-7.228051 -13.44562,6.787834 2.79088,-14.801024 -10.61054,-10.689986 14.93904,-1.919484 6.88794,-13.3946089 6.44196,13.6147169 14.86752,2.411663 -10.95769,10.333842 z"
+ inkscape:label="cursor" />
+ </g>
+ <g
+ transform="matrix(1.3425901,0,0,1.3433676,-917.1196,42.980158)"
+ id="g982"
+ inkscape:label="HMI:PathSlider@.position@.min@.max"
+ style="stroke-width:0.74461341">
+ <path
+ sodipodi:nodetypes="cssc"
+ inkscape:connector-curvature="0"
+ id="path978"
+ d="m 952.93687,23.941761 c 51.19833,-44.196391 62.05743,74.937687 92.34943,75.490114 21.6066,0.394035 85.7552,-75.64156 18.9371,-55.006769 -72.1854,22.292318 95.3404,97.369964 112.9989,61.828304"
+ style="fill:none;stroke:#000000;stroke-width:0.74461341px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#SquareL)"
+ inkscape:label="path" />
+ <path
+ d="m 965.58932,65.187083 -13.21418,-7.228052 -13.44561,6.787834 2.79087,-14.801023 -10.61053,-10.689986 14.93903,-1.919485 6.88795,-13.394608 6.44195,13.614717 14.86753,2.411662 -10.9577,10.333842 z"
+ inkscape:randomized="0"
+ inkscape:rounded="0"
+ inkscape:flatsided="false"
+ sodipodi:arg2="1.5873072"
+ sodipodi:arg1="0.9589887"
+ sodipodi:r2="11.340635"
+ sodipodi:r1="22.681271"
+ sodipodi:cy="46.61994"
+ sodipodi:cx="952.5624"
+ sodipodi:sides="5"
+ id="path980"
+ style="opacity:1;vector-effect:none;fill:#ff7903;fill-opacity:0.5288889;stroke:none;stroke-width:0.74461341;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
+ sodipodi:type="star"
+ inkscape:label="cursor" />
+ </g>
+</svg>
--- a/tests/svghmi_scrollbar/beremiz.xml Thu Sep 16 09:40:36 2021 +0200
+++ b/tests/svghmi_scrollbar/beremiz.xml Fri Oct 01 17:44:52 2021 +0200
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
-<BeremizRoot xmlns:xsd="http://www.w3.org/2001/XMLSchema" URI_location="PYRO://127.0.0.1:61284">
+<BeremizRoot xmlns:xsd="http://www.w3.org/2001/XMLSchema" URI_location="LOCAL://">
<TargetType/>
<Libraries Enable_SVGHMI_Library="true"/>
</BeremizRoot>
--- a/tests/svghmi_scrollbar/plc.xml Thu Sep 16 09:40:36 2021 +0200
+++ b/tests/svghmi_scrollbar/plc.xml Fri Oct 01 17:44:52 2021 +0200
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<project xmlns:ns1="http://www.plcopen.org/xml/tc6_0201" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.plcopen.org/xml/tc6_0201">
<fileHeader companyName="Unknown" productName="Unnamed" productVersion="1" creationDateTime="2019-08-06T14:23:42"/>
- <contentHeader name="Unnamed" modificationDateTime="2021-02-12T19:29:13">
+ <contentHeader name="Unnamed" modificationDateTime="2021-09-10T14:17:04">
<coordinateInfo>
<fbd>
<scaling x="5" y="5"/>
--- a/tests/svghmi_scrollbar/svghmi_0@svghmi/confnode.xml Thu Sep 16 09:40:36 2021 +0200
+++ b/tests/svghmi_scrollbar/svghmi_0@svghmi/confnode.xml Fri Oct 01 17:44:52 2021 +0200
@@ -1,2 +1,2 @@
<?xml version='1.0' encoding='utf-8'?>
-<SVGHMI xmlns:xsd="http://www.w3.org/2001/XMLSchema" OnWatchdog="echo Watchdog for {name} !" OnStart="chromium http://127.0.0.1:{port}/{name}" OnStop="echo Closing {name}" WatchdogInitial="10" WatchdogInterval="5"/>
+<SVGHMI xmlns:xsd="http://www.w3.org/2001/XMLSchema" WatchdogInitial="10" WatchdogInterval="5"/>
--- a/tests/svghmi_scrollbar/svghmi_0@svghmi/svghmi.svg Thu Sep 16 09:40:36 2021 +0200
+++ b/tests/svghmi_scrollbar/svghmi_0@svghmi/svghmi.svg Fri Oct 01 17:44:52 2021 +0200
@@ -60,13 +60,13 @@
showgrid="false"
units="px"
inkscape:zoom="0.64"
- inkscape:cx="318.22524"
- inkscape:cy="196.09799"
- inkscape:window-width="1939"
- inkscape:window-height="1243"
- inkscape:window-x="3325"
- inkscape:window-y="162"
- inkscape:window-maximized="0"
+ inkscape:cx="-438.80601"
+ inkscape:cy="183.59799"
+ inkscape:window-width="3200"
+ inkscape:window-height="1672"
+ inkscape:window-x="0"
+ inkscape:window-y="54"
+ inkscape:window-maximized="1"
showguides="true"
inkscape:guide-bbox="true"
inkscape:snap-global="true"
@@ -745,7 +745,7 @@
</g>
<g
id="g4507"
- inkscape:label="HMI:ScrollBar@.position@.range@.size"
+ inkscape:label="HMI:ScrollBar@.range@.position@.size"
transform="translate(-202)">
<rect
y="84"
@@ -818,7 +818,7 @@
x="277.58728"
y="596.54126">Size</tspan></text>
<g
- inkscape:label="HMI:ScrollBar@.position@.range@.size"
+ inkscape:label="HMI:ScrollBar@.range@.position@.size"
id="g146"
transform="rotate(90,837.8103,-106.02497)">
<rect
@@ -854,7 +854,7 @@
</g>
<g
transform="matrix(0.35355339,0.35355339,-0.35355339,0.35355339,831.43929,-136.17916)"
- inkscape:label="HMI:ScrollBar@.position@.range@.size"
+ inkscape:label="HMI:ScrollBar@.range@.position@.size"
id="g156"
style="stroke-width:2">
<rect
--- a/util/BitmapLibrary.py Thu Sep 16 09:40:36 2021 +0200
+++ b/util/BitmapLibrary.py Fri Oct 01 17:44:52 2021 +0200
@@ -71,7 +71,7 @@
height = max(bmp1.GetHeight(), bmp2.GetHeight())
# Create bitmap with both icons
- bmp = wx.EmptyBitmap(width, height)
+ bmp = wx.Bitmap(width, height)
dc = wx.MemoryDC()
dc.SelectObject(bmp)
dc.Clear()
--- a/util/ExceptionHandler.py Thu Sep 16 09:40:36 2021 +0200
+++ b/util/ExceptionHandler.py Fri Oct 01 17:44:52 2021 +0200
@@ -49,7 +49,7 @@
trcbck_lst.append(trcbck)
# Allow clicking....
- cap = wx.Window_GetCapture()
+ cap = wx.Window.GetCapture()
if cap:
cap.ReleaseMouse()