Skip to content

Commit f3d1dc9

Browse files
author
kasemir
committed
Merge branch 'master' of https://github.com/ControlSystemStudio/phoebus into pva_acl
2 parents b7ecd0e + b9aec75 commit f3d1dc9

File tree

25 files changed

+480
-91
lines changed

25 files changed

+480
-91
lines changed

app/display/representation-javafx/.classpath

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<classpathentry combineaccessrules="false" kind="src" path="/core-util"/>
1313
<classpathentry combineaccessrules="false" kind="src" path="/core-types"/>
1414
<classpathentry combineaccessrules="false" kind="src" path="/core-vtype"/>
15+
<classpathentry combineaccessrules="false" kind="src" path="/core-pv"/>
1516
<classpathentry combineaccessrules="false" kind="src" path="/app-rtplot"/>
1617
<classpathentry combineaccessrules="false" kind="src" path="/app-display-model"/>
1718
<classpathentry combineaccessrules="false" kind="src" path="/app-display-representation"/>

app/display/representation-javafx/src/main/java/org/csstudio/display/builder/representation/javafx/widgets/ByteMonitorRepresentation.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,5 +447,14 @@ public void updateChanges()
447447
}
448448
}
449449
}
450+
451+
if (jfx_node != null) {
452+
jfx_node.layout();
453+
}
454+
for (Label label : labels) {
455+
if (label != null) {
456+
label.layout();
457+
}
458+
}
450459
}
451460
}

app/display/representation-javafx/src/main/java/org/csstudio/display/builder/representation/javafx/widgets/JFXBaseRepresentation.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -369,12 +369,14 @@ public void updateOrder()
369369
* @param children list of children nodes under the parent widget
370370
*/
371371
public void setDisabledLook(Boolean enabled, ObservableList<Node> children) {
372-
jfx_node.setCursor(enabled ? Cursor.DEFAULT : Cursors.NO_WRITE);
373-
if (children != null) {
374-
for (Node node : children)
375-
{
376-
Styles.update(node, Styles.NOT_ENABLED, !enabled);
377-
}
372+
if (!toolkit.isEditMode()) {
373+
jfx_node.setCursor(enabled ? Cursor.DEFAULT : Cursors.NO_WRITE);
374+
if (children != null) {
375+
for (Node node : children)
376+
{
377+
Styles.update(node, Styles.NOT_ENABLED, !enabled);
378+
}
379+
}
378380
}
379381
}
380382
}

app/display/representation-javafx/src/main/java/org/csstudio/display/builder/representation/javafx/widgets/LabelRepresentation.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,26 +138,30 @@ public void updateChanges()
138138
{
139139
case NONE:
140140
jfx_node.setPrefSize(width, height);
141+
jfx_node.setMinSize(Control.USE_PREF_SIZE, Control.USE_PREF_SIZE);
141142
jfx_node.setMaxSize(Control.USE_PREF_SIZE, Control.USE_PREF_SIZE);
142143
if (was_ever_transformed)
143144
jfx_node.getTransforms().clear();
144145
break;
145146
case NINETY:
146147
jfx_node.setPrefSize(height, width);
148+
jfx_node.setMinSize(Control.USE_PREF_SIZE, Control.USE_PREF_SIZE);
147149
jfx_node.setMaxSize(Control.USE_PREF_SIZE, Control.USE_PREF_SIZE);
148150
jfx_node.getTransforms().setAll(new Rotate(-rotation.getAngle()),
149151
new Translate(-height, 0));
150152
was_ever_transformed = true;
151153
break;
152154
case ONEEIGHTY:
153155
jfx_node.setPrefSize(width, height);
156+
jfx_node.setMinSize(Control.USE_PREF_SIZE, Control.USE_PREF_SIZE);
154157
jfx_node.setMaxSize(Control.USE_PREF_SIZE, Control.USE_PREF_SIZE);
155158
jfx_node.getTransforms().setAll(new Rotate(-rotation.getAngle()),
156159
new Translate(-width, -height));
157160
was_ever_transformed = true;
158161
break;
159162
case MINUS_NINETY:
160163
jfx_node.setPrefSize(height, width);
164+
jfx_node.setMinSize(Control.USE_PREF_SIZE, Control.USE_PREF_SIZE);
161165
jfx_node.setMaxSize(Control.USE_PREF_SIZE, Control.USE_PREF_SIZE);
162166
jfx_node.getTransforms().setAll(new Rotate(-rotation.getAngle()),
163167
new Translate(0, -width));

app/display/representation-javafx/src/main/java/org/csstudio/display/builder/representation/javafx/widgets/TextEntryRepresentation.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import static org.csstudio.display.builder.representation.ToolkitRepresentation.logger;
1111

12+
import java.util.UUID;
1213
import java.util.concurrent.TimeUnit;
1314
import java.util.logging.Level;
1415

@@ -51,6 +52,8 @@ public class TextEntryRepresentation extends RegionBaseRepresentation<TextInputC
5152
*/
5253
private boolean active = false;
5354
private volatile boolean enabled = true;
55+
private final String node_id = UUID.randomUUID().toString();;
56+
5457

5558
private final DirtyFlag dirty_size = new DirtyFlag();
5659
private final DirtyFlag dirty_style = new DirtyFlag();
@@ -101,6 +104,7 @@ public TextInputControl createJFXNode() throws Exception
101104
text = new TextField();
102105
text.setMinSize(Region.USE_PREF_SIZE, Region.USE_PREF_SIZE);
103106
text.getStyleClass().add("text_entry");
107+
text.setId(node_id);
104108

105109
if (! toolkit.isEditMode())
106110
{
@@ -425,6 +429,13 @@ else if(jfx_node instanceof TextArea){
425429
String alignment = model_widget.propHorizontalAlignment().getValue().toString().toLowerCase();
426430
PseudoClass alignmentClass = PseudoClass.getPseudoClass(alignment);
427431
jfx_node.pseudoClassStateChanged(alignmentClass, true);
432+
433+
if (jfx_node.getScene() != null && !enabled) {
434+
// Need to get the TextArea 'content' node to set the cursor
435+
// for the whole widget otherwise it will only show on the borders.
436+
jfx_node.getScene().lookup("#"+node_id+" .content").setCursor(Cursors.NO_WRITE);
437+
jfx_node.layout();
438+
}
428439
}
429440
}
430441
if (! active)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
5+
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
6+
<classpathentry kind="src" path="src/main/resources"/>
7+
<classpathentry combineaccessrules="false" kind="src" path="/phoebus-target"/>
8+
<classpathentry combineaccessrules="false" kind="src" path="/core-framework"/>
9+
<classpathentry combineaccessrules="false" kind="src" path="/core-util"/>
10+
<classpathentry combineaccessrules="false" kind="src" path="/core-pv"/>
11+
<classpathentry combineaccessrules="false" kind="src" path="/core-ui"/>
12+
<classpathentry combineaccessrules="false" kind="src" path="/core-security"/>
13+
<classpathentry combineaccessrules="false" kind="src" path="/core-types"/>
14+
<classpathentry combineaccessrules="false" kind="src" path="/app-databrowser"/>
15+
<classpathentry combineaccessrules="false" kind="src" path="/app-display-model"/>
16+
<classpathentry combineaccessrules="false" kind="src" path="/app-display-runtime"/>
17+
<classpathentry combineaccessrules="false" kind="src" path="/app-display-representation"/>
18+
<classpathentry combineaccessrules="false" kind="src" path="/app-display-representation-javafx"/>
19+
<classpathentry kind="output" path="target/classes"/>
20+
</classpath>

app/display/waterfallplot/.project

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>app-display-waterfallplot</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>
Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
<project default="app-display-waterfallplot">
2-
<import file="../../dependencies/ant_settings.xml"/>
2+
<import file="../../../dependencies/ant_settings.xml"/>
3+
4+
<target name="app-display-waterfallplot">
5+
<mkdir dir="${classes}"/>
6+
<javac destdir="${classes}" debug="${debug}">
7+
<src path="${src}"/>
8+
<classpath>
9+
<path refid="app-classpath"/>
10+
<pathelement path="../model/${build}/app-display-model-${version}.jar"/>
11+
<pathelement path="../representation/${build}/app-display-representation-${version}.jar"/>
12+
<pathelement path="../representation-javafx/${build}/app-display-representation-javafx-${version}.jar"/>
13+
<pathelement path="../runtime/${build}/app-display-runtime-${version}.jar"/>
14+
<pathelement path="../../databrowser/${build}/app-databrowser-${version}.jar"/>
15+
<pathelement path="../../rtplot/${build}/app-rtplot-${version}.jar"/>
16+
</classpath>
17+
</javac>
318

4-
<target name="app-display-waterfallplot" depends="compile-app">
519
<jar destfile="${build}/app-display-waterfallplot-${version}.jar">
620
<fileset dir="${classes}"/>
721
<fileset dir="${resources}"/>
822
</jar>
923
</target>
24+
1025
</project>

app/display/waterfallplot/src/main/java/org/phoebus/applications/waterfallplotwidget/WaterfallPlotController.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.time.Duration;
1919
import java.time.Instant;
2020
import java.util.ArrayList;
21+
import java.util.HashMap;
2122
import java.util.LinkedList;
2223
import java.util.List;
2324
import java.util.Optional;
@@ -321,6 +322,8 @@ public synchronized void redraw(WaterfallPlotRuntime.PVData pvData) {
321322

322323
ConcurrentSkipListMap<Instant, ArrayList<Double>> instantToWaveform = waveformPVData.instantToValue();
323324
Instant startKey = instantToWaveform.ceilingKey(Instant.MIN);
325+
326+
Optional<Instant> previousInstant = Optional.empty();
324327
for (Instant t = t1.plus(stepsize); t.compareTo(t2) <= 0; t = t.plus(stepsize)) {
325328
timeValuesLinkedList.add(((double) t.toEpochMilli()) / 1000.0);
326329

@@ -333,6 +336,15 @@ public synchronized void redraw(WaterfallPlotRuntime.PVData pvData) {
333336
ArrayList<Double> waveform = instantToWaveform.get(instant);
334337
waveformLength = Math.max(waveformLength, waveform.size());
335338
zValuesLinkedList.add(waveform);
339+
340+
if (previousInstant.isPresent()) {
341+
// Optimization: Remove data points that are not plotted.
342+
for (var key : instantToWaveform.subMap(previousInstant.get(), false, instant, false).keySet()) {
343+
instantToWaveform.remove(key);
344+
}
345+
}
346+
347+
previousInstant = Optional.of(instant);
336348
}
337349
}
338350
} else if (pvData instanceof WaterfallPlotRuntime.ScalarPVsData scalarPVsData) {
@@ -344,6 +356,12 @@ public synchronized void redraw(WaterfallPlotRuntime.PVData pvData) {
344356

345357
waveformLength = 2 * pvNameToInstantToValue.size() + 1;
346358

359+
HashMap<String, Optional<Instant>> pvNameToPreviousInstant = new HashMap<>();
360+
for (var pvNameAndInstantToValue : pvNameToInstantToValue) {
361+
String pvName = pvNameAndInstantToValue.getKey();
362+
pvNameToPreviousInstant.put(pvName, Optional.empty());
363+
}
364+
347365
for (Instant t = t1.plus(stepsize); t.compareTo(t2) <= 0; t = t.plus(stepsize)) {
348366
timeValuesLinkedList.add(((double) t.toEpochMilli()) / 1000.0);
349367
ArrayList<Double> zValues = new ArrayList<>();
@@ -360,6 +378,16 @@ public synchronized void redraw(WaterfallPlotRuntime.PVData pvData) {
360378
} else {
361379
zValues.add(instantToValue.get(instant));
362380
zValues.add(instantToValue.get(instant));
381+
382+
Optional<Instant> previousInstant = pvNameToPreviousInstant.get(pvName);
383+
if (previousInstant.isPresent()) {
384+
// Optimization: Remove data points that are not plotted.
385+
for (var key : instantToValue.subMap(previousInstant.get(), false, instant, false).keySet()) {
386+
instantToValue.remove(key);
387+
}
388+
}
389+
390+
pvNameToPreviousInstant.put(pvName, Optional.of(instant));
363391
}
364392
}
365393

app/save-and-restore/app/doc/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ Brief description of all items in the context menu (details on actions are outli
8888
* Restore from client - restore a snapshot or composite snapshot from the client application.
8989
* Restore from service - restore a snapshot or composite snapshot from the service.
9090
* Edit - edit a configuration.
91-
* Rename - rename a folder or configuration.
91+
* Find references - locates composite snapshot nodes referencing the selected node.
92+
* Rename - rename a folder.
9293
* Copy - put selected items on clipboard.
9394
* Paste - paste items from clipboard.
9495
* Delete - delete selected items.

0 commit comments

Comments
 (0)