From 62dc276fd8b7b0bd3ce0c532119b5b473075a6ab Mon Sep 17 00:00:00 2001
From: Gijs <Schoonderbeek>
Date: Wed, 30 Aug 2023 13:54:11 +0200
Subject: [PATCH] CCD service scripts

---
 install_ccd.sh          |  3 +++
 install_services_ccd.sh |  4 ++++
 scripts/CCDon.py        | 23 +++++++++++++++++++++++
 3 files changed, 30 insertions(+)
 create mode 100755 install_ccd.sh
 create mode 100755 install_services_ccd.sh
 create mode 100644 scripts/CCDon.py

diff --git a/install_ccd.sh b/install_ccd.sh
new file mode 100755
index 0000000..eed25f3
--- /dev/null
+++ b/install_ccd.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+sudo python3.11 setup.py install
+sudo systemctl restart ccdtr.service
diff --git a/install_services_ccd.sh b/install_services_ccd.sh
new file mode 100755
index 0000000..69f044b
--- /dev/null
+++ b/install_services_ccd.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+sudo cp bin/*.service /lib/systemd/system/.
+sudo systemctl daemon-reload
+sudo systemctl enable ccdtr.service
diff --git a/scripts/CCDon.py b/scripts/CCDon.py
new file mode 100644
index 0000000..f9e68b3
--- /dev/null
+++ b/scripts/CCDon.py
@@ -0,0 +1,23 @@
+from test_common import *
+connect("opc.tcp://localhost:4843/")
+
+#callmethod("APSCT_off")
+#time.sleep(1)
+callmethod("CCD_on")
+#callmethod("APSCT_160MHz_on")
+for x in range(10):
+  busy=get_value("CCDTR_translator_busy_R")
+  print(busy)
+  if not(busy): break
+  time.sleep(0.1)
+
+#time.sleep(1)
+#callmethod("CLK_PLL_setup")
+#exit()
+#time.sleep(1)
+#callmethod("RCU_on")
+#callmethod("RCU_on")
+#time.sleep(1)
+#callmethod("ADC_on")
+
+disconnect();
-- 
GitLab