--- a/ProjectController.py Thu Apr 11 13:45:27 2019 +0200
+++ b/ProjectController.py Mon Apr 15 13:34:09 2019 +0200
@@ -1422,6 +1422,7 @@
@@ -1438,6 +1439,7 @@
PlcStatus.Broken: {"_Connect": False,
PlcStatus.Disconnected: {},
@@ -1913,6 +1915,17 @@
wx.CallAfter(self.UpdateMethodsFromPLCStatus)
+ dialog = wx.MessageDialog( + _('Delete target PLC application?'), + wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION) + answer = dialog.ShowModal() + if answer == wx.ID_YES: + self._connector.PurgePLC() @@ -1955,6 +1968,13 @@
+ "tooltip": _("Repair broken PLC"), "tooltip": _("Disconnect from PLC"),
--- a/images/icons.svg Thu Apr 11 13:45:27 2019 +0200
+++ b/images/icons.svg Mon Apr 15 13:34:09 2019 +0200
@@ -43,12 +43,12 @@
- inkscape:cx="754.13513"
- inkscape:cy="907.03479"
+ inkscape:zoom="5.6568543" + inkscape:cx="766.02087" + inkscape:cy="916.07252" - inkscape:current-layer="svg2"
+ inkscape:current-layer="g10453" inkscape:guide-bbox="true"
inkscape:window-maximized="1"
@@ -87442,6 +87442,27 @@
gradientTransform="matrix(0.95160132,-0.01357563,0.01391374,0.97645493,3.8528826,4.1473681)"
gradientUnits="userSpaceOnUse" />
+ id="linearGradient10435" + xlink:href="#radialGradient2553-7-9" + gradientUnits="userSpaceOnUse" + gradientTransform="scale(0.89256,1.1204)" + inkscape:collect="always" /> + id="linearGradient7925"> + style="stop-color:#d0d0d0" + style="stop-color:#a6a3a3" @@ -89948,7 +89969,7 @@
- style="font-size:12.76095104px;line-height:1.25">%% editIECrawcode editWXGLADE editPYTHONcode EditCfile Transfer Connect Disconnect Debug IDManager %%</tspan></text>
+ style="font-size:12.76095104px;line-height:1.25">%% editIECrawcode editWXGLADE editPYTHONcode EditCfile Transfer Connect Disconnect Debug IDManager Repair %%</tspan></text> @@ -93341,12 +93362,21 @@
inkscape:connector-curvature="0" />
+ transform="matrix(0.27063582,0.04354624,-0.04354624,0.27063582,790.21268,127.46614)"> + style="fill:url(#linearGradient10435);stroke:#606060;stroke-width:1.25;stroke-linecap:round;stroke-linejoin:round;fill-opacity:1.0" + inkscape:connector-curvature="0" + d="m 64.661,6.0611 c -4.831,1.9764 -8.619,6.2529 -9.679,11.757 -0.673,3.493 -0.092,6.917 1.339,9.901 -3.895,8.12 -19.113,29.069 -26.331,36.587 -6.581,0.93 -12.171,5.856 -13.497,12.74 -1.006,5.227 0.712,10.321 4.096,13.932 l 2.098,-10.894 c 0.523,-2.72 3.135,-4.488 5.855,-3.964 l 7.917,1.525 c 2.72,0.523 4.488,3.135 3.964,5.855 l -2.186,11.354 c 4.83,-1.977 8.619,-6.253 9.679,-11.757 0.842,-4.372 -0.202,-8.667 -2.544,-12.074 5.389,-9.026 18.947,-28.336 26.036,-34.225 7.218,-0.328 13.571,-5.527 14.996,-12.929 1.007,-5.228 -0.711,-10.321 -4.095,-13.932 l -2.098,10.894 c -0.524,2.72 -3.135,4.488 -5.855,3.964 l -7.917,-1.525 c -2.721,-0.524 -4.489,-3.135 -3.965,-5.855 l 2.187,-11.354 z" /> inkscape:label="#rect16270"
- style="display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:0;fill-rule:evenodd;stroke:#6e6e6e;stroke-width:0.1;marker:none;enable-background:accumulate;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ style="display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:0;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;enable-background:accumulate"
--- a/runtime/PLCObject.py Thu Apr 11 13:45:27 2019 +0200
+++ b/runtime/PLCObject.py Mon Apr 15 13:34:09 2019 +0200
@@ -530,31 +530,45 @@
shutil.move(path, newpath)
+ def _extra_files_log_path(self): + return os.path.join(self.workingdir, "extra_files.txt") + extra_files_log = self._extra_files_log_path() + old_PLC_filename = os.path.join(self.workingdir, self.CurrentPLCFilename) \ + if self.CurrentPLCFilename is not None \ + os.remove(old_PLC_filename) + for filename in open(extra_files_log, "rt").readlines() + [extra_files_log]: + os.remove(os.path.join(self.workingdir, filename.strip())) + self.PLCStatus = PlcStatus.Empty + # TODO: PLCObject restart def NewPLC(self, md5sum, plc_object, extrafiles):
if self.PLCStatus in [PlcStatus.Stopped, PlcStatus.Empty, PlcStatus.Broken]:
NewFileName = md5sum + lib_ext
- extra_files_log = os.path.join(self.workingdir, "extra_files.txt")
+ extra_files_log = self._extra_files_log_path() - old_PLC_filename = os.path.join(self.workingdir, self.CurrentPLCFilename) \
- if self.CurrentPLCFilename is not None \
new_PLC_filename = os.path.join(self.workingdir, NewFileName)
- self.LogMessage("NewPLC (%s)" % md5sum)
- self.PLCStatus = PlcStatus.Empty
- os.remove(old_PLC_filename)
- for filename in open(extra_files_log, "rt").readlines() + [extra_files_log]:
- os.remove(os.path.join(self.workingdir, filename.strip()))
+ self.LogMessage("NewPLC (%s)" % md5sum)