Displaying timer on web interface
-
Hello,
In my start code, I have a bed temperature stabilization delay as my bed typically overshoots the desired temp and after some time reaches steady state (my hypothesis is the actual top surface of the bed doesn't reach temperature when the thermistor reads the temperature so the temperature difference to the outside world is lower and as such a lower power/heat-loss until steady state is reached; anyway doesn't matter).
My delay is 30s, and I'd like to display the 30s as a timer for the user that counts down by the second (30, 29, 28, etc). I can do this with a loop and a variable and constantly write it to the console but that inflates the console messages quickly. Is there a way to display a single message that persists until the timer runs out (a pop-up on the Status tab) that would count down like that?
-
@Merlin246
You could do it with M291 and a loop.
Here is an extract from a macro I use to preheat for the current filament
The down side is that the user can't do anything while the message box is displayed, so if something is wrong an e-stop may be required.var TargetTemp = heat.coldExtrudeTemperature+10 var thisHeater = tools[state.currentTool].heaters[0] ;show progress of heating from lower temp while (heat.heaters[tools[state.currentTool].heaters[0]].current) < (var.TargetTemp - 2) M291 R"Preheating.. Please wait" P{"Current temp = " ^ heat.heaters[{var.thisHeater}].current ^ " : target = " ^ (var.TargetTemp) } S0 T2 G4 S1.8 if global.Cancelled = true M108 M98 P"0:/macros/heating/all_heaters_off.g" abort "heating cancelled" ;show progress of cooling from hotter temp if (heat.heaters[{var.thisHeater}].current) > (var.TargetTemp + 1) echo "Fan on to help cooling faster" M106 S1 while (heat.heaters[{var.thisHeater}].current) > (var.TargetTemp + 2) M291 R"Preheating.. Please wait" P{"Current temp = " ^ heat.heaters[{var.thisHeater}].current ^ " : target = " ^ (var.TargetTemp)} S0 T2 G4 S1.8 if global.Cancelled = true M108 M98 P"0:/macros/heating/all_heaters_off.g" abort "heating cancelled" echo "nozzle temp done" M106 S0 ; part fan off