mirror of
https://github.com/Doodle3D/doodle3d-firmware.git
synced 2024-12-22 19:13:49 +01:00
Improve printer/print logging, partial fix for https://github.com/Doodle3D/doodle3d-firmware/issues/58.
This commit is contained in:
parent
00d77c491d
commit
ca45f15151
@ -120,7 +120,6 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function M.heatup_POST(request, response)
|
function M.heatup_POST(request, response)
|
||||||
|
|
||||||
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
|
||||||
@ -145,8 +144,6 @@ function M.heatup_POST(request, response)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function M.stop_POST(request, response)
|
function M.stop_POST(request, response)
|
||||||
log:info(MOD_ABBR, "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
|
||||||
@ -183,8 +180,6 @@ end
|
|||||||
--accepts: seq_total(int) (total number of gcode chunks to be appended, must be given until clear() after given once, and stay the same)
|
--accepts: seq_total(int) (total number of gcode chunks to be appended, must be given until clear() after given once, and stay the same)
|
||||||
--returns: when the gcode buffer cannot accept the gcode, or the IPC transaction fails, a fail with a (formal, i.e., parseable) status argument will be returned
|
--returns: when the gcode buffer cannot accept the gcode, or the IPC transaction fails, a fail with a (formal, i.e., parseable) status argument will be returned
|
||||||
function M.print_POST(request, response)
|
function M.print_POST(request, response)
|
||||||
log:info(MOD_ABBR, "API:printer/print")
|
|
||||||
|
|
||||||
local controllerIP = accessManager.getController()
|
local controllerIP = accessManager.getController()
|
||||||
local hasControl = false
|
local hasControl = false
|
||||||
if controllerIP == "" then
|
if controllerIP == "" then
|
||||||
@ -194,7 +189,6 @@ function M.print_POST(request, response)
|
|||||||
hasControl = true
|
hasControl = true
|
||||||
end
|
end
|
||||||
|
|
||||||
log:info(MOD_ABBR, " hasControl: "..utils.dump(hasControl))
|
|
||||||
if not hasControl then
|
if not hasControl then
|
||||||
response:setFail("No control access")
|
response:setFail("No control access")
|
||||||
return
|
return
|
||||||
@ -210,6 +204,8 @@ function M.print_POST(request, response)
|
|||||||
local argSeqTotal = request:get("seq_total") or -1
|
local argSeqTotal = request:get("seq_total") or -1
|
||||||
local remoteHost = request:getRemoteHost()
|
local remoteHost = request:getRemoteHost()
|
||||||
|
|
||||||
|
log:info(MOD_ABBR, "print chunk metadata: total_lines=" .. argTotalLines .. ", seq_number=" .. argSeqNumber .. ", seq_total=" .. argSeqTotal)
|
||||||
|
|
||||||
local printer,msg = printerUtils.createPrinterOrFail(argId, response)
|
local printer,msg = printerUtils.createPrinterOrFail(argId, response)
|
||||||
if not printer or not printer:hasSocket() then return end
|
if not printer or not printer:hasSocket() then return end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user