mirror of
https://github.com/Doodle3D/doodle3d-firmware.git
synced 2024-12-22 11:03:48 +01:00
rename remote to gcodeServer for clarity
This commit is contained in:
parent
8eb83ac6a0
commit
6729af7064
@ -252,8 +252,8 @@ function M.fetch_POST(request, response)
|
|||||||
response:setError("no socket found")
|
response:setError("no socket found")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local remote = settings.get('gcode.server')
|
local gcodeServer = settings.get('gcode.server')
|
||||||
if remote == nil then
|
if gcodeServer == nil then
|
||||||
response:setError("no gcode server configured")
|
response:setError("no gcode server configured")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -262,7 +262,8 @@ function M.fetch_POST(request, response)
|
|||||||
response:setError("no id supplied")
|
response:setError("no id supplied")
|
||||||
return
|
return
|
||||||
end
|
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)
|
io.open("/tmp/current-print", 'w+').write(id)
|
||||||
response:setSuccess()
|
response:setSuccess()
|
||||||
end
|
end
|
||||||
|
@ -6,7 +6,7 @@ local function log(message)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if (table.getn(arg) == 0) then
|
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
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -23,16 +23,16 @@ if printer == nil then
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local remote = arg[2]
|
local gcodeServer = arg[2]
|
||||||
|
|
||||||
local finished = false
|
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)
|
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 current_line = 0
|
||||||
local total_lines = tonumber(info["lines"])
|
local total_lines = tonumber(info["lines"])
|
||||||
@ -65,7 +65,7 @@ end
|
|||||||
|
|
||||||
while(not finished)
|
while(not finished)
|
||||||
do
|
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()
|
local line = f:read()
|
||||||
while line ~= nil do
|
while line ~= nil do
|
||||||
printer:appendGcode(line, total_lines, { seq_number = -1, seq_total = -1, source = id })
|
printer:appendGcode(line, total_lines, { seq_number = -1, seq_total = -1, source = id })
|
||||||
|
Loading…
Reference in New Issue
Block a user