Skip to content

Commit b2022f4

Browse files
committed
Merge remote-tracking branch 'origin/master' into Ticket6240_3He_Fridge_Cryo_Logic
2 parents 4b2fda1 + da2ee2e commit b2022f4

File tree

464 files changed

+59794
-19158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

464 files changed

+59794
-19158
lines changed

.project

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>ibex_gui</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
</buildSpec>
9+
<natures>
10+
</natures>
11+
</projectDescription>

Jenkinsfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pipeline {
1414
// The options directive is for configuration that applies to the whole job.
1515
options {
1616
buildDiscarder(logRotator(numToKeepStr:'10'))
17-
timeout(time: 60, unit: 'MINUTES')
17+
timeout(time: 120, unit: 'MINUTES')
1818
disableConcurrentBuilds()
1919
timestamps()
2020
skipDefaultCheckout(true)
@@ -47,22 +47,22 @@ pipeline {
4747
// env.BRANCH_NAME is only supplied to multi-branch pipeline jobs
4848
if (env.BRANCH_NAME == null) {
4949
env.BRANCH_NAME = ""
50-
}
50+
}
51+
env.GIT_BRANCH = scm.branches[0].name
5152
env.GIT_COMMIT = bat(returnStdout: true, script: '@git rev-parse HEAD').trim()
52-
env.GIT_BRANCH = bat(returnStdout: true, script: '@git rev-parse --abbrev-ref HEAD').trim()
5353
echo "git commit: ${env.GIT_COMMIT}"
54-
echo "git branch: ${env.BRANCH_NAME} ${env.GIT_BRANCH}"
54+
echo "git branch: ${env.BRANCH_NAME} (${env.GIT_BRANCH})"
5555
if (env.BRANCH_NAME.startsWith("Release")) {
5656
env.IS_RELEASE = "YES"
5757
env.IS_DEPLOY = "NO"
5858
env.IS_E4 = "YES"
5959
}
60-
else if (env.GIT_BRANCH == "origin/master_E3_maint") {
60+
else if (env.GIT_BRANCH == "refs/heads/master_E3_maint") {
6161
env.IS_RELEASE = "NO"
6262
env.IS_DEPLOY = "YES"
6363
env.IS_E4 = "NO"
6464
}
65-
else if (env.GIT_BRANCH == "origin/master") {
65+
else if (env.GIT_BRANCH == "refs/heads/master") {
6666
env.IS_RELEASE = "NO"
6767
env.IS_DEPLOY = "YES"
6868
env.IS_E4 = "YES"
@@ -111,6 +111,7 @@ pipeline {
111111

112112
post {
113113
always {
114+
archiveArtifacts artifacts: 'build/*.log', caseSensitive: false
114115
junit '**/surefire-reports/TEST-*.xml,**/test-reports/TEST-*.xml'
115116
}
116117
}

base/uk.ac.stfc.isis.ibex.activemq/.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
<classpathentry kind="src" path="src"/>
44
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"><attributes><attribute name="module" value="true"/></attributes></classpathentry>
55
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
6-
<classpathentry kind="lib" path="lib/activemq-all-5.16.0.jar"/>
6+
<classpathentry kind="lib" path="lib/activemq-all-5.16.2.jar"/>
77
<classpathentry kind="output" path="bin"/>
88
</classpath>

base/uk.ac.stfc.isis.ibex.activemq/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ Require-Bundle: uk.ac.stfc.isis.ibex.logger,
1515
uk.ac.stfc.isis.ibex.instrument;bundle-version="1.0.0",
1616
org.eclipse.ui.workbench
1717
Bundle-ClassPath: .,
18-
lib/activemq-all-5.16.0.jar
18+
lib/activemq-all-5.16.2.jar
1919
Import-Package: org.apache.logging.log4j
2020
Automatic-Module-Name: uk.ac.stfc.isis.ibex.activemq

base/uk.ac.stfc.isis.ibex.banner/src/uk/ac/stfc/isis/ibex/banner/ObservableCustomControl.java

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
package uk.ac.stfc.isis.ibex.banner;
2121

2222
import uk.ac.stfc.isis.ibex.epics.adapters.ModelAdapter;
23-
import uk.ac.stfc.isis.ibex.epics.writing.SameTypeWriter;
23+
import uk.ac.stfc.isis.ibex.epics.writing.OnCanWriteChangeListener;
2424
import uk.ac.stfc.isis.ibex.epics.writing.Writable;
2525
import uk.ac.stfc.isis.ibex.model.SettableUpdatedValue;
2626
import uk.ac.stfc.isis.ibex.model.UpdatedValue;
@@ -32,7 +32,8 @@ public class ObservableCustomControl extends ModelAdapter {
3232

3333
private Long valueToWrite;
3434

35-
private final SameTypeWriter<Long> act = new SameTypeWriter<Long>();
35+
private final Writable<Long> act;
36+
private final OnCanWriteChangeListener canWriteListener = canWrite -> ObservableCustomControl.this.canWrite.setValue(canWrite);
3637

3738
private SettableUpdatedValue<Boolean> canWrite = new SettableUpdatedValue<Boolean>();
3839

@@ -45,13 +46,8 @@ public class ObservableCustomControl extends ModelAdapter {
4546
* The value to write to the PV to perform the action
4647
*/
4748
public ObservableCustomControl(Writable<Long> act, Long valueToWrite) {
48-
this.act.subscribe(act);
49-
act.subscribe(new SameTypeWriter<Long>() {
50-
@Override
51-
public void onCanWriteChanged(boolean canwrite) {
52-
ObservableCustomControl.this.canWrite.setValue(canwrite);
53-
}
54-
});
49+
this.act = act;
50+
act.addOnCanWriteChangeListener(canWriteListener);
5551
this.valueToWrite = valueToWrite;
5652
}
5753

@@ -76,11 +72,10 @@ public UpdatedValue<Boolean> canWrite() {
7672
public void setValueToWrite(Long valueToWrite) {
7773
this.valueToWrite = valueToWrite;
7874
}
79-
80-
/**
81-
* @param writable the writable to set
82-
*/
83-
public void setWritable(Writable<Long> writable) {
84-
act.subscribe(writable);
75+
76+
@Override
77+
protected void finalize() {
78+
act.removeOnCanWriteChangeListener(canWriteListener);
8579
}
80+
8681
}
Lines changed: 93 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
/*
2-
* This file is part of the ISIS IBEX application.
3-
* Copyright (C) 2012-2016 Science & Technology Facilities Council.
4-
* All rights reserved.
5-
*
6-
* This program is distributed in the hope that it will be useful.
7-
* This program and the accompanying materials are made available under the
8-
* terms of the Eclipse Public License v1.0 which accompanies this distribution.
9-
* EXCEPT AS EXPRESSLY SET FORTH IN THE ECLIPSE PUBLIC LICENSE V1.0, THE PROGRAM
10-
* AND ACCOMPANYING MATERIALS ARE PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES
11-
* OR CONDITIONS OF ANY KIND. See the Eclipse Public License v1.0 for more details.
12-
*
13-
* You should have received a copy of the Eclipse Public License v1.0
14-
* along with this program; if not, you can obtain a copy from
15-
* https://www.eclipse.org/org/documents/epl-v10.php or
16-
* http://opensource.org/licenses/eclipse-1.0.php
17-
*/
1+
/*
2+
* This file is part of the ISIS IBEX application.
3+
* Copyright (C) 2012-2016 Science & Technology Facilities Council.
4+
* All rights reserved.
5+
*
6+
* This program is distributed in the hope that it will be useful.
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Eclipse Public License v1.0 which accompanies this distribution.
9+
* EXCEPT AS EXPRESSLY SET FORTH IN THE ECLIPSE PUBLIC LICENSE V1.0, THE PROGRAM
10+
* AND ACCOMPANYING MATERIALS ARE PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES
11+
* OR CONDITIONS OF ANY KIND. See the Eclipse Public License v1.0 for more details.
12+
*
13+
* You should have received a copy of the Eclipse Public License v1.0
14+
* along with this program; if not, you can obtain a copy from
15+
* https://www.eclipse.org/org/documents/epl-v10.php or
16+
* http://opensource.org/licenses/eclipse-1.0.php
17+
*/
1818

1919
/**
2020
*
@@ -28,79 +28,85 @@
2828
import uk.ac.stfc.isis.ibex.instrument.channels.EnumChannel;
2929
import uk.ac.stfc.isis.ibex.instrument.channels.NumberChannel;
3030
import uk.ac.stfc.isis.ibex.instrument.channels.NumberWithPrecisionChannel;
31-
import uk.ac.stfc.isis.ibex.model.UpdatedValue;
3231

3332
/**
3433
* The observables for a generic ISIS end station.
3534
*/
3635
public abstract class EndStationObservables extends Observables {
37-
private final UpdatedValue<String> beam;
38-
private final UpdatedValue<String> pps;
39-
private final UpdatedValue<String> beamCurrent;
40-
private final UpdatedValue<String> uAHToday;
41-
private final UpdatedValue<String> lastBeamOff;
42-
private final UpdatedValue<String> lastBeamOn;
43-
44-
/**
45-
* Constructor to register the observables for an ISIS end station.
46-
*
47-
* @param prefix
48-
* The prefix for that specific station.
49-
*/
50-
protected EndStationObservables(PVAddress prefix) {
51-
52-
beam = adaptEnum(
53-
obsFactory.getSwitchableObservable(new EnumChannel<OnOff>(OnOff.class), prefix.endWith("BEAM:STAT")));
54-
pps = adaptNumber(obsFactory.getSwitchableObservable(new NumberChannel(), prefix.endWith(FREQ)));
55-
beamCurrent = adaptNumber(
56-
obsFactory.getSwitchableObservable(new NumberWithPrecisionChannel(), prefix.endWith(BEAM_CURRENT)));
57-
uAHToday = adaptNumber(
58-
obsFactory.getSwitchableObservable(new NumberWithPrecisionChannel(), prefix.endWith("BEAM:TOTAL")));
59-
lastBeamOff = adapt(obsFactory.getSwitchableObservable(new DateTimeChannel(), prefix.endWith("BEAMOFF:TIME")));
60-
lastBeamOn = adapt(obsFactory.getSwitchableObservable(new DateTimeChannel(), prefix.endWith("BEAMON:TIME")));
61-
}
62-
63-
/**
64-
* @return The updated value for the end station beam status.
65-
*/
66-
public UpdatedValue<String> beam() {
67-
return beam;
68-
}
69-
70-
/**
71-
* @return The updated value for the end station beam frequency.
72-
*/
73-
public UpdatedValue<String> pps() {
74-
return pps;
75-
}
76-
77-
/**
78-
* @return The updated value for the end station beam current.
79-
*/
80-
public UpdatedValue<String> beamCurrent() {
81-
return beamCurrent;
82-
}
83-
84-
/**
85-
* @return The updated value for the total current today at the end station.
86-
*/
87-
public UpdatedValue<String> uAHToday() {
88-
return uAHToday;
89-
}
90-
91-
/**
92-
* @return The updated value for the last time the beam was off for the end
93-
* station.
94-
*/
95-
public UpdatedValue<String> lastBeamOff() {
96-
return lastBeamOff;
97-
}
98-
99-
/**
100-
* @return The updated value for the last time the beam was on for the end
101-
* station.
102-
*/
103-
public UpdatedValue<String> lastBeamOn() {
104-
return lastBeamOn;
105-
}
36+
private final FacilityPV beam;
37+
private final FacilityPV pps;
38+
private final FacilityPV beamCurrent;
39+
private final FacilityPV uAHToday;
40+
private final FacilityPV lastBeamOff;
41+
private final FacilityPV lastBeamOn;
42+
43+
/**
44+
* Constructor to register the observables for an ISIS end station.
45+
*
46+
* @param prefix The prefix for that specific station.
47+
*/
48+
protected EndStationObservables(PVAddress prefix) {
49+
50+
beam = new FacilityPV(prefix.endWith("BEAM:STAT"), adaptEnum(
51+
obsFactory.getSwitchableObservable(new EnumChannel<OnOff>(OnOff.class), prefix.endWith("BEAM:STAT"))));
52+
53+
pps = new FacilityPV(prefix.endWith(FREQ),
54+
adaptNumber(obsFactory.getSwitchableObservable(new NumberChannel(), prefix.endWith(FREQ))));
55+
56+
beamCurrent = new FacilityPV(prefix.endWith(BEAM_CURRENT), adaptNumber(
57+
obsFactory.getSwitchableObservable(new NumberWithPrecisionChannel(), prefix.endWith(BEAM_CURRENT))));
58+
59+
uAHToday = new FacilityPV(prefix.endWith("BEAM:TOTAL"), adaptNumber(
60+
obsFactory.getSwitchableObservable(new NumberWithPrecisionChannel(), prefix.endWith("BEAM:TOTAL"))));
61+
62+
lastBeamOff = new FacilityPV(prefix.endWith("BEAMOFF:TIME"),
63+
adapt(obsFactory.getSwitchableObservable(new DateTimeChannel(), prefix.endWith("BEAMOFF:TIME"))));
64+
65+
lastBeamOn = new FacilityPV(prefix.endWith("BEAMON:TIME"),
66+
adapt(obsFactory.getSwitchableObservable(new DateTimeChannel(), prefix.endWith("BEAMON:TIME"))));
67+
}
68+
69+
/**
70+
* @return The updated value for the end station beam status.
71+
*/
72+
public FacilityPV beam() {
73+
return beam;
74+
}
75+
76+
/**
77+
* @return The updated value for the end station beam frequency.
78+
*/
79+
public FacilityPV pps() {
80+
return pps;
81+
}
82+
83+
/**
84+
* @return The updated value for the end station beam current.
85+
*/
86+
public FacilityPV beamCurrent() {
87+
return beamCurrent;
88+
}
89+
90+
/**
91+
* @return The updated value for the total current today at the end station.
92+
*/
93+
public FacilityPV uAHToday() {
94+
return uAHToday;
95+
}
96+
97+
/**
98+
* @return The updated value for the last time the beam was off for the end
99+
* station.
100+
*/
101+
public FacilityPV lastBeamOff() {
102+
return lastBeamOff;
103+
}
104+
105+
/**
106+
* @return The updated value for the last time the beam was on for the end
107+
* station.
108+
*/
109+
public FacilityPV lastBeamOn() {
110+
return lastBeamOn;
111+
}
106112
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package uk.ac.stfc.isis.ibex.beamstatus;
2+
3+
import uk.ac.stfc.isis.ibex.model.UpdatedValue;
4+
5+
/**
6+
* A class to create facility PV objects.
7+
*
8+
*/
9+
public class FacilityPV {
10+
11+
/**
12+
* The source PV address.
13+
*/
14+
public String pv;
15+
16+
/**
17+
* The object holding the latest PV value.
18+
*/
19+
public UpdatedValue<String> updatedValue;
20+
21+
/**
22+
* Constructor for creating a facility PV.
23+
*
24+
* @param pv Pv address
25+
* @param updatedValue Value of the pv
26+
*/
27+
public FacilityPV(String pv, UpdatedValue<String> updatedValue) {
28+
this.pv = pv;
29+
this.updatedValue = updatedValue;
30+
31+
}
32+
33+
}

0 commit comments

Comments
 (0)