-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Layers & Estimated time finish #136
base: master
Are you sure you want to change the base?
Conversation
Added in Current Layer & Estimated End time (Clock) for print.
Added in Total Layers and changed the size of the font of the number of layers to a smaller size.
Added Time till next update Added Layer & Estimated Time in webpage
Updated Readme to state new features
Updated Layer screen to change between font sizes depending on how many layers are printing. Also added the features to RepetierClient
Fixed an issue for the text showing on Printer Layers screen.
Compiled BIN for D1 Mini including all the features that are within the INO file
@victor7376 Any chance you could honor the 12/24hour config value for End time? Maybe even a step further if the end time is not today display date and time? |
@samwiseg0 the screens take the information from the DisplayLayerProgress plug-in, so what ever is displayed there is shown on the screens. |
@victor7376 I understand. I think ETA would be better calculated by using current time and adding seconds left. That would allow the ETA time to be formatted properly. Currently with the value you selected it is just a string value for time and is only formatted in 24hrs. I am suggesting to use remaining seconds and calculate that value. |
When I've got my printer back up and running I'll take a look. |
Thank you. I have been poking at it with little success. I am very new to arruino. I have been able to make some other minor modifications but I have not been able to get this modification to work successfully. Thank your your time. Much appreciated |
if you want if you post what you have coded, could take a look at it. |
I am mostly stuck on trying to get current time in seconds. My thought was. If I get current time in seconds then I can add remaining seconds to it. Then format it in either date time or just time if the date is today. Much like the example given in the issue.
I was looking at |
I could see what you were trying to do, but I couldnt work it out myself. I have however found out that Display Layer Progress has a feature that shows you the day of the week when a print will finish. The guy who makes the plugin is planning a new update for the clock in a future release. In Display Layer Progress plugin change the following option to what's shown and it will give you the day of the week. %A = Full weekday name. Hope this helps. |
That certainly is a much easier approach. I made the changes in the plugin config and it is much more useable now. I do wish it only showed the date when it was not today. But that is a bit more minor. Thank you for pointing that out. As a side note, another issue I came across is when the printer is paused it shows as offline. I modified String printing = (const char*)root2["state"]["flags"]["printing"];
String paused = (const char*)root2["state"]["flags"]["paused"];
if (printing == "true" || paused == "true") {
printerData.isPrinting = true;
} else {
printerData.isPrinting = false;
} Thanks again for your help. |
No problem, I do know how to make new screens, I’ll take a look tomorrow regarding pausing screen. |
I was able to change the main status bar by doing the following. It now shows paused instead of the percentage.
boolean OctoPrintClient::isPaused() {
boolean paused = false;
if (printerData.state == "Paused") {
paused = true;
}
return paused;
}
void drawHeaderOverlay(OLEDDisplay *display, OLEDDisplayUiState* state) {
display->setColor(WHITE);
display->setFont(ArialMT_Plain_16);
String displayTime = timeClient.getAmPmHours() + ":" + timeClient.getMinutes();
if (IS_24HOUR) {
displayTime = timeClient.getHours() + ":" + timeClient.getMinutes();
}
display->setTextAlignment(TEXT_ALIGN_LEFT);
display->drawString(0, 48, displayTime);
if (!IS_24HOUR) {
String ampm = timeClient.getAmPm();
display->setFont(ArialMT_Plain_10);
display->drawString(39, 54, ampm);
}
if (printerClient.isPaused()) {
display->setFont(ArialMT_Plain_10);
display->setTextAlignment(TEXT_ALIGN_LEFT);
String paused = "Paused";
display->drawString(64, 51, paused);
}
else {
display->setFont(ArialMT_Plain_16);
display->setTextAlignment(TEXT_ALIGN_LEFT);
String percent = String(printerClient.getProgressCompletion()) + "%";
display->drawString(64, 48, percent);
}
// Draw indicator to show next update
int updatePos = (printerClient.getProgressCompletion().toFloat() / float(100)) * 128;
display->drawRect(0, 41, 128, 6);
display->drawHorizontalLine(0, 42, updatePos);
display->drawHorizontalLine(0, 43, updatePos);
display->drawHorizontalLine(0, 44, updatePos);
display->drawHorizontalLine(0, 45, updatePos);
drawRssi(display);
} |
nice work, it has also given me an idea for something else. When a print is paused for example to change the filament a new screen appears informing the user regarding the pause. |
@victor7376 I rebased off your branch and made additional changes. Hopefully @Qrome can merge your changes in so I can PR against them. Either way feel free to implement them in your fork if you wish. The most notable changes are:
Changes: Precompiled Binaries: |
Added 3 new screens:
Also for the layer progress the code switches between different size fonts if the layer size is equal or greater than 1000.
added these features into OctoprintClient & RepetierClient.