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

Handling multiline settings. Added start and end gcode

This commit is contained in:
peteruithoven 2013-08-28 17:12:41 +02:00
parent aeb669cc99
commit 24b773bd6f
2 changed files with 22 additions and 4 deletions

View File

@ -156,6 +156,18 @@ M.printer_autoWarmUpCommand = {
description = '' 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 X-100 Y-100 E0 ;zero the extruded length again and make center the start position\nG1 F9000\nG90 ;absolute positioning\nM117 Printing Doodle... ;display message (20 characters to clear whole screen)',
type = 'string',
description = ''
}
M.printer_endgcode = {
default = 'M107 ;fan off\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nM84 ;disable axes / steppers\nG90 ;absolute positioning\nM117 Done ;display message (20 characters to clear whole screen)',
type = 'string',
description = ''
}
M.doodle3d_objectHeight = { M.doodle3d_objectHeight = {
default = 20, default = 20,
type = 'int', type = 'int',

View File

@ -16,7 +16,6 @@ local baseconfig = require('conf_defaults')
local M = {} local M = {}
--- UCI config name (i.e. file under /etc/config) --- UCI config name (i.e. file under /etc/config)
local UCI_CONFIG_NAME = 'wifibox' local UCI_CONFIG_NAME = 'wifibox'
@ -61,6 +60,10 @@ end
-- @return A value usable to write to UCI. -- @return A value usable to write to UCI.
local function toUciValue(v, vType) local function toUciValue(v, vType)
if vType == 'bool' then return v and '1' or '0' end if vType == 'bool' then return v and '1' or '0' end
if(vType == 'string') then
v = v:gsub('[\n\r]', '\\n')
end
return tostring(v) return tostring(v)
end end
@ -78,6 +81,9 @@ local function fromUciValue(v, vType)
return (v == '1') and true or false return (v == '1') and true or false
elseif vType == 'float' or vType == 'int' then elseif vType == 'float' or vType == 'int' then
return tonumber(v) return tonumber(v)
elseif vType == 'string' then
v = v:gsub('\\n', '\n')
return v
else else
return v return v
end end