0
0
mirror of https://github.com/Doodle3D/doodle3d-firmware.git synced 2024-12-22 02:53:49 +01:00

rename remote to gcodeServer for clarity

This commit is contained in:
Simon Voordouw 2017-06-20 15:18:36 +02:00
parent 8eb83ac6a0
commit 6729af7064
2 changed files with 9 additions and 8 deletions

View File

@ -252,8 +252,8 @@ function M.fetch_POST(request, response)
response:setError("no socket found")
return
end
local remote = settings.get('gcode.server')
if remote == nil then
local gcodeServer = settings.get('gcode.server')
if gcodeServer == nil then
response:setError("no gcode server configured")
return
end
@ -262,7 +262,8 @@ function M.fetch_POST(request, response)
response:setError("no id supplied")
return
end
io.popen("print-fetch " .. socket .. " " .. remote .. " " .. id .. gcodeFiles)
io.popen("print-fetch " .. socket .. " " .. gcodeServer .. " " .. id .. gcodeFiles)
io.open("/tmp/current-print", 'w+').write(id)
response:setSuccess()
end

View File

@ -6,7 +6,7 @@ local function log(message)
end
if (table.getn(arg) == 0) then
print("Usage: ./print-fetch {printerSocket} {remoteURL} {id} [startGcode] [endGCode]")
print("Usage: ./print-fetch {printerSocket} {gcodeServerURL} {id} [startGcode] [endGCode]")
return
end
@ -23,16 +23,16 @@ if printer == nil then
return
end
local remote = arg[2]
local gcodeServer = arg[2]
local finished = false
local id = arg[3]
log("gcode file id: " .. id)
log("gcode server: " .. remote)
log("gcode server: " .. gcodeServer)
local info = JSON:decode(io.popen("wget -qO - " .. remote .. "/info/" .. id):read("*a"))
local info = JSON:decode(io.popen("wget -qO - " .. gcodeServer .. "/info/" .. id):read("*a"))
local current_line = 0
local total_lines = tonumber(info["lines"])
@ -65,7 +65,7 @@ end
while(not finished)
do
local f = io.popen("wget -qO - " .. remote .. "/fetch/" .. id .. "/" .. current_line)
local f = io.popen("wget -qO - " .. gcodeServer .. "/fetch/" .. id .. "/" .. current_line)
local line = f:read()
while line ~= nil do
printer:appendGcode(line, total_lines, { seq_number = -1, seq_total = -1, source = id })