Search in sources :

Example 1 with RemoteException

use of de.neemann.digital.gui.remote.RemoteException in project Digital by hneemann.

the class Main method runToBreak.

@Override
public String runToBreak() throws RemoteException {
    try {
        AddressPicker addressPicker = new AddressPicker();
        SwingUtilities.invokeAndWait(() -> {
            if (model != null && model.isFastRunModel() && !realTimeClockRunning) {
                runToBreakAction.actionPerformed(null);
                addressPicker.getProgramROMAddress(model);
            }
        });
        return addressPicker.getAddressString();
    } catch (InterruptedException | InvocationTargetException e) {
        throw new RemoteException("error performing a run to break " + e.getMessage());
    }
}
Also used : RemoteException(de.neemann.digital.gui.remote.RemoteException) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Example 2 with RemoteException

use of de.neemann.digital.gui.remote.RemoteException in project Digital by hneemann.

the class Main method doSingleStep.

@Override
public String doSingleStep() throws RemoteException {
    if (model != null && !realTimeClockRunning) {
        try {
            AddressPicker addressPicker = new AddressPicker();
            SwingUtilities.invokeAndWait(() -> {
                ArrayList<Clock> cl = model.getClocks();
                if (cl.size() == 1) {
                    ObservableValue clkVal = cl.get(0).getClockOutput();
                    clkVal.setBool(!clkVal.getBool());
                    try {
                        model.doStep();
                        if (clkVal.getBool()) {
                            clkVal.setBool(!clkVal.getBool());
                            model.doStep();
                        }
                        circuitComponent.repaintNeeded();
                        addressPicker.getProgramROMAddress(model);
                    } catch (NodeException | RuntimeException e) {
                        showErrorAndStopModel(Lang.get("err_remoteExecution"), e);
                    }
                }
            });
            return addressPicker.getAddressString();
        } catch (InterruptedException | InvocationTargetException e) {
            throw new RemoteException("error performing a single step " + e.getMessage());
        }
    }
    return null;
}
Also used : RealTimeClock(de.neemann.digital.draw.model.RealTimeClock) Clock(de.neemann.digital.core.wiring.Clock) RemoteException(de.neemann.digital.gui.remote.RemoteException) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Aggregations

RemoteException (de.neemann.digital.gui.remote.RemoteException)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 Clock (de.neemann.digital.core.wiring.Clock)1 RealTimeClock (de.neemann.digital.draw.model.RealTimeClock)1