diff --git a/app/src/main/java/com/codigoparallevar/minicards/parts/ProgramakerCustomBlockPart.java b/app/src/main/java/com/codigoparallevar/minicards/parts/ProgramakerCustomBlockPart.java index 62144c0..5810e00 100644 --- a/app/src/main/java/com/codigoparallevar/minicards/parts/ProgramakerCustomBlockPart.java +++ b/app/src/main/java/com/codigoparallevar/minicards/parts/ProgramakerCustomBlockPart.java @@ -53,6 +53,7 @@ public class ProgramakerCustomBlockPart implements Part { private int height = 100; private String token = null; private Object[] lastValues; + private boolean active = true; public ProgramakerCustomBlockPart(String id, PartGrid grid, Tuple2 center, ProgramakerCustomBlock block) { @@ -337,6 +338,11 @@ public class ProgramakerCustomBlockPart implements Part { } private void runBlockOperation() { + if (!this.active) { + Log.w(LogTag, "Trying to run inactive block function=" + this._block.getFunction_name()); + return; + } + ProgramakerApi api = this._partGrid.getApi(); List arguments = new LinkedList<>(); @@ -435,12 +441,12 @@ public class ProgramakerCustomBlockPart implements Part { @Override public void resume() { - // Intentionally left empty + this.active = true; } @Override public void pause() { - // Intentionally left empty + this.active = false; } @Override @@ -542,6 +548,9 @@ public class ProgramakerCustomBlockPart implements Part { @Override public void unlink() { - // TODO: Implement + this.active = false; + for (InputConnector input : getInputConnectors()) { + input.unlink(); + } } }