Skip to content

Commit

Permalink
Remove all instances of session.set_status('running') (#671)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJKoopman committed May 7, 2024
1 parent 2d8d91c commit 3175b01
Show file tree
Hide file tree
Showing 38 changed files with 0 additions and 193 deletions.
1 change: 0 additions & 1 deletion socs/agents/acti_camera/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ def acq(self, session, params=None):
"""
pm = Pacemaker(1 / 60, quantize=False)

session.set_status('running')
self.is_streaming = True
while self.is_streaming:
# Use UTC
Expand Down
15 changes: 0 additions & 15 deletions socs/agents/acu/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ def idle_reset(self, session, params):
"""
IDLE_RESET_TIMEOUT = 60 # The watchdog timeout in ACU

session.set_status('running')
next_action = 0

while session.status in ['starting', 'running']:
Expand Down Expand Up @@ -433,8 +432,6 @@ def monitor(self, session, params):
"""

session.set_status('running')

# Note that session.data will get scanned, to assign data to
# feed blocks. We make an explicit list of items to ignore
# during that scan (not_data_keys).
Expand Down Expand Up @@ -806,7 +803,6 @@ def broadcast(self, session, params):
}
"""
session.set_status('running')
FMT = self.udp_schema['format']
FMT_LEN = struct.calcsize(FMT)
UDP_PORT = self.udp['port']
Expand Down Expand Up @@ -1361,7 +1357,6 @@ def go_to(self, session, params):
f'[{limits[0]}, {limits[1]}].')

self.log.info(f'Requested position: az={target_az}, el={target_el}')
session.set_status('running')

legs, msg = yield self._get_sunsafe_moves(target_az, target_el,
zero_legs_ok=False)
Expand Down Expand Up @@ -1417,7 +1412,6 @@ def set_boresight(self, session, params):
f'[{limits[0]}, {limits[1]}].')

self.log.info(f'Commanded position: boresight={target}')
session.set_status('running')

ok, msg = yield self._go_to_axis(session, 'Boresight', target)

Expand All @@ -1444,8 +1438,6 @@ def go_to_named(self, session, params):
if target is None:
return False, 'Position "%s" is not configured.' % params['target']

session.set_status('running')

ok, msg, _session = self.agent.start('go_to', {'az': target[0], 'el': target[1],
'end_stop': params['end_stop']})
if ok == ocs.ERROR:
Expand Down Expand Up @@ -1529,7 +1521,6 @@ def clear_faults(self, session, params):
"""

session.set_status('running')
yield self.acu_control.clear_faults()
session.set_status('stopping')
return True, 'Job completed.'
Expand All @@ -1556,7 +1547,6 @@ def _read_modes():
modes.append(self.data['status']['corotator']['Corotator_mode'])
return modes

session.set_status('running')
for i in range(6):
for short_name, mode in zip(['az', 'el', 'third'],
_read_modes()):
Expand Down Expand Up @@ -1628,7 +1618,6 @@ def fromfile_scan(self, session, params=None):
It is acceptable to omit columns 5 and 6.
"""
session.set_status('running')

times, azs, els, vas, ves, azflags, elflags = sh.from_file(params['filename'])
if min(azs) <= self.motion_limits['azimuth']['lower'] \
Expand Down Expand Up @@ -1803,7 +1792,6 @@ def generate_scan(self, session, params):
if scan_upload_len:
point_batch_count = scan_upload_len / step_time

session.set_status('running')
self.log.info('The plan: {plan}', plan=plan)
self.log.info('The scan_params: {scan_params}', scan_params=scan_params)

Expand Down Expand Up @@ -2238,7 +2226,6 @@ def lookup(keys, tree):
last_panic = 0

session.data = {}
session.set_status('running')

while session.status in ['starting', 'running']:
new_data = {
Expand Down Expand Up @@ -2442,7 +2429,6 @@ def escape_sun_now(self, session, params):

session.data = {'state': state,
'timestamp': time.time()}
session.set_status('running')

while session.status in ['starting', 'running'] and state not in ['escape-done']:
az, el = [self.data['status']['summary'][f'{ax}_current_position']
Expand Down Expand Up @@ -2622,7 +2608,6 @@ def exercise(self, session, params):
'attempts': 0,
'errors': 0,
}
session.set_status('running')

def _publish_activity(activity):
msg = {
Expand Down
2 changes: 0 additions & 2 deletions socs/agents/bluefors/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,6 @@ def acq(self, session, params=None):
if not ok:
return ok, msg

session.set_status('running')

# Create file objects for all logs in today's directory
self.log_tracker.open_all_logs()

Expand Down
6 changes: 0 additions & 6 deletions socs/agents/cryomech_cpa/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,6 @@ def init(self, session, params=None):
"{} is already running".format(self.lock.job))
return False, "Could not acquire lock."

session.set_status('running')

# Establish connection to ptc
self.ptc = PTC(self.ip_address, port=self.port,
fake_errors=self.fake_errors)
Expand Down Expand Up @@ -287,8 +285,6 @@ def power_ptc(self, session, params=None):
"running".format(self.lock.job))
return False, "Could not acquire lock."

session.set_status('running')

self.ptc.power(params['state'])

return True, "PTC powered {}".format(params['state'])
Expand All @@ -310,8 +306,6 @@ def acq(self, session, params):
"running".format(self.lock.job))
return False, "Could not acquire lock."

session.set_status('running')

last_release = time.time()

self.take_data = True
Expand Down
1 change: 0 additions & 1 deletion socs/agents/fts_aerotech/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ def acq(self, session, params=None):

self.log.info("Starting Data Acquisition for FTS Mirror at"
f"{f_sample} Hz")
session.set_status('running')
self.take_data = True
last_release = time.time()

Expand Down
2 changes: 0 additions & 2 deletions socs/agents/generator/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,6 @@ def acq(self, session, params=None):
.format(self.lock.job))
return False, "Could not acquire lock."

session.set_status('running')

self.take_data = True

session.data = {"fields": {}}
Expand Down
1 change: 0 additions & 1 deletion socs/agents/hi6200/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def monitor_weight(self, session, params=None):
[seconds].
"""
session.set_status('running')
self.monitor = True

pm = Pacemaker(1, quantize=True)
Expand Down
2 changes: 0 additions & 2 deletions socs/agents/hwp_encoder/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,6 @@ def acq(self, session, params):
.format(self.lock.job))
return False, 'Could not acquire lock.'

session.set_status('running')

self.take_data = True

# Prepare data_cache for session.data
Expand Down
2 changes: 0 additions & 2 deletions socs/agents/hwp_gripper/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,6 @@ def monitor_state(self, session, params=None):
'act{axis}_emg': False,
'act{axis}_brake': True}}
"""
session.set_status('running')
sleep_time = 5
while session.status in ['starting', 'running']:
if self.client is None:
Expand Down Expand Up @@ -745,7 +744,6 @@ def monitor_supervisor(self, session, params=None):
{'time': 1649085992.719602,
'gripper_action': 'ok'}
"""
session.set_status('running')
last_ok_time = time.time()

if self.supervisor_id is None:
Expand Down
1 change: 0 additions & 1 deletion socs/agents/hwp_pcu/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ def main(self, session, params):
**Process** - Main process for PCU agent.
"""
PCU = None
session.set_status('running')

threads.blockingCallFromThread(reactor, self._clear_queue)

Expand Down
2 changes: 0 additions & 2 deletions socs/agents/hwp_pmx/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ def main(self, session, params):
"""
PMX = None
session.set_status('running')

threads.blockingCallFromThread(reactor, self._clear_queue)

Expand Down Expand Up @@ -385,7 +384,6 @@ def monitor_supervisor(self, session, params):
power off.
"""

session.set_status('running')
last_ok_time = time.time()

if self.supervisor_id is None:
Expand Down
2 changes: 0 additions & 2 deletions socs/agents/hwp_supervisor/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,6 @@ def monitor(self, session, params):

kw = {'test_mode': test_mode, 'log': self.log}

session.set_status('running')
while session.status in ['starting', 'running']:
session.data['timestamp'] = time.time()

Expand Down Expand Up @@ -1155,7 +1154,6 @@ def spin_control(self, session, params):
"""
clients = self._get_hwp_clients()

session.set_status('running')
while session.status in ['starting', 'running']:
self.control_state_machine.update(clients, self.hwp_state)
session.data = {
Expand Down
1 change: 0 additions & 1 deletion socs/agents/ibootbar/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ def acq(self, session, params=None):
names = ['Outlet-1', 'Outlet-2', 'Outlet-3', 'Outlet-4',
'Outlet-5', 'Outlet-6', 'Outlet-7', 'Outlet-8']

session.set_status('running')
self.is_streaming = True
while self.is_streaming:
yield dsleep(1)
Expand Down
1 change: 0 additions & 1 deletion socs/agents/ifm_sbn246_flowmeter/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ def acq(self, session, params=None):
"""
pm = Pacemaker(1, quantize=True)
self.take_data = True
session.set_status('running')

while self.take_data:
pm.sleep()
Expand Down
2 changes: 0 additions & 2 deletions socs/agents/labjack/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ def acq(self, session, params=None):
"{} is already running".format(self.lock.job))
return False, "Could not acquire lock."

session.set_status('running')
self.take_data = True

# Start the data stream. Use the scan rate returned by the stream,
Expand Down Expand Up @@ -441,7 +440,6 @@ def acq_reg(self, session, params=None):
"{} is already running".format(self.lock.job))
return False, "Could not acquire lock."

session.set_status('running')
self.take_data = True

while self.take_data:
Expand Down
2 changes: 0 additions & 2 deletions socs/agents/lakeshore240/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@ def acq(self, session, params=None):
.format(self.lock.job))
return False, "Could not acquire lock."

session.set_status('running')

self.take_data = True

session.data = {"fields": {}}
Expand Down

0 comments on commit 3175b01

Please sign in to comment.