--- a/LPCArch.py Tue Oct 05 09:29:49 2021 +0200
+++ b/LPCArch.py Thu Jan 13 11:49:25 2022 +0100
@@ -5,7 +5,7 @@
SVG_GOT_modules = ['GOT_012', 'LHC2_GOT_012']
MC9_modules = ['MC9', 'MW1']
SOM28_modules = MC9_modules + WX_GOT_modules
-SOM6_modules = SVG_GOT_modules
+SOM6_modules = SVG_GOT_modules + ['MM1'] --- a/LPCBus.py Tue Oct 05 09:29:49 2021 +0200
+++ b/LPCBus.py Thu Jan 13 11:49:25 2022 +0100
@@ -32,7 +32,8 @@
"LHC2_GOT_111":"LHC2_GOT100",
bus_template_code = { plc: GetLocalCode(
--- a/LPCSVGHMI.py Tue Oct 05 09:29:49 2021 +0200
+++ b/LPCSVGHMI.py Thu Jan 13 11:49:25 2022 +0100
@@ -2,6 +2,8 @@
from svghmi.svghmi import SVGHMI, SVGHMILibrary, paths
+from LPCArch import GetLPCProduct # set default values so that COG browser is managed by SVGHMI
SVGHMI.XSD = """<?xml version="1.0" encoding="utf-8" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
@@ -46,31 +48,40 @@
old_get_SVGHMI_options = SVGHMI.get_SVGHMI_options
+product = GetLPCProduct() def get_SVGHMI_options(self):
svghmi_options = old_get_SVGHMI_options(self)
- portrait = self.GetParamsAttributes("SVGHMI.Portrait")["value"]
- rotate180 = self.GetParamsAttributes("SVGHMI.Rotate180")["value"]
- eglfs_angle,touch_angle = {
- (False,False): ("0","0"),
- (False,True): ("90","90"),
- (True,False): ("180","180"),
- (True,True): ("-90","270")}[(rotate180,portrait)]
+ if product in SVG_GOT_modules: + portrait = self.GetParamsAttributes("SVGHMI.Portrait")["value"] + rotate180 = self.GetParamsAttributes("SVGHMI.Rotate180")["value"] + eglfs_angle,touch_angle = { + (False,False): ("0","0"), + (False,True): ("90","90"), + (True,False): ("180","180"), + (True,True): ("-90","270")}[(rotate180,portrait)] - # When we were using EVDEV, this was how rotation was done:
- # 'QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=rotate=' + touch_angle + \
- browser_commandline = 'TSLIB_CONFFILE=/etc/ts_' + touch_angle + ".conf" \
- ' QT_QPA_EGLFS_ROTATION=' + eglfs_angle + \
- ' qt_webenginewidgets_minimal' + \
- ' --js-flags="--max_old_space_size=16 --gc_interval=100 --optimize_for_size"' + \
- ' --single-process' + \
- ' --no-sandbox "' + svghmi_options["url"] + '"'
+ # When we were using EVDEV, this was how rotation was done: + # 'QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=rotate=' + touch_angle + \ + browser_commandline = 'TSLIB_CONFFILE=/etc/ts_' + touch_angle + ".conf" \ + ' QT_QPA_EGLFS_ROTATION=' + eglfs_angle + \ + ' qt_webenginewidgets_minimal' + \ + ' --js-flags="--max_old_space_size=16 --gc_interval=100 --optimize_for_size"' + \ + ' --single-process' + \ + ' --no-sandbox "' + svghmi_options["url"] + '"'
- {"LPCBrowserStart": "sh -c '"+browser_commandline+"'",
- "LPCBrowserStop": "killall qt_webenginewidgets_minimal",
- "LPCBrowserRestart": "sh -c 'killall qt_webenginewidgets_minimal; sleep 1; "+browser_commandline+" '"})
+ {"LPCBrowserStart": "sh -c '"+browser_commandline+"'", + "LPCBrowserStop": "killall qt_webenginewidgets_minimal", + "LPCBrowserRestart": "sh -c 'killall qt_webenginewidgets_minimal; sleep 1; "+browser_commandline+" '"}) + {"LPCBrowserStart": "", + "LPCBrowserRestart": ""})