Skip to content
Open
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
2 changes: 2 additions & 0 deletions bambu/src/main/java/com/tfyre/bambu/printer/BambuPrinter.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public interface BambuPrinter {

void commandFullStatus(final boolean force);

void commandDone();

void commandClearPrinterError();

void commandLight(BambuConst.LightMode lightMode);
Expand Down
13 changes: 13 additions & 0 deletions bambu/src/main/java/com/tfyre/bambu/printer/BambuPrinterImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,19 @@ public void commandSystemReboot() {
toJson(message).ifPresent(this::sendData);
}

@Override
public void commandDone() {
logUser("%s: commandDone".formatted(name));
final BambuMessage message = BambuMessage.newBuilder()
.setPrint(
com.tfyre.bambu.model.Print.newBuilder()
.setSequenceId("%d".formatted(counter.incrementAndGet()))
.setCommand("done")
)
.build();
toJson(message).ifPresent(this::sendData);
}

@Override
public void commandFilamentUnload() {
logUser("%s: commandFilamentUnload".formatted(name));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ private Div buildName() {
newButton("Show SD Card", VaadinIcon.ARCHIVE, l -> UI.getCurrent().navigate(SdCardView.class, printer.getName())),
newButton("Request full status", VaadinIcon.REFRESH, l -> printer.commandFullStatus(true)),
newButton("Clear Print Error", VaadinIcon.WARNING, l -> printer.commandClearPrinterError()),
newButton("Send Done", VaadinIcon.ENTER, l -> printer.commandDone()),
newButton("Resume Print", VaadinIcon.PLAY, l -> doConfirm(BambuConst.CommandControl.RESUME)),
newButton("Pause Print", VaadinIcon.PAUSE, l -> doConfirm(BambuConst.CommandControl.PAUSE)),
newButton("Stop Print", VaadinIcon.STOP, l -> doConfirm(BambuConst.CommandControl.STOP))
Expand Down