ProjectController.py
changeset 1050 56bef276055e
parent 1006 0302f9ab7e9a
child 1062 fd7c9a7cf882
equal deleted inserted replaced
1049:ebf53b5f0777 1050:56bef276055e
   600         if not C_files:
   600         if not C_files:
   601             self.logger.write_error(_("Error : At least one configuration and one resource must be declared in PLC !\n"))
   601             self.logger.write_error(_("Error : At least one configuration and one resource must be declared in PLC !\n"))
   602             return False
   602             return False
   603         # transform those base names to full names with path
   603         # transform those base names to full names with path
   604         C_files = map(lambda filename:os.path.join(buildpath, filename), C_files)
   604         C_files = map(lambda filename:os.path.join(buildpath, filename), C_files)
       
   605 
       
   606         # prepend beremiz include to configuration header
       
   607         H_files = [ fname for fname in result.splitlines() if fname[-2:]==".h" or fname[-2:]==".H" ]
       
   608         H_files.remove("LOCATED_VARIABLES.h")
       
   609         H_files = map(lambda filename:os.path.join(buildpath, filename), H_files)
       
   610         for H_file in H_files:
       
   611             with file(H_file, 'r') as original: data = original.read()
       
   612             with file(H_file, 'w') as modified: modified.write('#include "beremiz.h"\n' + data)
       
   613 
   605         self.logger.write(_("Extracting Located Variables...\n"))
   614         self.logger.write(_("Extracting Located Variables...\n"))
   606         # Keep track of generated located variables for later use by self._Generate_C
   615         # Keep track of generated located variables for later use by self._Generate_C
   607         self.PLCGeneratedLocatedVars = self.GetLocations()
   616         self.PLCGeneratedLocatedVars = self.GetLocations()
   608         # Keep track of generated C files for later use by self.CTNGenerate_C
   617         # Keep track of generated C files for later use by self.CTNGenerate_C
   609         self.PLCGeneratedCFiles = C_files
   618         self.PLCGeneratedCFiles = C_files