ProjectController.py
changeset 3380 794e39598e46
parent 3376 83ed4ea362db
child 3395 93ad018fb602
equal deleted inserted replaced
3378:e655ec8162e1 3380:794e39598e46
   795         # Compute offset before ST resulting of transformation from user POUs
   795         # Compute offset before ST resulting of transformation from user POUs
   796         self.ProgramOffset = IECCodeContent.count("\n")
   796         self.ProgramOffset = IECCodeContent.count("\n")
   797 
   797 
   798         IECCodeContent += open(self._getIECgeneratedcodepath(), "r").read()
   798         IECCodeContent += open(self._getIECgeneratedcodepath(), "r").read()
   799 
   799 
   800         with open(self._getIECcodepath(), "w") as plc_file:
   800         IECcodepath = self._getIECcodepath()
       
   801 
       
   802         if not os.path.exists(IECcodepath):
       
   803             self.LastBuiltIECcodeDigest = None
       
   804 
       
   805         with open(IECcodepath, "w") as plc_file:
   801             plc_file.write(IECCodeContent)
   806             plc_file.write(IECCodeContent)
   802 
   807 
   803         hasher = hashlib.md5()
   808         hasher = hashlib.md5()
   804         hasher.update(IECCodeContent)
   809         hasher.update(IECCodeContent)
   805         self.IECcodeDigest = hasher.hexdigest()
   810         self.IECcodeDigest = hasher.hexdigest()