794 |
794 |
795 |
795 |
796 # Compute offset before ST resulting of transformation from user POUs |
796 # Compute offset before ST resulting of transformation from user POUs |
797 self.ProgramOffset = IECCodeContent.count("\n") |
797 self.ProgramOffset = IECCodeContent.count("\n") |
798 |
798 |
799 IECCodeContent += open(self._getIECgeneratedcodepath(), "r").read() |
799 POUsIECCodeContent = open(self._getIECgeneratedcodepath(), "r").read() |
800 |
800 |
801 IECcodepath = self._getIECcodepath() |
801 IECcodepath = self._getIECcodepath() |
802 |
802 |
803 if not os.path.exists(IECcodepath): |
803 if not os.path.exists(IECcodepath): |
804 self.LastBuiltIECcodeDigest = None |
804 self.LastBuiltIECcodeDigest = None |
805 |
805 |
806 with open(IECcodepath, "w") as plc_file: |
806 with open(IECcodepath, "w") as plc_file: |
807 plc_file.write(IECCodeContent) |
807 plc_file.write(IECCodeContent) |
|
808 plc_file.write(POUsIECCodeContent) |
808 |
809 |
809 hasher = hashlib.md5() |
810 hasher = hashlib.md5() |
810 hasher.update(IECCodeContent) |
811 hasher.update(IECCodeContent) |
|
812 hasher.update(POUsIECCodeContent) |
811 self.IECcodeDigest = hasher.hexdigest() |
813 self.IECcodeDigest = hasher.hexdigest() |
812 |
814 |
813 return True |
815 return True |
814 |
816 |
815 def _Compile_ST_to_SoftPLC(self): |
817 def _Compile_ST_to_SoftPLC(self): |