From db12ca1f815477923df45790786ec0f8e4bcbe95 Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Wed, 29 Sep 2021 21:32:51 +0200
Subject: [PATCH] L2SS-391: Renamed station_control -> boot

---
 CDB/LOFAR_ConfigDb.json                              |  6 +++---
 README.md                                            | 12 ++++++------
 devices/devices/{station_control.py => boot.py}      | 12 +++++++-----
 .../{device-station_control.yml => device-boot.yml}  |  8 ++++----
 .../stationcontrol-jupyter/startup/01-devices.py     |  4 ++--
 5 files changed, 22 insertions(+), 20 deletions(-)
 rename devices/devices/{station_control.py => boot.py} (97%)
 rename docker-compose/{device-station_control.yml => device-boot.yml} (83%)

diff --git a/CDB/LOFAR_ConfigDb.json b/CDB/LOFAR_ConfigDb.json
index 89ec942ed..b28c57984 100644
--- a/CDB/LOFAR_ConfigDb.json
+++ b/CDB/LOFAR_ConfigDb.json
@@ -21,10 +21,10 @@
                 }
             }
         },
-        "station_control": {
+        "boot": {
             "LTS": {
-                "StationControl": {
-                    "LTS/StationControl/1": {}
+                "Boot": {
+                    "LTS/Boot/1": {}
                 }
             }
         },
diff --git a/README.md b/README.md
index 8f636d910..81b708abe 100644
--- a/README.md
+++ b/README.md
@@ -120,18 +120,18 @@ Futhermore, there are some low-level interfaces:
 Initially, all the devices controlling the station are down. To boot everything up, go to Jupyter (port 8888) and run:
 
 ```
-# start station control device
-sc.initialise()
-sc.on()
+# start boot device
+boot.initialise()
+boot.on()
 
 # this should report as DevState.ON
-sc.status()
+boot.status()
 
 # boot station
-sc.initialise_station()
+boot.initialise_station()
 
 # wait until this reports the initialisation is done (or was stopped half way):
-print(f"Still initialising: {sc.initialising_station_R}. Completeness: {sc.initialisation_progress_R}%. State: {sc.initialisation_status_R}")
+print(f"Still initialising: {boot.initialising_station_R}. Completeness: {boot.initialisation_progress_R}%. State: {boot.initialisation_status_R}")
 ```
 
 Then, in Grafana (port 3000), you should see the devices reaching the ON state.
diff --git a/devices/devices/station_control.py b/devices/devices/boot.py
similarity index 97%
rename from devices/devices/station_control.py
rename to devices/devices/boot.py
index bf7c711d6..c90c66ce6 100644
--- a/devices/devices/station_control.py
+++ b/devices/devices/boot.py
@@ -7,7 +7,9 @@
 # Distributed under the terms of the APACHE license.
 # See LICENSE.txt for more info.
 
-""" StationControl Device Server for LOFAR2.0
+""" Boot Device Server for LOFAR2.0
+
+Boots the rest of the station software.
 
 """
 
@@ -37,7 +39,7 @@ logger = logging.getLogger()
 
 from threading import Thread
 
-__all__ = ["StationControl", "main"]
+__all__ = ["Boot", "main"]
 
 
 class InitialisationException(Exception):
@@ -102,7 +104,7 @@ class DevicesInitialiser(Thread):
 
         logger.info(status)
 
-    def initialise_devices(self):
+    def boot_devices(self):
         """
         Initialise or re-initialise all devices on the station.
 
@@ -181,7 +183,7 @@ class DevicesInitialiser(Thread):
         self.set_status(f"[restarting {device_name}] Succesfully started.")
 
 @device_logging_to_python()
-class StationControl(hardware_device):
+class Boot(hardware_device):
     """
 
     **Properties:**
@@ -302,7 +304,7 @@ def main(args=None, **kwargs):
     from common.lofar_logging import configure_logger
     configure_logger()
 
-    return run((StationControl,), args=args, **kwargs)
+    return run((Boot,), args=args, **kwargs)
 
 
 if __name__ == '__main__':
diff --git a/docker-compose/device-station_control.yml b/docker-compose/device-boot.yml
similarity index 83%
rename from docker-compose/device-station_control.yml
rename to docker-compose/device-boot.yml
index d95e9ca49..e0f804d28 100644
--- a/docker-compose/device-station_control.yml
+++ b/docker-compose/device-boot.yml
@@ -12,15 +12,15 @@
 version: '2'
 
 services:
-  device-station_control:
-    image: device-station_control
+  device-boot:
+    image: device-boot
     # build explicitly, as docker-compose does not understand a local image
     # being shared among services.
     build:
         context: lofar-device-base
         args:
             SOURCE_IMAGE: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}-tango-itango:${TANGO_ITANGO_VERSION}
-    container_name: ${CONTAINER_NAME_PREFIX}device-station_control
+    container_name: ${CONTAINER_NAME_PREFIX}device-boot
     networks:
       - control
     ports:
@@ -37,5 +37,5 @@ services:
       - --
       # configure CORBA to _listen_ on 0:port, but tell others we're _reachable_ through ${HOSTNAME}:port, since CORBA
       # can't know about our Docker port forwarding
-      - python3 -u ${TANGO_LOFAR_CONTAINER_DIR}/devices/devices/station_control.py LTS -v -ORBendPoint giop:tcp:0:5708 -ORBendPointPublish giop:tcp:${HOSTNAME}:5708
+      - python3 -u ${TANGO_LOFAR_CONTAINER_DIR}/devices/devices/boot.py LTS -v -ORBendPoint giop:tcp:0:5708 -ORBendPointPublish giop:tcp:${HOSTNAME}:5708
     restart: unless-stopped
diff --git a/docker-compose/jupyter/ipython-profiles/stationcontrol-jupyter/startup/01-devices.py b/docker-compose/jupyter/ipython-profiles/stationcontrol-jupyter/startup/01-devices.py
index ba7ade76a..fc4fd663d 100644
--- a/docker-compose/jupyter/ipython-profiles/stationcontrol-jupyter/startup/01-devices.py
+++ b/docker-compose/jupyter/ipython-profiles/stationcontrol-jupyter/startup/01-devices.py
@@ -4,7 +4,7 @@ sdp = DeviceProxy("LTS/SDP/1")
 sst = DeviceProxy("LTS/SST/1")
 xst = DeviceProxy("LTS/XST/1")
 unb2 = DeviceProxy("LTS/UNB2/1")
-sc = DeviceProxy("LTS/StationControl/1")
+boot = DeviceProxy("LTS/Boot/1")
 
 # Put them in a list in case one wants to iterate
-devices = [recv, sdp, sst, xst, unb2, sc]
+devices = [recv, sdp, sst, xst, unb2, boot]
-- 
GitLab