Skip to content
Snippets Groups Projects
Select Git revision
  • c24173a9721977de97b7736699ea6c30f27e34f4
  • master default protected
  • test-pytango-10.0.3
  • revert-cs032-ccd-ip
  • deploy-components-parallel
  • fix-chrony-exporter
  • L2SS-2407-swap-iers-caltable-monitoring-port
  • L2SS-2357-fix-ruff
  • sync-up-with-meta-pypcc
  • stabilise-landing-page
  • all-stations-lofar2
  • v0.39.7-backports
  • Move-sdptr-to-v1.5.0
  • fix-build-ubuntu
  • tokens-in-env-files
  • fix-build
  • L2SS-2214-deploy-cdb
  • fix-missing-init
  • add-power-hardware-apply
  • L2SS-2129-Add-Subrack-Routine
  • Also-listen-internal-to-rpc
  • v0.55.5-r2 protected
  • v0.52.8-rc1 protected
  • v0.55.5 protected
  • v0.55.4 protected
  • 0.55.2.dev0
  • 0.55.1.dev0
  • 0.55.0.dev0
  • v0.54.0 protected
  • 0.53.2.dev0
  • 0.53.1.dev0
  • v0.52.3-r2 protected
  • remove-snmp-client
  • v0.52.3 protected
  • v0.52.3dev0 protected
  • 0.53.1dev0
  • v0.52.2-rc3 protected
  • v0.52.2-rc2 protected
  • v0.52.2-rc1 protected
  • v0.52.1.1 protected
  • v0.52.1 protected
41 results

hardware_device.py

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    01-devices.py 4.51 KiB
    # Create shortcuts for our devices, if they exist
    
    
    def OptionalDeviceProxy(device_name: str):
        """Return a DeviceProxy for the given device, or None."""
        try:
            return DeviceProxy(device_name)
        except DevFailed:
            # device is not in database, or otherwise not reachable
            return None
    
    aps_l0 = OptionalDeviceProxy("STAT/APSCT/L0")
    aps_l1 = OptionalDeviceProxy("STAT/APSCT/L1")
    aps_h0 = OptionalDeviceProxy("STAT/APSCT/H0")
    apss = [aps_l0, aps_l1, aps_h0]
    
    apsct_l0 = OptionalDeviceProxy("STAT/APSCT/L0")
    apsct_l1 = OptionalDeviceProxy("STAT/APSCT/L1")
    apsct_h0 = OptionalDeviceProxy("STAT/APSCT/H0")
    apscts = [apsct_l0, apsct_l1, apsct_h0]
    
    apspu_l0 = OptionalDeviceProxy("STAT/APSPU/L0")
    apspu_l1 = OptionalDeviceProxy("STAT/APSPU/L1")
    apspu_h0 = OptionalDeviceProxy("STAT/APSPU/H0")
    apspus = [apspu_l0, apspu_l1, apspu_h0]
    
    recvl_l0 = OptionalDeviceProxy("STAT/RECVL/L0")
    recvl_l1 = OptionalDeviceProxy("STAT/RECVL/L1")
    recvh_h0 = OptionalDeviceProxy("STAT/RECVH/H0")
    recvs = [recvl_l0, recvl_l1, recvh_h0]
    
    unb2_l0 = OptionalDeviceProxy("STAT/UNB2/L0")
    unb2_l1 = OptionalDeviceProxy("STAT/UNB2/L1")
    unb2_h0 = OptionalDeviceProxy("STAT/UNB2/H0")
    unb2s = [unb2_l0, unb2_l1, unb2_h0]
    
    sdpfirmware_l = OptionalDeviceProxy("STAT/SDPFirmware/LBA")
    sdp_l = OptionalDeviceProxy("STAT/SDP/LBA")
    bst_l = OptionalDeviceProxy("STAT/BST/LBA")
    sst_l = OptionalDeviceProxy("STAT/SST/LBA")
    xst_l = OptionalDeviceProxy("STAT/XST/LBA")
    beamlet_l = OptionalDeviceProxy("STAT/Beamlet/LBA")
    digitalbeam_l = OptionalDeviceProxy("STAT/DigitalBeam/LBA")
    antennafield_l = af_l = OptionalDeviceProxy("STAT/AFL/LBA")
    
    sdpfirmware_h = OptionalDeviceProxy("STAT/SDPFirmware/HBA")
    sdp_h = OptionalDeviceProxy("STAT/SDP/HBA")
    bst_h = OptionalDeviceProxy("STAT/BST/HBA")
    sst_h = OptionalDeviceProxy("STAT/SST/HBA")
    xst_h = OptionalDeviceProxy("STAT/XST/HBA")
    beamlet_h = OptionalDeviceProxy("STAT/Beamlet/HBA")
    digitalbeam_h = OptionalDeviceProxy("STAT/DigitalBeam/HBA")
    tilebeam_h = OptionalDeviceProxy("STAT/TileBeam/HBA")
    antennafield_h = af_h = OptionalDeviceProxy("STAT/AFH/HBA")
    
    sdpfirmware_h0 = OptionalDeviceProxy("STAT/SDPFirmware/HBA0")
    sdp_h0 = OptionalDeviceProxy("STAT/SDP/HBA0")
    bst_h0 = OptionalDeviceProxy("STAT/BST/HBA0")
    sst_h0 = OptionalDeviceProxy("STAT/SST/HBA0")
    xst_h0 = OptionalDeviceProxy("STAT/XST/HBA0")
    beamlet_h0 = OptionalDeviceProxy("STAT/Beamlet/HBA0")
    digitalbeam_h0 = OptionalDeviceProxy("STAT/DigitalBeam/HBA0")
    tilebeam_h0 = OptionalDeviceProxy("STAT/TileBeam/HBA0")
    antennafield_h0 = af_h0 = OptionalDeviceProxy("STAT/AFH/HBA0")
    
    sdpfirmware_h1 = OptionalDeviceProxy("STAT/SDPFirmware/HBA1")
    sdp_h1 = OptionalDeviceProxy("STAT/SDP/HBA1")
    bst_h1 = OptionalDeviceProxy("STAT/BST/HBA1")
    sst_h1 = OptionalDeviceProxy("STAT/SST/HBA1")
    xst_h1 = OptionalDeviceProxy("STAT/XST/HBA1")
    beamlet_h1 = OptionalDeviceProxy("STAT/Beamlet/HBA1")
    digitalbeam_h1 = OptionalDeviceProxy("STAT/DigitalBeam/HBA1")
    tilebeam_h1 = OptionalDeviceProxy("STAT/TileBeam/HBA1")
    antennafield_h1 = af_h1 = OptionalDeviceProxy("STAT/AFH/HBA1")
    
    stationmanager = OptionalDeviceProxy("STAT/StationManager/1")
    ccd = OptionalDeviceProxy("STAT/CCD/1")
    ec = OptionalDeviceProxy("STAT/EC/1")
    pcon = OptionalDeviceProxy("STAT/PCON/1")
    psoc = OptionalDeviceProxy("STAT/PSOC/1")
    temperaturemanager = OptionalDeviceProxy("STAT/TemperatureManager/1")
    configuration = OptionalDeviceProxy("STAT/Configuration/1")
    calibration = OptionalDeviceProxy("STAT/Calibration/1")
    observationcontrol = OptionalDeviceProxy("STAT/ObservationControl/1")
    metadata = OptionalDeviceProxy("STAT/Metadata/1")
    
    # Put them in a list in case one wants to iterate
    devices = (
        [
            stationmanager,
            observationcontrol,
            calibration,
            ccd,
            ec,
            pcon,
            psoc,
            temperaturemanager,
            configuration,
            sdpfirmware_l,
            sdp_l,
            bst_l,
            sst_l,
            xst_l,
            beamlet_l,
            digitalbeam_l,
            af_l,
            sdpfirmware_h,
            sdp_h,
            bst_h,
            sst_h,
            xst_h,
            beamlet_h,
            digitalbeam_h,
            tilebeam_h,
            af_h,
            sdpfirmware_h0,
            sdp_h0,
            bst_h0,
            sst_h0,
            xst_h0,
            beamlet_h0,
            digitalbeam_h0,
            tilebeam_h0,
            af_h0,
            sdpfirmware_h1,
            sdp_h1,
            bst_h1,
            sst_h1,
            xst_h1,
            beamlet_h1,
            digitalbeam_h1,
            tilebeam_h1,
            af_h1,
        ]
        + apss
        + apscts
        + apspus
        + recvs
        + unb2s
    )
    
    # Filter out devices that do not exist
    devices = [d for d in devices if d is not None]