refactor: StreamReader ASCII decoder uses shared sensor_count_for()
This commit is contained in:
@@ -7,6 +7,7 @@ import time
|
|||||||
from typing import Callable
|
from typing import Callable
|
||||||
|
|
||||||
from pygui.backend.models.frame import Frame
|
from pygui.backend.models.frame import Frame
|
||||||
|
from pygui.backend.wafer.family_spec import sensor_count_for
|
||||||
from pygui.serialcomm.data_parser import _convert_hex_to_temp
|
from pygui.serialcomm.data_parser import _convert_hex_to_temp
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@@ -182,7 +183,7 @@ class StreamReader:
|
|||||||
def _run_ascii(self, initial_bytes: bytes) -> None:
|
def _run_ascii(self, initial_bytes: bytes) -> None:
|
||||||
log.info("StreamReader: starting ASCII hex dump stream parsing")
|
log.info("StreamReader: starting ASCII hex dump stream parsing")
|
||||||
|
|
||||||
valid_words = 80 if self._family_code == "X" else 244
|
valid_words = sensor_count_for(self._family_code)
|
||||||
block_words = 256
|
block_words = 256
|
||||||
word_char_len = 4
|
word_char_len = 4
|
||||||
chars_needed = block_words * word_char_len # total hex chars per block
|
chars_needed = block_words * word_char_len # total hex chars per block
|
||||||
|
|||||||
Reference in New Issue
Block a user