Skip to content
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

[FR] make the date/time stamp of the 'compile' available to display. #27589

Closed
dbyy opened this issue Dec 15, 2024 · 8 comments · May be fixed by #27590
Closed

[FR] make the date/time stamp of the 'compile' available to display. #27589

dbyy opened this issue Dec 15, 2024 · 8 comments · May be fixed by #27590
Labels
T: Feature Request Features requested by users.

Comments

@dbyy
Copy link

dbyy commented Dec 15, 2024

Is your feature request related to a problem? Please describe.

no, not related to a problem.

Are you looking for hardware support?

n/a

Describe the feature you want

It would be nice to have the date/time stamp of the last compile (from the firmware.bin file) available to display on the printers screen when running the firmware.
When testing some features in Marlin, I may end up with several compilations in a short period of time.
To have the date/time stamp available on the display helps to keep the different versions apart.
It would be a 'nice to have'.

Additional context

I'm not thinking of a new '#define". More of an internal variable that can be displayed on the printers screen

@dbyy dbyy added the T: Feature Request Features requested by users. label Dec 15, 2024
@ellensp ellensp changed the title make the date/time stamp of the 'compile' available to display. [FR] make the date/time stamp of the 'compile' available to display. Dec 15, 2024
@robherc
Copy link
Contributor

robherc commented Dec 15, 2024

Is there a reason why the compile datetimestamp from Serial Report isn't sufficient here?

@ellensp
Copy link
Contributor

ellensp commented Dec 16, 2024

this is almost trivial

When BUILDDATE is defined add a submenu "Build Datetime" to the About Printer menu
This menu shows the build date and time
I didn't want to add it to the Printer info menu, as there is already a release date and time in there and it was just confusing.

Eg added submenu
Screenshot from 2024-12-16 12-58-26

The build date and time
Screenshot from 2024-12-16 12-57-11

diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h
index 564f44df60..f992dd7884 100644
--- a/Marlin/Configuration_adv.h
+++ b/Marlin/Configuration_adv.h
@@ -1546,8 +1546,9 @@
   #endif
 
   // Include a page of printer information in the LCD Main Menu
-  //#define LCD_INFO_MENU
+  #define LCD_INFO_MENU
   #if ENABLED(LCD_INFO_MENU)
+    #define BUILDDATE
     //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
   #endif
 
diff --git a/Marlin/src/lcd/menu/menu_info.cpp b/Marlin/src/lcd/menu/menu_info.cpp
index 2db0caa805..81ca11beca 100644
--- a/Marlin/src/lcd/menu/menu_info.cpp
+++ b/Marlin/src/lcd/menu/menu_info.cpp
@@ -263,6 +263,18 @@ void menu_info_board() {
 
 #endif
 
+//
+// "Build Date" submenu
+//
+#if ENABLED(BUILDDATE)
+  void menu_info_build() {
+    if (ui.use_click()) return ui.go_back();
+    START_SCREEN();
+    STATIC_ITEM_F(F(__DATE__ " " __TIME__));
+    END_SCREEN();
+  }
+#endif
+
 //
 // "About Printer" submenu
 //
@@ -306,6 +318,11 @@ void menu_info() {
   }
   #endif
 
+  #if ENABLED(BUILDDATE)
+    SUBMENU(MSG_INFO_BUILD, menu_info_build);
+  #endif
+
+
   END_MENU();
 }
 

Everything needs a define, so it can be removed entirely from the code.

@dbyy
Copy link
Author

dbyy commented Dec 16, 2024

This is awesome.
Just wondering, on which version of configuration/configuration_adv.h is the 'diff' based upon?
I'm using 'configs' of Marlin 2.1.2.4 with BTT-SKR-Mini-E3/BTT TF35 and can't locate the spots so easily in my files.
Thanks for the suggestions.

@ellensp
Copy link
Contributor

ellensp commented Dec 16, 2024

based on bugfix 2.1.x

@ellensp
Copy link
Contributor

ellensp commented Dec 16, 2024

this is for marlin menus, to update the touch interface would require you to update the btt tft firmware

@ellensp
Copy link
Contributor

ellensp commented Dec 16, 2024

I have created a PR to add this

@ellensp ellensp closed this as completed Dec 16, 2024
@dbyy
Copy link
Author

dbyy commented Dec 16, 2024

based on bugfix 2.1.x

I figured out where it has to go.
The only problem is (and I'm not a c++ guru) I'm receiving an error when compiling 'Marlin/src/lcd/menu/menu_info.cpp: In function 'void menu_info_board()': Marlin/src/lcd/menu/menu_info.cpp:232:5: error: a function-definition is not allowed here before '{' token
and later on as consequence of that
Marlin/src/lcd/menu/menu_info.cpp:333:29: error: 'menu_info_build' was not declared in this scope; did you mean 'menu_info_board'? 333 | SUBMENU(MSG_INFO_BUILD, menu_info_build); // Printer Stats >
So at the moment I'm stuck with that. Too bad.
Any help is much appreciated even though its not really a problem of the Marlin code.
TIA

@dbyy
Copy link
Author

dbyy commented Dec 16, 2024

Update:
I figured it out.
I positioned the changes at the wrong spot in "menu_info.cpp".
After I consulted the original file from bug-fix 2.1.x, I changed the location (to the right spot), and now it's compiling w/o any error.
Have to flash the firmware and see how it looks on the display.
Thanks again for all feedback.

@thisiskeithb thisiskeithb linked a pull request Dec 18, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: Feature Request Features requested by users.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants