diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000000..123014908b
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,6 @@
+version: 2
+updates:
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "daily"
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 3c7fb41ee9..79ade6a101 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -1,6 +1,56 @@
name: lint
on: [pull_request]
jobs:
+ check-opi-format:
+ runs-on: "windows-latest"
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
+ with:
+ python-version: '3.11'
+ - name: OPI checker dependencies
+ run: python -m pip install -r base/uk.ac.stfc.isis.ibex.opis/requirements.txt
+ - name: Run OPI checker
+ run: python base/uk.ac.stfc.isis.ibex.opis/check_opi_format.py -strict -directory base/uk.ac.stfc.isis.ibex.opis
+ - name: Validate OPIs
+ run: python base/uk.ac.stfc.isis.ibex.opis/validate_opis.py
+
+ check-build:
+ runs-on: "ubuntu-latest"
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
+ with:
+ python-version: '3.11'
+ - name: Run check_build
+ working-directory: ./build
+ run: python check_build.py ../base
+
+ scriptgenerator-tests:
+ runs-on: "ubuntu-latest"
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
+ with:
+ python-version: '3.11'
+ - name: Install dependencies
+ run: python -m pip install -r ./base/uk.ac.stfc.isis.ibex.scriptgenerator/python_support/requirements.txt
+ - name: Run scriptgenerator tests
+ working-directory: ./base/uk.ac.stfc.isis.ibex.scriptgenerator/python_support
+ run: python -m unittest discover
+
+ checkstyle:
+ runs-on: "ubuntu-latest"
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-java@v4
+ with:
+ distribution: 'temurin'
+ java-version: '21'
+ - name: checkstyle
+ working-directory: ./base/uk.ac.stfc.isis.ibex.client.tycho.parent
+ run: mvn checkstyle:check
+
code-ql:
strategy:
matrix:
diff --git a/base/uk.ac.stfc.isis.ibex.opis/requirements.txt b/base/uk.ac.stfc.isis.ibex.opis/requirements.txt
new file mode 100644
index 0000000000..310d95617a
--- /dev/null
+++ b/base/uk.ac.stfc.isis.ibex.opis/requirements.txt
@@ -0,0 +1,4 @@
+lxml
+pyhamcrest
+pywin32
+xmlrunner
diff --git a/base/uk.ac.stfc.isis.ibex.opis/resources/CAENHexagon/CAEN_hexagon_channel.opi b/base/uk.ac.stfc.isis.ibex.opis/resources/CAENHexagon/CAEN_hexagon_channel.opi
index e3a4bc456b..babec1c5e3 100644
--- a/base/uk.ac.stfc.isis.ibex.opis/resources/CAENHexagon/CAEN_hexagon_channel.opi
+++ b/base/uk.ac.stfc.isis.ibex.opis/resources/CAENHexagon/CAEN_hexagon_channel.opi
@@ -1,6 +1,6 @@
-
+
-
+
false
-1
@@ -8,20 +8,20 @@
false
-
+
5.1.0
-
+
6
600
true
-
-
-
+
+
+
true
true
true
@@ -33,16 +33,16 @@
-1
-1
-
+
false
false
false
-
+
true
-
+
0
1
@@ -52,7 +52,7 @@
false
-
+
0
20
@@ -61,15 +61,15 @@
0
true
$(P)$(Q):$(CHAN):LISTMODE
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -85,13 +85,13 @@ $(pv_value)
24
-
+
false
-
+
-
+
0
1
@@ -100,20 +100,20 @@ $(pv_value)
Default
-
+
20
1
Label
-
+
true
true
false
-
+
LISTMODE
-
+
true
1
true
@@ -125,16 +125,16 @@ $(pv_value)
24
-
+
false
false
false
-
+
true
-
+
0
1
@@ -144,7 +144,7 @@ $(pv_value)
false
-
+
4
20
@@ -153,15 +153,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):LISTFILE
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -177,13 +177,13 @@ $(pv_value)
63
-
+
false
-
+
-
+
0
1
@@ -192,20 +192,20 @@ $(pv_value)
Default
-
+
20
1
Label_1
-
+
true
true
false
-
+
LISTFILE
-
+
true
1
true
@@ -217,16 +217,16 @@ $(pv_value)
63
-
+
false
false
false
-
+
true
-
+
0
1
@@ -236,7 +236,7 @@ $(pv_value)
false
-
+
0
20
@@ -245,15 +245,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):NEVENTS
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -269,13 +269,13 @@ $(pv_value)
102
-
+
false
-
+
-
+
0
1
@@ -284,20 +284,20 @@ $(pv_value)
Default
-
+
20
1
Label_5
-
+
true
true
false
-
+
Unprocessed Events
-
+
true
1
true
@@ -309,16 +309,16 @@ $(pv_value)
102
-
+
false
false
false
-
+
true
-
+
0
1
@@ -328,7 +328,7 @@ $(pv_value)
false
-
+
0
20
@@ -337,15 +337,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):ACQ:STARTMODE
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -361,13 +361,13 @@ $(pv_value)
294
-
+
false
-
+
-
+
0
1
@@ -376,20 +376,20 @@ $(pv_value)
Default
-
+
20
1
Label_6
-
+
true
true
false
-
+
ACQ:STARTMODE
-
+
true
1
true
@@ -401,16 +401,16 @@ $(pv_value)
294
-
+
false
false
false
-
+
true
-
+
0
1
@@ -420,7 +420,7 @@ $(pv_value)
false
-
+
0
20
@@ -429,15 +429,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):ACQ:RUNNING
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -453,13 +453,13 @@ $(pv_value)
336
-
+
false
-
+
-
+
0
1
@@ -468,20 +468,20 @@ $(pv_value)
Default
-
+
20
1
Label_7
-
+
true
true
false
-
+
ACQ:RUNNING
-
+
true
1
true
@@ -493,16 +493,16 @@ $(pv_value)
336
-
+
false
false
false
-
+
true
-
+
0
1
@@ -512,7 +512,7 @@ $(pv_value)
false
-
+
0
20
@@ -521,15 +521,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):ACQ:INIT
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -545,13 +545,13 @@ $(pv_value)
432
-
+
false
-
+
-
+
0
1
@@ -560,20 +560,20 @@ $(pv_value)
Default
-
+
20
1
Label_8
-
+
true
true
false
-
+
ACQ:INIT
-
+
true
1
true
@@ -585,16 +585,16 @@ $(pv_value)
432
-
+
false
false
false
-
+
true
-
+
0
1
@@ -604,7 +604,7 @@ $(pv_value)
false
-
+
0
20
@@ -613,15 +613,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):LISTENABLED
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -637,13 +637,13 @@ $(pv_value)
384
-
+
false
-
+
-
+
0
1
@@ -652,20 +652,20 @@ $(pv_value)
Default
-
+
20
1
Label_9
-
+
true
true
false
-
+
LISTENABLED
-
+
true
1
true
@@ -677,16 +677,16 @@ $(pv_value)
384
-
+
false
false
false
-
+
true
-
+
0
1
@@ -696,7 +696,7 @@ $(pv_value)
false
-
+
0
20
@@ -705,15 +705,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):ENABLED
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -729,13 +729,13 @@ $(pv_value)
208
-
+
false
-
+
-
+
0
1
@@ -744,20 +744,20 @@ $(pv_value)
Default
-
+
20
1
Label_10
-
+
true
true
false
-
+
ENABLED
-
+
true
1
true
@@ -769,16 +769,16 @@ $(pv_value)
208
-
+
false
false
false
-
+
true
-
+
0
1
@@ -788,7 +788,7 @@ $(pv_value)
false
-
+
0
20
@@ -797,15 +797,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):POLARITY
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -821,13 +821,13 @@ $(pv_value)
252
-
+
false
-
+
-
+
0
1
@@ -836,20 +836,20 @@ $(pv_value)
Default
-
+
20
1
Label_11
-
+
true
true
false
-
+
POLARITY
-
+
true
1
true
@@ -866,18 +866,18 @@ $(pv_value)
$(pv_name)
1
10
-
-
+
+
false
false
-
+
false
-
+
0
1
@@ -887,14 +887,14 @@ $(pv_value)
false
-
+
40
-
+
Action Button
0
$(P)$(Q):$(CHAN):START:SP
-
+
@@ -908,7 +908,7 @@ $(pv_value)
true
false
-
+
Start This Channel
false
@@ -927,18 +927,18 @@ $(pv_value)
$(pv_name)
1
10
-
-
+
+
false
false
-
+
false
-
+
0
1
@@ -948,14 +948,14 @@ $(pv_value)
false
-
+
40
-
+
Action Button_1
0
$(P)$(Q):$(CHAN):STOP:SP
-
+
@@ -969,7 +969,7 @@ $(pv_value)
true
false
-
+
Stop This Channel
false
@@ -987,11 +987,11 @@ $(pv_value)
false
false
-
+
false
-
+
6
1
@@ -1001,20 +1001,20 @@ $(pv_value)
false
-
+
30
-
+
Menu Button
$(P)$(Q):$(CHAN):LISTMODE:SP
-
-
+
+
true
true
false
-
+
false
$(pv_name)
$(pv_value)
@@ -1031,11 +1031,11 @@ $(pv_value)
false
false
-
+
false
-
+
6
1
@@ -1045,20 +1045,20 @@ $(pv_value)
false
-
+
30
-
+
Menu Button_1
$(P)$(Q):$(CHAN):ENABLED:SP
-
-
+
+
true
true
false
-
+
false
$(pv_name)
$(pv_value)
@@ -1075,11 +1075,11 @@ $(pv_value)
false
false
-
+
false
-
+
6
1
@@ -1089,20 +1089,20 @@ $(pv_value)
false
-
+
30
-
+
Menu Button_2
$(P)$(Q):$(CHAN):LISTENABLED:SP
-
-
+
+
true
true
false
-
+
false
$(pv_name)
$(pv_value)
@@ -1115,16 +1115,16 @@ $(pv_value)
379
-
+
false
false
false
-
+
true
-
+
0
1
@@ -1134,7 +1134,7 @@ $(pv_value)
false
-
+
0
20
@@ -1143,15 +1143,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):LISTMODE:MAXNEVENTS
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -1167,13 +1167,13 @@ $(pv_value)
160
-
+
false
-
+
-
+
0
1
@@ -1182,20 +1182,20 @@ $(pv_value)
Default
-
+
20
1
Label_12
-
+
true
true
false
-
+
Unprocessed Events Limit
-
+
true
1
true
@@ -1207,27 +1207,27 @@ $(pv_value)
160
-
+
false
false
false
-
+
false
-
+
3
1
-
+
true
Default
false
-
+
0
25
@@ -1240,19 +1240,19 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):LISTMODE:MAXNEVENTS:SP
-
+
0.0
-
+
true
true
false
-
+
0
true
-
+
$(pv_name)
$(pv_value)
false
@@ -1264,16 +1264,16 @@ $(pv_value)
157
-
+
false
false
false
-
+
true
-
+
0
1
@@ -1283,7 +1283,7 @@ $(pv_value)
false
-
+
0
20
@@ -1292,15 +1292,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):EVENTSPEC:NTRIG
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -1316,13 +1316,13 @@ $(pv_value)
271
-
+
false
-
+
-
+
0
1
@@ -1331,20 +1331,20 @@ $(pv_value)
Default
-
+
20
1
Label_13
-
+
true
true
false
-
+
NTRIGGERS
-
+
true
1
true
@@ -1356,16 +1356,16 @@ $(pv_value)
271
-
+
false
false
false
-
+
true
-
+
0
1
@@ -1375,7 +1375,7 @@ $(pv_value)
false
-
+
0
20
@@ -1384,15 +1384,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):NEVENTSPROC
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -1408,13 +1408,13 @@ $(pv_value)
306
-
+
false
-
+
-
+
0
1
@@ -1423,20 +1423,20 @@ $(pv_value)
Default
-
+
20
1
Label_14
-
+
true
true
false
-
+
Processed Events
-
+
true
1
true
@@ -1448,16 +1448,16 @@ $(pv_value)
306
-
+
false
false
false
-
+
true
-
+
0
1
@@ -1467,7 +1467,7 @@ $(pv_value)
false
-
+
0
20
@@ -1476,15 +1476,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):LISTFILE:SIZE
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -1500,13 +1500,13 @@ $(pv_value)
342
-
+
false
-
+
-
+
0
1
@@ -1515,20 +1515,20 @@ $(pv_value)
Default
-
+
20
1
Label_15
-
+
true
true
false
-
+
List File Size
-
+
true
1
true
@@ -1545,18 +1545,18 @@ $(pv_value)
$(pv_name)
1
10
-
-
+
+
false
false
-
+
false
-
+
0
1
@@ -1566,14 +1566,14 @@ $(pv_value)
false
-
+
40
-
+
Action Button_2
0
$(P)$(Q):START:SP
-
+
@@ -1587,7 +1587,7 @@ $(pv_value)
true
false
-
+
Start All Channels
false
@@ -1606,18 +1606,18 @@ $(pv_value)
$(pv_name)
1
10
-
-
+
+
false
false
-
+
false
-
+
0
1
@@ -1627,14 +1627,14 @@ $(pv_value)
false
-
+
40
-
+
Action Button_3
0
$(P)$(Q):STOP:SP
-
+
@@ -1648,7 +1648,7 @@ $(pv_value)
true
false
-
+
Stop All Channels
false
@@ -1667,18 +1667,18 @@ $(pv_value)
$(pv_name)
1
10
-
-
+
+
false
false
-
+
false
-
+
0
1
@@ -1688,21 +1688,21 @@ $(pv_value)
false
-
+
40
-
+
Action Button_4
0
$(P)$(Q):RESTART:SP
-
-
+
+
true
true
false
-
+
Restart
false
@@ -1716,22 +1716,22 @@ $(pv_value)
543
-
+
false
false
-
+
-1
true
-
+
0
1
3
-
+
0
true
@@ -1741,27 +1741,27 @@ $(pv_value)
false
-
+
52
LED
-
+
OFF
-
+
ON
$(P)$(Q):ACQ:RUNNING
-
-
+
+
true
true
true
-
+
false
false
$(pv_name)
@@ -1774,22 +1774,22 @@ $(pv_value)
486
-
+
false
false
-
+
-1
true
-
+
0
1
3
-
+
0
true
@@ -1799,27 +1799,27 @@ $(pv_value)
false
-
+
52
LED_1
-
+
OFF
-
+
ON
$(P)$(Q):$(CHAN):ACQ:RUNNING
-
-
+
+
true
true
true
-
+
false
false
$(pv_name)
@@ -1837,18 +1837,18 @@ $(pv_value)
$(pv_name)
1
10
-
-
+
+
false
false
-
+
false
-
+
0
1
@@ -1858,23 +1858,23 @@ $(pv_value)
false
-
+
40
-
+
Action Button_5
0
$(P)$(Q):$(CHAN):RELOADLIVE:SP
-
-
+
+
true
true
false
-
+
- Reload Live Data
+ Reload Live Data
This Channel
false
$(pv_name)
@@ -1887,10 +1887,10 @@ $(pv_value)
498
-
+
false
-
+
0
1
@@ -1900,25 +1900,25 @@ $(pv_value)
false
-
+
1
-
+
Dummy
0
-
-
-
+
+
+
true
true
false
-
+
-
+
false
-
+
true
Action Button
1
@@ -1927,13 +1927,13 @@ $(pv_value)
102
-
+
false
-
+
-
+
0
1
@@ -1942,20 +1942,20 @@ $(pv_value)
Default
-
+
20
1
Label_16
-
+
true
true
false
-
+
Count Rate TMIN
-
+
true
1
true
@@ -1967,13 +1967,13 @@ $(pv_value)
27
-
+
false
-
+
-
+
0
1
@@ -1982,20 +1982,20 @@ $(pv_value)
Default
-
+
20
1
Label_17
-
+
true
true
false
-
+
Count Rate TMAX
-
+
true
1
true
@@ -2007,27 +2007,27 @@ $(pv_value)
54
-
+
false
false
false
-
+
false
-
+
3
1
-
+
true
Default
false
-
+
0
25
@@ -2040,19 +2040,19 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):EVENTSPECRATE:TMIN:SP
-
+
0.0
-
+
true
true
false
-
+
0
true
-
+
$(pv_name)
$(pv_value)
false
@@ -2064,27 +2064,27 @@ $(pv_value)
24
-
+
false
false
false
-
+
false
-
+
3
1
-
+
true
Default
false
-
+
0
25
@@ -2097,19 +2097,19 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):EVENTSPECRATE:TMAX:SP
-
+
0.0
-
+
true
true
false
-
+
0
true
-
+
$(pv_name)
$(pv_value)
false
@@ -2121,13 +2121,13 @@ $(pv_value)
54
-
+
false
-
+
-
+
0
1
@@ -2136,20 +2136,20 @@ $(pv_value)
Default
-
+
20
1
Label_18
-
+
true
true
false
-
+
Counts / Pulse
-
+
true
1
true
@@ -2161,16 +2161,16 @@ $(pv_value)
94
-
+
false
false
false
-
+
true
-
+
0
1
@@ -2180,7 +2180,7 @@ $(pv_value)
false
-
+
0
20
@@ -2189,15 +2189,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):EVENTSPECRATE
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -2213,13 +2213,13 @@ $(pv_value)
94
-
+
false
-
+
-
+
0
1
@@ -2228,20 +2228,20 @@ $(pv_value)
Default
-
+
20
1
Label_4
-
+
true
true
false
-
+
Start Time
-
+
true
1
true
@@ -2253,16 +2253,16 @@ $(pv_value)
141
-
+
false
false
false
-
+
true
-
+
0
1
@@ -2272,7 +2272,7 @@ $(pv_value)
false
-
+
0
20
@@ -2281,15 +2281,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):STARTTIME
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -2305,13 +2305,13 @@ $(pv_value)
141
-
+
false
-
+
-
+
0
1
@@ -2320,20 +2320,20 @@ $(pv_value)
Default
-
+
20
1
Label_20
-
+
true
true
false
-
+
Run Duration
-
+
true
1
true
@@ -2345,16 +2345,16 @@ $(pv_value)
213
-
+
false
false
false
-
+
true
-
+
0
1
@@ -2364,7 +2364,7 @@ $(pv_value)
false
-
+
0
20
@@ -2373,15 +2373,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):RUNDURATION
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -2397,13 +2397,13 @@ $(pv_value)
213
-
+
false
-
+
-
+
0
1
@@ -2412,20 +2412,20 @@ $(pv_value)
Default
-
+
20
1
Label_21
-
+
true
true
false
-
+
Stop Time
-
+
true
1
true
@@ -2437,16 +2437,16 @@ $(pv_value)
179
-
+
false
false
false
-
+
true
-
+
0
1
@@ -2456,7 +2456,7 @@ $(pv_value)
false
-
+
0
20
@@ -2465,15 +2465,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):STOPTIME
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -2489,22 +2489,22 @@ $(pv_value)
179
-
+
false
false
-
+
-1
true
-
+
0
1
3
-
+
0
true
@@ -2514,27 +2514,27 @@ $(pv_value)
false
-
+
52
LED_2
-
+
ERROR
-
+
OK
$(P)$(Q):$(CHAN):TIMEREG
-
-
+
+
true
true
true
-
+
false
false
$(pv_name)
@@ -2547,13 +2547,13 @@ $(pv_value)
278
-
+
false
-
+
-
+
0
1
@@ -2562,20 +2562,20 @@ $(pv_value)
Default
-
+
20
1
Label_22
-
+
true
true
false
-
+
Timing Register
-
+
true
1
true
@@ -2586,4 +2586,44 @@ $(pv_value)
581
294
-
\ No newline at end of file
+
+
+ false
+
+
+
+ 0
+ 1
+ true
+
+ ISIS_Button_NEW
+
+ false
+
+
+
+ 1
+
+ Dummy
+ 0
+
+
+
+
+ true
+ true
+ false
+
+
+
+
+ false
+
+ true
+ Action Button
+ 1
+ -648922a4:1624e4fa0bd:-7f69
+ 105
+ 102
+
+
diff --git a/base/uk.ac.stfc.isis.ibex.opis/resources/CAENHexagon/CAEN_hexagon_energyspec.opi b/base/uk.ac.stfc.isis.ibex.opis/resources/CAENHexagon/CAEN_hexagon_energyspec.opi
index adfe245795..6b48cf9e5e 100644
--- a/base/uk.ac.stfc.isis.ibex.opis/resources/CAENHexagon/CAEN_hexagon_energyspec.opi
+++ b/base/uk.ac.stfc.isis.ibex.opis/resources/CAENHexagon/CAEN_hexagon_energyspec.opi
@@ -1,6 +1,6 @@
-
+
-
+
false
-1
@@ -8,20 +8,20 @@
false
-
+
5.1.0
-
+
6
600
true
-
-
-
+
+
+
true
true
true
@@ -33,17 +33,17 @@
-1
-1
-
+
false
true
0.0
-
+
Energy
true
-
+
false
100.0
@@ -51,7 +51,7 @@
Default
-
+
true
0
@@ -61,12 +61,12 @@
true
0.0
-
+
Counts
true
-
+
false
100.0
@@ -74,7 +74,7 @@
Default
-
+
true
0
@@ -84,33 +84,33 @@
2
false
-
+
true
-
+
0
1
true
false
-
+
367
XY Graph
-
+
-
-
-
+
+
+
true
true
false
-
+
true
false
true
@@ -129,7 +129,7 @@ $(trace_0_y_pv_value)
4
0
-
+
0
100
@@ -137,14 +137,14 @@ $(trace_0_y_pv_value)
true
0
$(P)$(Q):$(CHAN):ENERGYSPEC:X
-
+
1
$(P)$(Q):$(CHAN):ENERGYSPEC
-
+
1
false
-
-
+
+
true
XY Graph
721
@@ -153,16 +153,16 @@ $(trace_0_y_pv_value)
6
-
+
false
false
false
-
+
true
-
+
0
1
@@ -172,7 +172,7 @@ $(trace_0_y_pv_value)
false
-
+
0
20
@@ -181,15 +181,15 @@ $(trace_0_y_pv_value)
0
true
$(P)$(Q):$(CHAN):ENERGYSPEC:NBINS
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -205,13 +205,13 @@ $(pv_value)
384
-
+
false
-
+
-
+
0
1
@@ -220,20 +220,20 @@ $(pv_value)
Default
-
+
20
1
Label
-
+
true
true
false
-
+
NBINS
-
+
true
1
true
@@ -245,27 +245,27 @@ $(pv_value)
384
-
+
false
false
false
-
+
false
-
+
3
1
-
+
true
Default
false
-
+
0
25
@@ -278,19 +278,19 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):ENERGYSPEC:NBINS:SP
-
+
0.0
-
+
true
true
false
-
+
0
true
-
+
$(pv_name)
$(pv_value)
false
@@ -302,16 +302,16 @@ $(pv_value)
381
-
+
false
false
false
-
+
true
-
+
0
1
@@ -321,7 +321,7 @@ $(pv_value)
false
-
+
0
20
@@ -330,15 +330,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):ENERGYSPEC:AUTOSAVE
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -354,13 +354,13 @@ $(pv_value)
420
-
+
false
-
+
-
+
0
1
@@ -369,20 +369,20 @@ $(pv_value)
Default
-
+
20
1
Label_1
-
+
true
true
false
-
+
AUTOSAVE
-
+
true
1
true
@@ -394,27 +394,27 @@ $(pv_value)
420
-
+
false
false
false
-
+
false
-
+
3
1
-
+
true
Default
false
-
+
0
25
@@ -427,19 +427,19 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):ENERGYSPEC:AUTOSAVE:SP
-
+
0.0
-
+
true
true
false
-
+
0
true
-
+
$(pv_name)
$(pv_value)
false
@@ -451,16 +451,16 @@ $(pv_value)
417
-
+
false
false
false
-
+
true
-
+
0
1
@@ -470,7 +470,7 @@ $(pv_value)
false
-
+
0
20
@@ -479,15 +479,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):ENERGYSPEC:REALTIME
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -503,13 +503,13 @@ $(pv_value)
475
-
+
false
-
+
-
+
0
1
@@ -518,20 +518,20 @@ $(pv_value)
Default
-
+
20
1
Label_2
-
+
true
true
false
-
+
REALTIME
-
+
true
1
true
@@ -543,16 +543,16 @@ $(pv_value)
475
-
+
false
false
false
-
+
true
-
+
0
1
@@ -562,7 +562,7 @@ $(pv_value)
false
-
+
0
20
@@ -571,15 +571,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):ENERGYSPEC:DEADTIME
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -595,13 +595,13 @@ $(pv_value)
486
-
+
false
-
+
-
+
0
1
@@ -610,20 +610,20 @@ $(pv_value)
Default
-
+
20
1
Label_3
-
+
true
true
false
-
+
DEADTIME
-
+
true
1
true
@@ -635,16 +635,16 @@ $(pv_value)
486
-
+
false
false
false
-
+
true
-
+
0
1
@@ -654,7 +654,7 @@ $(pv_value)
false
-
+
0
20
@@ -663,15 +663,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):ENERGYSPEC:LIVETIME
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -687,13 +687,13 @@ $(pv_value)
516
-
+
false
-
+
-
+
0
1
@@ -702,20 +702,20 @@ $(pv_value)
Default
-
+
20
1
Label_4
-
+
true
true
false
-
+
LIVETIME
-
+
true
1
true
@@ -727,16 +727,16 @@ $(pv_value)
516
-
+
false
false
false
-
+
true
-
+
0
1
@@ -746,7 +746,7 @@ $(pv_value)
false
-
+
0
20
@@ -755,15 +755,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):ENERGYSPEC:CNTS
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -779,13 +779,13 @@ $(pv_value)
392
-
+
false
-
+
-
+
0
1
@@ -794,20 +794,20 @@ $(pv_value)
Default
-
+
20
1
Label_5
-
+
true
true
false
-
+
COUNTS
-
+
true
1
true
@@ -819,16 +819,16 @@ $(pv_value)
392
-
+
false
false
false
-
+
true
-
+
0
1
@@ -838,7 +838,7 @@ $(pv_value)
false
-
+
0
20
@@ -847,15 +847,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):ENERGYSPEC:OVERFLOWS
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -871,13 +871,13 @@ $(pv_value)
420
-
+
false
-
+
-
+
0
1
@@ -886,20 +886,20 @@ $(pv_value)
Default
-
+
20
1
Label_7
-
+
true
true
false
-
+
OVERFLOWS
-
+
true
1
true
@@ -911,16 +911,16 @@ $(pv_value)
420
-
+
false
false
false
-
+
true
-
+
0
1
@@ -930,7 +930,7 @@ $(pv_value)
false
-
+
0
20
@@ -939,15 +939,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):ENERGYSPEC:UNDERFLOWS
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -963,13 +963,13 @@ $(pv_value)
445
-
+
false
-
+
-
+
0
1
@@ -978,20 +978,20 @@ $(pv_value)
Default
-
+
20
1
Label_8
-
+
true
true
false
-
+
UNDERFLOWS
-
+
true
1
true
@@ -1003,16 +1003,16 @@ $(pv_value)
445
-
+
false
false
false
-
+
true
-
+
0
1
@@ -1022,7 +1022,7 @@ $(pv_value)
false
-
+
4
20
@@ -1031,15 +1031,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):ENERGYSPEC:FILE
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -1055,13 +1055,13 @@ $(pv_value)
450
-
+
false
-
+
-
+
0
1
@@ -1070,20 +1070,20 @@ $(pv_value)
Default
-
+
20
1
Label_9
-
+
true
true
false
-
+
FILE
-
+
true
1
true
@@ -1100,18 +1100,18 @@ $(pv_value)
$(pv_name)
1
10
-
-
+
+
false
false
-
+
false
-
+
0
1
@@ -1121,21 +1121,21 @@ $(pv_value)
false
-
+
40
-
+
Action Button
0
$(P)$(Q):$(CHAN):ENERGYSPEC:CLEAR:SP
-
-
+
+
true
true
false
-
+
Clear Spectrum
false
@@ -1149,10 +1149,10 @@ $(pv_value)
516
-
+
false
-
+
0
1
@@ -1162,25 +1162,25 @@ $(pv_value)
false
-
+
1
-
+
Dummy
0
-
-
-
+
+
+
true
true
false
-
+
-
+
false
-
+
true
Action Button
1
@@ -1189,13 +1189,13 @@ $(pv_value)
36
-
+
false
-
+
-
+
0
1
@@ -1204,21 +1204,21 @@ $(pv_value)
Default
-
+
42
1
Label_10
-
+
true
true
false
-
- Energy Bin Scaling
+
+ Energy Bin Scaling
Energy = A * bin_number + B
-
+
true
1
true
@@ -1230,13 +1230,13 @@ Energy = A * bin_number + B
475
-
+
false
-
+
-
+
0
1
@@ -1245,20 +1245,20 @@ Energy = A * bin_number + B
Default
-
+
20
1
Label_11
-
+
true
true
false
-
+
A
-
+
true
1
true
@@ -1270,13 +1270,13 @@ Energy = A * bin_number + B
528
-
+
false
-
+
-
+
0
1
@@ -1285,20 +1285,20 @@ Energy = A * bin_number + B
Default
-
+
20
1
Label_12
-
+
true
true
false
-
+
B
-
+
true
1
true
@@ -1310,27 +1310,27 @@ Energy = A * bin_number + B
526
-
+
false
false
false
-
+
true
-
+
3
1
-
+
true
Default
false
-
+
0
20
@@ -1343,15 +1343,15 @@ Energy = A * bin_number + B
0
true
$(P)$(Q):$(CHAN):ENERGYSPEC:SCALE:B
-
+
0.0
-
+
true
true
false
-
+
0
true
@@ -1367,27 +1367,27 @@ $(pv_value)
526
-
+
false
false
false
-
+
true
-
+
3
1
-
+
true
Default
false
-
+
0
20
@@ -1400,15 +1400,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):ENERGYSPEC:SCALE:A
-
+
0.0
-
+
true
true
false
-
+
0
true
@@ -1423,4 +1423,44 @@ $(pv_value)
318
526
-
\ No newline at end of file
+
+
+ false
+
+
+
+ 0
+ 1
+ true
+
+ ISIS_Button_NEW
+
+ false
+
+
+
+ 1
+
+ Dummy
+ 0
+
+
+
+
+ true
+ true
+ false
+
+
+
+
+ false
+
+ true
+ Action Button
+ 1
+ -648922a4:1624e4fa0bd:-7f69
+ 102
+ 36
+
+
diff --git a/base/uk.ac.stfc.isis.ibex.opis/resources/CAENHexagon/CAEN_hexagon_event_energyspec.opi b/base/uk.ac.stfc.isis.ibex.opis/resources/CAENHexagon/CAEN_hexagon_event_energyspec.opi
index 10a23f296a..bf0fd44210 100644
--- a/base/uk.ac.stfc.isis.ibex.opis/resources/CAENHexagon/CAEN_hexagon_event_energyspec.opi
+++ b/base/uk.ac.stfc.isis.ibex.opis/resources/CAENHexagon/CAEN_hexagon_event_energyspec.opi
@@ -1,6 +1,6 @@
-
+
-
+
false
-1
@@ -8,20 +8,20 @@
false
-
+
5.1.0
-
+
6
600
true
-
-
-
+
+
+
true
true
true
@@ -33,17 +33,17 @@
-1
-1
-
+
false
true
0.0
-
+
Energy
true
-
+
false
100.0
@@ -51,7 +51,7 @@
Default
-
+
true
0
@@ -61,12 +61,12 @@
true
0.0
-
+
Counts
true
-
+
false
100.0
@@ -74,7 +74,7 @@
Default
-
+
true
0
@@ -84,33 +84,33 @@
2
false
-
+
true
-
+
0
1
true
false
-
+
367
XY Graph
-
+
-
-
-
+
+
+
true
true
false
-
+
true
false
true
@@ -129,7 +129,7 @@ $(trace_0_y_pv_value)
4
0
-
+
0
100
@@ -137,14 +137,14 @@ $(trace_0_y_pv_value)
true
0
$(P)$(Q):$(CHAN):ENERGYSPEC:X
-
+
1
$(P)$(Q):$(CHAN):ENERGYSPEC:EVENT
-
+
1
false
-
-
+
+
true
XY Graph
721
@@ -153,16 +153,16 @@ $(trace_0_y_pv_value)
6
-
+
false
false
false
-
+
true
-
+
0
1
@@ -172,7 +172,7 @@ $(trace_0_y_pv_value)
false
-
+
0
20
@@ -181,15 +181,15 @@ $(trace_0_y_pv_value)
0
true
$(P)$(Q):$(CHAN):ENERGYSPEC:EVENT:TMIN
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -205,13 +205,13 @@ $(pv_value)
420
-
+
false
-
+
-
+
0
1
@@ -220,20 +220,20 @@ $(pv_value)
Default
-
+
20
1
Label_1
-
+
true
true
false
-
+
TMIN
-
+
true
1
true
@@ -245,27 +245,27 @@ $(pv_value)
420
-
+
false
false
false
-
+
false
-
+
3
1
-
+
true
Default
false
-
+
0
25
@@ -278,19 +278,19 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):ENERGYSPEC:EVENT:TMIN:SP
-
+
0.0
-
+
true
true
false
-
+
0
true
-
+
$(pv_name)
$(pv_value)
false
@@ -302,16 +302,16 @@ $(pv_value)
417
-
+
false
false
false
-
+
true
-
+
0
1
@@ -321,7 +321,7 @@ $(pv_value)
false
-
+
0
20
@@ -330,15 +330,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):ENERGYSPEC:EVENT:CNTS
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -354,13 +354,13 @@ $(pv_value)
417
-
+
false
-
+
-
+
0
1
@@ -369,20 +369,20 @@ $(pv_value)
Default
-
+
20
1
Label_5
-
+
true
true
false
-
+
COUNTS
-
+
true
1
true
@@ -394,16 +394,16 @@ $(pv_value)
417
-
+
false
false
false
-
+
true
-
+
0
1
@@ -413,7 +413,7 @@ $(pv_value)
false
-
+
0
20
@@ -422,15 +422,15 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):ENERGYSPEC:EVENT:TMAX
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -446,13 +446,13 @@ $(pv_value)
450
-
+
false
-
+
-
+
0
1
@@ -461,20 +461,20 @@ $(pv_value)
Default
-
+
20
1
Label_9
-
+
true
true
false
-
+
TMAX
-
+
true
1
true
@@ -486,27 +486,27 @@ $(pv_value)
450
-
+
false
false
false
-
+
false
-
+
3
1
-
+
true
Default
false
-
+
0
25
@@ -519,19 +519,19 @@ $(pv_value)
0
true
$(P)$(Q):$(CHAN):ENERGYSPEC:EVENT:TMAX:SP
-
+
0.0
-
+
true
true
false
-
+
0
true
-
+
$(pv_name)
$(pv_value)
false
@@ -543,10 +543,10 @@ $(pv_value)
447
-
+
false
-
+
0
1
@@ -556,25 +556,25 @@ $(pv_value)
false
-
+
1
-
+
Dummy
0
-
-
-
+
+
+
true
true
false
-
+
-
+
false
-
+
true
Action Button
1
@@ -583,13 +583,13 @@ $(pv_value)
36
-
+
false
-
+
-
+
0
1
@@ -598,20 +598,20 @@ $(pv_value)
Default
-
+
20
1
Label_10
-
+
true
true
false
-
+
Changes to TMIN/TMAX only apply to new data unless/until Reload Live Data is pressed
-
+
true
1
true
@@ -628,18 +628,18 @@ $(pv_value)
$(pv_name)
1
10
-
-
+
+
false
false
-
+
false
-
+
0
1
@@ -649,21 +649,21 @@ $(pv_value)
false
-
+
40
-
+
Action Button_5
0
$(P)$(Q):$(CHAN):RELOADLIVE:SP
-
-
+
+
true
true
false
-
+
Reload Live Data
false
@@ -677,10 +677,10 @@ $(pv_value)
456
-
+
false
-
+
0
1
@@ -690,25 +690,25 @@ $(pv_value)
false
-
+
1
-
+
Dummy
0
-
-
-
+
+
+
true
true
false
-
+
-
+
false
-
+
true
Action Button
1
@@ -717,13 +717,13 @@ $(pv_value)
36
-
+
false
-
+
-
+
0
1
@@ -732,21 +732,21 @@ $(pv_value)
Default
-
+
74
1
Label
-
+
true
true
false
-
+
false
Uses same A*X+B scaling as on other energy spectrum graph
-
+
true
1
true
@@ -757,4 +757,44 @@ $(pv_value)
636
423
-
\ No newline at end of file
+
+
+ false
+
+
+
+ 0
+ 1
+ true
+
+ ISIS_Button_NEW
+
+ false
+
+
+
+ 1
+
+ Dummy
+ 0
+
+
+
+
+ true
+ true
+ false
+
+
+
+
+ false
+
+ true
+ Action Button
+ 1
+ -648922a4:1624e4fa0bd:-7f69
+ 102
+ 36
+
+
diff --git a/base/uk.ac.stfc.isis.ibex.opis/resources/LITRON_POWER.opi b/base/uk.ac.stfc.isis.ibex.opis/resources/LITRON_POWER.opi
index f00998f58e..9111f9be6a 100644
--- a/base/uk.ac.stfc.isis.ibex.opis/resources/LITRON_POWER.opi
+++ b/base/uk.ac.stfc.isis.ibex.opis/resources/LITRON_POWER.opi
@@ -1,6 +1,6 @@
-
+
-
+
false
-1
@@ -8,20 +8,20 @@
false
-
+
5.1.0
-
+
6
600
true
-
-
-
+
+
+
true
true
true
@@ -33,13 +33,13 @@
-1
-1
-
+
false
-
+
-
+
0
1
@@ -48,21 +48,21 @@
ISIS_Header1_NEW
-
+
37
0
Label
-
+
true
true
false
-
+
false
Litron Power Supply
-
+
false
1
true
@@ -74,13 +74,13 @@
0
-
+
false
-
+
-
+
0
1
@@ -89,21 +89,21 @@
ISIS_Header2_NEW
-
+
37
0
Label_1
-
+
true
true
false
-
+
false
$(NAME)
-
+
false
1
true
@@ -115,12 +115,12 @@
36
-
+
-
+
-
+
13
1
@@ -130,23 +130,23 @@
ISIS_GroupBox_NEW
-
+
439
false
true
-
-
+
+
true
true
false
-
+
true
-
+
false
true
Grouping Container
@@ -155,12 +155,12 @@
0
72
-
+
-
+
-
+
0
1
@@ -169,9 +169,9 @@
Default
-
+
-
+
246
true
@@ -181,14 +181,14 @@
Linking Container
Motor/mymotor.opi
2
-
+
true
true
false
-
-
+
+
true
Linking Container
447
@@ -197,12 +197,12 @@
1
-
+
-
+
-
+
13
1
@@ -212,23 +212,23 @@
Default
-
+
60
false
true
-
-
+
+
true
true
false
-
+
false
-
+
false
true
Grouping Container
@@ -237,16 +237,16 @@
0
246
-
+
false
false
false
-
+
true
-
+
0
1
@@ -256,7 +256,7 @@
false
-
+
0
20
@@ -265,15 +265,15 @@
0
true
$(P)$(MOTOR).RRBV
-
+
0.0
-
+
true
true
false
-
+
false
######
$(pv_name)
@@ -289,13 +289,13 @@ $(pv_value)
3
-
+
false
-
+
-
+
0
1
@@ -304,20 +304,20 @@ $(pv_value)
ISIS_Label_NEW
-
+
20
1
Label
-
+
true
true
false
-
+
Raw Steps:
-
+
true
1
true
@@ -329,27 +329,27 @@ $(pv_value)
3
-
+
false
false
false
-
+
false
-
+
3
1
-
+
true
Default
false
-
+
0
25
@@ -362,19 +362,19 @@ $(pv_value)
0
true
$(P)$(MOTOR).RVAL
-
+
0.0
-
+
true
true
false
-
+
0
false
-
+
$(pv_name)
$(pv_value)
false
@@ -388,15 +388,15 @@ $(pv_value)
-
+
false
false
-
+
false
-
+
0
1
@@ -406,25 +406,25 @@ $(pv_value)
false
-
+
1
Picture1.jpg
Dummy
0
-
-
-
+
+
+
true
true
false
-
+
-
+
false
-
+
true
Action Button
1
@@ -433,10 +433,10 @@ $(pv_value)
36
-
+
false
-
+
0
1
@@ -446,25 +446,25 @@ $(pv_value)
false
-
+
1
-
+
Dummy_1
0
-
-
-
+
+
+
true
true
false
-
+
-
+
false
-
+
true
Action Button
1
@@ -472,4 +472,44 @@ $(pv_value)
432
36
-
\ No newline at end of file
+
+
+ false
+
+
+
+ 0
+ 1
+ true
+
+ ISIS_Button_NEW
+
+ false
+
+
+
+ 1
+
+ Dummy
+ 0
+
+
+
+
+ true
+ true
+ false
+
+
+
+
+ false
+
+ true
+ Action Button
+ 1
+ -648922a4:1624e4fa0bd:-7f69
+ 0
+ 0
+
+
diff --git a/base/uk.ac.stfc.isis.ibex.opis/resources/ldens3300.opi b/base/uk.ac.stfc.isis.ibex.opis/resources/ldens3300.opi
index 95ec7f9bba..1b87f7cc49 100644
--- a/base/uk.ac.stfc.isis.ibex.opis/resources/ldens3300.opi
+++ b/base/uk.ac.stfc.isis.ibex.opis/resources/ldens3300.opi
@@ -1,6 +1,6 @@
-
+
-
+
false
-1
@@ -8,11 +8,11 @@
false
-
+
5.1.0
-
+
6
600
@@ -20,9 +20,9 @@
true
$(P)$(LDEN3300):
-
-
-
+
+
+
true
true
true
@@ -34,13 +34,13 @@
-1
-1
-
+
false
-
+
-
+
0
1
@@ -49,21 +49,21 @@
ISIS_Header1_NEW
-
+
37
0
Label
-
+
true
true
false
-
+
false
Anton Paar L-Dens 3300
-
+
false
1
true
@@ -75,13 +75,13 @@
6
-
+
false
-
+
-
+
0
1
@@ -90,21 +90,21 @@
ISIS_Header2_NEW
-
+
37
0
Label_1
-
+
true
true
false
-
+
false
$(NAME)
-
+
false
1
true
@@ -116,12 +116,12 @@
42
-
+
-
+
-
+
13
1
@@ -131,23 +131,23 @@
ISIS_GroupBox_NEW
-
+
97
false
true
-
-
+
+
true
true
false
-
+
true
-
+
false
true
Grouping Container
@@ -156,13 +156,13 @@
6
84
-
+
false
-
+
-
+
0
1
@@ -171,21 +171,21 @@
ISIS_Label_NEW
-
+
20
2
Label
-
+
true
true
false
-
+
false
Temperature
-
+
false
1
true
@@ -197,16 +197,16 @@
6
-
+
false
false
false
-
+
true
-
+
0
1
@@ -216,7 +216,7 @@
false
-
+
0
20
@@ -225,15 +225,15 @@
0
true
$(PV_ROOT)TEMP
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -249,13 +249,13 @@ $(pv_value)
6
-
+
false
-
+
-
+
0
1
@@ -264,21 +264,21 @@ $(pv_value)
ISIS_Label_NEW
-
+
31
2
Label_3
-
+
true
true
false
-
+
false
Density
-
+
false
1
true
@@ -290,16 +290,16 @@ $(pv_value)
36
-
+
false
false
false
-
+
true
-
+
0
1
@@ -309,7 +309,7 @@ $(pv_value)
false
-
+
0
20
@@ -318,15 +318,15 @@ $(pv_value)
0
true
$(PV_ROOT)DENSITY
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -342,4 +342,44 @@ $(pv_value)
42
-
\ No newline at end of file
+
+
+ false
+
+
+
+ 0
+ 1
+ true
+
+ ISIS_Button_NEW
+
+ false
+
+
+
+ 1
+
+ Dummy
+ 0
+
+
+
+
+ true
+ true
+ false
+
+
+
+
+ false
+
+ true
+ Action Button
+ 1
+ -648922a4:1624e4fa0bd:-7f69
+ 6
+ 42
+
+
diff --git a/base/uk.ac.stfc.isis.ibex.opis/resources/litronlasertimer.opi b/base/uk.ac.stfc.isis.ibex.opis/resources/litronlasertimer.opi
index 676de0f619..fd5b42ec62 100644
--- a/base/uk.ac.stfc.isis.ibex.opis/resources/litronlasertimer.opi
+++ b/base/uk.ac.stfc.isis.ibex.opis/resources/litronlasertimer.opi
@@ -1,6 +1,6 @@
-
+
-
+
false
-1
@@ -8,11 +8,11 @@
false
-
+
5.1.0
-
+
6
600
@@ -23,9 +23,9 @@
$(P)AS:$(IOC):
$(P)CS:IOC:$(IOC):
-
-
-
+
+
+
true
true
true
@@ -37,13 +37,13 @@
-1
-1
-
+
false
-
+
-
+
0
1
@@ -52,21 +52,21 @@
ISIS_Header1_NEW
-
+
37
0
Label
-
+
true
true
false
-
+
false
Litron Laser Timing Control
-
+
false
1
true
@@ -78,13 +78,13 @@
12
-
+
false
-
+
-
+
0
1
@@ -93,21 +93,21 @@
ISIS_Header2_NEW
-
+
37
0
Label_1
-
+
true
true
false
-
+
false
$(NAME)
-
+
false
1
true
@@ -119,12 +119,12 @@
48
-
+
-
+
-
+
13
1
@@ -134,23 +134,23 @@
ISIS_GroupBox_NEW
-
+
133
false
true
-
-
+
+
true
true
false
-
+
true
-
+
false
true
Grouping Container
@@ -159,13 +159,13 @@
12
90
-
+
false
-
+
-
+
0
1
@@ -174,21 +174,21 @@
ISIS_Label_NEW
-
+
20
2
Label
-
+
true
true
false
-
+
false
Delay
-
+
false
1
true
@@ -200,13 +200,13 @@
6
-
+
false
-
+
-
+
0
1
@@ -215,21 +215,21 @@
ISIS_Label_NEW
-
+
31
2
Label_3
-
+
true
true
false
-
+
false
Offset
-
+
false
1
true
@@ -241,27 +241,27 @@
36
-
+
false
false
false
-
+
false
-
+
3
1
-
+
true
Default
false
-
+
0
25
@@ -274,19 +274,19 @@
0
true
$(PV_ROOT)DELAY
-
+
0.0
-
+
true
true
false
-
+
0
true
-
+
$(pv_name)
$(pv_value)
false
@@ -298,27 +298,27 @@ $(pv_value)
3
-
+
false
false
false
-
+
false
-
+
3
1
-
+
true
Default
false
-
+
0
25
@@ -331,19 +331,19 @@ $(pv_value)
0
true
$(PV_ROOT)OFFSET
-
+
0.0
-
+
true
true
false
-
+
0
true
-
+
$(pv_name)
$(pv_value)
false
@@ -360,18 +360,18 @@ $(pv_value)
$(PV_ROOT)SET.PROC
1
10
-
-
+
+
false
false
-
+
false
-
+
0
1
@@ -381,21 +381,21 @@ $(pv_value)
false
-
+
25
-
+
Set
0
-
-
-
+
+
+
true
true
false
-
+
Set
false
@@ -409,22 +409,22 @@ $(pv_value)
72
-
+
false
false
-
+
-1
true
-
+
0
1
3
-
+
0
true
@@ -434,27 +434,27 @@ $(pv_value)
false
-
+
20
LED
-
+
OFF
-
+
ON
$(PV_ROOT)ERROR
-
-
+
+
true
true
true
-
+
false
false
$(pv_name)
@@ -467,13 +467,13 @@ $(pv_value)
42
-
+
false
-
+
-
+
0
1
@@ -482,21 +482,21 @@ $(pv_value)
ISIS_Label_NEW
-
+
31
2
Label_5
-
+
true
true
false
-
+
false
Error
-
+
false
1
true
@@ -508,15 +508,15 @@ $(pv_value)
36
-
+
false
false
-
+
false
-
+
0
1
@@ -526,20 +526,20 @@ $(pv_value)
false
-
+
23
true
Combo
$(PV_ROOT)MODE
-
-
+
+
true
false
false
-
+
$(pv_name)
$(pv_value)
true
@@ -550,13 +550,13 @@ $(pv_value)
4
-
+
false
-
+
-
+
0
1
@@ -565,21 +565,21 @@ $(pv_value)
ISIS_Label_NEW
-
+
20
0
Label
-
+
true
true
false
-
+
false
Mode
-
+
false
1
true
@@ -591,16 +591,16 @@ $(pv_value)
6
-
+
false
false
false
-
+
true
-
+
0
1
@@ -610,7 +610,7 @@ $(pv_value)
false
-
+
0
20
@@ -618,8 +618,8 @@ $(pv_value)
Text Update
0
true
-
-
+
+
0.0
@@ -637,7 +637,7 @@ $(pv_value)
true
false
-
+
true
######
$(pv_name)
@@ -654,10 +654,10 @@ $(pv_value)
-
+
false
-
+
0
1
@@ -667,25 +667,25 @@ $(pv_value)
false
-
+
1
-
+
Dummy
0
-
-
-
+
+
+
true
true
false
-
+
-
+
false
-
+
true
Action Button
1
@@ -694,12 +694,12 @@ $(pv_value)
126
-
+
-
+
-
+
13
1
@@ -709,23 +709,23 @@ $(pv_value)
ISIS_GroupBox_NEW
-
+
133
false
true
-
-
+
+
true
true
false
-
+
true
-
+
false
true
Grouping Container
@@ -734,13 +734,13 @@ $(pv_value)
12
228
-
+
false
-
+
-
+
0
1
@@ -749,21 +749,21 @@ $(pv_value)
ISIS_Label_NEW
-
+
20
2
Label
-
+
true
true
false
-
+
false
dA_0 RB
-
+
false
1
true
@@ -775,16 +775,16 @@ $(pv_value)
6
-
+
false
false
false
-
+
true
-
+
0
1
@@ -794,7 +794,7 @@ $(pv_value)
false
-
+
0
20
@@ -803,15 +803,15 @@ $(pv_value)
0
true
$(PV_ROOT)ADLAYSCAL
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -827,13 +827,13 @@ $(pv_value)
6
-
+
false
-
+
-
+
0
1
@@ -842,21 +842,21 @@ $(pv_value)
ISIS_Label_NEW
-
+
31
2
Label_3
-
+
true
true
false
-
+
false
dC_0 RB
-
+
false
1
true
@@ -868,16 +868,16 @@ $(pv_value)
36
-
+
false
false
false
-
+
true
-
+
0
1
@@ -887,7 +887,7 @@ $(pv_value)
false
-
+
0
20
@@ -896,15 +896,15 @@ $(pv_value)
0
true
$(PV_ROOT)CDLAYSCAL
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -920,13 +920,13 @@ $(pv_value)
42
-
+
false
-
+
-
+
0
1
@@ -935,21 +935,21 @@ $(pv_value)
ISIS_Label_NEW
-
+
31
2
Label_3
-
+
true
true
false
-
+
false
Summed Delay
-
+
false
1
true
@@ -961,16 +961,16 @@ $(pv_value)
72
-
+
false
false
false
-
+
true
-
+
0
1
@@ -980,7 +980,7 @@ $(pv_value)
false
-
+
0
20
@@ -989,15 +989,15 @@ $(pv_value)
0
true
$(PV_ROOT)SUMMED_DELAY
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -1014,13 +1014,13 @@ $(pv_value)
-
+
true
-
+
-
+
0
1
@@ -1029,7 +1029,7 @@ $(pv_value)
Header2
-
+
22
1
@@ -1047,9 +1047,9 @@ $(pv_value)
true
false
-
+
AUTO MODE IS UNTESTED
-
+
true
1
true
@@ -1061,13 +1061,13 @@ $(pv_value)
96
-
+
true
-
+
-
+
0
1
@@ -1076,7 +1076,7 @@ $(pv_value)
Default
-
+
15
1
@@ -1094,9 +1094,9 @@ $(pv_value)
true
false
-
+
Contact Experiment Controls if you would like to use this
-
+
true
1
true
@@ -1107,4 +1107,44 @@ $(pv_value)
432
119
-
\ No newline at end of file
+
+
+ false
+
+
+
+ 0
+ 1
+ true
+
+ ISIS_Button_NEW
+
+ false
+
+
+
+ 1
+
+ Dummy
+ 0
+
+
+
+
+ true
+ true
+ false
+
+
+
+
+ false
+
+ true
+ Action Button
+ 1
+ -648922a4:1624e4fa0bd:-7f69
+ 12
+ 119
+
+
diff --git a/base/uk.ac.stfc.isis.ibex.opis/resources/zero_field_controller_hifi/magnetometer_row.opi b/base/uk.ac.stfc.isis.ibex.opis/resources/zero_field_controller_hifi/magnetometer_row.opi
index 8118405109..5a2348d950 100644
--- a/base/uk.ac.stfc.isis.ibex.opis/resources/zero_field_controller_hifi/magnetometer_row.opi
+++ b/base/uk.ac.stfc.isis.ibex.opis/resources/zero_field_controller_hifi/magnetometer_row.opi
@@ -1,6 +1,6 @@
-
+
-
+
false
-1
@@ -8,20 +8,20 @@
false
-
+
5.1.0
-
+
6
600
true
-
-
-
+
+
+
true
true
true
@@ -33,13 +33,13 @@
-1
-1
-
+
false
-
+
-
+
0
1
@@ -48,21 +48,21 @@
ISIS_Label_NEW
-
+
20
2
Label_9
-
+
true
true
false
-
+
false
$(AXIS):
-
+
false
1
true
@@ -74,16 +74,16 @@
0
-
+
false
false
false
-
+
true
-
+
0
1
@@ -93,7 +93,7 @@
false
-
+
0
20
@@ -102,15 +102,15 @@
0
true
$(PV_ROOT)MAGNETOMETER:$(AXIS):RAW
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -126,16 +126,16 @@ $(pv_value)
0
-
+
false
false
false
-
+
true
-
+
0
1
@@ -145,7 +145,7 @@ $(pv_value)
false
-
+
0
20
@@ -154,15 +154,15 @@ $(pv_value)
0
true
$(PV_ROOT)MAGNETOMETER:$(AXIS):CORR_INH
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -178,16 +178,16 @@ $(pv_value)
0
-
+
false
false
false
-
+
true
-
+
0
1
@@ -197,7 +197,7 @@ $(pv_value)
false
-
+
0
20
@@ -206,15 +206,15 @@ $(pv_value)
0
true
$(PV_ROOT)MAGNETOMETER:$(AXIS):CORR_PERSIST
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -230,16 +230,16 @@ $(pv_value)
0
-
+
false
false
false
-
+
true
-
+
0
1
@@ -249,7 +249,7 @@ $(pv_value)
false
-
+
0
20
@@ -258,15 +258,15 @@ $(pv_value)
0
true
$(PV_ROOT)MAGNETOMETER:$(AXIS):CORR_OFFSET
-
+
0.0
-
+
true
true
false
-
+
true
######
$(pv_name)
@@ -281,4 +281,44 @@ $(pv_value)
312
0
-
\ No newline at end of file
+
+
+ false
+
+
+
+ 0
+ 1
+ true
+
+ ISIS_Button_NEW
+
+ false
+
+
+
+ 1
+
+ Dummy
+ 0
+
+
+
+
+ true
+ true
+ false
+
+
+
+
+ false
+
+ true
+ Action Button
+ 1
+ -648922a4:1624e4fa0bd:-7f69
+ 0
+ 0
+
+
diff --git a/base/uk.ac.stfc.isis.ibex.scriptgenerator/python_support/requirements.txt b/base/uk.ac.stfc.isis.ibex.scriptgenerator/python_support/requirements.txt
new file mode 100644
index 0000000000..ef10313a81
--- /dev/null
+++ b/base/uk.ac.stfc.isis.ibex.scriptgenerator/python_support/requirements.txt
@@ -0,0 +1,5 @@
+genie_python
+gitpython
+jinja2
+py4j
+pyhamcrest
diff --git a/base/uk.ac.stfc.isis.ibex.scriptgenerator/python_support/test_generator.py b/base/uk.ac.stfc.isis.ibex.scriptgenerator/python_support/test_generator.py
index 1f6c721a31..3306ae3766 100644
--- a/base/uk.ac.stfc.isis.ibex.scriptgenerator/python_support/test_generator.py
+++ b/base/uk.ac.stfc.isis.ibex.scriptgenerator/python_support/test_generator.py
@@ -1,73 +1,94 @@
import unittest
-from mock import MagicMock
-from script_definition_loader import Generator, ScriptDefinitionWrapper
-from typing import Dict, AnyStr, List
+from typing import AnyStr, Dict, List
+from unittest.mock import MagicMock
+
from hamcrest.core import assert_that, equal_to
-from hamcrest.library.text import matches_regexp
+from script_definition_loader import Generator, ScriptDefinitionWrapper
from test_script_definitions.valid_script_definition import DoRun as ValidDoRun
-from pprint import pprint
-import pathlib
class TestGenerator(unittest.TestCase):
-
- def _get_estimates_for_single_action(self, scriptDefinition):
- wrapper = ScriptDefinitionWrapper("test", scriptDefinition)
- estimates: Dict[int, int] = self.generator.estimateTime([
- {"param1": "param1Val", "param2": "param2Val"}
- ], wrapper, {})
+ def _get_estimates_for_single_action(self, script_definition):
+ wrapper = ScriptDefinitionWrapper("test", script_definition)
+ estimates: Dict[int, int] = self.generator.estimateTime(
+ [{"param1": "param1Val", "param2": "param2Val"}], wrapper, {}
+ )
return estimates
def setUp(self):
self.generator: Generator = Generator(repo_path="test_script_definitions")
def test_GIVEN_script_definitions_return_invalid_WHEN_get_generator_invalidity_reasons_THEN_context_as_expected(
- self):
+ self,
+ ):
# Arrange
mock_script_definition: ScriptDefinitionWrapper = MagicMock()
mock_script_definition.parametersValid.return_value = "invalid reason"
- validityCheck: List[Dict[int, AnyStr]] = self.generator.getValidityErrors({}, [
- {"param1": "param1Val", "param2": "param2Val"},
- {"param1": "param1Val", "param2": "param2Val"}
- ], mock_script_definition)
+ validity_check: List[Dict[int, AnyStr]] = self.generator.getValidityErrors(
+ {},
+ [
+ {"param1": "param1Val", "param2": "param2Val"},
+ {"param1": "param1Val", "param2": "param2Val"},
+ ],
+ mock_script_definition,
+ )
# Act and Assert
- assert_that(validityCheck, equal_to([{}, {0: "invalid reason", 1: "invalid reason"}]),
- "2 actions, both invalid with reason")
+ assert_that(
+ validity_check,
+ equal_to([{}, {0: "invalid reason", 1: "invalid reason"}]),
+ "2 actions, both invalid with reason",
+ )
def test_GIVEN_script_definitions_return_invalid_WHEN_get_generator_invalidity_reasons_with_global_THEN_context_as_expected(
- self):
+ self,
+ ):
# Arrange
mock_script_definition: ScriptDefinitionWrapper = MagicMock()
mock_script_definition.parametersValid.return_value = "invalid reason"
mock_script_definition.globalParamsValid.return_value = "invalid reason"
- validityCheck: List[Dict[int, AnyStr]] = self.generator.getValidityErrors({"global1": "global1Val"}, [
- {"param1": "param1Val", "param2": "param2Val"},
- {"param1": "param1Val", "param2": "param2Val"}
- ], mock_script_definition)
+ validity_check: List[Dict[int, AnyStr]] = self.generator.getValidityErrors(
+ {"global1": "global1Val"},
+ [
+ {"param1": "param1Val", "param2": "param2Val"},
+ {"param1": "param1Val", "param2": "param2Val"},
+ ],
+ mock_script_definition,
+ )
# Act and Assert
- assert_that(validityCheck, equal_to([{0: 'invalid reason'}, {0: "invalid reason", 1: "invalid reason"}]),
- "1 global, 2 actions, all invalid with reason")
-
- def test_GIVEN_script_definition_return_valid_WHEN_get_generator_invalidity_reasons_THEN_no_content(self):
+ assert_that(
+ validity_check,
+ equal_to([{0: "invalid reason"}, {0: "invalid reason", 1: "invalid reason"}]),
+ "1 global, 2 actions, all invalid with reason",
+ )
+
+ def test_GIVEN_script_definition_return_valid_WHEN_get_generator_invalidity_reasons_THEN_no_content(
+ self,
+ ):
# Arrange
mock_script_definition: ScriptDefinitionWrapper = MagicMock()
mock_script_definition.parametersValid.return_value = None
- validityCheck: List[Dict[int, AnyStr]] = self.generator.getValidityErrors({}, [
- {"param1": "param1Val", "param2": "param2Val"},
- {"param1": "param1Val", "param2": "param2Val"}
- ], mock_script_definition)
+ validity_check: List[Dict[int, AnyStr]] = self.generator.getValidityErrors(
+ {},
+ [
+ {"param1": "param1Val", "param2": "param2Val"},
+ {"param1": "param1Val", "param2": "param2Val"},
+ ],
+ mock_script_definition,
+ )
# Act and Assert
- assert_that(validityCheck, equal_to([{}, {}]), "2 actions, both valid")
+ assert_that(validity_check, equal_to([{}, {}]), "2 actions, both valid")
- def test_GIVEN_script_definition_return_valid_WHEN_get_generator_global_invalidity_reasons_THEN_no_content(self):
+ def test_GIVEN_script_definition_return_valid_WHEN_get_generator_global_invalidity_reasons_THEN_no_content(
+ self,
+ ):
# Arrange
mock_script_definition: ScriptDefinitionWrapper = MagicMock()
mock_script_definition.globalParamsValid.return_value = None
- validityCheck: List[Dict[int, AnyStr]] = self.generator.getValidityErrors(
- {"param1": "param1Val", "param2": "param2Val"}, [],
- mock_script_definition)
+ validity_check: List[Dict[int, AnyStr]] = self.generator.getValidityErrors(
+ {"param1": "param1Val", "param2": "param2Val"}, [], mock_script_definition
+ )
# Act and Assert
- assert_that(validityCheck, equal_to([{}, {}]), "2 globals, both valid")
+ assert_that(validity_check, equal_to([{}, {}]), "2 globals, both valid")
# Allows us to return whether invalid or not based on passed vals
def params_valid_side_effect(self, params, global_params) -> AnyStr:
@@ -77,19 +98,22 @@ def params_valid_side_effect(self, params, global_params) -> AnyStr:
return "invalid"
def test_GIVEN_script_definition_return_valid_and_invalid_WHEN_get_generator_invalidity_reasons_THEN_content_as_expected(
- self):
+ self,
+ ):
# Arrange
mock_script_definition: ScriptDefinitionWrapper = MagicMock()
mock_script_definition.parametersValid.side_effect = self.params_valid_side_effect
- validityCheck: List[Dict[int, AnyStr]] = self.generator.getValidityErrors({}, [
- {"param1": "param1Val"}, {"param2": "param2Val"}
- ], mock_script_definition)
+ validity_check: List[Dict[int, AnyStr]] = self.generator.getValidityErrors(
+ {}, [{"param1": "param1Val"}, {"param2": "param2Val"}], mock_script_definition
+ )
# Act and Assert
- assert_that(validityCheck, equal_to([{}, {1: "invalid"}]), "2 actions, one invalid with reason")
+ assert_that(
+ validity_check, equal_to([{}, {1: "invalid"}]), "2 actions, one invalid with reason"
+ )
def test_GIVEN_valid_parameters_and_int_estimate_WHEN_estimate_time_THEN_return_estimate(self):
# Arrange
- mock_script_definition: ScriptDefinition = MagicMock()
+ mock_script_definition = MagicMock()
mock_script_definition.parameters_valid.return_value = None
mock_script_definition.estimate_time.return_value = 2
estimates = self._get_estimates_for_single_action(mock_script_definition)
@@ -97,9 +121,11 @@ def test_GIVEN_valid_parameters_and_int_estimate_WHEN_estimate_time_THEN_return_
# Act and Assert
assert_that(estimates, equal_to({0: 2}))
- def test_GIVEN_valid_parameters_and_float_estimate_WHEN_estimate_time_THEN_round_estimate_and_return_it(self):
+ def test_GIVEN_valid_parameters_and_float_estimate_WHEN_estimate_time_THEN_round_estimate_and_return_it(
+ self,
+ ):
# Arrange
- mock_script_definition: ScriptDefinition = MagicMock()
+ mock_script_definition = MagicMock()
mock_script_definition.parameters_valid.return_value = None
mock_script_definition.estimate_time.return_value = 2.0
estimates = self._get_estimates_for_single_action(mock_script_definition)
@@ -107,9 +133,11 @@ def test_GIVEN_valid_parameters_and_float_estimate_WHEN_estimate_time_THEN_round
# Act and Assert
assert_that(estimates, equal_to({0: 2}))
- def test_GIVEN_valid_parameters_and_string_estimate_WHEN_estimate_time_THEN_return_empty_dict(self):
+ def test_GIVEN_valid_parameters_and_string_estimate_WHEN_estimate_time_THEN_return_empty_dict(
+ self,
+ ):
# Arrange
- mock_script_definition: ScriptDefinition = MagicMock()
+ mock_script_definition = MagicMock()
mock_script_definition.parameters_valid.return_value = None
mock_script_definition.estimate_time.return_value = "wrong type"
estimates = self._get_estimates_for_single_action(mock_script_definition)
@@ -119,7 +147,7 @@ def test_GIVEN_valid_parameters_and_string_estimate_WHEN_estimate_time_THEN_retu
def test_GIVEN_valid_parameters_and_no_estimate_WHEN_estimate_time_THEN_return_empty_dict(self):
# Arrange
- mock_script_definition: ScriptDefinition = MagicMock()
+ mock_script_definition = MagicMock()
mock_script_definition.parameters_valid.return_value = None
mock_script_definition.estimate_time.return_value = None
estimates = self._get_estimates_for_single_action(mock_script_definition)
@@ -127,9 +155,11 @@ def test_GIVEN_valid_parameters_and_no_estimate_WHEN_estimate_time_THEN_return_e
# Act and Assert
assert_that(estimates, equal_to({}))
- def test_GIVEN_invalid_parameters_and_int_estimate_WHEN_estimate_time_THEN_return_empty_dict(self):
+ def test_GIVEN_invalid_parameters_and_int_estimate_WHEN_estimate_time_THEN_return_empty_dict(
+ self,
+ ):
# Arrange
- mock_script_definition: ScriptDefinition = MagicMock()
+ mock_script_definition = MagicMock()
mock_script_definition.parameters_valid.return_value = "some error"
mock_script_definition.estimate_time.return_value = 2
estimates = self._get_estimates_for_single_action(mock_script_definition)
@@ -139,8 +169,7 @@ def test_GIVEN_invalid_parameters_and_int_estimate_WHEN_estimate_time_THEN_retur
def test_GIVEN_valid_script_definition_WHEN_generate_THEN_new_script_is_as_expected(self):
# Arrange
- expected_script_lines: List[AnyStr] = \
- """# pylint: skip-file
+ expected_script_lines: List[AnyStr] = """# pylint: skip-file
from genie_python import genie as g
@@ -187,27 +216,39 @@ def runscript():
value = b'789c030000000001'""".split("\n")
params = [{"param1": "1", "param2": "2"}, {"param1": "1", "param2": "2"}]
- script_definition: ScriptDefinitionWrapper = ScriptDefinitionWrapper(name="valid_script_definition",
- script_definition=ValidDoRun())
+ script_definition: ScriptDefinitionWrapper = ScriptDefinitionWrapper(
+ name="valid_script_definition", script_definition=ValidDoRun()
+ )
# Act
generated_script: str = self.generator.generate(params, "", {}, script_definition)
# Assert
- self.assertIsNotNone(generated_script, "ScriptDefinitionWrapper is valid, so should not return None")
+ self.assertIsNotNone(
+ generated_script, "ScriptDefinitionWrapper is valid, so should not return None"
+ )
generated_lines = generated_script.split("\n")
- assert_that(len(generated_lines), equal_to(len(expected_script_lines)),
- "Should have the same amount of lines if they match")
+ assert_that(
+ len(generated_lines),
+ equal_to(len(expected_script_lines)),
+ "Should have the same amount of lines if they match",
+ )
for i in range(len(generated_lines)):
- assert_that(generated_lines[i], equal_to(expected_script_lines[i]),
- "Each line of the generated script should match the expected line")
+ assert_that(
+ generated_lines[i],
+ equal_to(expected_script_lines[i]),
+ "Each line of the generated script should match the expected line",
+ )
def test_GIVEN_invalid_script_definition_params_WHEN_generate_THEN_return_none(self):
# Arrange
params = [{"param1": "invalid", "param2": "2"}, {"param1": "1", "param2": "2"}]
- script_definition: ScriptDefinitionWrapper = ScriptDefinitionWrapper(name="valid_script_definition",
- script_definition=ValidDoRun())
+ script_definition: ScriptDefinitionWrapper = ScriptDefinitionWrapper(
+ name="valid_script_definition", script_definition=ValidDoRun()
+ )
# Act
generated_script: str = self.generator.generate(params, "", {}, script_definition)
# Assert
- self.assertIsNone(generated_script, "ScriptDefinitionWrapper is invalid, so should return None")
+ self.assertIsNone(
+ generated_script, "ScriptDefinitionWrapper is invalid, so should return None"
+ )
diff --git a/base/uk.ac.stfc.isis.ibex.scriptgenerator/python_support/test_git_utils.py b/base/uk.ac.stfc.isis.ibex.scriptgenerator/python_support/test_git_utils.py
index 473139ca1a..be06a4c9e1 100644
--- a/base/uk.ac.stfc.isis.ibex.scriptgenerator/python_support/test_git_utils.py
+++ b/base/uk.ac.stfc.isis.ibex.scriptgenerator/python_support/test_git_utils.py
@@ -1,10 +1,8 @@
import unittest
-from mock import patch
-from git_utils import DefinitionsRepository, DEFAULT_REPO_PATH
+from unittest.mock import MagicMock, Mock, patch
-from mock import Mock, MagicMock
from git.exc import GitCommandError
-
+from git_utils import DEFAULT_REPO_PATH, DefinitionsRepository
TEST_REPO_PATH = "path/to/repo"
TEST_BUNDLE_PATH = "path/to/bundle"
@@ -15,15 +13,16 @@ class Branch:
def __init__(self, name):
self.name = name
+
class DefinitionsRepositoryTests(unittest.TestCase):
- def _raise_error_when_attempting_merge(_, abort=None):
+ def _raise_error_when_attempting_merge(self, abort=None):
"""
Raises a git error if attempting a merge. Does nothing if abort is set to True.
"""
if abort is True:
pass
else:
- raise GitCommandError(command='command', status='status')
+ raise GitCommandError(command="command", status="status")
@patch("os.path.exists", return_value=True)
@patch("git_utils.Git", return_value=Mock())
@@ -31,14 +30,18 @@ def _raise_error_when_attempting_merge(_, abort=None):
def setUp(self, mock_repo, mock_git, _):
self.mock_git = mock_git.return_value
self.mock_repo = mock_repo.return_value
- self.definitions_repo = DefinitionsRepository(path=TEST_REPO_PATH, bundle_path=TEST_BUNDLE_PATH, remote_url=TEST_URL)
+ self.definitions_repo = DefinitionsRepository(
+ path=TEST_REPO_PATH, bundle_path=TEST_BUNDLE_PATH, remote_url=TEST_URL
+ )
def tearDown(self):
# Ensure git clone mock is reset between tests
self.mock_git.clone.reset_mock(return_value=True, side_effect=True)
self.mock_repo.remotes["origin"].pull.reset_mock(return_value=True, side_effect=True)
- def test_GIVEN_uninitialised_directory_WHEN_repo_cloned_from_bundle_THEN_git_called_with_correct_arguments(self):
+ def test_GIVEN_uninitialised_directory_WHEN_repo_cloned_from_bundle_THEN_git_called_with_correct_arguments(
+ self,
+ ):
bundle_path = "path/to/bundle"
self.definitions_repo.clone_repo_from_bundle()
@@ -51,20 +54,26 @@ def test_GIVEN_origin_change_requested_THEN_git_commands_to_change_origin_called
self.mock_repo.create_remote.assert_called_with("origin", TEST_URL)
@patch("git_utils.Repo")
- def test_GIVEN_uninitialised_directory_WHEN_repo_cloned_from_bundle_THEN_new_repo_has_correct_remote_URL(self, mock_repo):
+ def test_GIVEN_uninitialised_directory_WHEN_repo_cloned_from_bundle_THEN_new_repo_has_correct_remote_URL(
+ self, mock_repo
+ ):
with patch.object(self.definitions_repo, "_change_origin_url") as mock_origin_change:
self.definitions_repo.clone_repo_from_bundle()
mock_origin_change.assert_called()
@patch("git_utils.Repo")
- def test_GIVEN_repository_with_incorrect_url_WHEN_checking_that_repo_exists_THEN_return_repo_does_not_exist(self, mock_repo):
+ def test_GIVEN_repository_with_incorrect_url_WHEN_checking_that_repo_exists_THEN_return_repo_does_not_exist(
+ self, mock_repo
+ ):
repo_instance = mock_repo.return_value
repo_instance.remotes["origin"].url = "different_remote_address.com"
self.assertFalse(self.definitions_repo._repo_already_exists())
@patch("git_utils.Repo")
- def test_GIVEN_repository_with_correct_url_WHEN_checking_that_repo_exists_THEN_return_repo_does_exist(self, mock_repo):
+ def test_GIVEN_repository_with_correct_url_WHEN_checking_that_repo_exists_THEN_return_repo_does_exist(
+ self, mock_repo
+ ):
repo_instance = mock_repo.return_value
repo_instance.remotes["origin"].url = self.definitions_repo.remote_url
@@ -72,12 +81,18 @@ def test_GIVEN_repository_with_correct_url_WHEN_checking_that_repo_exists_THEN_r
@patch("os.path.isdir", return_value=True)
@patch("os.listdir", return_value=[])
- def test_GIVEN_remote_repository_reachable_WHEN_cloning_the_repository_THEN_clone_from_github_requested(self, mock_list, mock_isdir):
+ def test_GIVEN_remote_repository_reachable_WHEN_cloning_the_repository_THEN_clone_from_github_requested(
+ self, mock_list, mock_isdir
+ ):
self.definitions_repo._attempt_repo_init()
self.mock_git.clone.assert_called_with(TEST_URL, TEST_REPO_PATH)
- def test_GIVEN_remote_repository_unreachable_WHEN_cloning_the_repository_THEN_clone_from_bundle(self):
- self.mock_git.clone = MagicMock(side_effect=GitCommandError(command="command", status="status"))
+ def test_GIVEN_remote_repository_unreachable_WHEN_cloning_the_repository_THEN_clone_from_bundle(
+ self,
+ ):
+ self.mock_git.clone = MagicMock(
+ side_effect=GitCommandError(command="command", status="status")
+ )
with patch.object(self.definitions_repo, "clone_repo_from_bundle") as mock_clone:
self.definitions_repo._attempt_repo_init()
@@ -85,62 +100,84 @@ def test_GIVEN_remote_repository_unreachable_WHEN_cloning_the_repository_THEN_cl
mock_clone.assert_called()
@patch("git_utils.Repo")
- def test_GIVEN_repository_can_be_pulled_WHEN_repo_initialised_THEN_no_error_gets_logged(self, mock_repo):
+ def test_GIVEN_repository_can_be_pulled_WHEN_repo_initialised_THEN_no_error_gets_logged(
+ self, mock_repo
+ ):
with patch.object(self.definitions_repo, "_append_error") as error_handler:
with patch.object(self.definitions_repo, "_repo_already_exists", return_value=True):
self.definitions_repo.initialise_repo()
error_handler.assert_not_called()
@patch("git_utils.Repo", side_effect=GitCommandError(command="Command", status="Status"))
- def test_GIVEN_repository_cannot_be_initialised_WHEN_repo_initialised_THEN_error_gets_logged(self, mock_repo):
+ def test_GIVEN_repository_cannot_be_initialised_WHEN_repo_initialised_THEN_error_gets_logged(
+ self, mock_repo
+ ):
with patch.object(self.definitions_repo, "_append_error") as error_handler:
with patch.object(self.definitions_repo, "_repo_already_exists", return_value=True):
self.definitions_repo.initialise_repo()
error_handler.assert_called()
- def test_GIVEN_origin_fetch_information_available_WHEN_local_and_origin_commits_different_THEN_updates_available_is_true(self):
+ def test_GIVEN_origin_fetch_information_available_WHEN_local_and_origin_commits_different_THEN_updates_available_is_true(
+ self,
+ ):
self.definitions_repo.fetch_info = Mock()
self.definitions_repo.fetch_info.commit = 10
self.mock_repo.head.commit = 11
self.assertTrue(self.definitions_repo.updates_available())
- def test_GIVEN_origin_fetch_information_available_WHEN_local_and_origin_commits_equal_THEN_updates_available_is_false(self):
+ def test_GIVEN_origin_fetch_information_available_WHEN_local_and_origin_commits_equal_THEN_updates_available_is_false(
+ self,
+ ):
self.definitions_repo.fetch_info = Mock()
self.definitions_repo.fetch_info.commit = 10
self.mock_repo.head.commit = 10
self.assertFalse(self.definitions_repo.updates_available())
- def test_GIVEN_origin_fetch_info_not_available_WHEN_updates_available_requested_THEN_false(self):
+ def test_GIVEN_origin_fetch_info_not_available_WHEN_updates_available_requested_THEN_false(
+ self,
+ ):
self.definitions_repo.fetch_info = None
self.assertFalse(self.definitions_repo.updates_available())
- def test_GIVEN_correct_branch_in_fetch_info_WHEN_fetch_from_origin_requested_THEN_branch_info_returned(self):
+ def test_GIVEN_correct_branch_in_fetch_info_WHEN_fetch_from_origin_requested_THEN_branch_info_returned(
+ self,
+ ):
expected_branch = Branch("origin/master")
self.mock_repo.remotes["origin"].fetch.return_value = [expected_branch, Branch("master")]
self.assertIs(self.definitions_repo.fetch_from_origin(), expected_branch)
- def test_GIVEN_correct_branch_in_fetch_info_WHEN_fetch_from_origin_requested_THEN_None_returned(self):
+ def test_GIVEN_correct_branch_in_fetch_info_WHEN_fetch_from_origin_requested_THEN_None_returned(
+ self,
+ ):
self.mock_repo.remotes["origin"].fetch.return_value = []
self.assertIs(self.definitions_repo.fetch_from_origin(), None)
- def test_GIVEN_multiple_branches_with_correct_name_in_fetch_info_WHEN_fetch_from_origin_requested_THEN_first_branch_returned(self):
+ def test_GIVEN_multiple_branches_with_correct_name_in_fetch_info_WHEN_fetch_from_origin_requested_THEN_first_branch_returned(
+ self,
+ ):
branch = Branch("origin/master")
self.mock_repo.remotes["origin"].fetch.return_value = [branch, Branch("origin/master")]
self.assertIs(self.definitions_repo.fetch_from_origin(), branch)
-
+
@patch("os.path.exists", return_value=False)
@patch("git_utils.Git", return_value=Mock())
@patch.object(DefinitionsRepository, "initialise_repo", return_value=MagicMock())
- def test_GIVEN_repo_path_does_not_exist_THEN_path_set_to_to_relative_directory_instead(self, mock_repo, mock_git, _):
- self.definitions_repo = DefinitionsRepository(path=TEST_REPO_PATH, bundle_path=TEST_BUNDLE_PATH, remote_url=TEST_URL)
+ def test_GIVEN_repo_path_does_not_exist_THEN_path_set_to_to_relative_directory_instead(
+ self, mock_repo, mock_git, _
+ ):
+ self.definitions_repo = DefinitionsRepository(
+ path=TEST_REPO_PATH, bundle_path=TEST_BUNDLE_PATH, remote_url=TEST_URL
+ )
self.assertEqual(self.definitions_repo.path, DEFAULT_REPO_PATH)
-
+
@patch("os.path.exists", return_value=True)
@patch("git_utils.Git", return_value=Mock())
@patch.object(DefinitionsRepository, "initialise_repo", return_value=MagicMock())
def test_GIVEN_repo_path_does_exist_THEN_repo_path_is_correct(self, mock_repo, mock_git, _):
- self.definitions_repo = DefinitionsRepository(path=TEST_REPO_PATH, bundle_path=TEST_BUNDLE_PATH, remote_url=TEST_URL)
+ self.definitions_repo = DefinitionsRepository(
+ path=TEST_REPO_PATH, bundle_path=TEST_BUNDLE_PATH, remote_url=TEST_URL
+ )
self.assertEqual(self.definitions_repo.path, TEST_REPO_PATH)