diff --git a/src/conf_defaults.lua b/src/conf_defaults.lua index 14841d7..697f122 100644 --- a/src/conf_defaults.lua +++ b/src/conf_defaults.lua @@ -9,7 +9,7 @@ - type: used for basic type checking, one of bool, int, float or string - description: A descriptive text usable by API clients - min, max, regex: optional constraints (min and max constrain value for numbers, or length for strings) - + NOTE that the all-caps definitions will be changed into configuration keys, or moved to a different location ]]-- local printer = require('util.printer') @@ -54,9 +54,9 @@ M.printer_type = { default = 'ultimaker', type = 'string', description = '', - isValid = function(value) + isValid = function(value) local printers = printer.supportedPrinters() - return printers[value] ~= nil + return printers[value] ~= nil end } @@ -64,9 +64,9 @@ M.printer_baudrate = { default = '115200', type = 'int', description = '', - isValid = function(value) + isValid = function(value) local baudrates = printer.supportedBaudRates() - return baudrates[tostring(value)] ~= nil + return baudrates[tostring(value)] ~= nil end } @@ -124,7 +124,13 @@ M.printer_firstLayerSlow = { description = 'Print the first layer slowly to get a more stable start' } -M.printer_heatupTemperature = { +M.printer_heatup_enabled = { + default = true, + type = 'bool', + description = '' +} + +M.printer_heatup_temperature = { default = 180, type = 'int', description = '' @@ -163,12 +169,6 @@ M.printer_enableTraveling = { description = '' } -M.printer_autoWarmUpCommand = { - default = 'M104 S180', - type = 'string', - description = '' -} - M.printer_startgcode = { default = ';Generated with Doodle3D\nG21 ;metric values\nG91 ;relative positioning\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to min endstops\nG1 Z15 F9000 ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E10 ;extrude 10mm of feed stock\nG92 E0 ;zero the extruded length again\nG92 E0 ;zero the extruded length again\nG1 F9000\nG90 ;absolute positioning\nM117 Printing Doodle... ;display message (20 characters to clear whole screen)', type = 'string', diff --git a/src/rest/api/api_printer.lua b/src/rest/api/api_printer.lua index b0691ba..d4f02ed 100644 --- a/src/rest/api/api_printer.lua +++ b/src/rest/api/api_printer.lua @@ -121,7 +121,7 @@ function M.heatup_POST(request, response) local printer,msg = createPrinterOrFail(argId, response) if not printer then return end - local temperature = settings.get('printer.heatupTemperature') + local temperature = settings.get('printer.heatup.temperature') local rv,msg = printer:heatup(temperature) response:addData('id', argId) @@ -165,7 +165,7 @@ function M.print_POST(request, response) end if argIsFirst == true then - log:debug("clearing all gcode for " .. printer) + log:debug("clearing all gcode for " .. printer:getId()) response:addData('gcode_clear',true) local rv,msg = printer:clearGcode() diff --git a/src/www b/src/www index 1842ec0..a45d1ad 160000 --- a/src/www +++ b/src/www @@ -1 +1 @@ -Subproject commit 1842ec01b2d455142b8f654323ec92a4e2395753 +Subproject commit a45d1ad8edb89902fd4ef2b91d82dec23f8e51cd