Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4018775
CSSTUDIO-2072 Remove '\t', ',' ,';', and ' ' as separators from drag-…
abrahamwolk Feb 16, 2024
1f74feb
CSSTUDIO-2072 Add the functionality to parse display names to the fun…
abrahamwolk Feb 19, 2024
ab3a1af
CSSTUDIO-2072 Use Messages.PVName instead of Messages.Name, and remov…
abrahamwolk Feb 19, 2024
56e65b4
CSSTUDIO-2072 Bugfix: increment 'pos' before assignment to 'start'.
abrahamwolk Feb 19, 2024
f1a5eab
CSSTUDIO-2072 Add UI-elements for entering display names when adding …
abrahamwolk Feb 19, 2024
f97e900
CSSTUDIO-2072 Add display names to UI when drag-and-dropping PV names…
abrahamwolk Feb 19, 2024
142fad0
CSSTUDIO-2072 Add display name to new traces when drag-and-dropping P…
abrahamwolk Feb 19, 2024
8510957
Merge branch 'master' into CSSTUDIO-2072
abrahamwolk Feb 19, 2024
814bc26
CSSTUDIO-2072 Add the class "AddPVsFromTheClipboardMenuItem".
abrahamwolk Feb 20, 2024
78cfe8a
Add "Add PV(s) from the Clipboard" to the context-menu in the Data Br…
abrahamwolk Feb 20, 2024
3e9a01c
CSSTUDIO-2072 Refactor: Move implementation of droppedNames() into th…
abrahamwolk Feb 21, 2024
0aae048
CSSTUDIO-2072 Rename Activator.droppedNames() -> Activator.addPVsToPl…
abrahamwolk Feb 21, 2024
b7f41e2
CSSTUDIO-2072 Add an outermost ScrollPane to the contents of the "Add…
abrahamwolk Feb 21, 2024
dcf440c
CSSTUDIO-2072 Set layout of the "Add PV" window, and rename "dlg" -> …
abrahamwolk Feb 21, 2024
fed3e75
CSSTUDIO-2072 Add "Add PV(s) from the Clipboard" to the context-menu …
abrahamwolk Feb 21, 2024
6462721
CSSTUDIO-2072 If several PVs are added, set title of dialog to "Add P…
abrahamwolk Feb 21, 2024
876c4a0
CSSTUDIO-2072 Call scrollPane.setFitToWidth(true) in AddPVDialog inst…
abrahamwolk Feb 21, 2024
624b27d
CSSTUDIO-2072 When adding a formula, display "Name" instead of "PV Na…
abrahamwolk Feb 21, 2024
f4110d1
CSSTUDIO-2072 Adjust tests for changed type of DroppedPVNameParser.pa…
abrahamwolk Feb 21, 2024
7b27e25
CSSTUDIO-2072 Add the choice "Use the same value axis for all added P…
abrahamwolk Mar 6, 2024
78b26cc
CSSTUDIO-2072 Remove commented-out code.
abrahamwolk Mar 6, 2024
891ad37
CSSTUDIO-2072 Add labels to messages.properties.
abrahamwolk Mar 6, 2024
d63fbf8
CSSTUDIO-2072 Update "AddPVMsg" in messages.properties.
abrahamwolk Mar 6, 2024
2269d1e
Merge branch 'master' into CSSTUDIO-2072
abrahamwolk Apr 24, 2024
3247b12
CSSTUDIO-2072 Remove tests for previously implemented drag'n'drop fun…
abrahamwolk Apr 24, 2024
228d483
CSSTUDIO-2072 Add labels to messages.properties.
abrahamwolk May 8, 2024
ff62232
CSSTUDIO-2072 Add title to warning alert.
abrahamwolk May 8, 2024
c26d641
Merge branch 'master' into CSSTUDIO-2072
abrahamwolk Jul 30, 2024
fb59efb
Revert "CSSTUDIO-2072 Remove tests for previously implemented drag'n'…
abrahamwolk Jul 30, 2024
3303c7c
CSSTUDIO-2072 Change back to the original way of splitting PV names i…
abrahamwolk Jul 30, 2024
07d4fcf
CSSTUDIO-2072 Skip to closing single quote when parsing a single quot…
abrahamwolk Jul 30, 2024
7af6919
Revert "CSSTUDIO-2072 Adjust tests for changed type of DroppedPVNameP…
abrahamwolk Jul 30, 2024
27fa4b2
CSSTUDIO-2072 Update error message when no PVs are found in the clipb…
abrahamwolk Jul 30, 2024
39d4f77
Merge branch 'master' into CSSTUDIO-2072
abrahamwolk Nov 14, 2024
6652661
Revert "CSSTUDIO-2072 Skip to closing single quote when parsing a sin…
abrahamwolk Nov 14, 2024
0ed4488
CSSTUDIO-2072 Remove the possibility to represent Display Names on th…
abrahamwolk Nov 14, 2024
a0c68f1
CSSTUDIO-2072 Add the configuration option 'org.csstudio.trends.datab…
abrahamwolk Nov 15, 2024
78c86ca
CSSTUDIO-2072 Update error message.
abrahamwolk Nov 15, 2024
91b5de9
CSSTUDIO-2072 Add 'assign_pvs_from_clipboard_to_the_same_axis_by_defa…
abrahamwolk Nov 15, 2024
652952d
CSSTUDIO-2072 Add label "Messages.DefaultDisplayName".
abrahamwolk Nov 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,33 @@
******************************************************************************/
package org.csstudio.trends.databrowser3;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;

import javafx.scene.Node;
import javafx.scene.control.DialogPane;
import javafx.scene.control.ScrollPane;
import javafx.stage.Window;
import javafx.util.Pair;
import org.csstudio.trends.databrowser3.model.AxisConfig;
import org.csstudio.trends.databrowser3.model.Model;
import org.csstudio.trends.databrowser3.ui.AddModelItemCommand;
import org.csstudio.trends.databrowser3.ui.AddPVDialog;
import org.phoebus.framework.jobs.NamedThreadFactory;
import org.phoebus.ui.dialog.DialogHelper;
import org.phoebus.ui.javafx.ImageCache;

import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import org.phoebus.ui.undo.UndoableActionManager;

/** Global Data Browser helper
* @author Kay Kasemir
Expand Down Expand Up @@ -71,6 +86,53 @@ public static ImageView getIcon(final String base_name)
return new ImageView(getImage(base_name));
}

public static void addPVsToPlotDialog(List<String> pvNames,
UndoableActionManager undoableActionManager,
Model model,
Node nodeToPositionDialogOver)
{
// Offer potential PV name in dialog so user can edit/cancel
// sim://sine sim://ramp sim://noise
AddPVDialog addPVDialog = new AddPVDialog(pvNames.size(), model, false);

{ // Set layout of addPVDialog:
int addPVDialogWidth = 750;
int addPVDialogHeight = 600;

Window addPVDialowWindow = addPVDialog.getDialogPane().getScene().getWindow();
addPVDialowWindow.setWidth(addPVDialogWidth);
addPVDialowWindow.setHeight(addPVDialogHeight);
addPVDialog.setResizable(false);

DialogPane dialogPane = addPVDialog.getDialogPane();
dialogPane.setPrefWidth(addPVDialogWidth);
dialogPane.setPrefHeight(addPVDialogHeight);
dialogPane.setMaxWidth(Double.MAX_VALUE);
dialogPane.setMaxHeight(Double.MAX_VALUE);

DialogHelper.positionDialog(addPVDialog, nodeToPositionDialogOver, (int) -addPVDialowWindow.getWidth()/2, (int) -addPVDialowWindow.getHeight()/2);
}

for (int i=0; i<pvNames.size(); ++i) {
addPVDialog.setNameAndDisplayName(i, pvNames.get(i));
}

if (!addPVDialog.showAndWait().orElse(false)) {
return;
}

for (int i=0; i<pvNames.size(); ++i) {
AxisConfig axis = addPVDialog.getOrCreateAxis(model, undoableActionManager, addPVDialog.getAxisIndex(i));
AddModelItemCommand.forPV(undoableActionManager,
model,
addPVDialog.getName(i),
addPVDialog.getDisplayName(i),
addPVDialog.getScanPeriod(i),
axis,
null);
}
}

/*
public static void main(String[] args) throws Exception
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class Messages
AddFormula_NameTT,
AddItemErrorFmt,
AddPV,
AddPVs,
AddPVsFromTheClipboard,
AddPV_Axis,
AddPV_AxisTT,
AddPVMsg,
Expand Down Expand Up @@ -63,6 +65,7 @@ public class Messages
CursorValueTT,
DataBrowser,
DataBrowserMenuPath,
DefaultDisplayName,
DeleteAxis,
DeleteAxisWarningFmt,
DeleteItem,
Expand Down Expand Up @@ -222,6 +225,8 @@ public class Messages
NewPlotFileCreateFailed,
NewPlotOverwriteExisting,
NewPlotOverwriteExistingTitle,
NoEachPVIsAssignedAnValueAxisIndividually,
NoPVsFoundInTheClipboard,
NotApplicable,
OpenExportView,
OpenPropertiesView,
Expand Down Expand Up @@ -284,6 +289,7 @@ public class Messages
StatisticsSum,
StatisticsSampleCount,
StatusColumn,
TheClipboardDoesNotContainPVs,
TimeAxis,
TimeColumn,
TitleFontLbl,
Expand All @@ -306,6 +312,7 @@ public class Messages
UseAxisName,
UseLines,
UsePoints,
UseTheSameValueAxisForAllAddedPVs,
UseTraceNames,
UseUnixTimeStamp,
ValueAxes,
Expand All @@ -318,7 +325,8 @@ public class Messages
WaveformTimeSelector,
WaveformTimestamp,
WaveformView,
WaveformViewSelect;
WaveformViewSelect,
YesAllPVsAreAddedToTheAxis;
// ---
// --- Keep alphabetically sorted and 'in sync' with messages.properties!
// ---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import java.io.File;
import java.text.MessageFormat;
import java.util.Optional;

import org.csstudio.trends.databrowser3.Activator;
import org.csstudio.trends.databrowser3.Messages;
Expand Down Expand Up @@ -64,7 +65,7 @@ private void run()
final ArchiveDataSource imported = new ArchiveDataSource(url, type);
// Add PV Item with data to model
AddModelItemCommand.forPV(op_manager, model,
type, Preferences.scan_period, axis, imported);
type, Optional.empty(), Preferences.scan_period, axis, imported);
}
catch (Exception ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ public static class TimePreset
/** Setting */
@Preference public static boolean config_dialog_supported;

@Preference
public static boolean assign_pvs_from_clipboard_to_the_same_axis_by_default;


@Preference
public static String value_axis_label_policy;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
package org.csstudio.trends.databrowser3.ui;

import java.text.MessageFormat;
import java.util.Optional;

import org.csstudio.trends.databrowser3.Messages;
import org.csstudio.trends.databrowser3.model.ArchiveDataSource;
Expand All @@ -34,6 +35,7 @@ public class AddModelItemCommand extends UndoableAction
* @param operations_manager OperationsManager where command will be reg'ed
* @param model Model were PV is to be added
* @param pv_name Name of new PV
* @param optional_display_name Optional Display Name to associate with the PV
* @param period scan period
* @param axis Axis
* @param archive Archive data source
Expand All @@ -43,6 +45,7 @@ public static AddModelItemCommand forPV(
final UndoableActionManager operations_manager,
final Model model,
final String pv_name,
final Optional<String> optional_display_name,
final double period,
final AxisConfig axis,
final ArchiveDataSource archive)
Expand All @@ -52,6 +55,9 @@ public static AddModelItemCommand forPV(
try
{
item = new PVItem(pv_name, period);
if (optional_display_name.isPresent()) {
item.setDisplayName(optional_display_name.get());
}
if (archive != null)
item.addArchiveDataSource(archive);
else
Expand Down
Loading
Loading