ProjectController.py
changeset 2442 b13f021c68a5
parent 2441 c553769a65af
child 2449 b0560adec4b7
equal deleted inserted replaced
2441:c553769a65af 2442:b13f021c68a5
   857             -2:] == ".h" or fname[-2:] == ".H"]
   857             -2:] == ".h" or fname[-2:] == ".H"]
   858         H_files.remove("LOCATED_VARIABLES.h")
   858         H_files.remove("LOCATED_VARIABLES.h")
   859         H_files = map(
   859         H_files = map(
   860             lambda filename: os.path.join(buildpath, filename), H_files)
   860             lambda filename: os.path.join(buildpath, filename), H_files)
   861         for H_file in H_files:
   861         for H_file in H_files:
   862             with file(H_file, 'r') as original:
   862             with open(H_file, 'r') as original:
   863                 data = original.read()
   863                 data = original.read()
   864             with file(H_file, 'w') as modified:
   864             with open(H_file, 'w') as modified:
   865                 modified.write('#include "beremiz.h"\n' + data)
   865                 modified.write('#include "beremiz.h"\n' + data)
   866 
   866 
   867         self.logger.write(_("Extracting Located Variables...\n"))
   867         self.logger.write(_("Extracting Located Variables...\n"))
   868         # Keep track of generated located variables for later use by
   868         # Keep track of generated located variables for later use by
   869         # self._Generate_C
   869         # self._Generate_C
  1287                 self._IECCodeView = IECCodeViewer(
  1287                 self._IECCodeView = IECCodeViewer(
  1288                     self.AppFrame.TabsOpened, "", self.AppFrame, None, instancepath=name)
  1288                     self.AppFrame.TabsOpened, "", self.AppFrame, None, instancepath=name)
  1289                 self._IECCodeView.SetTextSyntax("ALL")
  1289                 self._IECCodeView.SetTextSyntax("ALL")
  1290                 self._IECCodeView.SetKeywords(IEC_KEYWORDS)
  1290                 self._IECCodeView.SetKeywords(IEC_KEYWORDS)
  1291                 try:
  1291                 try:
  1292                     text = file(plc_file).read()
  1292                     text = open(plc_file).read()
  1293                 except Exception:
  1293                 except Exception:
  1294                     text = '(* No IEC code have been generated at that time ! *)'
  1294                     text = '(* No IEC code have been generated at that time ! *)'
  1295                 self._IECCodeView.SetText(text=text)
  1295                 self._IECCodeView.SetText(text=text)
  1296                 self._IECCodeView.Editor.SetReadOnly(True)
  1296                 self._IECCodeView.Editor.SetReadOnly(True)
  1297                 self._IECCodeView.SetIcon(GetBitmap("ST"))
  1297                 self._IECCodeView.SetIcon(GetBitmap("ST"))