mirror of
https://github.com/Doodle3D/doodle3d-firmware.git
synced 2025-01-03 08:13:49 +01:00
Replacing variables in endcode on API:printer/stop
This commit is contained in:
parent
c3bb0359bf
commit
8ab87312b3
@ -106,6 +106,8 @@ end
|
|||||||
|
|
||||||
function M.stop_POST(request, response)
|
function M.stop_POST(request, response)
|
||||||
|
|
||||||
|
log:info("API:printer/stop")
|
||||||
|
|
||||||
if not accessManager.hasControl(request.remoteAddress) then
|
if not accessManager.hasControl(request.remoteAddress) then
|
||||||
response:setFail("No control access")
|
response:setFail("No control access")
|
||||||
return
|
return
|
||||||
@ -115,7 +117,13 @@ function M.stop_POST(request, response)
|
|||||||
local printer,msg = printerUtils.createPrinterOrFail(argId, response)
|
local printer,msg = printerUtils.createPrinterOrFail(argId, response)
|
||||||
if not printer then return end
|
if not printer then return end
|
||||||
|
|
||||||
|
-- replacing {printingTemp} and {preheatTemp} in endgcode
|
||||||
|
local printingTemperature = settings.get('printer.temperature')
|
||||||
|
local preheatTemperature = settings.get('printer.heatup.temperature')
|
||||||
local endGcode = settings.get('printer.endgcode')
|
local endGcode = settings.get('printer.endgcode')
|
||||||
|
endGcode = string.gsub(endGcode,"{printingTemp}",printingTemperature)
|
||||||
|
endGcode = string.gsub(endGcode,"{preheatTemp}",preheatTemperature)
|
||||||
|
|
||||||
local rv,msg = printer:stopPrint(endGcode)
|
local rv,msg = printer:stopPrint(endGcode)
|
||||||
|
|
||||||
response:addData('id', argId)
|
response:addData('id', argId)
|
||||||
|
Loading…
Reference in New Issue
Block a user