0
0
mirror of https://github.com/Doodle3D/doodle3d-firmware.git synced 2024-11-05 06:03:23 +01:00

Rename sequence_* in API responses to seq_* to be consistent with printer/print POST arguments.

This commit is contained in:
Wouter R 2016-04-19 12:10:40 +02:00
parent 6a26cf3005
commit 7cc345d729

View File

@ -64,8 +64,8 @@ function M.progress(request, response)
response:addData('total_lines', totalLines) response:addData('total_lines', totalLines)
response:addData('buffer_size', bufferSize) response:addData('buffer_size', bufferSize)
response:addData('max_buffer_size', maxBufferSize) response:addData('max_buffer_size', maxBufferSize)
response:addData('sequence_number', seqNumber) response:addData('seq_number', seqNumber)
response:addData('sequence_total', seqTotal) response:addData('seq_total', seqTotal)
elseif progress == false then elseif progress == false then
response:addData('status', bufferedLines) response:addData('status', bufferedLines)
response:setFail("could not get progress information (" .. bufferedLines .. ")") response:setFail("could not get progress information (" .. bufferedLines .. ")")
@ -177,8 +177,8 @@ local function addSequenceNumbering(printer, 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()
if currentLine then if currentLine then
response:addData('sequence_number', seqNumber) response:addData('seq_number', seqNumber)
response:addData('sequence_total', seqTotal) response:addData('seq_total', seqTotal)
--else --else
--Note: getProgress failure is ignored (unlikely to happen if the other calls work, and also not really fatal here). --Note: getProgress failure is ignored (unlikely to happen if the other calls work, and also not really fatal here).
-- Alternatively, we could still add the fields with a special value (NaN is not supported by json, so perhaps -2?) -- Alternatively, we could still add the fields with a special value (NaN is not supported by json, so perhaps -2?)