plugger.py
changeset 661 5d3da49e8029
parent 656 c1792dfc8c7e
child 669 472469f4d5ad
equal deleted inserted replaced
660:56b536118ec8 661:5d3da49e8029
  1191                     
  1191                     
  1192                     last_section = None
  1192                     last_section = None
  1193                     f = open(self._getIECcodepath())
  1193                     f = open(self._getIECcodepath())
  1194 
  1194 
  1195                     for i, line in enumerate(f.readlines()):
  1195                     for i, line in enumerate(f.readlines()):
       
  1196                         i = i + 1
  1196                         if line[0] not in '\t \r\n':
  1197                         if line[0] not in '\t \r\n':
  1197                             last_section = line
  1198                             last_section = line
  1198 
  1199 
  1199                         if first_line <= i <= last_line:
  1200                         if first_line <= i <= last_line:
  1200                             if last_section is not None:
  1201                             if last_section is not None:
  1531     def ShowError(self, logger, from_location, to_location):
  1532     def ShowError(self, logger, from_location, to_location):
  1532         chunk_infos = self.GetChunkInfos(from_location, to_location)
  1533         chunk_infos = self.GetChunkInfos(from_location, to_location)
  1533         for infos, (start_row, start_col) in chunk_infos:
  1534         for infos, (start_row, start_col) in chunk_infos:
  1534             start = (from_location[0] - start_row, from_location[1] - start_col)
  1535             start = (from_location[0] - start_row, from_location[1] - start_col)
  1535             end = (to_location[0] - start_row, to_location[1] - start_col)
  1536             end = (to_location[0] - start_row, to_location[1] - start_col)
       
  1537             print from_location, to_location, start_row, start_col, start, end
  1536             if self.AppFrame is not None:
  1538             if self.AppFrame is not None:
  1537                 self.AppFrame.ShowError(infos, start, end)
  1539                 self.AppFrame.ShowError(infos, start, end)
  1538 
  1540 
  1539     def _showIECcode(self):
  1541     def _showIECcode(self):
  1540         plc_file = self._getIECcodepath()
  1542         plc_file = self._getIECcodepath()