lpcmanager

Parents 1c870ee5ecc3
Children d7c0471efa16
Added double click function to URI_location. Added ToZIPFile function.
  • +19 -1
    LPCManager.py
  • --- a/LPCManager.py Tue Jul 19 10:16:57 2016 +0200
    +++ b/LPCManager.py Fri Aug 05 12:56:54 2016 +0200
    @@ -2,6 +2,7 @@
    # -*- coding: utf-8 -*-
    import shutil
    import socket
    +import zipfile
    __version__ = "$Revision$"
    @@ -411,7 +412,6 @@
    _MethodFromPLCState["Connected"] += [("_Connect", False),
    ("_Disconnect", True)]
    -
    class LPCProjectController(ProjectController):
    StatusMethods = _StatusMethods
    # ConfNodeMethods = []
    @@ -443,6 +443,9 @@
    # Firmware update running status
    self.firmawreUpadateIsRunning = False
    + # Bind mouse double click event on URI_location in Beremiz
    + self.wizard = True
    +
    def GetProjectName(self):
    return self.Project.getname()
    @@ -466,6 +469,19 @@
    else:
    return ProjectController._getBuildPath(self)
    + def ToZIPFile(self):
    + # MD5 = self.GetLastBuildMD5()
    + zf = zipfile.ZipFile(self.BuildPath[:-5] + "\\" + self._builder.exe[:-3] + ".xEye", mode='w')
    +
    + for extrafilespath in [self._getExtraFilesPath(),
    + self._getProjectFilesPath()]:
    + dir = extrafilespath.split("\\")[-1]
    + for name in os.listdir(extrafilespath):
    + zf.write(extrafilespath + '\\' + str(name), dir + '\\' + str(name), zipfile.ZIP_DEFLATED)
    + zf.write(self._builder.exe_path, self._builder.exe)
    + zf.write(self.BuildPath + '\\lastbuildPLC.md5', 'lastbuildPLC.md5')
    + zf.close()
    +
    def _Build(self):
    save = self.ProjectTestModified()
    if save:
    @@ -474,9 +490,11 @@
    if self.BuildPath is not None:
    mycopytree(self.OrigBuildPath, self.BuildPath)
    ProjectController._Build(self)
    + self.ToZIPFile()
    if save:
    wx.CallAfter(self.AppFrame.RefreshAll)
    +
    def SetProjectName(self, name):
    return self.Project.setname(name)