Skip to content

Commit

Permalink
added change type to "Up to" text
Browse files Browse the repository at this point in the history
  • Loading branch information
NilsRo committed May 10, 2022
1 parent ca1cb58 commit 371c0b8
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions octoprint_SlicerEstimator/static/js/SlicerEstimator.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,19 @@ $(function() {
returnChange.push(returnArr);
}
} else {
returnArr["description"] = gettext("up to") + " " + changeList.length;
returnArr["value"] = "...";
if (changeList[changeList.length - 1][0] == "M600") {
changeType = gettext("filament change (M600)");
} else {
changeType = gettext("filament") + " (" + gettext("tool") + " " + changeList[changeList.length - 1][0].substring(1,2) +")";
}
returnArr["description"] = gettext("up to") + " " + changeList.length + ". " + changeType;
if (self.printerStateViewModel.printTimeLeft() === null) {
changeTime = self.printerStateViewModel.estimatedPrintTime() - changeList[changeList.length - 1][1];
} else {
changeTime = (self.printerStateViewModel.estimatedPrintTime() - changeList[changeList.length - 1][1]) - (self.printerStateViewModel.estimatedPrintTime() - self.printerStateViewModel.printTimeLeft());
}
let changeTimeString = self.filamentChangeTimeFormat(changeTime);
returnArr["value"] = changeTimeString;
returnChange.push(returnArr);
break;
}
Expand Down

0 comments on commit 371c0b8

Please sign in to comment.