0
0
mirror of https://github.com/Doodle3D/doodle3d-firmware.git synced 2024-12-22 11:03:48 +01:00

remove total lines

This commit is contained in:
Simon Voordouw 2017-06-13 14:40:20 +02:00
parent aec8343bc0
commit 6b4e4e934c

View File

@ -18,6 +18,10 @@ JSON = (loadfile "/usr/share/lua/wifibox/util/JSON.lua")()
local p3d = require("print3d") local p3d = require("print3d")
local printer = p3d.getPrinter(arg[1]) local printer = p3d.getPrinter(arg[1])
if printer == nil then
log("error connecting to printer")
return
end
local remote = arg[2] local remote = arg[2]
@ -26,6 +30,7 @@ local finished = false
local id = arg[3] local id = arg[3]
log("gcode file id: " .. id) log("gcode file id: " .. id)
log("gcode server: " .. remote)
local info = JSON:decode(io.popen("wget -qO - " .. remote .. "/info/" .. id):read("*a")) local info = JSON:decode(io.popen("wget -qO - " .. remote .. "/info/" .. id):read("*a"))
@ -63,7 +68,7 @@ do
local f = io.popen("wget -qO - " .. remote .. "/fetch/" .. id .. "/" .. current_line) local f = io.popen("wget -qO - " .. remote .. "/fetch/" .. id .. "/" .. current_line)
local line = f:read() local line = f:read()
while line ~= nil do while line ~= nil do
printer:appendGcode(line, total_lines) printer:appendGcode(line)
current_line = current_line + 1 current_line = current_line + 1
line = f:read() line = f:read()
end end