Skip to content
Snippets Groups Projects
Commit 4ee24db4 authored by Lan Dam's avatar Lan Dam
Browse files

collect all channels start with one of channels in no_question_req_soh_chans

parent c1daa1d3
No related branches found
No related tags found
1 merge request!154Fix bug in reftek not plot channel with question mark '?' if use preference list
Pipeline #2845 failed with stage
in 2 minutes and 56 seconds
from __future__ import annotations from __future__ import annotations
from typing import Callable, Tuple, List, Union, Set, TYPE_CHECKING from typing import Callable, Tuple, List, Union, Set, Dict, TYPE_CHECKING
from sohstationviewer.conf import constants from sohstationviewer.conf import constants
from sohstationviewer.controller.util import ( from sohstationviewer.controller.util import (
get_time_6, get_time_4, get_val, rtn_pattern) get_time_6, get_time_4, get_val, rtn_pattern)
from sohstationviewer.view.util.enums import LogType from sohstationviewer.view.util.enums import LogType
from sohstationviewer.model.reftek_data.log_info_helper import (
remove_question_mark)
if TYPE_CHECKING: if TYPE_CHECKING:
from sohstationviewer.model.reftek_data.reftek import RT130 from sohstationviewer.model.reftek_data.reftek import RT130
...@@ -33,7 +35,7 @@ class LogInfo(): ...@@ -33,7 +35,7 @@ class LogInfo():
self.key = key self.key = key
self.unit_id, self.exp_no = key self.unit_id, self.exp_no = key
self.req_data_streams = req_data_streams self.req_data_streams = req_data_streams
self.req_soh_chans = req_soh_chans self.no_question_req_soh_chans = remove_question_mark(req_soh_chans)
self.is_log_file = is_log_file self.is_log_file = is_log_file
""" """
track_year to add year to time since year time not include year after track_year to add year to time since year time not include year after
...@@ -49,7 +51,7 @@ class LogInfo(): ...@@ -49,7 +51,7 @@ class LogInfo():
self.model = "72A" self.model = "72A"
self.max_epoch = 0 self.max_epoch = 0
self.min_epoch = constants.HIGHEST_INT self.min_epoch = constants.HIGHEST_INT
self.chans: dict = self.parent.soh_data[self.key] self.chans: Dict = self.parent.soh_data[self.key]
self.cpu_vers: Set[str] = set() self.cpu_vers: Set[str] = set()
self.gps_vers: Set[str] = set() self.gps_vers: Set[str] = set()
self.extract_info() self.extract_info()
...@@ -314,9 +316,10 @@ class LogInfo(): ...@@ -314,9 +316,10 @@ class LogInfo():
:param d: float - value of data :param d: float - value of data
:param idx: int - index of SOH message line :param idx: int - index of SOH message line
""" """
if self.no_question_req_soh_chans and not chan_id.startswith(
if self.req_soh_chans and chan_id not in self.req_soh_chans: tuple(self.no_question_req_soh_chans)):
return return
if chan_id not in self.chans: if chan_id not in self.chans:
self.chans[chan_id] = { self.chans[chan_id] = {
'reftek': True, 'reftek': True,
......
def remove_question_mark(req_soh_chan):
no_question_req_soh_chan = []
for idx, req in enumerate(req_soh_chan):
if req.endswith('?'):
no_question_req_soh_chan.append(req_soh_chan[idx][:-1])
else:
no_question_req_soh_chan.append(req_soh_chan[idx])
return no_question_req_soh_chan
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment