diff --git a/Ccs/ccs_function_lib.py b/Ccs/ccs_function_lib.py index a717c2b1b0e33347b36412276d97026126e504f6..cbff75a292786d0a184aa345436e6969ea745546 100644 --- a/Ccs/ccs_function_lib.py +++ b/Ccs/ccs_function_lib.py @@ -1104,6 +1104,12 @@ def read_stream(stream, fmt, pos=None, offbi=0): x = x.decode('utf-8', errors='replace') elif fmt == timepack[0]: x = timecal(data) + elif fmt.startswith('CUC'): + logger.error('Undefined time format {}, project time format is {}'.format(fmt, timepack[0])) + # x = int.from_bytes(data, 'big') + # only interpret 4 MSBs as coarse time + # x = x >> ((len(data) - 4) * 8) + x = 0xFFFFFFFF else: x = struct.unpack('>' + fmt, data)[0] @@ -2037,7 +2043,10 @@ def filter_by_discr(rows, pi1_off, pi1_wid, pi1_val): :return: """ - rows = rows.filter(func.mid(DbTelemetry.raw, pi1_off + 1, pi1_wid) == pi1_val.to_bytes(pi1_wid, 'big')) + if not isinstance(pi1_val, bytes): + pi1_val = pi1_val.to_bytes(pi1_wid, 'big') + + rows = rows.filter(func.mid(DbTelemetry.raw, pi1_off + 1, pi1_wid) == pi1_val) return rows @@ -3206,7 +3215,7 @@ def PUSpack(version=0, typ=0, dhead=0, apid=0, gflags=0b11, sc=0, pktl=0, elif typ == 0 and dhead == 1: header.bits.PUS_VERSION = tmv - header.bits.SC_REFTIME = tref_stat + # header.bits.SC_REFTIME = tref_stat # replaced with TIMESYNC to be backwards-compatible with PUS-A header.bits.SERV_TYPE = st header.bits.SERV_SUB_TYPE = sst header.bits.MSG_TYPE_CNT = msg_type_cnt diff --git a/Ccs/monitor.py b/Ccs/monitor.py index 64014971f2cb9c8897722c043cb38928b47c7e42..3c503f0d19b572234ef6ec2e4028afefbfd98c89 100644 --- a/Ccs/monitor.py +++ b/Ccs/monitor.py @@ -783,8 +783,9 @@ class ParameterMonitor(Gtk.Window): editor.Functions('_to_console_via_socket', 'del(monitor'+str(nr)+')') self.update_all_connections_quit() - if Gtk.main_level(): - Gtk.main_quit() + #if Gtk.main_level(): + Gtk.main_quit() + return False def update_all_connections_quit(self): """ diff --git a/Ccs/plotter.py b/Ccs/plotter.py index 46a5ceceb78e2161215e1f8f2ccbb3c0decad2a2..717f9eb90c6af8d3d0a9ff14bc7dae66e2e3c879 100644 --- a/Ccs/plotter.py +++ b/Ccs/plotter.py @@ -54,13 +54,12 @@ ActivePoolInfo = NamedTuple( ('pool_name', str), ('live', bool)]) -# fmtlist = {'INT8': 'b', 'UINT8': 'B', 'INT16': 'h', 'UINT16': 'H', 'INT32': 'i', 'UINT32': 'I', 'INT64': 'q', -# 'UINT64': 'Q', 'FLOAT': 'f', 'DOUBLE': 'd', 'INT24': 'i24', 'UINT24': 'I24', 'bit*': 'bit'} +REFRESH_RATE = 1 class PlotViewer(Gtk.Window): - def __init__(self, loaded_pool, refresh_rate=1, parameters=None, start_live=False, **kwargs): + def __init__(self, loaded_pool, refresh_rate=REFRESH_RATE, parameters=None, start_live=False, **kwargs): Gtk.Window.__init__(self) assert isinstance(loaded_pool, str)