lpcmanager

c097dedf00a4
Parents d951ad18b4c0
Children 9191cb1496fc
Add "Manage Alarms" button. opening a dumb choice dialog.
--- a/LPCProjectController.py Mon May 25 14:07:51 2020 +0200
+++ b/LPCProjectController.py Mon Sep 07 15:20:00 2020 +0200
@@ -28,6 +28,14 @@
LPCMethodsFromStatus["Stopped"]["_UpdateFw"] = True
LPCMethodsFromStatus["Empty"]["_UpdateFw"] = True
+ProjectController.ConfNodeMethods += [
+ {
+ "bitmap": "ALARM",
+ "name": _("Manage alarms"),
+ "tooltip": _("Describe and translate alarms"),
+ "method": "_ManageAlarms"
+ },
+]
class LPCProjectController(ProjectController):
StatusMethods = ProjectController.StatusMethods + LPCStatusMethods
DefaultMethods = LPCDefaultMethods
@@ -162,6 +170,20 @@
return None
+ def _ManageAlarms(self):
+ dlg = wx.SingleChoiceDialog(
+ self.AppFrame,
+ 'Test Single Choice', 'The Caption',
+ ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight'],
+ wx.CHOICEDLG_STYLE)
+
+ if dlg.ShowModal() == wx.ID_OK:
+ self.log.WriteText('You selected: %s\n' % dlg.GetStringSelection())
+
+ dlg.Destroy()
+
+ print("Manage alarms")
+
def _UpdateFw(self):
"""
Method called by user to flash the firmware of the PLC
Binary file images/ALARM.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/images/genicons.sh Mon Sep 07 15:20:00 2020 +0200
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+INKSCAPE=inkscape
+
+for fname in `ls *.svg`; do
+ for i in `cat $fname |grep -o -e '%%[^%]*%%'|sed 's/%//g'`
+ do
+ if [ $i.png -nt $fname ]; then
+ echo "Skip $i"
+ else
+ rm -f $i.png
+ echo "$INKSCAPE" $fname -z -e $i.png -i $i
+ "$INKSCAPE" $fname -z -e $i.png -i $i
+ fi
+ done
+done
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/images/icons.svg Mon Sep 07 15:20:00 2020 +0200
@@ -0,0 +1,127 @@
+<?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:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="744.09448"
+ height="1052.3622"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.92.3 (2405546, 2018-03-11)"
+ sodipodi:docname="icons.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <metadata
+ id="metadata13810">
+ <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>
+ <sodipodi:namedview
+ inkscape:window-height="836"
+ inkscape:window-width="1800"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0"
+ guidetolerance="10.0"
+ gridtolerance="10000"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ showgrid="false"
+ inkscape:zoom="5.6568543"
+ inkscape:cx="380.11858"
+ inkscape:cy="676.83086"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:current-layer="g46158"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ inkscape:window-maximized="1"
+ inkscape:measure-start="904.956,703.964"
+ inkscape:measure-end="930.144,704.058">
+ <inkscape:grid
+ type="xygrid"
+ id="grid16717"
+ empspacing="5"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" />
+ </sodipodi:namedview>
+ <text
+ style="font-style:normal;font-weight:normal;font-size:40.12579727px;line-height:0%;font-family:'Bitstream Vera Sans';fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"
+ id="text18397"
+ y="54.610374"
+ x="371.85562"><tspan
+ style="text-align:center;text-anchor:middle"
+ id="tspan18399"
+ y="54.610374"
+ x="371.85562">LPCManager icons</tspan></text>
+ <text
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none"
+ xml:space="preserve"
+ id="text60407-68-0"
+ y="360.20483"
+ x="365.61026"><tspan
+ y="360.20483"
+ x="365.61026"
+ id="tspan16195-3-3"
+ sodipodi:role="line"
+ style="font-size:12.76000023px;line-height:1.25">%% ALARM %%</tspan></text>
+ <g
+ id="g46158"
+ transform="matrix(1.5,0,0,1.5,-202.5,-195.93108)"
+ style="stroke-width:0.66666669">
+ <rect
+ width="16"
+ height="16"
+ x="405"
+ y="375.86215"
+ id="ALARM"
+ style="display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:0;fill-rule:evenodd;stroke:none;stroke-width:0.66666669;marker:none;enable-background:accumulate" />
+ <path
+ inkscape:transform-center-y="-1.9795276"
+ inkscape:transform-center-x="-0.011147353"
+ d="m 420.17779,390.02543 -7.17729,0.0865 -7.17828,-0.0479 3.51374,-6.25895 3.63061,-6.19263 3.66355,6.17246 z"
+ inkscape:randomized="0"
+ inkscape:rounded="0"
+ inkscape:flatsided="false"
+ sodipodi:arg2="1.568032"
+ sodipodi:arg1="0.52090978"
+ sodipodi:r2="4.2112961"
+ sodipodi:r1="8.2882175"
+ sodipodi:cy="385.90063"
+ sodipodi:cx="412.98886"
+ sodipodi:sides="3"
+ id="path19290"
+ style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#ffcc00;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.44444481;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
+ sodipodi:type="star" />
+ <text
+ transform="scale(1.191303,0.839417)"
+ id="text19292"
+ y="463.00879"
+ x="344.19293"
+ style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.66666669"
+ xml:space="preserve"><tspan
+ style="font-size:12.4041214px;line-height:1.25;font-family:sans-serif;stroke-width:0.66666669"
+ y="463.00879"
+ x="344.19293"
+ id="tspan19294"
+ sodipodi:role="line">!</tspan></text>
+ </g>
+</svg>