Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions base/uk.ac.stfc.isis.ibex.e4.client.product/ibex.product
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<plugin id="org.eclipse.osgi" autoStart="true" startLevel="0" />
<plugin id="uk.ac.stfc.isis.ibex.activemq" autoStart="false" startLevel="0" />
<plugin id="uk.ac.stfc.isis.ibex.alarm" autoStart="false" startLevel="0" />
<plugin id="uk.ac.stfc.isis.ibex.alerts" autoStart="false" startLevel="0" />
<plugin id="uk.ac.stfc.isis.ibex.banner" autoStart="false" startLevel="0" />
<plugin id="uk.ac.stfc.isis.ibex.beamstatus" autoStart="false" startLevel="0" />
<plugin id="uk.ac.stfc.isis.ibex.configserver" autoStart="false" startLevel="0" />
Expand Down Expand Up @@ -93,6 +94,7 @@
<plugin id="uk.ac.stfc.isis.ibex.targets" autoStart="false" startLevel="0" />
<plugin id="uk.ac.stfc.isis.ibex.ui" autoStart="false" startLevel="0" />
<plugin id="uk.ac.stfc.isis.ibex.ui.alarm" autoStart="false" startLevel="0" />
<plugin id="uk.ac.stfc.isis.ibex.ui.alerts" autoStart="false" startLevel="0" />
<plugin id="uk.ac.stfc.isis.ibex.ui.banner" autoStart="false" startLevel="0" />
<plugin id="uk.ac.stfc.isis.ibex.ui.beamstatus" autoStart="false" startLevel="0" />
<plugin id="uk.ac.stfc.isis.ibex.ui.blocks" autoStart="false" startLevel="0" />
Expand All @@ -119,8 +121,6 @@
<plugin id="uk.ac.stfc.isis.ibex.ui.weblinks" autoStart="false" startLevel="0" />
<plugin id="uk.ac.stfc.isis.ibex.ui.widgets" autoStart="false" startLevel="0" />
<plugin id="uk.ac.stfc.isis.ibex.validators" autoStart="false" startLevel="0" />
<plugin id="uk.ac.stfc.isis.ibex.alerts" autoStart="false" startLevel="0" />
<plugin id="uk.ac.stfc.isis.ibex.ui.alerts" autoStart="false" startLevel="0" />
<property name="osgi.splashPath" value="platform:/base/plugins/uk.ac.stfc.isis.ibex.e4.product" />
</configurations>

Expand Down
2 changes: 1 addition & 1 deletion base/uk.ac.stfc.isis.ibex.e4.client/Application.e4xmi
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@
</children>
<children xsi:type="basic:PartSashContainer" xmi:id="_iXy6F5IBEe-V38_cTZ3ImQ" elementId="uk.ac.stfc.isis.ibex.e4.client.partsashcontainer.14" containerData="70">
<children xsi:type="basic:PartStack" xmi:id="_iXy6GJIBEe-V38_cTZ3ImQ" elementId="uk.ac.stfc.isis.ibex.e4.client.partstack.13" containerData="60">
<children xsi:type="basic:Part" xmi:id="_iXy6GZIBEe-V38_cTZ3ImQ" elementId="uk.ac.stfc.isis.ibex.e4.client.part.scriptcomposer" contributionURI="bundleclass://uk.ac.stfc.isis.ibex.ui.scriptgenerator/uk.ac.stfc.isis.ibex.ui.scriptgenerator.views.ScriptGeneratorView" label="Script Composer"/>
<children xsi:type="basic:Part" xmi:id="_iXy6GZIBEe-V38_cTZ3ImQ" elementId="uk.ac.stfc.isis.ibex.e4.client.part.scriptcomposer" containerData="" contributionURI="bundleclass://uk.ac.stfc.isis.ibex.ui.scriptgenerator/uk.ac.stfc.isis.ibex.ui.scriptgenerator.views.ScriptGeneratorView" label="Script Composer"/>
</children>
</children>
</children>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
*/
public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {

private static final int MIN_WINDOW_HEIGHT = 800;
private static final int MIN_WINDOW_WIDTH = 1100;
private static final int MIN_WINDOW_HEIGHT = 800;
private static final int MIN_WINDOW_WIDTH = 1100;

private static final String DIALOG_BOX_TITLE = "IBEX is already running.";
private static final String DIALOG_QUESTION = "It appears that IBEX client is already running. "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public class DashboardView {
*/
public static final String ID = "uk.ac.stfc.isis.ibex.ui.dashboard.views.DashboardView"; //$NON-NLS-1$

private static final int FIXED_WIDTH = 580;
private static final int FIXED_HEIGHT = 225;
private static final int FIXED_WIDTH = 580; // 580
private static final int FIXED_HEIGHT = 225; // 225

private final Font bannerTitleFont = SWTResourceManager.getFont("Arial", 24, SWT.BOLD);
private final Font bannerFont = SWTResourceManager.getFont("Arial", 14, SWT.NORMAL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class QueueScriptPreviewDialog extends TitleAreaDialog {
*/
public QueueScriptPreviewDialog(Shell parentShell, String generatedScript) {
super(parentShell);
setShellStyle(getShellStyle() | SWT.RESIZE | SWT.MAX);
setShellStyle(getShellStyle() | SWT.RESIZE | SWT.MAX);
this.generatedScript = generatedScript;
this.parentShell = parentShell;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
* Constants used on the script generator page.
*/
final class Constants {
protected static final String BUTTON_TITLE_SAVE = "Save Script";
protected static final String BUTTON_TITLE_SAVE_AS = "Save Script As";
protected static final String BUTTON_TITLE_LOAD = "Load Script";
protected static final String BUTTON_TITLE_SAVE = "Save"; // Save Script
protected static final String BUTTON_TITLE_SAVE_AS = "Save As"; // Save Script As
protected static final String BUTTON_TITLE_LOAD = "Load"; // Load Script

protected static final String BUTTON_TITLE_ADD_ROW_TO_END = "Add Row to End";
protected static final String BUTTON_TITLE_INSERT_ROW_BELOW = "Insert Row Below";
protected static final String BUTTON_TITLE_DELETE_ROWS = "Clear All Rows";
protected static final String BUTTON_TITLE_ADD_ROW_TO_END = "Add to End"; // Add Row to End
protected static final String BUTTON_TITLE_INSERT_ROW_BELOW = "Insert Below"; // Insert Row Below
protected static final String BUTTON_TITLE_DELETE_ROWS = "Clear All"; // Clear All Rows

protected static final String CHECKBOX_TITLE_PARAM_TRANSFER = "Transfer Compatible Parameters";
protected static final String CHECKBOX_TITLE_INVALID_PAUSE = "Invalid Actions are Paused on";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Group;

import uk.ac.stfc.isis.ibex.preferences.PreferenceSupplier;
import uk.ac.stfc.isis.ibex.scriptgenerator.ScriptGeneratorProperties;
Expand Down Expand Up @@ -100,7 +101,7 @@ public class ScriptGeneratorView implements ScriptGeneratorViewModelDelegate {
* Denotes whether script definitions have been loaded once.
*/
private boolean scriptDefinitionsLoadedOnce = false;

private ActionsViewTable table;
private Button btnMoveActionUp;
private Button btnMoveActionDown;
Expand Down Expand Up @@ -135,7 +136,7 @@ public void createPartControl(Composite parent) {
scriptGeneratorViewModel.setScriptGeneratorViewModelDelegate(this);

GridData gdQueueContainer = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1);
gdQueueContainer.heightHint = 300;
gdQueueContainer.heightHint = 300;
parent.setLayoutData(gdQueueContainer);
parent.setLayout(new GridLayout());

Expand Down Expand Up @@ -269,32 +270,36 @@ private void displayLoaded() {

globalParamComposite = new Composite(mainParent, SWT.NONE);
globalParamComposite.setLayout(new GridLayout(24, false));
globalParamComposite.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false));

globalParamComposite.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false));
// Composite to split the middle into bigger left and smaller right section
Composite middleComposite = makeGrid(mainParent, 2, false, 0);
middleComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
middleComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

makeTableAndUpDownButtons(middleComposite);

// The composite to contain the buttons on the right to the table
Composite buttonContainerComposite = makeGrid(middleComposite, 1, false, 0);
Composite buttonContainerComposite = makeGrid(middleComposite, 1, false, 0);
buttonContainerComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true));

makeControlButtons(buttonContainerComposite);

// Composite for the row containing the parameter file location and total
// estimated run time
Composite scriptInfoGrp = new Composite(mainParent, SWT.NONE);
scriptInfoGrp.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false, 1, 1));
GridLayout scriptInfoLayout = new GridLayout(3, true);
scriptInfoLayout.marginRight = 40;
scriptInfoGrp.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false, 1, 1));
GridLayout scriptInfoLayout = new GridLayout(3, true);
scriptInfoLayout.marginRight = 40;
scriptInfoGrp.setLayout(scriptInfoLayout);

Composite bottomComposite = makeGrid(mainParent, 2, false, 0);
bottomComposite.setLayoutData(new GridData(SWT.END, SWT.FILL, false, true));

// Label for Location of Saved Parameters File
parametersFileText = new Label(scriptInfoGrp, SWT.LEFT);
parametersFileText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
parametersFileText.setText("Current Script: <new file>");


scriptGenerationTimeText = new Label(scriptInfoGrp, SWT.LEFT);
scriptGenerationTimeText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
Expand All @@ -317,7 +322,7 @@ private void displayLoaded() {
if (!scriptDefinitionLoadErrors.isEmpty()) {
setUpScriptDefinitionLoadErrorTable(mainParent, scriptDefinitionLoadErrors);
}

mainParent.layout();
});
}
Expand All @@ -330,7 +335,7 @@ private void displayLoaded() {
* @param columns number of columns
* @param equal whether or not to make the columns equal width
* @param margin margin around all four sides
* @return the new COmposite instance
* @return the new Composite instance
*/
private Composite makeGrid(Composite parent, int columns, boolean equal, int margin) {
Composite group = new Composite(parent, SWT.NONE);
Expand All @@ -344,7 +349,8 @@ private Composite makeGrid(Composite parent, int columns, boolean equal, int mar

private void makeToggleParameterTransfer(Composite parent) {
Composite actionsControlsGrp = makeGrid(parent, 1, true, 10);

actionsControlsGrp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));

new IBEXButton(actionsControlsGrp, SWT.CHECK, event -> {
boolean enabled = ((Button) event.widget).getSelection();
scriptGeneratorViewModel.setParameterTransferEnabled(enabled);
Expand All @@ -356,7 +362,8 @@ private void makeToggleParameterTransfer(Composite parent) {

private void makeToggleInvalidPauseSkip(Composite parent) {
Composite actionsControlsGrp = makeGrid(parent, 1, true, 10);

actionsControlsGrp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));

// Pause
new IBEXButton(actionsControlsGrp, SWT.RADIO, event -> {
ScriptGeneratorSettingsSingleton.getInstance().setSkipEnabled(false); //sets skipEnabled to false, causing Pause on invalid actions during run of script
Expand All @@ -375,16 +382,20 @@ private void makeToggleInvalidPauseSkip(Composite parent) {
}

/**
* Creates a column containing three buttons for table row modifications.
* Creates a row containing three buttons for table row modifications.
*
* @param parent the containing Composite
*/
private void makeTableRowControlButtons(Composite parent) {
// Composite for laying out new/delete/duplicate action buttons
Composite actionsControlsGrp = makeGrid(parent, 1, true, 10);

// Group for laying out new/delete/duplicate action buttons
Group actionsControlsGrp = new Group(parent, SWT.NONE);
actionsControlsGrp.setText("Row Operations");
actionsControlsGrp.setLayout(new GridLayout(3, false));
actionsControlsGrp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));

// Make buttons for insert new/delete/duplicate actions
btnAddAction = new IBEXButton(actionsControlsGrp, SWT.NONE, event -> {

btnAddAction = new IBEXButton(actionsControlsGrp, SWT.NONE, event -> {
scriptGeneratorViewModel.addEmptyAction();
})
.text(Constants.BUTTON_TITLE_ADD_ROW_TO_END)
Expand All @@ -401,20 +412,24 @@ private void makeTableRowControlButtons(Composite parent) {
new IBEXButton(actionsControlsGrp, SWT.NONE, event -> {
scriptGeneratorViewModel.clearAction();
})
.text(Constants.BUTTON_TITLE_DELETE_ROWS)
.tooltip(Constants.BUTTON_TOOLTIP_DELETE_ROWS)
.layoutData(IBEXButton.expandingGrid);
.text(Constants.BUTTON_TITLE_DELETE_ROWS)
.tooltip(Constants.BUTTON_TOOLTIP_DELETE_ROWS)
.layoutData(IBEXButton.expandingGrid);
}



/**
* Creates a column containing three buttons for save, save as, and load script.
* Creates a row containing three buttons for save, save as, and load script.
*
* @param parent the containing Composite
*/
private void makeScriptSaveLoadButtons(Composite parent) {
// Composite for generate buttons
Composite generateButtonsGrp = makeGrid(parent, 1, true, 10);

// Group for script operation buttons
Group generateButtonsGrp = new Group(parent, SWT.NONE);
generateButtonsGrp.setText("Script Operations");
generateButtonsGrp.setLayout(new GridLayout(3, false));
generateButtonsGrp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));

// Buttons to generate a script
generateScriptButton = new IBEXButton(generateButtonsGrp, SWT.NONE, event -> {
scriptGeneratorViewModel.generateScriptToCurrentFilepath();
Expand Down Expand Up @@ -446,35 +461,37 @@ private void makeScriptSaveLoadButtons(Composite parent) {
*/
private void makeDynamicScriptingControlButtons(Composite parent) {
errorLabel = new Label(parent, SWT.NONE);
errorLabel.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, true));
errorLabel.setForeground(new Color(255, 0, 0));

// Composite for generate buttons
Composite dynamicScriptingButtonsGrp = makeGrid(parent, 3, true, 10);

errorLabel.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, true));
errorLabel.setForeground(new Color(255, 0, 0));
// Group for dynamic scripting buttons
Group dynamicScriptingButtonsGrp = new Group(parent, SWT.NONE);
dynamicScriptingButtonsGrp.setText("Run Operations");
dynamicScriptingButtonsGrp.setLayout(new GridLayout(3, false));
dynamicScriptingButtonsGrp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));

// Button to run/pause/stop script in nicos
runButton = new IBEXButton(dynamicScriptingButtonsGrp, SWT.NONE)
.image(Constants.IMAGE_RUN)
.tooltip("Run")
.layoutData(IBEXButton.expandingGrid)
.layoutData(IBEXButton.expandingGrid)
.get();
pauseButton = new IBEXButton(dynamicScriptingButtonsGrp, SWT.NONE)
.image(Constants.IMAGE_PAUSE)
.tooltip("Pause")
.layoutData(IBEXButton.expandingGrid)
.layoutData(IBEXButton.expandingGrid)
.get();
stopButton = new IBEXButton(dynamicScriptingButtonsGrp, SWT.NONE)
.image(Constants.IMAGE_STOP)
.tooltip("Stop")
.layoutData(IBEXButton.expandingGrid)
.layoutData(IBEXButton.expandingGrid)
.get();
nicosViewModel.bindControls(runButton, pauseButton, stopButton);
}

private void makeRunAndFinishTime(Composite parent) {
// Composite for the row containing total estimated run time
Composite scriptTimeGrp = makeGrid(parent, 1, true, 10);
scriptTimeGrp.setLayoutData(new GridData(SWT.END, SWT.NONE, true, false));
Composite scriptTimeGrp = makeGrid(parent, 1, true, 10);
scriptTimeGrp.setLayoutData(new GridData(SWT.END, SWT.NONE, true, false));

// Label for the total estimated run time
estimateText = new Label(scriptTimeGrp, SWT.TOP);
Expand Down Expand Up @@ -504,8 +521,8 @@ private void makeRunAndFinishTime(Composite parent) {
private void makeTableAndUpDownButtons(Composite parent) {
// The composite to contain the UI table
Composite tableContainerComposite = new Composite(parent, SWT.NONE);
tableContainerComposite.setLayout(new GridLayout(2, false));
tableContainerComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
tableContainerComposite.setLayout(new GridLayout(2, false));
tableContainerComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

// The UI table
table = new ActionsViewTable(tableContainerComposite, SWT.NONE, SWT.MULTI | SWT.V_SCROLL | SWT.FULL_SELECTION,
Expand All @@ -516,7 +533,7 @@ private void makeTableAndUpDownButtons(Composite parent) {
// Composite for move action up/down buttons
Composite moveComposite = new Composite(tableContainerComposite, SWT.NONE);
moveComposite.setLayout(new GridLayout());
moveComposite.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));
moveComposite.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));

// Make buttons to move an action up and down the list
btnMoveActionUp = new IBEXButton(moveComposite, SWT.NONE, event -> {
Expand Down Expand Up @@ -584,9 +601,10 @@ private Text makeHelpTextBox(Composite parent) {
private void setUpScriptDefinitionLoadErrorTable(Composite parent, Map<String, String> scriptDefinitionLoadErrors) {
if (!preferences.hideScriptGenScriptDefinitionErrorTable()) {
// A composite to contain the script definition load errors
Composite scriptDefinitionErrorComposite = makeGrid(parent, 1, false, 5);
scriptDefinitionErrorComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));

Composite scriptDefinitionErrorComposite = makeGrid(parent, 1, false, 5);
scriptDefinitionErrorComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));


Label errorLabel = new Label(scriptDefinitionErrorComposite, SWT.NONE);
errorLabel.setText("Errors:");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
* The ViewModel for the ScriptGeneratorView.
*/
public class ScriptGeneratorViewModel extends ModelObject {

private static final Logger LOG = IsisLog.getLogger(ScriptGeneratorViewModel.class);

private static final String TAB = "\t";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected void configureShell(Shell shell) {

@Override
protected Point getInitialSize() {
return new Point(450, 300);
return new Point(450, 300);
}

@Override
Expand Down
Loading