mirror of
https://github.com/Doodle3D/doodle3d-firmware.git
synced 2024-12-22 02:53:49 +01:00
save print id and add it to the progres api
This commit is contained in:
parent
3b6b9618cc
commit
8eb83ac6a0
@ -56,7 +56,17 @@ function M.progress(request, response)
|
|||||||
-- NOTE: despite their names, `currentLine` is still the error indicator and `bufferedLines` the message in such case.
|
-- NOTE: despite their names, `currentLine` is still the error indicator and `bufferedLines` the message in such case.
|
||||||
local currentLine,bufferedLines,totalLines,bufferSize,maxBufferSize,seqNumber,seqTotal = printer:getProgress()
|
local currentLine,bufferedLines,totalLines,bufferSize,maxBufferSize,seqNumber,seqTotal = printer:getProgress()
|
||||||
|
|
||||||
|
local idfile = io.open('/tmp/currentprint')
|
||||||
|
local printId
|
||||||
|
if idfile ~= nil then
|
||||||
|
printId = idfile:read('*a')
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
response:addData('id', argId)
|
response:addData('id', argId)
|
||||||
|
if printid ~= nil then
|
||||||
|
response:addData('current_print', printid)
|
||||||
|
end
|
||||||
if currentLine then
|
if currentLine then
|
||||||
response:setSuccess()
|
response:setSuccess()
|
||||||
response:addData('current_line', currentLine)
|
response:addData('current_line', currentLine)
|
||||||
@ -253,6 +263,7 @@ function M.fetch_POST(request, response)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
io.popen("print-fetch " .. socket .. " " .. remote .. " " .. id .. gcodeFiles)
|
io.popen("print-fetch " .. socket .. " " .. remote .. " " .. id .. gcodeFiles)
|
||||||
|
io.open("/tmp/current-print", 'w+').write(id)
|
||||||
response:setSuccess()
|
response:setSuccess()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user