LazeMSS / OctoPrint-TopTemp

Topbar temperature plugin for OctoPrint
21 stars 2 forks source link

[FR] show all passed decimal places #56

Closed electronicm closed 3 years ago

electronicm commented 3 years ago

Is it possible to display all the decimal places passed without specifying a fixed length? For example, if the field "Number of digits" is empty.

This would help me a lot, because I am currently still trying to map the layer state. Your plugin checks if the return value of the RegEx is an int or float. Therefore I have to send via 'DisplayLayerProgress' Layer [current_layer].[total_layers] to the printer. Per 'Gcode sent' I then check for ^M117 Layer ([\d\.]+) and output / as decimal character. Since the maximum number of layers can range from one to six digits, the fixed length of the decimal places leads to the wrong display of the maximum layers.

Example1:

Number of digits: 4
Current layer = 5
Max Layers = 256
-> Output to printer: M117 Layer 5.256
-> RegEx match: 5.256
-> Output to TopTemp: 5/2560

Example2:

Number of digits: 2
Current layer = 5
Max Layers = 256
-> Output to printer: M117 Layer 5.256
-> RegEx match: 5.256
-> Output in TopTemp: 5/25

The expected output of both examples would be 5/256.

LazeMSS commented 3 years ago

Not sure if I understand what you mean - can you explain a bit more.

I will probally make the following new "inputs" in the next version:

electronicm commented 3 years ago

At the moment: If I currently enter 2 in 'Number of digits' and

If I currently enter 0 in 'Number of digits' and

However, I need the possibility that the decimal places are not adjusted. If I leave the 'Number of digits' field blank or whatever you define and -recive '3.243' via RegEx, '3.243' is also output -recive '5.27' via RegEx, '5.27' is also output -recive '7.1' via RegEx, '7.1' is also output The output of the RegEx should be passed on in the code without adjusting the places after the comma.

Afterwards, it should continue to genes normally in the code and replace the '.' with the character defined under 'Decimal separator'.

LazeMSS commented 3 years ago

Ahh NOW i get it - will fix it right away

electronicm commented 3 years ago

Not sure if I understand what you mean - can you explain a bit more.

I will probally make the following new "inputs" in the next version:

  • layer height/z
  • progress in %/minutes
  • remaining in %/minutes and more

Do you also have something like

LazeMSS commented 3 years ago

Yes think so.

LazeMSS commented 3 years ago

Included in: https://github.com/LazeMSS/OctoPrint-TopTemp/releases/tag/0.0.1.6

electronicm commented 3 years ago

It works great after I figure out what I need to enter. The help text in d7e507e toptemp_settings.jinja2 line163 is only displayed in the bed settings.

LazeMSS commented 3 years ago

Thanks will fix ASAP