Skip to content
Snippets Groups Projects
Select Git revision
  • 39d70508ce434c3d81b1bd5fdebbd0e3c49091e3
  • master default protected
  • L2SS-1914-fix_job_dispatch
  • TMSS-3170
  • TMSS-3167
  • TMSS-3161
  • TMSS-3158-Front-End-Only-Allow-Changing-Again
  • TMSS-3133
  • TMSS-3319-Fix-Templates
  • test-fix-deploy
  • TMSS-3134
  • TMSS-2872
  • defer-state
  • add-custom-monitoring-points
  • TMSS-3101-Front-End-Only
  • TMSS-984-choices
  • SDC-1400-Front-End-Only
  • TMSS-3079-PII
  • TMSS-2936
  • check-for-max-244-subbands
  • TMSS-2927---Front-End-Only-PXII
  • Before-Remove-TMSS
  • LOFAR-Release-4_4_318 protected
  • LOFAR-Release-4_4_317 protected
  • LOFAR-Release-4_4_316 protected
  • LOFAR-Release-4_4_315 protected
  • LOFAR-Release-4_4_314 protected
  • LOFAR-Release-4_4_313 protected
  • LOFAR-Release-4_4_312 protected
  • LOFAR-Release-4_4_311 protected
  • LOFAR-Release-4_4_310 protected
  • LOFAR-Release-4_4_309 protected
  • LOFAR-Release-4_4_308 protected
  • LOFAR-Release-4_4_307 protected
  • LOFAR-Release-4_4_306 protected
  • LOFAR-Release-4_4_304 protected
  • LOFAR-Release-4_4_303 protected
  • LOFAR-Release-4_4_302 protected
  • LOFAR-Release-4_4_301 protected
  • LOFAR-Release-4_4_300 protected
  • LOFAR-Release-4_4_299 protected
41 results

test_utils.py

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    startup.py 1.42 KiB
    #! /usr/bin/env python3
    
    
    def startup(device: str, force_restart: bool):
        '''
        Start a LOFAR Tango device:
        pcc = startup(device = 'LTS/PCC/1', force_restart = False)
        '''
        import tango
        proxy = tango.DeviceProxy(device)
        state = proxy.state()
    
        if force_restart is True:
            print("Forcing device {} restart.".format(device))
            proxy.off()
            state = proxy.state()
            if state is not tango._tango.DevState.OFF:
                print("Device {} cannot perform off although restart has been enforced, state = {}.  Please investigate.".format(device, state))
                return proxy
        if state is not tango._tango.DevState.OFF:
            print("Device {} is not in OFF state, cannot start it.  state = {}".format(device, state))
            return proxy
        print("Device {} is in OFF, performing initialisation.".format(device))
        proxy.initialise()
        state = proxy.state()
        if state is not tango._tango.DevState.STANDBY:
            print("Device {} cannot perform initialise, state = {}.  Please investigate.".format(device, state))
            return proxy
        print("Device {} is in STANDBY, performing on.".format(device))
        proxy.on()
        state = proxy.state()
        if state is not tango._tango.DevState.ON:
            print("Device {} cannot perform on, state = {}.  Please investigate.".format(device, state))
        else:
            print("Device {} has successfully reached ON state.".format(device))
        return proxy