mirror of
https://github.com/Doodle3D/doodle3d-firmware.git
synced 2024-12-22 11:03:48 +01:00
Supported printers and baudrate api call
This commit is contained in:
parent
24b773bd6f
commit
077a0b6818
@ -1,11 +1,11 @@
|
|||||||
local log = require('util.logger')
|
local log = require('util.logger')
|
||||||
local settings = require('util.settings')
|
local settings = require('util.settings')
|
||||||
|
local printer = require('util.printer')
|
||||||
|
|
||||||
local M = {
|
local M = {
|
||||||
isApi = true
|
isApi = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function M._global_GET(request, response)
|
function M._global_GET(request, response)
|
||||||
response:setSuccess()
|
response:setSuccess()
|
||||||
for k,v in pairs(request:getAll()) do
|
for k,v in pairs(request:getAll()) do
|
||||||
@ -35,4 +35,18 @@ function M.all_GET(request, response)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.supportedprinters_GET(request, response)
|
||||||
|
response:setSuccess()
|
||||||
|
for k,v in pairs(printer.supportedPrinters()) do
|
||||||
|
response:addData(k,v)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.supportedbaudrates_GET(request, response)
|
||||||
|
response:setSuccess()
|
||||||
|
for k,v in pairs(printer.supportedBaudRates()) do
|
||||||
|
response:addData(k,v)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
49
src/util/printer.lua
Normal file
49
src/util/printer.lua
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
local SUPPORTED_PRINTERS = {
|
||||||
|
rigidbot = "Rigidbot",
|
||||||
|
ultimaker = "Ultimaker",
|
||||||
|
makerbot_replicator2 = "MakerBot Replicator2",
|
||||||
|
makerbot_thingomatic = "MakerBot Thing-o-matic",
|
||||||
|
printrbot = "Printrbot",
|
||||||
|
bukobot = "Bukobot",
|
||||||
|
cartesio = "Cartesio",
|
||||||
|
cyrus = "Cyrus",
|
||||||
|
delta_rostockmax = "Delta RostockMax",
|
||||||
|
deltamaker = "Deltamaker",
|
||||||
|
eventorbot = "EventorBot",
|
||||||
|
felix = "Felix",
|
||||||
|
gigabot = "Gigabot",
|
||||||
|
kossel = "Kossel",
|
||||||
|
leapfrog_creatr = "LeapFrog Creatr",
|
||||||
|
lulzbot_aO_101 = "LulzBot AO-101",
|
||||||
|
makergear_m2 = "MakerGear M2",
|
||||||
|
makergear_prusa = "MakerGear Prusa",
|
||||||
|
makibox = "Makibox",
|
||||||
|
orca_0_3 = "Orca 0.3",
|
||||||
|
ord_bot_hadron = "ORD Bot Hadron",
|
||||||
|
printxel_3d = "Printxel 3D",
|
||||||
|
prusa_i3 = "Prusa I3",
|
||||||
|
prusa_iteration_2 = "Prusa Iteration 2",
|
||||||
|
rapman = "RapMan",
|
||||||
|
reprappro_huxley = "RepRapPro Huxley",
|
||||||
|
reprappro_mendel = "RepRapPro Mendel",
|
||||||
|
robo_3d_printer = "RoBo 3D Printer",
|
||||||
|
shapercube = "ShaperCube",
|
||||||
|
tantillus = "Tantillus",
|
||||||
|
vision_3d_printer = "Vision 3D Printer"
|
||||||
|
}
|
||||||
|
local SUPPORTED_BAUDRATES = {
|
||||||
|
["115200"] = "115200 bps",
|
||||||
|
["2500000"] = "2500000 bps"
|
||||||
|
}
|
||||||
|
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
function M.supportedPrinters()
|
||||||
|
return SUPPORTED_PRINTERS
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.supportedBaudRates()
|
||||||
|
return SUPPORTED_BAUDRATES
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
Loading…
Reference in New Issue
Block a user