diff --git a/src/util/printer.lua b/src/util/printer.lua index 0b3ce67..13f65a2 100644 --- a/src/util/printer.lua +++ b/src/util/printer.lua @@ -2,7 +2,7 @@ local log = require('util.logger') local utils = require('util.utils') local printDriver = require('print3d') -local SUPPORTED_PRINTERS = { +local SUPPORTED_PRINTERS = { rigidbot = "Rigidbot", ultimaker = "Ultimaker", makerbot_replicator2 = "MakerBot Replicator2", @@ -35,7 +35,7 @@ local SUPPORTED_PRINTERS = { tantillus = "Tantillus", vision_3d_printer = "Vision 3D Printer" } -local SUPPORTED_BAUDRATES = { +local SUPPORTED_BAUDRATES = { ["115200"] = "115200 bps", ["2500000"] = "2500000 bps" } @@ -55,15 +55,15 @@ end --returns a printer instance or nil (and sets error state on response in the latter case) function M.createPrinterOrFail(deviceId, response) - log:info("API:printer:createPrinterOrFail: "..utils.dump(deviceId)) + --log:debug("API:printer:createPrinterOrFail: "..utils.dump(deviceId)) local msg,printer = nil, nil - + if deviceId == nil or deviceId == "" then printer,msg = printDriver.getPrinter() - else + else printer,msg = printDriver.getPrinter(deviceId) end - + if not printer then response:setError("could not open printer driver (" .. msg .. ")") response:addData('id', deviceId)