Commit 3ccb7a91 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Adds plot_exec_log in test

Showing with 4 additions and 3 deletions
+4 -3
......@@ -133,11 +133,11 @@ class OhmPiHardware:
self._pulse = 0
def _gain_auto(self): # TODO: improve _gain_auto
self.exec_logger.event(f'OhmPiHardware\tGAin_Auto\tbegin\t{datetime.datetime.utcnow()}')
self.exec_logger.event(f'OhmPiHardware\tGain_Auto\tbegin\t{datetime.datetime.utcnow()}')
self.tx_sync.wait()
self.tx.adc_gain_auto()
self.rx.adc_gain_auto()
self.exec_logger.event(f'OhmPiHardware\tGAin_Auto\tend\t{datetime.datetime.utcnow()}')
self.exec_logger.event(f'OhmPiHardware\tGain_Auto\tend\t{datetime.datetime.utcnow()}')
def _inject(self, polarity=1, inj_time=None): # TODO: deal with voltage or current pulse
self.exec_logger.event(f'OhmPiHardware\tInject\tbegin\t{datetime.datetime.utcnow()}')
......
......@@ -7,7 +7,8 @@ import matplotlib
def plot_exec_log(exec_log,names=None,last_session=True): # TODO: select session id instead of last session (if -1 : last)
time, process_id, tag, msg, session = parse_log(exec_log)
if last_session:
time, process_id, tag, msg = time[session==max(session)], process_id[session==max(session)], tag[session==max(session)], msg[session==max(session)]
time, process_id, tag, msg = time[session == max(session)], process_id[session == max(session)], \
tag[session == max(session)], msg[session == max(session)]
events = msg[tag == 'EVENT']
category, name, state, time = np.empty(events.shape[0]).astype(str), np.empty(events.shape[0]).astype(str), \
np.empty(events.shape[0]).astype(str), np.empty(events.shape[0]).astype(str)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment