add a TaskBarIcon to configure beremiz_service and display plc states (started, stopped)
--- a/Beremiz_service.py Tue Nov 04 15:44:44 2008 +0100
+++ b/Beremiz_service.py Tue Nov 04 16:00:44 2008 +0100
@@ -33,78 +33,97 @@
except:
havewx = False
-BeremizIcon = PyEmbeddedImage(
-"iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgIfAhkiAAADopJ"
-"REFUaIG1mntwXNV9xz/n3rt79+5KWq1WsiRLWlkyfgnHsiwMtnkUYptQMBGFMjRhCDANJmMe"
-"pYV/gJZkpoHMJJm2NG1JBzKBQNIUGlLbmMG1MWAZ25LAtmwZW5Yta/WyHtZ7tSvt7r2nf1yt"
-"vJJWtmyH386Z3XvuOff+vr/zO7/XWSG4JAlAAzxANlAIFAMBS8oCYF5jY2NhdXV1UWtrq7u9"
-"vV1vbW1VY7GYMAxDulwuy+VyxUpLS0MVFRVdGzZsqPFnZTUBLUAr0AUMAGHAAhyAAehAbKI/"
-"CsiUzF0CgDrxMD+wAFhiSbkUKN2/f3/Ztm3bCj/66CNXfX39HORgk8PhoKysLL5p06bWxx9/"
-"fHtxIFALnAI6gDEgHZg/8X1+AuQgYKZ8oJi9aQKyBJQL+K6U8qdSyg+qq6vb1q9fb05I5Kpa"
-"enq6vP/++wf27NnzCwF/IeA2AQ8I+Acp5Y8feuih1wRsFOCcjc/ZmHcKyBdws4BnpJS/PXr0"
-"aNM999wTF0JcNePTm2EYcsuWLe2jo6P/LqV8OxwO77333ntbASngOQHpswo6xdo7gRxgKbDO"
-"knLt22+/vW7Lli3eUCiUchV1XWfJNYWUzE8jkGtQnGfg0SWmVBmNarR2R2nuGOZ0sJ8zZ4NY"
-"lpXyOcuXL5cvvfTSwCuvvJJ+5MgRB8DKlSv/q/7IkV8Be7H3xBSaDsCBre9lwI3RWGztM888"
-"c8trr73mkVIipUyaKCi/toQ7bsimaq1Bmm4iLROwIDFOKCAUhFARqgNFMwj2G7y/d5D/23eS"
-"YGt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eTyeTvLl26"
+ "FJiamnpim6qrq9mzZ094fHz875FI5J3p6ekr631WBARgaWlpCezYsePeuXPnzFAo5Dp58uS+"
+ "dDp91GKxNBYKBW82m3Vomqa7XK7pbDYbnJmZuR2LxYL5fP79WCyWeeys1h/D9e97enqsp06d"
+ "8mWzWU+xWPTkcjmXaZpxwzDCsVhsbqNggP8BMJOU3UUUf+0AAAAASUVORK5CYII=")
+
+ #----------------------------------------------------------------------
+ starticon = PyEmbeddedImage(
+ "iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABHNCSVQICAgIfAhkiAAABbpJ"
+ "REFUSIl9lltsFNcdxn9nZnbHs15fd23j9TXYC0UCKzEhMQ+oIS2g1kQ1pbFStX0opFWsovSh"
+ "rUqp2pS2ioTUolaKFOGHqGkiJcKRuDhOaZRiZCsCXyBgCBBfMfbu+oa9s17wzuzl9MH24mDD"
+ "XzoPc/6fft+c72jOGSGlZEVlAU8D9cB20zQ9HR0duRcvXszq7e01EomEUlFREa+srLR8Pl+g"
+ "sbHx3zk5ORcAFfACA8Bt4CFUSomUUkgpS6SUB6SUH5umOXLgwIEHqqrKJfGao7S0VB49ejRo"
+ "2/YnUsrT+/fvb66pqSldYiKlRCytoBB4Gfjx6dOnq5qamjwTExOKqqqU+QrYUJFN7QY32Qbc"
+ "vSeYCGtcux1i5M5dAPx+P1VVVQvnzp0ziouLfx8MBt9cXoAGZABbgZ1HjhwpO378eEEymaSi"
+ "tIBjPy9lU5nKoyWExF2yjy+mN3HsH+/Q3d3NwMCAsZTI9pVaDXgK2Hr27Nn85ubmEpdh8IMX"
+ "ffxirwshVrGXHBQSC/dIRvoZGuz/WkvTtHIhhCGlXABQgI2Tk5P5hw8f3uZwOGj8VjGHXnoC"
+ "HJCpJFbkLtr8FXbX+XC79HRPVVW/qqre9LtIKX/S0NDwy76+vq1lhTr/fM2NAmTk+fHv/dea"
+ "BlZkDHP0PHODH2NHg1gykw8/X7Dfb7vjTNgJqqurT3R1db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/3z7pcuXzmia1rJSs3xlOg8dOvTD"
+ "8fHx7wQCgb4tW7bMm6b55/Pnz+eGw+FFGJDT5iT1XRWlfxHMZ06+/Vz9dCAQeG9kZKR1x44d"
+ "nSdPnkyuZSAArbq6eqOiKAP9/f3xlpaWgra2tlei0eiryWSyKGKa2TcaL+muwcxU5aDf9Gi+"
+ "L0Oh0BehUOiaZVlnAoHAzFr7Ih75bVnVb2pqcvf09Phi0ei6+/rUC6lw1k0p5bSUctThcIwP"
+ "Dw/HnwT4P6CDl+TMvD0JAAAAAElFTkSuQmCC")
+
+ #----------------------------------------------------------------------
+ stopicon = PyEmbeddedImage(
+ "iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABHNCSVQICAgIfAhkiAAABPRJ"
+ "REFUSImdlllsVGUUx3/f/e4sd5iZLjNt6XSFdtgkjWFRePABDaCBGgjamIg81CU0aoxbRHww"
+ "+EDkhWjEB5rYGEMUxQTCJg8EoQ2BbgrFCNJWltplgC63naEzd+bO50NLLVAq4STfwz3nfP/f"
+ "PSf3O98VSikmmQ94HFgDLDdNM1BfX5955swZX0tLi5FKpbSSkpJkaWlpIhQKdVdVVX2XkZFx"
+ "EpBAEGgHLgH/iSqlUEoJpVSBUqpaKXXYNM0r1dXVt6WUajx5ylVYWKi2bdvWY1nWUaXUgQ0b"
+ "NtRWVFQUjmuilEKMV5ALvAhsPHDgQFlNTU2gr69Pk1JSFMphTomfRXO8+A243i/oG9I5f6mX"
+ "K1evAxAOhykrKxs9duyYkZ+f/0lPT8/2OwXogBtYDKzYunVr0c6dO3Ns26akMIcdbxQyv0hy"
+ "rwmh8Bas5/eb89nxRR1NTU20t7cb4x1ZPjlXB2YBiw8ePJhdW1tb4DEMXng6xJtrPQhxn/Y4"
+ "QSM12o89fJnOjst3hXRdLxZCGEqpUQANmBuJRLK3bNmy1OFwUPVMPm9VTiMOqLRNYvg6+shv"
+ "rFoWwutxTcSklGEpZXDiXZRSr6xbt+6dtra2xUW5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Hp7mK7jdxz2/LffGamhpvc3NzyLKsbFd3z1PG"
+ "aHyBTKdjum0POGzbFAp7qo0xVOtJZdf/C/wRDnL5FYGSAAAAAElFTkSuQmCC")
def usage():
print """
@@ -178,8 +197,10 @@
self.args = args
self.plcobj = None
self.servicepublisher = None
-
- def Loop(self):
+ self.statuschange = None
+
+ def Loop(self, statuschange=None):
+ self.statuschange = statuschange
while self.continueloop:
self.Start()
@@ -193,7 +214,7 @@
def Start(self):
pyro.initServer()
self.daemon=pyro.Daemon(host=self.ip, port=self.port)
- self.plcobj = PLCObject(self.workdir, self.daemon, self.args)
+ self.plcobj = PLCObject(self.workdir, self.daemon, self.args, self.statuschange)
uri = self.daemon.connect(self.plcobj,"PLCObject")
print "The daemon runs on port :",self.port
@@ -265,11 +286,9 @@
def __init__(self, pyroserver):
wx.TaskBarIcon.__init__(self)
# Set the image
- icon = self.MakeIcon(BeremizIcon.GetImage())
- self.SetIcon(icon, "Beremiz Service")
+ self.UpdateIcon(None)
+
# bind some events
- #self.Bind(wx.EVT_TASKBAR_CLICK, self.OnClick)
- #self.Bind(wx.EVT_TASKBAR_LEFT_DCLICK, self.OnTaskBarActivate)
self.Bind(wx.EVT_MENU, self.OnTaskBarChangeName, id=self.TBMENU_CHANGE_NAME)
self.Bind(wx.EVT_MENU, self.OnTaskBarChangeInterface, id=self.TBMENU_CHANGE_INTERFACE)
self.Bind(wx.EVT_MENU, self.OnTaskBarChangePort, id=self.TBMENU_CHANGE_PORT)
@@ -340,12 +359,23 @@
self.RemoveIcon()
wx.GetApp().ExitMainLoop()
+ def UpdateIcon(self, plcstatus):
+ if plcstatus is "Started" :
+ currenticon = self.MakeIcon(starticon.GetImage())
+ elif plcstatus is "Stopped":
+ currenticon = self.MakeIcon(stopicon.GetImage())
+ else:
+ currenticon = self.MakeIcon(defaulticon.GetImage())
+ self.SetIcon(currenticon, "Beremiz Service")
+
pyroserver = Server(name, ip, port, WorkingDir, args)
if havewx:
app=wx.App(redirect=False)
taskbar_instance = DemoTaskBarIcon(pyroserver)
- pyro_thread=Thread(target=pyroserver.Loop)
+ def statuschange(status):
+ wx.CallAfter(taskbar_instance.UpdateIcon,status)
+ pyro_thread=Thread(target=pyroserver.Loop, args=[statuschange])
pyro_thread.start()
app.MainLoop()
else:
--- a/images/icons.svg Tue Nov 04 15:44:44 2008 +0100
+++ b/images/icons.svg Tue Nov 04 16:00:44 2008 +0100
@@ -29,8 +29,8 @@
</rdf:RDF>
</metadata>
<sodipodi:namedview
- inkscape:window-height="994"
- inkscape:window-width="1623"
+ inkscape:window-height="945"
+ inkscape:window-width="1270"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
guidetolerance="10.0"
@@ -41,17 +41,21 @@
pagecolor="#ffffff"
id="base"
showgrid="false"
- inkscape:zoom="1"
- inkscape:cx="195.89792"
- inkscape:cy="212.79757"
- inkscape:window-x="52"
- inkscape:window-y="51"
- inkscape:current-layer="g18993"
+ inkscape:zoom="2.828427"
+ inkscape:cx="16.327355"
+ inkscape:cy="437.51409"
+ inkscape:window-x="0"
+ inkscape:window-y="25"
+ inkscape:current-layer="svg2"
showguides="true"
inkscape:guide-bbox="true">
<inkscape:grid
type="xygrid"
id="grid16717" />
+ <sodipodi:guide
+ orientation="1,0"
+ position="125.33468,460.32653"
+ id="guide16428" />
</sodipodi:namedview>
<defs
id="defs4">
@@ -84948,7 +84952,7 @@
x="26.008392"><tspan
id="tspan19985"
y="509.33417"
- x="26.008392">%% ico48 ico24 ico16 %%</tspan></text>
+ x="26.008392">%% ico48 ico24 ico16 icoplay24 icostop24 %%</tspan></text>
<g
transform="translate(1084.009,-193.72536)"
id="g17590">
@@ -85770,4 +85774,50 @@
style="opacity:1;fill:#160379;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="M 514.14211,134.18201 L 513.44846,134.37119 L 514.09481,136.75167 C 513.55664,136.88976 513.034,137.15037 512.61293,137.57144 C 512.58031,137.60404 512.56503,137.64813 512.53409,137.68179 C 511.78169,137.61864 511.00589,137.70771 510.24821,137.94979 L 509.60186,135.53777 L 508.90819,135.72696 L 509.5861,138.20203 C 508.90904,138.50465 508.25523,138.92751 507.67856,139.47899 L 505.51876,138.13898 L 505.15618,138.7538 L 507.18983,139.99922 C 506.46851,140.85118 505.98679,141.84216 505.771,142.83687 L 503.56394,142.23781 L 503.37475,142.93146 L 505.67641,143.56206 C 505.54986,144.9582 505.92466,146.33767 506.82724,147.39291 L 514.37857,139.84157 L 514.88305,140.34605 L 507.33172,147.89738 C 508.2984,148.72357 509.54404,149.1165 510.81574,149.07974 L 511.28869,150.84539 L 511.98234,150.65621 L 511.54092,149.01668 C 512.59832,148.85042 513.66579,148.38127 514.58351,147.64515 L 515.46634,149.06397 L 516.08117,148.70138 L 515.13529,147.15642 C 515.82639,146.46532 516.32697,145.65819 516.64871,144.82323 L 518.49319,145.31195 L 518.68237,144.6183 L 516.86941,144.1296 C 517.03506,143.48333 517.09629,142.82751 517.04282,142.19052 C 517.07648,142.15959 517.12057,142.14431 517.15319,142.11171 C 517.57426,141.69063 517.83486,141.16798 517.97296,140.6298 L 520.35344,141.27617 L 520.54262,140.58251 L 518.08331,139.92038 C 518.10481,139.07152 517.80055,138.21881 517.15319,137.57144 C 516.50581,136.92407 515.6531,136.61982 514.80424,136.64131 L 514.14211,134.18201 z"
id="path16411" />
+ <rect
+ style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:10.43299961;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="icoplay24"
+ y="572.17468"
+ x="114.5"
+ height="24"
+ width="24"
+ inkscape:label="#rect16422" />
+ <use
+ style="display:inline"
+ xlink:href="#g19358"
+ height="1052.3622"
+ width="744.09448"
+ y="0"
+ x="0"
+ id="use16424"
+ transform="matrix(0.1343319,0,0,0.1343319,344.9601,301.85368)" />
+ <path
+ style="opacity:1;fill:#0fff09;fill-opacity:1;fill-rule:evenodd;stroke:#1d0000;stroke-width:0.30481818;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 125.5806,584.61698 L 136.41579,590.03458 L 125.5806,595.45217 L 125.5806,584.61698 z"
+ id="rect16426"
+ sodipodi:nodetypes="cccc" />
+ <rect
+ style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:10.43299961;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="icostop24"
+ y="602.86218"
+ x="113.75"
+ height="24"
+ width="24"
+ inkscape:label="#rect17199" />
+ <use
+ style="display:inline"
+ xlink:href="#g19358"
+ height="1052.3622"
+ width="744.09448"
+ y="0"
+ x="0"
+ id="use17201"
+ transform="matrix(0.1343319,0,0,0.1343319,344.2101,332.54118)" />
+ <rect
+ style="fill:#ff0009;fill-opacity:1;stroke:#000000;stroke-width:0.31892911;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect17210"
+ width="10.821424"
+ height="10.821424"
+ x="125.33468"
+ y="615.21997" />
</svg>
Binary file images/icoplay24.png has changed
Binary file images/icostop24.png has changed
--- a/runtime/PLCObject.py Tue Nov 04 15:44:44 2008 +0100
+++ b/runtime/PLCObject.py Tue Nov 04 16:00:44 2008 +0100
@@ -41,7 +41,7 @@
class PLCObject(pyro.ObjBase):
_Idxs = []
- def __init__(self, workingdir, daemon, argv):
+ def __init__(self, workingdir, daemon, argv, statuschange=None):
pyro.ObjBase.__init__(self)
self.argv = [workingdir] + argv # force argv[0] to be "path" to exec...
self.workingdir = workingdir
@@ -50,6 +50,7 @@
# Creates fake C funcs proxies
self._FreePLC()
self.daemon = daemon
+ self.statuschange = statuschange
# Get the last transfered PLC if connector must be restart
try:
@@ -171,6 +172,8 @@
if debug:
self._resumeDebug()
self.PLCStatus = "Started"
+ if self.statuschange is not None:
+ self.statuschange(self.PLCStatus)
return True
else:
print "_StartPLC did not return 0 !"
@@ -180,6 +183,8 @@
def _DoStopPLC(self):
self._stopPLC()
self.PLCStatus = "Stopped"
+ if self.statuschange is not None:
+ self.statuschange(self.PLCStatus)
if self._FreePLC():
self.PLCStatus = "Dirty"
return True