fix comma invalid input, add fdm markers, add any modal

This commit is contained in:
Stewart Allen 2020-06-12 20:39:59 -04:00
commit f2b1674887
6 changed files with 20 additions and 8 deletions

View file

@ -386,6 +386,7 @@
intersect : intersect,
determinant : determinant,
comma: (v) => {
if (!v) return v;
let [lt,rt] = v.toString().split('.');
lt = lt.toString().split('').reverse().map((v,i,a) => {
return (i < a.length - 1 && i % 3 === 2) ? `,${v}` : v

View file

@ -1136,6 +1136,7 @@
saves: $('mod-saves'),
print: $('mod-print'),
local: $('mod-local'),
any: $('mod-any'),
catalogBody: $('catalogBody'),
catalogList: $('catalogList'),
@ -1265,7 +1266,7 @@
laserSliceHeight: UC.newInput(LANG.ls_lahi_s, {title:LANG.ls_lahi_l, convert:UC.toFloat, modes:LASER}),
laserSliceSingle: UC.newBoolean(LANG.ls_sngl_s, onBooleanClick, {title:LANG.ls_sngl_l, modes:LASER}),
process: UC.newGroup(LANG.fi_menu, $('settings'), {modes:FDM}),
fdmInfill: UC.newGroup(LANG.fi_menu, $('settings'), {modes:FDM, marker:true}),
sliceFillType: UC.newSelect(LANG.fi_type, {modes:FDM}, "infill"),
sliceFillSparse: UC.newInput(LANG.fi_pcnt_s, {title:LANG.fi_pcnt_l, convert:UC.toFloat, bound:UC.bound(0.0,1.0), modes:FDM}),
sliceFillAngle: UC.newInput(LANG.fi_angl_s, {title:LANG.fi_angl_l, convert:UC.toFloat, modes:FDM, expert:true}),
@ -1281,7 +1282,7 @@
firstLayerNozzleTemp:UC.newInput(LANG.fl_nozl_s, {title:LANG.fl_nozl_l, convert:UC.toInt, modes:FDM, expert:true}),
firstLayerBedTemp: UC.newInput(LANG.fl_bedd_s, {title:LANG.fl_bedd_l, convert:UC.toInt, modes:FDM, expert:true}),
support: UC.newGroup(LANG.sp_menu, null, {modes:FDM}),
fdmSupport: UC.newGroup(LANG.sp_menu, null, {modes:FDM, marker:true}),
sliceSupportDensity: UC.newInput(LANG.sp_dens_s, {title:LANG.sp_dens_l, convert:UC.toFloat, bound:UC.bound(0.05,1.0), modes:FDM}),
sliceSupportSize: UC.newInput(LANG.sp_size_s, {title:LANG.sp_size_l, bound:UC.bound(1.0,200.0), convert:UC.toFloat, modes:FDM}),
sliceSupportOffset: UC.newInput(LANG.sp_offs_s, {title:LANG.sp_offs_l, bound:UC.bound(0.0,200.0), convert:UC.toFloat, modes:FDM}),
@ -1292,6 +1293,10 @@
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}),
fdmRaft: UC.newGroup(LANG.fr_menu, null, {modes:FDM, marker:true}),
outputRaftSpacing: UC.newInput(LANG.fr_spac_s, {title:LANG.fr_spac_l, convert:UC.toFloat, bound:UC.bound(0.0,3.0), modes:FDM}),
outputRaft: UC.newBoolean(LANG.enable, onBooleanClick, {title:LANG.fr_nabl_l, modes:FDM}),
roughing: UC.newGroup(LANG.cr_menu, null, {modes:CAM, marker:true}),
roughingTool: UC.newSelect(LANG.cc_tool, {modes:CAM}),
roughingSpindle: UC.newInput(LANG.cc_spnd_s, {title:LANG.cc_spnd_l, convert:UC.toInt, modes:CAM}),
@ -1330,10 +1335,6 @@
drillingSep: UC.newBlank({class:"pop-sep"}),
drillingOn: UC.newBoolean(LANG.enable, onBooleanClick, {modes:CAM}),
output: UC.newGroup(LANG.fr_menu, null, {modes:FDM}),
outputRaftSpacing: UC.newInput(LANG.fr_spac_s, {title:LANG.fr_spac_l, convert:UC.toFloat, bound:UC.bound(0.0,3.0), modes:FDM}),
outputRaft: UC.newBoolean(LANG.enable, onBooleanClick, {title:LANG.fr_nabl_l, modes:FDM}),
camTabs: UC.newGroup(LANG.ct_menu, null, {modes:CAM, marker:true}),
camTabsAngle: UC.newInput(LANG.ct_angl_s, {title:LANG.ct_angl_l, convert:UC.toInt, bound:UC.bound(0,360), modes:CAM}),
camTabsCount: UC.newInput(LANG.ct_numb_s, {title:LANG.ct_numb_l, convert:UC.toInt, bound:UC.bound(1,20), modes:CAM}),

View file

@ -1652,7 +1652,7 @@
visible = modalShowing(),
info = { pct: 0 };
["help","setup","tools","prefs","saves","files","print","local"].forEach(function(name) {
["help","setup","tools","prefs","saves","files","print","local","any"].forEach(function(name) {
UI[name].style.display = name === which ? 'flex' : '';
});

View file

@ -14,6 +14,7 @@
CONF = BASE.config,
POLY = BASE.polygons,
FDM = KIRI.driver.FDM = {
init,
slice,
sliceRender,
printSetup,
@ -43,6 +44,15 @@
return settings;
}
function init(kiri, api) {
api.event.on("settings.saved", (settings) => {
let proc = settings.process;
api.ui.fdmSupport.marker.style.display = proc.sliceSupportEnable ? 'flex' : 'none';
api.ui.fdmInfill.marker.style.display = proc.sliceFillSparse > 0 ? 'flex' : 'none';
api.ui.fdmRaft.marker.style.display = proc.outputRaft ? 'flex' : 'none';
});
}
/**
* DRIVER SLICE CONTRACT
*

View file

@ -888,7 +888,6 @@ th, tr, td {
padding: 5px;
}
.marker {
xdisplay: none;
position:absolute;
border-radius: 2px;
background-color: rgba(0,0,0,0.25);

View file

@ -295,6 +295,7 @@
</div>
<div id="mod-local" class="mdialog col"></div>
<div id="mod-print" class="mdialog col"></div>
<div id="mod-any" class="mdialog col"></div>
<!-- hidden file input loader -->
<input id="load-file" type="file" name="loadme" style="display:none" accept=".stl,.gcode,.nc"/>
<div class="mod-end"></div></div>