Skip to content

Commit

Permalink
Merge pull request #2976 from ControlSystemStudio/CSSTUDIO-2044
Browse files Browse the repository at this point in the history
CSSTUDIO-2044 Bugfix: run the correct search query when selecting "Alarm History" in the context menu of a widget in an OPI.
  • Loading branch information
shroffk authored Mar 15, 2024
2 parents 3ad6a95 + eeee966 commit 5fbce3c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public class AlarmLogTable implements AppInstance {
private DockItem tab;
private AlarmLogTableController controller;

AlarmLogTable(final AlarmLogTableApp app) {
AlarmLogTable(final AlarmLogTableApp app, URI resource) {
// If URI resource == null, the default search query is used.
this.app = app;
try {
ResourceBundle resourceBundle = NLS.getMessages(Messages.class);
Expand All @@ -50,6 +51,9 @@ else if(clazz.isAssignableFrom(AdvancedSearchViewController.class)){
tab.setOnClosed(event -> {
controller.shutdown();
});
if (resource != null) {
setPVResource(resource);
}
DockPane.getActiveDockPane().addTab(tab);
} catch (IOException e) {
Logger.getLogger(getClass().getName()).log(Level.WARNING, "Cannot load UI", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public String getName() {

@Override
public AppInstance create() {
return new AlarmLogTable(this);
return new AlarmLogTable(this, null);
}

/**
Expand All @@ -50,8 +50,7 @@ public AppInstance create() {
*/
@Override
public AppInstance create(URI resource) {
AlarmLogTable alarmLogTable = new AlarmLogTable(this);
//alarmLogTable.s
AlarmLogTable alarmLogTable = new AlarmLogTable(this, resource);
return alarmLogTable;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ public void call(Selection selection) throws URISyntaxException {
selection.getSelections().stream().forEach(s -> {
AdapterService.adapt(s, ProcessVariable.class).ifPresent(selectedPvs::add);
});
AlarmLogTable table = ApplicationService.createInstance(AlarmLogTableApp.NAME);
URI uri = new URI(AlarmLogTableApp.SUPPORTED_SCHEMA, "", "", "pv="+selectedPvs.stream().map(ProcessVariable::getName).collect(Collectors.joining(",")), "");
table.setPVResource(uri);
AlarmLogTable table = ApplicationService.createInstance(AlarmLogTableApp.NAME, uri);
}

@Override
Expand Down

0 comments on commit 5fbce3c

Please sign in to comment.