check
This commit is contained in:
@ -231,14 +231,14 @@ class LogScale16BitX2BinaryParser:
|
||||
del self._buf[:8]
|
||||
continue
|
||||
if words[3] == 0xFFFF and words[0] != 0xFFFF:
|
||||
avg_1 = u16_to_i16(words[1])
|
||||
avg_2 = u16_to_i16(words[2])
|
||||
real = u16_to_i16(words[1])
|
||||
imag = u16_to_i16(words[2])
|
||||
events.append(
|
||||
PointEvent(
|
||||
ch=self._current_channel,
|
||||
x=int(words[0]),
|
||||
y=log_pair_to_sweep(avg_1, avg_2),
|
||||
aux=(float(avg_1), float(avg_2)),
|
||||
y=float(abs(complex(real, imag))),
|
||||
aux=(float(real), float(imag)),
|
||||
)
|
||||
)
|
||||
del self._buf[:8]
|
||||
@ -268,14 +268,14 @@ class ParserTestStreamParser:
|
||||
return None
|
||||
if self._expected_step is not None and step < self._expected_step:
|
||||
return None
|
||||
avg_1 = u16_to_i16(int(self._point_buf[1]))
|
||||
avg_2 = u16_to_i16(int(self._point_buf[2]))
|
||||
real = u16_to_i16(int(self._point_buf[1]))
|
||||
imag = u16_to_i16(int(self._point_buf[2]))
|
||||
self._expected_step = step + 1
|
||||
return PointEvent(
|
||||
ch=self._current_channel,
|
||||
x=step,
|
||||
y=log_pair_to_sweep(avg_1, avg_2),
|
||||
aux=(float(avg_1), float(avg_2)),
|
||||
y=float(abs(complex(real, imag))),
|
||||
aux=(float(real), float(imag)),
|
||||
)
|
||||
|
||||
def feed(self, data: bytes) -> List[ParserEvent]:
|
||||
|
||||
Reference in New Issue
Block a user