Ejemplo n.º 1
0
 def __init__(self, tell, lrType, theF, xAxisIndex=0):
     super().__init__(tell, lrType, theF)
     assert (self._typ == LogiRec.LR_TYPE_DATA_FORMAT)
     # Have to rewind for DFSR creation
     theF.seekCurrentLrStart()
     # Create a DFSR and thus a Log Pass
     self._logPass = LogPass.LogPass(LogiRec.LrDFSRRead(theF), self._fileId,
                                     xAxisIndex)
     theF.skipToNextLr()
Ejemplo n.º 2
0
 def test_02(self):
     """TestXMLMatchesRHDT.test_01(): Which XML LgFormat files with RPS1 (RepCode 130, 80 bytes) channel and a LIS LogPass."""
     # DIPMETER_EDIT_TAPE_REP_CODE
     myF = self._retFileSinglePr(
         # LRH for DFSR
         bytes([64, 0])
         # EB 4, up/down value 0 (down)
         + bytes([4, 1, 66, 0])
         # EB 12, absent value -153.0
         + bytes([12, 4, 68]) + b'\xbb\xb3\x80\x00'
         # EB 0 terminates read
         + bytes([0, 1, 66, 0])
         #
         # Sensor 0
         # Mnemonic  Service ID  Serv ord No    Units   API 45,310,01,1       File No: 256
         + b'DEPT' + b'ServID' + b'ServOrdN' + b'FEET' +
         b'\x02\xb3\x60\x3b' + bytes([1, 0])
         # 4 LIS bytes     Pad      1 super  Rep code     Process indicators
         + bytes([0, 4]) + b'000' + b'\x01' + bytes([
             68,
         ]) + bytes([0, 1, 2, 3, 4])
         # Sensor 1
         + b'RPS1' + b'ServID' + b'ServOrdN' + b'    ' +
         b'\x02\xb3\x60\x3b' + bytes([1, 0]) + bytes([0, 80]) + b'000' +
         b'\x01' + bytes([
             130,
         ]) + bytes([0, 1, 2, 3, 4])
         # Sensor 2
         + b'P1AZ' + b'ServID' + b'ServOrdN' + b'    ' +
         b'\x02\xb3\x60\x3b' + bytes([1, 0]) + bytes([0, 4]) + b'000' +
         b'\x01' + bytes([
             68,
         ]) + bytes([0, 1, 2, 3, 4])
         # Sensor 3
         + b'DEVI' + b'ServID' + b'ServOrdN' + b'    ' +
         b'\x02\xb3\x60\x3b' + bytes([1, 0]) + bytes([0, 4]) + b'000' +
         b'\x01' + bytes([
             68,
         ]) + bytes([0, 1, 2, 3, 4])
         # Sensor 4
         + b'HAZI' + b'ServID' + b'ServOrdN' + b'    ' +
         b'\x02\xb3\x60\x3b' + bytes([1, 0]) + bytes([0, 4]) + b'000' +
         b'\x01' + bytes([
             68,
         ]) + bytes([0, 1, 2, 3, 4])
         # Sensor 5
         + b'C1  ' + b'ServID' + b'ServOrdN' + b'    ' +
         b'\x02\xb3\x60\x3b' + bytes([1, 0]) + bytes([0, 4]) + b'000' +
         b'\x01' + bytes([
             68,
         ]) + bytes([0, 1, 2, 3, 4])
         # Sensor 6
         + b'C2  ' + b'ServID' + b'ServOrdN' + b'    ' +
         b'\x02\xb3\x60\x3b' + bytes([1, 0]) + bytes([0, 4]) + b'000' +
         b'\x01' + bytes([
             68,
         ]) + bytes([0, 1, 2, 3, 4])
         # Sensor 7
         + b'FEP ' + b'ServID' + b'ServOrdN' + b'    ' +
         b'\x02\xb3\x60\x3b' + bytes([1, 0]) + bytes([0, 4]) + b'000' +
         b'\x01' + bytes([
             68,
         ]) + bytes([0, 1, 2, 3, 4])
         # Sensor 8
         + b'RB  ' + b'ServID' + b'ServOrdN' + b'    ' +
         b'\x02\xb3\x60\x3b' + bytes([1, 0]) + bytes([0, 4]) + b'000' +
         b'\x01' + bytes([
             68,
         ]) + bytes([0, 1, 2, 3, 4]))
     myLp = LogPass.LogPass(LogiRec.LrDFSRRead(myF), 'FileID')
     myFilmCfg = FILMCfgXML.FilmCfgXMLRead('')
     myFilmCfg.addXMLRoot(etree.fromstring(
         TestLgFormatXMLData.LGFORMAT_HDT))
     filmMap = XMLMatches.fileCurveMapFromFILM(myLp, myFilmCfg)
     #        print()
     #        print('myLp._chMap:')
     #        pprint.pprint(myLp._chMap)
     #        print(myLp.longStr())
     #        pprint.pprint(sorted(myLp.outpMnemS()))
     #        print('filmMap:')
     #        pprint.pprint(filmMap)
     #        pprint.pprint(sorted(filmMap['HDT']))
     self.assertEqual(
         [
             Mnem.Mnem(b'C1\x00\x00'),
             Mnem.Mnem(b'C2\x00\x00'),
             Mnem.Mnem(b'DEPT'),
             Mnem.Mnem(b'DEVI'),
             #                Mnem.Mnem(b'EMEX'),
             Mnem.Mnem(b'FC0\x00'),
             Mnem.Mnem(b'FC1\x00'),
             Mnem.Mnem(b'FC2\x00'),
             Mnem.Mnem(b'FC3\x00'),
             Mnem.Mnem(b'FC4\x00'),
             Mnem.Mnem(b'FEP\x00'),
             #                Mnem.Mnem(b'FEP1'),
             #                Mnem.Mnem(b'FEP2'),
             Mnem.Mnem(b'HAZI'),
             Mnem.Mnem(b'P1AZ'),
             #                Mnem.Mnem(b'PADP'),
             #                Mnem.Mnem(b'RAC1'),
             #                Mnem.Mnem(b'RAC2'),
             Mnem.Mnem(b'RB\x00\x00'),
             #                Mnem.Mnem(b'REF\x00'),
             #                Mnem.Mnem(b'REFC'),
             #                Mnem.Mnem(b'STAT'),
             #                Mnem.Mnem(b'TEMP'),
         ],
         sorted(myLp.outpMnemS()),
     )
     self.assertEqual(1, len(filmMap))
     self.assertTrue('HDT' in filmMap)
     self.assertEqual([
         Mnem.Mnem(b'C1\x00\x00'),
         Mnem.Mnem(b'C2\x00\x00'),
         Mnem.Mnem(b'DEVI'),
         Mnem.Mnem(b'FC0\x00'),
         Mnem.Mnem(b'FC1\x00'),
         Mnem.Mnem(b'FC2\x00'),
         Mnem.Mnem(b'FC3\x00'),
         Mnem.Mnem(b'FC4\x00'),
         Mnem.Mnem(b'HAZI'),
         Mnem.Mnem(b'P1AZ'),
         Mnem.Mnem(b'RB\x00\x00'),
     ], sorted(filmMap['HDT']))
Ejemplo n.º 3
0
 def time_read(self, param):
     self.file_read.rewind()
     dfsr = LogiRec.LrDFSRRead(self.file_read)
Ejemplo n.º 4
0
 def time_read(self):
     self.file_read.rewind()
     LogiRec.LrDFSRRead(self.file_read)