def setup(self): logical_bytes = ( # Type 129 b'\x81\x00' # File name 6.3 format + b'RUNOne.lis' # Two blanks + b'\x00\x00' # Service sub-level name + b'SubLev' # Version number + b'Vers num' # Date + b'78/03/15' # One blank + b'\x00' # Max Physical record length + b' 1024' # Two blanks + b'\x00\x00' # File Type + b'\x41\x42' # Two blanks + b'\x00\x00' # Previous file name + b'Prev name.') file_bytes = write_logical_data_to_physical_records([ logical_bytes, ]) self.file_read = File.FileRead(theFile=file_bytes, theFileId='MyFile', keepGoing=True)
def setup(self): b = ( # Logical record header for DFSR bytes([64, 0]) # Entry block 4, value 0 + bytes([4, 1, 66, 0]) # Entry block 12, value -153.0 + bytes([12, 4, 68]) + b'\xbb\xb3\x80\x00' # Entry block 0, value None terminates read + bytes([0, 1, 66, 0]) # Sensor 0 # Mnemonic + b'DEPTServIDServOrdNFEET' + b'\x02\xb3\x60\x3b' + bytes([1, 0, 0, 4, 0, 0, 0, 1, 68, 0, 1, 2, 3, 4]) + b'CH01ServIDServOrdNNDIM' + b'\x02\xb3\x60\x3b' + bytes([1, 0, 0, 4, 0, 0, 0, 1, 68, 0, 1, 2, 3, 4]) + b'CH02ServIDServOrdNNDIM' + b'\x02\xb3\x60\x3b' + bytes([1, 0, 0, 4, 0, 0, 0, 1, 68, 0, 1, 2, 3, 4]) + b'CH03ServIDServOrdNNDIM' + b'\x02\xb3\x60\x3b' + bytes([1, 0, 0, 4, 0, 0, 0, 1, 68, 0, 1, 2, 3, 4]) + b'CH04ServIDServOrdNNDIM' + b'\x02\xb3\x60\x3b' + bytes([1, 0, 0, 4, 0, 0, 0, 1, 68, 0, 1, 2, 3, 4]) + b'CH05ServIDServOrdNNDIM' + b'\x02\xb3\x60\x3b' + bytes([1, 0, 0, 4, 0, 0, 0, 1, 68, 0, 1, 2, 3, 4]) + b'CH06ServIDServOrdNNDIM' + b'\x02\xb3\x60\x3b' + bytes([1, 0, 0, 4, 0, 0, 0, 1, 68, 0, 1, 2, 3, 4]) + b'CH07ServIDServOrdNNDIM' + b'\x02\xb3\x60\x3b' + bytes([1, 0, 0, 4, 0, 0, 0, 1, 68, 0, 1, 2, 3, 4])) file_obj = write_logical_data_to_physical_records([b]) self.file_read = File.FileRead(theFile=file_obj, theFileId='MyFile', keepGoing=True)
def setup(self): channels = [] for i in range(63): ch_name = '{:02d}'.format(i).encode('ascii') channels.append(b'CH' + ch_name + b'ServIDServOrdNNDIM' + b'\x02\xb3\x60\x3b' + bytes([1, 0, 0, 4, 0, 0, 0, 1, 68, 0, 1, 2, 3, 4])) b = ( # Logical record header for DFSR bytes([64, 0]) # Entry block 4, value 0 + bytes([4, 1, 66, 0]) # Entry block 12, value -153.0 + bytes([12, 4, 68]) + b'\xbb\xb3\x80\x00' # Entry block 0, value None terminates read + bytes([0, 1, 66, 0]) # Sensor 0 # Mnemonic + b'DEPTServIDServOrdNFEET' + b'\x02\xb3\x60\x3b' + bytes([1, 0, 0, 4, 0, 0, 0, 1, 68, 0, 1, 2, 3, 4]) + b''.join(channels)) file_obj = write_logical_data_to_physical_records([b]) self.file_read = File.FileRead(theFile=file_obj, theFileId='MyFile', keepGoing=True)
def setup(self, arg): b = bytearray() b.append(arg) b.append(0) file_obj = write_logical_data_to_physical_records([bytes(b)]) self.file_read = File.FileRead(theFile=file_obj, theFileId='MyFile', keepGoing=True) self.read_class = self.class_map[arg]
def setup(self): logical_bytes = ( # Type 133 b'\x85\x00' # Service name + b'SERVCE' # + b'\x00\x00\x00\x00\x00\x00' # + b'79/06/15' # + b'\x00\x00' # Origin + b'ORGN' # + b'\x00\x00' # Reel name + b'REELNAME' # + b'\x00\x00' # Reel continuation number + b'01' # + b'\x00\x00' # Previous reel name + b'NextName' # + b'\x00\x00' # Comments, 74 characters + b'_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123' ) file_bytes = write_logical_data_to_physical_records([ logical_bytes, ]) self.file_read = File.FileRead(theFile=file_bytes, theFileId='MyFile', keepGoing=True)
def setup(self): myT = LogiRec.LrTableWrite( 34, b'PRES', ( b'MNEM', b'OUTP', b'STAT', b'TRAC', b'CODI', b'DEST', b'MODE', b'FILT', b'LEDG', b'REDG', ), ( (b'40 ', b'TEST', b'ALLO', b'T1 ', b'LLIN', b'2 ', b'SHIF', 0.5, (-40.0, b'MV '), (40.0, b'MV ')), (b'20 ', b'TEST', b'ALLO', b'T2 ', b'HDAS', b'2 ', b'SHIF', 0.5, (-20.0, b'MV '), (20.0, b'MV ')), (b'10 ', b'TEST', b'ALLO', b'T3 ', b'LGAP', b'2 ', b'WRAP', 0.5, (-10.0, b'MV '), (10.0, b'MV ')), (b'5 ', b'TEST', b'ALLO', b'T2 ', b'HSPO', b'2 ', b'WRAP', 0.5, (-5.0, b'MV '), (5.0, b'MV ')), (b'2.5 ', b'TEST', b'ALLO', b'T3 ', b'LSPO', b'2 ', b'WRAP', 0.5, (-2.5, b'MV '), (2.5, b'MV ')), ), ) ba = bytearray([34, 0]) for b in myT.genLisBytes(): ba += b file_obj = write_logical_data_to_physical_records([bytes(ba)]) self.file_read = File.FileRead(theFile=file_obj, theFileId='MyFile', keepGoing=True)
def setup(self): b = ( # Logical record header for DFSR bytes([64, 0]) # Entry block 4, value 0 + bytes([4, 1, 66, 0]) # Entry block 12, value -153.0 + bytes([12, 4, 68]) + b'\xbb\xb3\x80\x00' # Entry block 0, value None terminates read + bytes([0, 1, 66, 0]) # Sensor 0 # Mnemonic + b'DEPT' # Service ID + b'ServID' # Service order number + b'ServOrdN' # Units + b'FEET' # API codes 45, 310, 01, 1 # Decimal 45310011 is 0x02b3603b + b'\x02\xb3\x60\x3b' # File number: 256 + bytes([1, 0]) # LIS size in bytes: 4 bytes + bytes([0, 4]) # Padding '0' + b'000' # Samples: 1 super samples + b'\x01' # Representation code + bytes([ 68, ]) # Process indicators + bytes([0, 1, 2, 3, 4]) # Sensor 1 # Mnemonic + b'GR ' # Service ID + b'ServID' # Service order number + b'ServOrdN' # Units + b'GAPI' # API codes 45, 310, 01, 1 # Decimal 45310011 is 0x02b3603b + b'\x02\xb3\x60\x3b' # File number: 256 + bytes([1, 0]) # LIS size in bytes: 4 samples * 6 burst samples * 4 bytes = 96 bytes + bytes([0, 96]) # Padding '0' + b'000' # Samples: 4 super samples + bytes([ 4, ]) # Representation code + bytes([ 68, ]) # Process indicators + bytes([0, 1, 2, 3, 4])) file_obj = write_logical_data_to_physical_records([b]) self.file_read = File.FileRead(theFile=file_obj, theFileId='MyFile', keepGoing=True)
def setup(self, arg): b = bytes([LogiRec.LR_TYPE_BLANK_RECORD, 0]) + b' ' * arg file_obj = write_logical_data_to_physical_records([b]) self.file_read = File.FileRead(theFile=file_obj, theFileId='MyFile', keepGoing=True)