Esempio n. 1
0
    def readDSFile(self, fileName):
        nRec = 0
        modo = None
        with self.openDSFile(fileName) as f:
            for line in f:
                nRec = nRec + 1

                if record.isComment(line) or record.isBlankLine(line):
                    continue
                if self.isEndOfBlock(line):
                    modo = None

                if record.assertString(line, 'UCTERM'):
                    self.ucterm = True
                elif record.assertString(line, 'FLGUCTERM'):
                    self.flgucterm = True
                elif record.assertString(line, 'INIT'):
                    modo = 'INIT'
                elif record.assertString(line, 'OPER'):
                    modo = 'OPER'
                elif modo == 'INIT':
                    self.getTable('INIT').parseLine(line)
                elif modo == 'OPER':
                    self.getTable('OPER').parseLine(line)
        f.close()
Esempio n. 2
0
 def readDSFile(self, fileName):
     nRec = 0
     modo = None
     with self.openDSFile(fileName) as f:
         for line in f:
             nRec = nRec + 1
             
             if record.isComment(line) or record.isBlankLine(line):
                 continue
             if record.assertString(line, 'FIM'):
                 continue
             if record.assertString(line, '9999'):
                 break
             
             if record.assertString(line, 'AREA'):
                 modo = 'AREA'
             elif record.assertString(line, 'USINA'):
                 modo = 'USINA'
             elif modo == 'AREA':
                 self.getTable('AREA').parseLine(line)
             elif modo == 'USINA':
                 self.getTable('USINA').parseLine(line)
     f.close()
Esempio n. 3
0
    def readDSFile(self, fileName):
        nRec = 0
        modo = None
        with self.openDSFile(fileName) as f:
            for line in f:
                nRec = nRec + 1

                if record.isComment(line) or record.isBlankLine(line):
                    continue
                if self.isEndOfBlock(line):
                    break
                if modo:
                    self.getTable('RAMP').parseLine(line)
                if record.assertString(line, 'RAMP'):
                    modo = True
        f.close()
Esempio n. 4
0
 def endOfBlock(self, line):
     return record.assertString(line, 'FIM')
Esempio n. 5
0
 def isEOF(self, line):
     return record.assertString(line, '9999')