IDE: follow-up on change in 83ed4ea362db - added workaround when matiec generated files contain unexpected characters.
authorEdouard Tisserant
Mon, 24 Jan 2022 11:14:56 +0100
changeset 3421 70ef15fca028
parent 3420 da8cceaa247d
child 3426 c2c366964913
child 3427 f748161de54b
IDE: follow-up on change in 83ed4ea362db - added workaround when matiec generated files contain unexpected characters.
ProjectController.py
--- a/ProjectController.py	Thu Jan 20 11:39:05 2022 +0100
+++ b/ProjectController.py	Mon Jan 24 11:14:56 2022 +0100
@@ -796,7 +796,7 @@
         # Compute offset before ST resulting of transformation from user POUs
         self.ProgramOffset = IECCodeContent.count("\n")
 
-        IECCodeContent += open(self._getIECgeneratedcodepath(), "r").read()
+        POUsIECCodeContent = open(self._getIECgeneratedcodepath(), "r").read()
 
         IECcodepath = self._getIECcodepath()
 
@@ -805,9 +805,11 @@
 
         with open(IECcodepath, "w") as plc_file:
             plc_file.write(IECCodeContent)
+            plc_file.write(POUsIECCodeContent)
 
         hasher = hashlib.md5()
         hasher.update(IECCodeContent)
+        hasher.update(POUsIECCodeContent)
         self.IECcodeDigest = hasher.hexdigest()
 
         return True