diff --git a/docker-compose/jupyterlab/ipython-profiles/stationcontrol-jupyter/startup/01-devices.py b/docker-compose/jupyterlab/ipython-profiles/stationcontrol-jupyter/startup/01-devices.py index 350ecb1e87f4829ddd60698831bbf75d941782a9..527f1ee25ebfd8acb420d5433b44541c8a705656 100644 --- a/docker-compose/jupyterlab/ipython-profiles/stationcontrol-jupyter/startup/01-devices.py +++ b/docker-compose/jupyterlab/ipython-profiles/stationcontrol-jupyter/startup/01-devices.py @@ -10,6 +10,7 @@ xst = DeviceProxy("STAT/XST/1") unb2 = DeviceProxy("STAT/UNB2/1") boot = DeviceProxy("STAT/Boot/1") tilebeam = DeviceProxy("STAT/TileBeam/1") +pcon = DeviceProxy("STAT/PCON/1") psoc = DeviceProxy("STAT/PSOC/1") beamlet = DeviceProxy("STAT/Beamlet/1") digitalbeam = DeviceProxy("STAT/DigitalBeam/1") @@ -18,4 +19,4 @@ docker = DeviceProxy("STAT/Docker/1") temperaturemanager = DeviceProxy("STAT/TemperatureManager/1") # Put them in a list in case one wants to iterate -devices = [apsct, ccd, apspu, recv, sdp, bst, sst, xst, unb2, boot, tilebeam, beamlet, digitalbeam, antennafield, temperaturemanager, docker] +devices = [apsct, ccd, apspu, recv, sdp, bst, sst, xst, unb2, boot, tilebeam, beamlet, digitalbeam, antennafield, temperaturemanager, docker, pcon, psoc] diff --git a/jupyter-notebooks/load_macro.ipynb b/jupyter-notebooks/load_macro.ipynb index d7348001f00cd8ebb9b58f9ae110c9f01880d55b..52d2aea466575549a0fa00dbd1d29c281808f8e0 100644 --- a/jupyter-notebooks/load_macro.ipynb +++ b/jupyter-notebooks/load_macro.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "c0494f3f-9db5-44cf-b70b-66a4e4180e71", "metadata": {}, "outputs": [], @@ -13,30 +13,13 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "f54daaa7-848f-4a5d-b6c6-70630e3c9474", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "RECV(stat/recv/1) is in state ON\n", - "SDP(stat/sdp/1) is in state ON\n" - ] - } - ], + "outputs": [], "source": [ "__start_devices" ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a018bfb3-1eaa-437c-8866-19266902e9d4", - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/jupyter-notebooks/macros.ipynb b/jupyter-notebooks/macros.ipynb index cdbe6af56e05f8c9b05d246beeed809aaf655827..3d4bf0befb4fd41602fec427fd30dece01030579 100644 --- a/jupyter-notebooks/macros.ipynb +++ b/jupyter-notebooks/macros.ipynb @@ -8,18 +8,19 @@ "outputs": [], "source": [ "# Start all devices\n", - "devices = [recv, sdp]\n", "for device in devices:\n", - " if device.state() == DevState.FAULT:\n", - " device.Off()\n", - " if device.state() == DevState.OFF:\n", - " device.warm_boot()\n", - " if device.state() == DevState.INIT:\n", - " device.Standby()\n", - " if device.state() == DevState.STANDBY:\n", - " device.On()\n", - " \n", - " print(f'{device} is in state {device.state()}')" + " try:\n", + " if device.state() == DevState.FAULT:\n", + " device.Off()\n", + " if device.state() == DevState.OFF:\n", + " device.warm_boot()\n", + " if device.state() == DevState.INIT:\n", + " device.Standby()\n", + " if device.state() == DevState.STANDBY:\n", + " device.On() \n", + " print(f'{device} is in state {device.state()}')\n", + " except ConnectionFailed as e:\n", + " print(f\"{device} is in state DOWN: {e.args[0].desc}\")" ] }, {