mirror of
https://github.com/Doodle3D/doodle3d-firmware.git
synced 2025-04-20 18:16:30 +02:00
Do not generate error when printer device exists without accompanying server. Fixes https://github.com/Doodle3D/doodle3d-client/issues/139.
This commit is contained in:
parent
fc9460fc82
commit
d254beb1ab
@ -29,10 +29,8 @@ local function operationsAccessOrFail(request, response)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local rv, printerState = printerAPI.state(request, response, true)
|
local rv, printerState = printerAPI.state(request, response, true)
|
||||||
if(rv == false) then
|
-- NOTE: rv being false means a printer device exists but no server is running for it, so it cannot be 'busy'
|
||||||
response:setError("Could not get printer state")
|
if rv == false then return true end
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
if printerState == 'buffering' or printerState == 'printing' or printerState == 'stopping' then
|
if printerState == 'buffering' or printerState == 'printing' or printerState == 'stopping' then
|
||||||
response:setFail("Printer is busy, please wait")
|
response:setFail("Printer is busy, please wait")
|
||||||
|
@ -29,10 +29,8 @@ local function operationsAccessOrFail(request, response)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local rv, printerState = printerAPI.state(request, response, true)
|
local rv, printerState = printerAPI.state(request, response, true)
|
||||||
if(rv == false) then
|
-- NOTE: rv being false means a printer device exists but no server is running for it, so it cannot be 'busy'
|
||||||
response:setError("Could not get printer state")
|
if rv == false then return true end
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
if printerState == 'buffering' or printerState == 'printing' or printerState == 'stopping' then
|
if printerState == 'buffering' or printerState == 'printing' or printerState == 'stopping' then
|
||||||
response:setFail("Printer is busy, please wait")
|
response:setFail("Printer is busy, please wait")
|
||||||
|
@ -34,10 +34,8 @@ local function operationsAccessOrFail(request, response)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local rv, printerState = printerAPI.state(request, response, true)
|
local rv, printerState = printerAPI.state(request, response, true)
|
||||||
if(rv == false) then
|
-- NOTE: rv being false means a printer device exists but no server is running for it, so it cannot be 'busy'
|
||||||
response:setError("Could not get printer state")
|
if rv == false then return true end
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
if printerState == 'buffering' or printerState == 'printing' or printerState == 'stopping' then
|
if printerState == 'buffering' or printerState == 'printing' or printerState == 'stopping' then
|
||||||
response:setFail("Printer is busy, please wait")
|
response:setFail("Printer is busy, please wait")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user