From 90c64917b59e83556454d1338634473cdcd952a9 Mon Sep 17 00:00:00 2001 From: imarom Date: Tue, 26 Jul 2016 11:47:15 +0300 Subject: some more TUI fixes --- .../trex_control_plane/stl/trex_stl_lib/trex_stl_port.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py') diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py index be46e95f..d239fc57 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py @@ -68,7 +68,7 @@ class Port(object): self.has_rx_streams = False self.owner = '' - + self.last_factor_type = None # decorator to verify port is up def up(func): @@ -417,6 +417,9 @@ class Port(object): self.state = last_state return self.err(rc.err()) + # save this for TUI + self.last_factor_type = mul['type'] + return self.ok() @@ -424,7 +427,7 @@ class Port(object): # with force ignores the cached state and sends the command @owned def stop (self, force = False): - + # if not is not active and not force - go back if not self.is_active() and not force: return self.ok() @@ -437,10 +440,11 @@ class Port(object): return self.err(rc.err()) self.state = self.STATE_STREAMS + self.last_factor_type = None # timestamp for last tx self.tx_stopped_ts = datetime.now() - + return self.ok() @@ -535,6 +539,9 @@ class Port(object): if rc.bad(): return self.err(rc.err()) + # save this for TUI + self.last_factor_type = mul['type'] + return self.ok() @owned @@ -712,6 +719,7 @@ class Port(object): # until thread is locked - order is important self.tx_stopped_ts = datetime.now() self.state = self.STATE_STREAMS + self.last_factor_type = None # rest of the events are used for TUI / read only sessions def async_event_port_stopped (self): -- cgit 1.2.3-korg