# HG changeset patch # User Edouard Tisserant # Date 1625060672 -7200 # Node ID aff5cedb35ba8e40ccab0fb0f2c3f7f7a9947045 # Parent f3cb352048b69c26e3ec42dc9b0751d89b9b50e4 IDE: Allow POU Libraries to inject PLC Configurations globals during build. diff -r f3cb352048b6 -r aff5cedb35ba POULibrary.py --- a/POULibrary.py Fri Jun 18 14:13:03 2021 +0200 +++ b/POULibrary.py Wed Jun 30 15:44:32 2021 +0200 @@ -63,6 +63,12 @@ # Pure python or IEC libs doesn't produce C code return ((""), [], False), "" + def GlobalInstances(self): + """ + @return: [(instance_name, instance_type),...] + """ + return [] + def FatalError(self, message): """ Raise an exception that will trigger error message intended to the user, but without backtrace since it is not a software error """ diff -r f3cb352048b6 -r aff5cedb35ba ProjectController.py --- a/ProjectController.py Fri Jun 18 14:13:03 2021 +0200 +++ b/ProjectController.py Wed Jun 30 15:44:32 2021 +0200 @@ -744,7 +744,11 @@ return locations def GetConfNodeGlobalInstances(self): - return self._GlobalInstances() + LibGlobals = [] + for lib in self.Libraries: + LibGlobals += lib.GlobalInstances() + CTNGlobals = self._GlobalInstances() + return LibGlobals + CTNGlobals def _Generate_SoftPLC(self): if self._Generate_PLC_ST():