private Label noMachineLabel;
private MemoryCellModifiedListener currentRegisteredCellListener;
+ private LogicObserver currentClockObserver;
@Override
public void createPartControl(Composite parent)
simSpeedSlider.setEnabled(true);
if (machine != null)
+ {
machine.getMicroInstructionMemory().deregisterCellModifiedListener(currentRegisteredCellListener);
+ machine.getClock().deregisterObserver(currentClockObserver);
+ }
machine = machineOptional.get();
canvas = new LogicUICanvas(parent, SWT.NONE, machine.getModel());
sbseButton = new Button(c, SWT.CHECK);
pauseButton = new Button(c, SWT.TOGGLE);
- LogicObserver clockObserver = o ->
+ currentClockObserver = o ->
{
if (((CoreClock) o).isOn())
{
{
CoreClock cl = machine.getClock();
if (sbseButton.getSelection())
- cl.registerObserver(clockObserver);
+ cl.registerObserver(currentClockObserver);
else
- cl.deregisterObserver(clockObserver);
+ cl.deregisterObserver(currentClockObserver);
});
sbseButton.setSelection(false);