plugger.py
changeset 228 848da15cf513
parent 227 48c13b84505c
child 235 a66e150f2888
equal deleted inserted replaced
227:48c13b84505c 228:848da15cf513
   960         Return C code generated by iec2c compiler 
   960         Return C code generated by iec2c compiler 
   961         when _generate_softPLC have been called
   961         when _generate_softPLC have been called
   962         @param locations: ignored
   962         @param locations: ignored
   963         @return: [(C_file_name, CFLAGS),...] , LDFLAGS_TO_APPEND
   963         @return: [(C_file_name, CFLAGS),...] , LDFLAGS_TO_APPEND
   964         """
   964         """
   965         return [(C_file_name, self.plcCFLAGS) for C_file_name in self.PLCGeneratedCFiles ] , "-lrt", False
   965         return [(C_file_name, self.plcCFLAGS) for C_file_name in self.PLCGeneratedCFiles ] , "", False
   966     
   966     
   967     def ResetIECProgramsAndVariables(self):
   967     def ResetIECProgramsAndVariables(self):
   968         """
   968         """
   969         Reset variable and program list that are parsed from
   969         Reset variable and program list that are parsed from
   970         CSV file generated by IEC2C compiler.
   970         CSV file generated by IEC2C compiler.
  1123             "retrieve_calls":"\n    ".join([
  1123             "retrieve_calls":"\n    ".join([
  1124                   "__retrieve_%s();"%locstr for locstr in locstrs]),
  1124                   "__retrieve_%s();"%locstr for locstr in locstrs]),
  1125             "publish_calls":"\n    ".join([ #Call publish in reverse order
  1125             "publish_calls":"\n    ".join([ #Call publish in reverse order
  1126                   "__publish_%s();"%locstrs[i-1] for i in xrange(len(locstrs), 0, -1)]),
  1126                   "__publish_%s();"%locstrs[i-1] for i in xrange(len(locstrs), 0, -1)]),
  1127             "init_calls":"\n    ".join([
  1127             "init_calls":"\n    ".join([
  1128                   "init_level=%d; "%i+
  1128                   "init_level=%d; "%(i+1)+
  1129                   "if(res = __init_%s(argc,argv)){"%locstr +
  1129                   "if(res = __init_%s(argc,argv)){"%locstr +
  1130                   #"printf(\"%s\"); "%locstr + #for debug
  1130                   #"printf(\"%s\"); "%locstr + #for debug
  1131                   "return res;}" for i,locstr in enumerate(locstrs)]),
  1131                   "return res;}" for i,locstr in enumerate(locstrs)]),
  1132             "cleanup_calls":"\n    ".join([
  1132             "cleanup_calls":"\n    ".join([
  1133                   "if(init_level >= %d) "%i+
  1133                   "if(init_level >= %d) "%i+