# HG changeset patch
# User Edouard Tisserant
# Date 1643019296 -3600
# Node ID 70ef15fca0280bd21389df61f349342c31bb1c25
# Parent  da8cceaa247dc4a3d0a311588925d068135d8351
IDE: follow-up on change in 83ed4ea362db - added workaround when matiec generated files contain unexpected characters.

diff -r da8cceaa247d -r 70ef15fca028 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