예제 #1
0
 def readDSFile(self, fileName):
     nRec = 0
     with self.openDSFile(fileName) as f:
         for line in f:
             nRec = nRec + 1
             
             if record.isBlankLine(line) or record.isComment(line):
                 continue
             if record.isEOF(line) or record.isComment(line):
                 break
             
             r = self.getRec('Geral').parse(line)
             if r['nomeCampo'] == 'MAPFCF':
                 m = self.getRec('MAPFCF').parse(line)
                 if m['nomeDado'] == 'SISGNL':
                     self.getTable('SISGNL').parseLine(line)
                 elif m['nomeDado'] == 'DURPAT':
                     self.getTable('DURPAT').parseLine(line)
                 elif m['nomeDado'] == 'TVIAG':
                     self.getTable('TVIAG').parseLine(line)
                 elif m['nomeDado'] == 'CGTMIN':
                     self.getTable('CGTMIN').parseLine(line)
             elif r['nomeCampo'] == 'FCFFIX':
                 self.getTable('FCFFIX').parseLine(line)
             
     f.close()
예제 #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 self.isEndOfBlock(line):
                    modo = None
                    continue
                if self.isEOF(line):
                    break

                if modo == 'USI':
                    self.getTable('USI').parseLine(line)
                else:
                    ls = line.strip()
                    nc = ls[0:2]
                    if nc == 'RP':
                        self.getTable('RP').parseLine(line)
                    elif nc == 'LM':
                        self.getTable('LM').parseLine(line)
                    elif ls[0:3] == 'USI':
                        self.modo = 'USI'

        f.close()
예제 #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):
                    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()
예제 #4
0
 def readDSFile(self, fileName):
     with self.openDSFile(fileName) as f:
         for line in f:
             if record.isComment(line) or record.isBlankLine(line):
                 continue
             self.readLine(line)
     f.close()
예제 #5
0
 def readDSFile(self, fileName):
     nRec = 0
     with self.openDSFile(fileName) as f:
         for line in f:
             nRec = nRec + 1
             
             if record.isComment(line) or record.isBlankLine(line):
                 continue
             self.getTable('PTOPER').parseLine(line)
     f.close()
예제 #6
0
 def readDSFile(self, fileName):
     nRec = 0
     with self.openDSFile(fileName) as f:
         for line in f:
             nRec = nRec + 1
             
             if record.isEOF(line):
                 break
             if record.isComment(line) or record.isBlankLine(line):
                 continue
             
             nc = self.recGeral.parse(line)['nomeCampo']
             self.getTable(nc).parseLine(line)
     f.close()
예제 #7
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()
예제 #8
0
    def readDSFile(self, fileName):
        nRec = 0
        with self.openDSFile(fileName) as f:
            for line in f:
                nRec = nRec + 1

                if record.isComment(line) or record.isBlankLine(line):
                    continue
                if record.isEOF(line):
                    break
                if line[0:3] == 'NOR':
                    continue
                if nRec == 2:
                    self.getRec('Nivel').parse(line)
                elif nRec >= 3:
                    if len(line) > 3 and line[:3] == 'MAX':
                        self.getRec('VazoesMax').parse(line)
                    else:
                        self.getTable('Vazoes').parseLine(line)
        f.close()
예제 #9
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()