add nozzle selector for supports. move list consts to api
This commit is contained in:
parent
af66eff5cd
commit
3888e62dd8
6 changed files with 34 additions and 31 deletions
|
|
@ -245,6 +245,7 @@ let gs_kiri_conf = exports;
|
||||||
sliceSupportArea: 1,
|
sliceSupportArea: 1,
|
||||||
sliceSupportExtra: 1,
|
sliceSupportExtra: 1,
|
||||||
sliceSupportSpan: 1,
|
sliceSupportSpan: 1,
|
||||||
|
sliceSupportNozzle: 1,
|
||||||
sliceSolidMinArea: 1,
|
sliceSolidMinArea: 1,
|
||||||
sliceSolidLayers: 1,
|
sliceSolidLayers: 1,
|
||||||
sliceBottomLayers: 1,
|
sliceBottomLayers: 1,
|
||||||
|
|
@ -283,7 +284,6 @@ let gs_kiri_conf = exports;
|
||||||
polishLayers: 1,
|
polishLayers: 1,
|
||||||
polishSpeed: 1,
|
polishSpeed: 1,
|
||||||
outputLayerRetract: 1,
|
outputLayerRetract: 1,
|
||||||
gcodeNozzle: 1,
|
|
||||||
gcodePauseLayers: 1,
|
gcodePauseLayers: 1,
|
||||||
outputClockwise: 1,
|
outputClockwise: 1,
|
||||||
outputOriginCenter: 1,
|
outputOriginCenter: 1,
|
||||||
|
|
@ -401,18 +401,6 @@ let gs_kiri_conf = exports;
|
||||||
},
|
},
|
||||||
// --------------- default settings
|
// --------------- default settings
|
||||||
template: {
|
template: {
|
||||||
// use by UI for populating selectors
|
|
||||||
infill:[
|
|
||||||
{ name: "vase" },
|
|
||||||
{ name: "hex" },
|
|
||||||
{ name: "grid" },
|
|
||||||
{ name: "gyroid" },
|
|
||||||
{ name: "triangle" }
|
|
||||||
],
|
|
||||||
units:[
|
|
||||||
{ name: "mm" },
|
|
||||||
{ name: "in" }
|
|
||||||
],
|
|
||||||
// CAM only
|
// CAM only
|
||||||
bounds: {},
|
bounds: {},
|
||||||
origin: {},
|
origin: {},
|
||||||
|
|
@ -517,6 +505,7 @@ let gs_kiri_conf = exports;
|
||||||
sliceSupportArea: 1,
|
sliceSupportArea: 1,
|
||||||
sliceSupportExtra: 0,
|
sliceSupportExtra: 0,
|
||||||
sliceSupportSpan: 6,
|
sliceSupportSpan: 6,
|
||||||
|
sliceSupportNozzle: 0,
|
||||||
sliceSolidMinArea: 1,
|
sliceSolidMinArea: 1,
|
||||||
sliceSolidLayers: 3,
|
sliceSolidLayers: 3,
|
||||||
sliceBottomLayers: 3,
|
sliceBottomLayers: 3,
|
||||||
|
|
@ -555,7 +544,6 @@ let gs_kiri_conf = exports;
|
||||||
polishLayers: 0,
|
polishLayers: 0,
|
||||||
polishSpeed: 40,
|
polishSpeed: 40,
|
||||||
outputLayerRetract: false,
|
outputLayerRetract: false,
|
||||||
gcodeNozzle: 0,
|
|
||||||
gcodePauseLayers: "",
|
gcodePauseLayers: "",
|
||||||
|
|
||||||
// --- LASER ---
|
// --- LASER ---
|
||||||
|
|
|
||||||
|
|
@ -635,10 +635,10 @@ var gs_kiri_fdm = exports;
|
||||||
left: offset ? 0 : -device.bedWidth/2,
|
left: offset ? 0 : -device.bedWidth/2,
|
||||||
right: offset ? device.bedWidth : device.bedWidth/2,
|
right: offset ? device.bedWidth : device.bedWidth/2,
|
||||||
bottom: offset ? 0 : -device.bedDepth/2,
|
bottom: offset ? 0 : -device.bedDepth/2,
|
||||||
nozzle: process.gcodeNozzle || 0,
|
|
||||||
tool: process.gcodeNozzle || 0,
|
|
||||||
z_max: device.maxHeight,
|
z_max: device.maxHeight,
|
||||||
layers: layers.length
|
layers: layers.length,
|
||||||
|
nozzle: 0,
|
||||||
|
tool: 0
|
||||||
},
|
},
|
||||||
seekMMM = process.outputSeekrate * 60,
|
seekMMM = process.outputSeekrate * 60,
|
||||||
retDist = process.outputRetractDist,
|
retDist = process.outputRetractDist,
|
||||||
|
|
@ -837,6 +837,7 @@ var gs_kiri_fdm = exports;
|
||||||
// look for extruder change and recalc emit factor
|
// look for extruder change and recalc emit factor
|
||||||
if (out.tool !== undefined && out.tool !== tool) {
|
if (out.tool !== undefined && out.tool !== tool) {
|
||||||
tool = out.tool;
|
tool = out.tool;
|
||||||
|
consts.nozzle = consts.tool = tool;
|
||||||
extruder = extruders[tool];
|
extruder = extruders[tool];
|
||||||
offset_x = extruder.extOffsetX;
|
offset_x = extruder.extOffsetX;
|
||||||
offset_y = extruder.extOffsetY;
|
offset_y = extruder.extOffsetY;
|
||||||
|
|
|
||||||
|
|
@ -542,10 +542,10 @@ var gs_kiri_init = exports;
|
||||||
|
|
||||||
// add extruder selection buttons
|
// add extruder selection buttons
|
||||||
if (dev.extruders) {
|
if (dev.extruders) {
|
||||||
|
let ext = API.lists.extruders = [];
|
||||||
dev.internal = 0;
|
dev.internal = 0;
|
||||||
let selext = $('sel-ext');
|
let selext = $('sel-ext');
|
||||||
selext.innerHTML = '';
|
selext.innerHTML = '';
|
||||||
let arr = [];
|
|
||||||
for (let i=dev.extruders.length-1; i>=0; i--) {
|
for (let i=dev.extruders.length-1; i>=0; i--) {
|
||||||
let b = DOC.createElement('button');
|
let b = DOC.createElement('button');
|
||||||
b.appendChild(DOC.createTextNode(i));
|
b.appendChild(DOC.createTextNode(i));
|
||||||
|
|
@ -557,6 +557,7 @@ var gs_kiri_init = exports;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
selext.appendChild(b);
|
selext.appendChild(b);
|
||||||
|
ext.push({id:i, name:i});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1311,6 +1312,7 @@ var gs_kiri_init = exports;
|
||||||
sliceSupportSpan: UC.newInput(LANG.sp_span_s, {title:LANG.sp_span_l, bound:UC.bound(0.0,200.0), convert:UC.toFloat, modes:FDM}),
|
sliceSupportSpan: UC.newInput(LANG.sp_span_s, {title:LANG.sp_span_l, bound:UC.bound(0.0,200.0), convert:UC.toFloat, modes:FDM}),
|
||||||
sliceSupportArea: UC.newInput(LANG.sp_area_s, {title:LANG.sp_area_l, bound:UC.bound(0.1,200.0), convert:UC.toFloat, modes:FDM}),
|
sliceSupportArea: UC.newInput(LANG.sp_area_s, {title:LANG.sp_area_l, bound:UC.bound(0.1,200.0), convert:UC.toFloat, modes:FDM}),
|
||||||
sliceSupportExtra: UC.newInput(LANG.sp_xpnd_s, {title:LANG.sp_xpnd_l, bound:UC.bound(0.0,200.0), convert:UC.toFloat, modes:FDM, expert:true}),
|
sliceSupportExtra: UC.newInput(LANG.sp_xpnd_s, {title:LANG.sp_xpnd_l, bound:UC.bound(0.0,200.0), convert:UC.toFloat, modes:FDM, expert:true}),
|
||||||
|
sliceSupportNozzle: UC.newSelect(LANG.sp_nozl_s, {title:LANG.sp_nozl_l, modes:FDM, expert:true}, "extruders"),
|
||||||
sliceSupportEnable: UC.newBoolean(LANG.enable, onBooleanClick, {modes:FDM}),
|
sliceSupportEnable: UC.newBoolean(LANG.enable, onBooleanClick, {modes:FDM}),
|
||||||
|
|
||||||
laserOffset: UC.newInput(LANG.ls_offs_s, {title:LANG.ls_offs_l, convert:UC.toFloat, modes:LASER}),
|
laserOffset: UC.newInput(LANG.ls_offs_s, {title:LANG.ls_offs_l, convert:UC.toFloat, modes:LASER}),
|
||||||
|
|
@ -1414,11 +1416,8 @@ var gs_kiri_init = exports;
|
||||||
// detectThinWalls: UC.newBoolean("thin wall fill", onBooleanClick, {title: "detect and fill thin openings\nbetween shells walls", modes:FDM, expert:true})
|
// detectThinWalls: UC.newBoolean("thin wall fill", onBooleanClick, {title: "detect and fill thin openings\nbetween shells walls", modes:FDM, expert:true})
|
||||||
polishLayers: LOCAL ? UC.newInput(LANG.ad_play_s, {title:LANG.ad_play_l, bound:UC.bound(0,10), convert:UC.toFloat, modes:FDM, expert:true}) : null,
|
polishLayers: LOCAL ? UC.newInput(LANG.ad_play_s, {title:LANG.ad_play_l, bound:UC.bound(0,10), convert:UC.toFloat, modes:FDM, expert:true}) : null,
|
||||||
polishSpeed: LOCAL ? UC.newInput(LANG.ad_pspd_s, {title:LANG.ad_pspd_l, bound:UC.bound(10,2000), convert:UC.toInt, modes:FDM, expert:true}) : null,
|
polishSpeed: LOCAL ? UC.newInput(LANG.ad_pspd_s, {title:LANG.ad_pspd_l, bound:UC.bound(10,2000), convert:UC.toInt, modes:FDM, expert:true}) : null,
|
||||||
outputLayerRetract: UC.newBoolean(LANG.ad_lret_s, onBooleanClick, {title:LANG.ad_lret_l, modes:FDM, expert:true}),
|
gcodePauseLayers: UC.newInput(LANG.ag_paws_s, {title:LANG.ag_paws_l, modes:FDM, expert:true}),
|
||||||
|
outputLayerRetract: UC.newBoolean(LANG.ad_lret_s, onBooleanClick, {title:LANG.ad_lret_l, modes:FDM, expert:true})
|
||||||
gcodeVars: UC.newGroup(LANG.ag_menu, null, {modes:FDM, expert:true}),
|
|
||||||
gcodeNozzle: UC.newInput(LANG.ag_nozl_s, {title:LANG.ag_nozl_l, convert:UC.toInt, modes:FDM, expert:true}),
|
|
||||||
gcodePauseLayers: UC.newInput(LANG.ag_paws_s, {title:LANG.ag_paws_l, modes:FDM, expert:true})
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!lang_set) {
|
if (!lang_set) {
|
||||||
|
|
|
||||||
27
js/kiri.js
27
js/kiri.js
|
|
@ -127,6 +127,20 @@ self.kiri.copyright = exports.COPYRIGHT;
|
||||||
cam_sliced_opacity: 0.25
|
cam_sliced_opacity: 0.25
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const lists = {
|
||||||
|
infill: [
|
||||||
|
{ name: "vase" },
|
||||||
|
{ name: "hex" },
|
||||||
|
{ name: "grid" },
|
||||||
|
{ name: "gyroid" },
|
||||||
|
{ name: "triangle" }
|
||||||
|
],
|
||||||
|
units:[
|
||||||
|
{ name: "mm" },
|
||||||
|
{ name: "in" }
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
const API = KIRI.api = {
|
const API = KIRI.api = {
|
||||||
ui: UI,
|
ui: UI,
|
||||||
uc: UC,
|
uc: UC,
|
||||||
|
|
@ -194,6 +208,7 @@ self.kiri.copyright = exports.COPYRIGHT;
|
||||||
import: function() { UI.import.style.display = 'none' }
|
import: function() { UI.import.style.display = 'none' }
|
||||||
},
|
},
|
||||||
language: KIRI.lang,
|
language: KIRI.lang,
|
||||||
|
lists,
|
||||||
modal: {
|
modal: {
|
||||||
show: showModal,
|
show: showModal,
|
||||||
hide: hideModal,
|
hide: hideModal,
|
||||||
|
|
@ -1275,8 +1290,6 @@ self.kiri.copyright = exports.COPYRIGHT;
|
||||||
function updateFieldsFromSettings(scope) {
|
function updateFieldsFromSettings(scope) {
|
||||||
if (!scope) return console.trace("missing scope");
|
if (!scope) return console.trace("missing scope");
|
||||||
|
|
||||||
// CONF.normalize(settings);
|
|
||||||
|
|
||||||
for (let key in scope) {
|
for (let key in scope) {
|
||||||
if (!scope.hasOwnProperty(key)) continue;
|
if (!scope.hasOwnProperty(key)) continue;
|
||||||
let val = scope[key];
|
let val = scope[key];
|
||||||
|
|
@ -1289,11 +1302,11 @@ self.kiri.copyright = exports.COPYRIGHT;
|
||||||
} else if (typ === 'select-one') {
|
} else if (typ === 'select-one') {
|
||||||
uie.innerHTML = '<option></option>';
|
uie.innerHTML = '<option></option>';
|
||||||
let source = uie.parentNode.getAttribute('source'),
|
let source = uie.parentNode.getAttribute('source'),
|
||||||
list = settings[source],
|
list = settings[source] || lists[source],
|
||||||
chosen = null;
|
chosen = null;
|
||||||
list.forEach(function(tool, index) {
|
if (list) list.forEach(function(tool, index) {
|
||||||
let id = tool.id || tool.name;
|
let id = tool.id || tool.name;
|
||||||
if (val === id) {
|
if (val == id) {
|
||||||
chosen = index + 1;
|
chosen = index + 1;
|
||||||
}
|
}
|
||||||
let opt = DOC.createElement('option');
|
let opt = DOC.createElement('option');
|
||||||
|
|
@ -1341,6 +1354,8 @@ self.kiri.copyright = exports.COPYRIGHT;
|
||||||
if (src === 'tools') {
|
if (src === 'tools') {
|
||||||
nval = parseInt(nval);
|
nval = parseInt(nval);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
nval = scope[key];
|
||||||
}
|
}
|
||||||
} else if (uie.type === 'textarea') {
|
} else if (uie.type === 'textarea') {
|
||||||
nval = uie.value.trim().split('\n');
|
nval = uie.value.trim().split('\n');
|
||||||
|
|
@ -1434,8 +1449,6 @@ self.kiri.copyright = exports.COPYRIGHT;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
settings = CONF.normalize(data.settings);
|
settings = CONF.normalize(data.settings);
|
||||||
// MOTO.restore(data.moto);
|
|
||||||
// SDB.setItem('kiri-init', data.init || 2);
|
|
||||||
API.conf.save();
|
API.conf.save();
|
||||||
LOC.reload();
|
LOC.reload();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -207,6 +207,8 @@ kiri.lang['en-us'] = {
|
||||||
sp_area_l: "minimum area for\na support column\nin millimeters",
|
sp_area_l: "minimum area for\na support column\nin millimeters",
|
||||||
sp_xpnd_s: "expand",
|
sp_xpnd_s: "expand",
|
||||||
sp_xpnd_l: "expand support area\nbeyond part boundary\nin millimeters",
|
sp_xpnd_l: "expand support area\nbeyond part boundary\nin millimeters",
|
||||||
|
sp_nozl_s: "extruder",
|
||||||
|
sp_nozl_l: "in multi-extruder systems\nthe extruder to use for\nsupport material",
|
||||||
|
|
||||||
// LASER SLICING
|
// LASER SLICING
|
||||||
ls_offs_s: "offset",
|
ls_offs_s: "offset",
|
||||||
|
|
|
||||||
|
|
@ -735,7 +735,7 @@ button[import="1"] {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 40px;
|
top: 40px;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue