move tab/support annotations into widget meta data / idb. fix support/lay flat conflict. fix support nozzle in slice.
This commit is contained in:
parent
b5516c1d9e
commit
bf51d56bb5
12 changed files with 92 additions and 42 deletions
|
|
@ -100,11 +100,11 @@
|
|||
proc.ops = proc.ops.filter(v => v);
|
||||
}
|
||||
// for any tabs or traces to set markers
|
||||
Object.keys(settings.widget).forEach(wid => {
|
||||
let wannot = settings.widget[wid];
|
||||
for (let widget of API.widgets.all()) {
|
||||
let wannot = widget.anno;
|
||||
if (wannot.tab && wannot.tab.length) hasTabs = true;
|
||||
if (wannot.trace && wannot.trace.length) hasTraces = true;
|
||||
});
|
||||
}
|
||||
// show/hide dots in enabled process pop buttons
|
||||
api.ui.camTabs.marker.style.display = hasTabs ? 'flex' : 'none';
|
||||
api.ui.camStock.marker.style.display = proc.camStockOn ? 'flex' : 'none';
|
||||
|
|
@ -478,6 +478,7 @@
|
|||
func.tabDone();
|
||||
API.widgets.all().forEach(widget => {
|
||||
clearTabs(widget);
|
||||
widget.saveState();
|
||||
});
|
||||
API.conf.save();
|
||||
});
|
||||
|
|
@ -524,6 +525,7 @@
|
|||
});
|
||||
ta.splice(ix,1);
|
||||
API.conf.save();
|
||||
widget.saveState();
|
||||
return;
|
||||
}
|
||||
if (!iw) return;
|
||||
|
|
@ -541,6 +543,7 @@
|
|||
wt.push(Object.clone(rec));
|
||||
addWidgetTab(iw, rec);
|
||||
API.conf.save();
|
||||
iw.saveState();
|
||||
};
|
||||
|
||||
// TRACE FUNCS
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
minToolDiam = Infinity,
|
||||
maxToolDiam = -Infinity,
|
||||
thruHoles,
|
||||
tabs = settings.widget[widget.id].tab,
|
||||
tabs = widget.anno.tab,
|
||||
unsafe = proc.camExpertFast,
|
||||
units = settings.controller.units === 'in' ? 25.4 : 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -521,6 +521,18 @@
|
|||
}
|
||||
|
||||
let xpdebug;
|
||||
let supsave = {};
|
||||
let suptimer;
|
||||
|
||||
function scheduleSupportSave(widget) {
|
||||
clearTimeout(suptimer);
|
||||
supsave[widget.id] = widget;
|
||||
suptimer = setTimeout(() => {
|
||||
for (let w of Object.values(supsave)) {
|
||||
w.saveState();
|
||||
}
|
||||
}, 50);
|
||||
}
|
||||
|
||||
function activeSupports() {
|
||||
const active = [];
|
||||
|
|
@ -554,6 +566,7 @@
|
|||
pos.box.pillar = Object.assign({widget}, pos);
|
||||
sups[id] = pos;
|
||||
widget.adds.push(pos.box);
|
||||
scheduleSupportSave(widget);
|
||||
}
|
||||
return sups[id];
|
||||
}
|
||||
|
|
@ -572,6 +585,7 @@
|
|||
});
|
||||
sa.splice(ix,1);
|
||||
API.conf.save();
|
||||
scheduleSupportSave(widget);
|
||||
fromPillar = undefined;
|
||||
}
|
||||
|
||||
|
|
@ -604,6 +618,7 @@
|
|||
});
|
||||
widget.sups = {};
|
||||
delete API.widgets.annotate(widget.id).support;
|
||||
scheduleSupportSave(widget);
|
||||
return cleared;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,21 +13,9 @@
|
|||
// slice, // src/mode/fdm/slice.js
|
||||
// prepare, // src/mode/fdm/prepare.js
|
||||
// export, // src/mode/fdm/export.js
|
||||
getRangeParameters,
|
||||
fixExtruders
|
||||
getRangeParameters
|
||||
};
|
||||
|
||||
function fixExtruders(settings) {
|
||||
Object.entries(settings.widget).forEach(arr => {
|
||||
let [wid,val] = arr;
|
||||
let dext = settings.device.extruders[val.extruder];
|
||||
if (!dext) {
|
||||
settings.widget[wid].extruder = 0;
|
||||
}
|
||||
});
|
||||
return settings;
|
||||
}
|
||||
|
||||
function getRangeParameters(process, index) {
|
||||
if (index === undefined || index === null || index < 0) {
|
||||
return process;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
*/
|
||||
FDM.export = function(print, online, ondone, ondebug) {
|
||||
let layers = print.output,
|
||||
settings = FDM.fixExtruders(print.settings),
|
||||
settings = print.settings,
|
||||
controller = settings.controller,
|
||||
thumbnails = controller.exportThumb,
|
||||
getRangeParameters = FDM.getRangeParameters,
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
// filter ignored widgets
|
||||
widgets = widgets.filter(w => !w.track.ignore);
|
||||
|
||||
settings = FDM.fixExtruders(settings);
|
||||
let render = settings.render !== false,
|
||||
{ device, process, controller, bounds, mode } = settings,
|
||||
{ bedWidth, bedDepth } = device,
|
||||
|
|
@ -222,7 +221,7 @@
|
|||
swidget.belt = widget.belt;
|
||||
swidget.track = Object.clone(widget.track);
|
||||
swidget.mesh = { widget: swidget, position: swidget.track.pos };
|
||||
settings.widget[swidget.id] = { extruder: process.sliceSupportNozzle };
|
||||
widget.anno.extruder = process.sliceSupportNozzle;
|
||||
widgets.push(swidget);
|
||||
}
|
||||
}
|
||||
|
|
@ -235,7 +234,7 @@
|
|||
// find max layers (for updates)
|
||||
// generate list of used extruders for purge blocks
|
||||
for (let widget of widgets) {
|
||||
let extruder = (settings.widget[widget.id] || {}).extruder || 0;
|
||||
let extruder = widget.anno.extruder || 0;
|
||||
if (!extruders[extruder]) {
|
||||
extruders[extruder] = {};
|
||||
extcount++;
|
||||
|
|
|
|||
|
|
@ -114,7 +114,6 @@
|
|||
* @param {Function} ondone (called when complete with an array of Slice objects)
|
||||
*/
|
||||
FDM.slice = function(settings, widget, onupdate, ondone) {
|
||||
FDM.fixExtruders(settings);
|
||||
let render = settings.render !== false,
|
||||
{ process, device, controller } = settings,
|
||||
isBelt = device.bedBelt,
|
||||
|
|
@ -125,8 +124,8 @@
|
|||
solidMinArea = process.sliceSolidMinArea,
|
||||
solidLayers = process.sliceSolidLayers || 0,
|
||||
vaseMode = process.sliceFillType === 'vase' && !isSynth,
|
||||
metadata = settings.widget[widget.id] || {},
|
||||
extruder = metadata.extruder || 0,
|
||||
metadata = widget.anno,
|
||||
extruder = parseInt(isSynth ? process.sliceSupportNozzle : metadata.extruder || 0),
|
||||
sliceHeight = process.sliceHeight,
|
||||
sliceHeightBase = (isBelt ? sliceHeight : process.firstSliceHeight) || sliceHeight,
|
||||
nozzleSize = device.extruders[extruder].extNozzle,
|
||||
|
|
@ -171,7 +170,7 @@
|
|||
const sliceMinHeight = process.sliceAdaptive && process.sliceMinHeight > 0 ?
|
||||
Math.min(process.sliceMinHeight, sliceHeight) : 0;
|
||||
|
||||
if (sliceHeightBase < sliceHeight) {
|
||||
if (sliceHeightBase <= 0) {
|
||||
console.log("invalid first layer height < slice height");
|
||||
console.log("reverting to min valid slice height");
|
||||
sliceHeightBase = sliceMinHeight || sliceHeight;
|
||||
|
|
|
|||
Loading…
Reference in a new issue