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

Feature Request: Custom M117 formatting #5

Closed
Konlii opened this issue Jun 15, 2018 · 8 comments
Closed

Feature Request: Custom M117 formatting #5

Konlii opened this issue Jun 15, 2018 · 8 comments

Comments

@Konlii
Copy link

Konlii commented Jun 15, 2018

Seems much more accurate than S3D, which is great.

Unfortunately, generated M117 lines do not fit onto Wanhao i3 Plus LCD screen using ADVi3++ Version 3.0.2 firmware, truncating remaining time info.

Is it possible to add a way to specify custom M117 formatting? Such as:

%p'% Remaining ( '%h':'%m':'%s' )'

That way I can change it to something like '%h':'%m' Remaining' since ADVi3++ already shows percentage complete and seconds aren't worth much given how infrequently this updates the display (unless you also add an option generate more M117 lines to update the display every second? Though it doesn't seem to be accurate down to the second anyway).

@arhi
Copy link
Owner

arhi commented Jun 16, 2018

with regards to "every second" you can use
--percent_step 1
to generate M117 every 1% ... so not every second but... IIRC you can even do
--percent_step 0.1
but I doubt it will work ok :D
generally we could push M117 between every G-code statement but... :D I assume that was a joke

as for the formatting, yes, I was thinking about adding this too myself since I found some firmwares that require %% instead of % so a format option makes sense..

@arhi
Copy link
Owner

arhi commented Jun 17, 2018

@Konlii try the v0.8 there's now --m117_format option, if option is not set it behaves like you called it with

--m117_format "M117 %p%% Remaining %w weeks %d days ( %h:%m:%s )"

available substitutions are:
%w - number of weeks
%d - number of days
%h - number of hours
%m - number of minutes
%s - number of seconds
%S - number of seconds + minutes * 60 + hours * 60 * 60 + days * 60 * 60 * 24 + weeks * ...
%p - percentage
%% - a % sign
%q - a " sign

please try it out

@arhi
Copy link
Owner

arhi commented Jun 17, 2018

do not forget to add the M117 (case sensitive) at the beginning of the format!! the code is intentionally not adding M117 at the beginning (as some firmware might use some other code, or you might want to use some other code to pass the info)

@arhi arhi closed this as completed Jun 17, 2018
@Konlii
Copy link
Author

Konlii commented Jun 20, 2018

The --m117_format option doesn't seem to be working properly.

If I don't include --m117_format it generates the M117 line as expected. However, manually adding --m117_format "M117 %p%% Remaining %w weeks %d days ( %h:%m:%s )" only generates the following without adding any of the actual numbers:

M117 w weeks h:s )

Manually adding --m117_format "M117 %h:%m:%s Remaining" only generates:

M117 m:s Remaining

@arhi
Copy link
Owner

arhi commented Jun 20, 2018

that's weird, are you adding those quotes around it? are you calling it like this from s3d or from some batch file or directly from command prompt? can you try like this:

image

> gcodestat.exe -a 1000 --quiet --gcode=samples\024707.gcode --output=\tmp\brisi.gcode --m117_format "M117 %h:%m:%s"

> head.exe -1 e:\tmp\brisi.gcode
M117 02:22:24

> gcodestat.exe -a 1000 --quiet --gcode=samples\024707.gcode --output=\tmp\brisi.gcode --m117_format "M117 fdsfsd %p %% %w %d %h:%m:%s"

> head.exe -1 e:\tmp\brisi.gcode
M117 fdsfsd 100 % 0 0 02:22:24

> gcodestat.exe -a 1000 --quiet --gcode=samples\024707.gcode --output=\tmp\brisi.gcode --m117_format "M117 %p%% Remaining %w weeks %d days ( %h:%m:%s )"

> e:\bin\WinAVR\utils\bin\head.exe -1 e:\tmp\brisi.gcode
M117 100% Remaining 0 weeks 0 days ( 02:22:24 )

not trying to "works on my box" solve it but need to understand what's actually happening on your :)

@arhi arhi reopened this Jun 20, 2018
@Konlii
Copy link
Author

Konlii commented Jun 20, 2018

Oh sorry, I forgot to mention my details:

Win 7 x64
calling the batch file from S3D (c:\gcodestat\gs.bat "[output_filepath]")
changes I made to the batch file:

C:\gcodestat\gcodestat.exe --alert -d 0.02 -a 1000 --gcode="%if%" --output="%of%" --m117_format "M117 %p%% Remaining %w weeks %d days ( %h:%m:%s )"

REM C:\gcodestat\gcodestat.exe --alert -a 1000 --gcode="%if%" --output="%of%" --api_key=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA --api_url="http://octopi.local/api/files/local" 

Just tried it from CLI and

gcodestat.exe -a 1000 --quiet --gcode=samples\test.gcode --output=test_M117.gcode --m117_format "M117 %h:%m:%s"

works perfectly

@Konlii
Copy link
Author

Konlii commented Jun 20, 2018

Duh! Needs double percent signs for the batch file. Working now.

--m117_format "M117 %%h:%%m:%%s"

@arhi
Copy link
Owner

arhi commented Jun 20, 2018

yeah looks like bat interpreter is eating those up ... need to update the README to reflect that!!!

@arhi arhi closed this as completed Jun 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants