add filament source persistence, palette3 boolean in preview/export

This commit is contained in:
Stewart Allen 2021-11-09 22:17:18 -05:00
commit 4d19171d70
3 changed files with 14 additions and 2 deletions

View file

@ -109,6 +109,14 @@
} }
} }
function filamentSourceSave() {
const sel = UI.filamentSource.options[UI.filamentSource.selectedIndex];
if (sel) {
settings().device.filamentSource = sel.value;
API.conf.save();
}
}
function detailSave() { function detailSave() {
let level = UI.detail.options[UI.detail.selectedIndex]; let level = UI.detail.options[UI.detail.selectedIndex];
if (level) { if (level) {
@ -745,6 +753,7 @@
UI.deviceRound.checked = dev.bedRound; UI.deviceRound.checked = dev.bedRound;
UI.deviceOrigin.checked = dev.outputOriginCenter || dev.originCenter || dev.bedRound; UI.deviceOrigin.checked = dev.outputOriginCenter || dev.originCenter || dev.bedRound;
UI.fwRetract.checked = dev.fwRetract; UI.fwRetract.checked = dev.fwRetract;
if (!dev.filamentSource) UI.filamentSource.selectedIndex = 0;
// add extruder selection buttons // add extruder selection buttons
if (dev.extruders) { if (dev.extruders) {
@ -791,6 +800,7 @@
UI.deviceRound, UI.deviceRound,
UI.deviceBelt, UI.deviceBelt,
UI.fwRetract, UI.fwRetract,
UI.filamentSource,
UI.deviceZMax, UI.deviceZMax,
UI.gcodeFan, UI.gcodeFan,
UI.gcodeTrack, UI.gcodeTrack,
@ -1619,7 +1629,7 @@
spindleMax: UC.newInput(LANG.dv_spmx_s, {title:LANG.dv_spmx_l, convert:UC.toInt, size: 6, modes:CAM}), spindleMax: UC.newInput(LANG.dv_spmx_s, {title:LANG.dv_spmx_l, convert:UC.toInt, size: 6, modes:CAM}),
deviceZMax: UC.newInput(LANG.dv_zmax_s, {title:LANG.dv_zmax_l, convert:UC.toInt, size: 6, modes:FDM}), deviceZMax: UC.newInput(LANG.dv_zmax_s, {title:LANG.dv_zmax_l, convert:UC.toInt, size: 6, modes:FDM}),
fdmSep: UC.newBlank({class:"pop-sep", modes:FDM}), fdmSep: UC.newBlank({class:"pop-sep", modes:FDM}),
filamentSource: UC.newSelect(LANG.dv_fsrc_s, {title: LANG.dv_fsrc_l, action: lineTypeSave, modes:FDM}, "filasrc"), filamentSource: UC.newSelect(LANG.dv_fsrc_s, {title: LANG.dv_fsrc_l, action: filamentSourceSave, modes:FDM}, "filasrc"),
fwRetract: UC.newBoolean(LANG.dv_retr_s, onBooleanClick, {title:LANG.dv_retr_l, modes:FDM}), fwRetract: UC.newBoolean(LANG.dv_retr_s, onBooleanClick, {title:LANG.dv_retr_l, modes:FDM}),
deviceOrigin: UC.newBoolean(LANG.dv_orgc_s, onBooleanClick, {title:LANG.dv_orgc_l, modes:FDM_LASER, show:() => !UI.deviceRound.checked}), deviceOrigin: UC.newBoolean(LANG.dv_orgc_s, onBooleanClick, {title:LANG.dv_orgc_l, modes:FDM_LASER, show:() => !UI.deviceRound.checked}),
deviceRound: UC.newBoolean(LANG.dv_bedc_s, onBooleanClick, {title:LANG.dv_bedc_l, modes:FDM, trigger:true, show:isNotBelt}), deviceRound: UC.newBoolean(LANG.dv_bedc_s, onBooleanClick, {title:LANG.dv_bedc_l, modes:FDM, trigger:true, show:isNotBelt}),

View file

@ -119,7 +119,8 @@
icos = 1 / bcos, icos = 1 / bcos,
inloops = 0, inloops = 0,
arcQ = [], arcQ = [],
minz = { x: Infinity, y: Infinity, z: Infinity }; minz = { x: Infinity, y: Infinity, z: Infinity },
isPalette = device.filamentSource === 'palette3';
// smallish band-aid. refactor above to remove redundancy // smallish band-aid. refactor above to remove redundancy
function updateParams(layer) { function updateParams(layer) {

View file

@ -34,6 +34,7 @@
isThin = controller.lineType === "line", isThin = controller.lineType === "line",
isFlat = controller.lineType === "flat", isFlat = controller.lineType === "flat",
isDanger = controller.danger || false, isDanger = controller.danger || false,
isPalette = device.filamentSource === 'palette3',
firstLayerHeight = isBelt ? process.sliceHeight : process.firstSliceHeight || process.sliceHeight, firstLayerHeight = isBelt ? process.sliceHeight : process.firstSliceHeight || process.sliceHeight,
firstLayerSeek = process.outputSeekrate, firstLayerSeek = process.outputSeekrate,
firstLayerRate = process.firstLayerRate, firstLayerRate = process.firstLayerRate,