Format a debug message
- Nitram
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 210
- Thank you received: 15
17 Apr 2022 06:36 #240441
by Nitram
Format a debug message was created by Nitram
Hello.
Per the manual, a debug message may include variables e.g. (debug, Tool number is #5400)
When I do something like this the returned message carries the value to a large number of decimal places
i.e. for say tool 20, it will return 20.000000000 in the on screen message.
Is there a way to format the output of the debug message to limit the decimal places?
I don't think that MSG i.e. (msg, xxxxx) can hold either variables or be formatted so I suspect a debug message is the only option, but I'm interested to hear any thoughts.
Thanks,
Marty.
Per the manual, a debug message may include variables e.g. (debug, Tool number is #5400)
When I do something like this the returned message carries the value to a large number of decimal places
i.e. for say tool 20, it will return 20.000000000 in the on screen message.
Is there a way to format the output of the debug message to limit the decimal places?
I don't think that MSG i.e. (msg, xxxxx) can hold either variables or be formatted so I suspect a debug message is the only option, but I'm interested to hear any thoughts.
Thanks,
Marty.
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
Less
More
- Posts: 7778
- Thank you received: 2074
17 Apr 2022 21:35 #240493
by cmorley
Replied by cmorley on topic Format a debug message
There is no way to format the float.
That would be a great little project though.
That would be a great little project though.
Please Log in or Create an account to join the conversation.
- Nitram
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 210
- Thank you received: 15
17 Apr 2022 23:05 #240518
by Nitram
Replied by Nitram on topic Format a debug message
I certainly don't personally need this functionality, and more for the fun of it, but how "little" is a "little project" like this?
Just intrigued about the back end workings....
Just intrigued about the back end workings....
Please Log in or Create an account to join the conversation.
- tommylight
- Online
- Moderator
Less
More
- Posts: 19479
- Thank you received: 6532
18 Apr 2022 00:12 #240525
by tommylight
Replied by tommylight on topic Format a debug message
-Off topic!
@ Nitram,
Did i see you in Instagram doing something related to 3D printing?
Just wondering if it is the same person.
@ Nitram,
Did i see you in Instagram doing something related to 3D printing?
Just wondering if it is the same person.
Please Log in or Create an account to join the conversation.
- Nitram
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 210
- Thank you received: 15
18 Apr 2022 00:14 #240526
by Nitram
Replied by Nitram on topic Format a debug message
No, not I!
Please Log in or Create an account to join the conversation.
- Nitram
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 210
- Thank you received: 15
18 Apr 2022 00:16 #240528
by Nitram
Replied by Nitram on topic Format a debug message
It is a fairly unique user name I guess, Martin backwards, but given the above I suspect there's more out there who have thought of it
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23170
- Thank you received: 4860
21 Apr 2022 00:29 #240770
by andypugh
github.com/LinuxCNC/linuxcnc/blob/master...erp_convert.cc#L1381
So perhaps one could parse the comment to replace that format string, such that "(DEBUG, %02.2f#<param>) would load a new format over a default variable rather than using the string literal.
Replied by andypugh on topic Format a debug message
It is formatted here as simply "%lf"I certainly don't personally need this functionality, and more for the fun of it, but how "little" is a "little project" like this?
Just intrigued about the back end workings....
github.com/LinuxCNC/linuxcnc/blob/master...erp_convert.cc#L1381
So perhaps one could parse the comment to replace that format string, such that "(DEBUG, %02.2f#<param>) would load a new format over a default variable rather than using the string literal.
Please Log in or Create an account to join the conversation.
Time to create page: 0.057 seconds