# HG changeset patch # User Laurent Bessard # Date 1366976307 -7200 # Node ID 83b0815b8812eae35c80fa1cae1f1fb2a546e69c # Parent 5e740fe71fbe9f49401edbb69e87c674d74f0bd8 Fixed retrieve and publish call order in PLC generated code diff -r 5e740fe71fbe -r 83b0815b8812 ProjectController.py --- a/ProjectController.py Thu Apr 25 15:30:50 2013 +0200 +++ b/ProjectController.py Fri Apr 26 13:38:27 2013 +0200 @@ -803,7 +803,7 @@ # in retreive, publish, init, cleanup locstrs = map(lambda x:"_".join(map(str,x)), [loc for loc,Cfiles,DoCalls in self.LocationCFilesAndCFLAGS if loc and DoCalls]) - + # Generate main, based on template if not self.BeremizRoot.getDisable_Extensions(): plc_main_code = targets.GetCode("plc_main_head") % { @@ -813,9 +813,9 @@ "void __retrieve_%(s)s(void);\n"+ "void __publish_%(s)s(void);")%{'s':locstr} for locstr in locstrs]), "retrieve_calls":"\n ".join([ - "__retrieve_%s();"%locstrs[i-1] for i in xrange(len(locstrs), 0, -1)]), + "__retrieve_%s();"%locstr for locstr in locstrs]), "publish_calls":"\n ".join([ #Call publish in reverse order - "__publish_%s();"%locstr for locstr in locstrs]), + "__publish_%s();"%locstrs[i-1] for i in xrange(len(locstrs), 0, -1)]), "init_calls":"\n ".join([ "init_level=%d; "%(i+1)+ "if((res = __init_%s(argc,argv))){"%locstr +