private void addSimulationControlWidgets(Composite parent)
{
Composite c = new Composite(parent, SWT.NONE);
- c.setLayout(new GridLayout(5, false));
- c.setLayout(new GridLayout(6, false));
++ c.setLayout(new GridLayout(7, false));
+
+ MograsimProjectCombo projectCombo = MachineContextSwtTools.createMograsimProjectSelector(c, SWT.NONE);
+ MachineCombo machineCombo = MachineContextSwtTools.createMachineSelector(c, SWT.NONE);
+
+ Button sbseButton = new Button(c, SWT.CHECK);
Button pauseButton = new Button(c, SWT.TOGGLE);
+
+ LogicObserver clockObserver = o ->
+ {
+ if (((CoreClock) o).isOn())
+ {
+ exec.pauseLiveExecution();
+ Display.getDefault().asyncExec(() ->
+ {
+ pauseButton.setSelection(false);
+ setPauseText(pauseButton, false);
+ });
+ }
+ };
+
+ sbseButton.addListener(SWT.Selection, e ->
+ {
+ String statusString = "disabled";
+ CoreClock cl = m.getClock();
+ if (sbseButton.getSelection())
+ {
+ cl.registerObserver(clockObserver);
+ statusString = "enabled";
+ } else
+ cl.deregisterObserver(clockObserver);
+ sbseButton.setToolTipText(String.format("Step by step execution: %s", statusString));
+ });
+ sbseButton.setSelection(false);
+
pauseButton.setSelection(true);
setPauseText(pauseButton, false);