fix process settings state bug
This commit is contained in:
parent
0ca8c1ce22
commit
058900af41
6 changed files with 56 additions and 61 deletions
|
|
@ -652,10 +652,8 @@ let gs_kiri_conf = exports;
|
||||||
layerPrint: false,
|
layerPrint: false,
|
||||||
layerMoves: false
|
layerMoves: false
|
||||||
},
|
},
|
||||||
|
// for passing temporary slice hints (topo currently)
|
||||||
synth: {
|
synth: {
|
||||||
// set in updateSettingsFromFields()
|
|
||||||
fillOffsetMult: 0,
|
|
||||||
diffOffsetMult: 0
|
|
||||||
},
|
},
|
||||||
controller:{
|
controller:{
|
||||||
view: null,
|
view: null,
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,10 @@ let gs_kiri_fdm = exports;
|
||||||
return btoa("; filename = kirimoto.gcode\n; machine = dv1MW0A000\n" + gcode);
|
return btoa("; filename = kirimoto.gcode\n; machine = dv1MW0A000\n" + gcode);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function bound(v,min,max) {
|
||||||
|
return Math.max(min,Math.min(max,v));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DRIVER SLICE CONTRACT
|
* DRIVER SLICE CONTRACT
|
||||||
*
|
*
|
||||||
|
|
@ -56,13 +60,12 @@ let gs_kiri_fdm = exports;
|
||||||
nozzleSize = sdev.extruders[extruder].extNozzle,
|
nozzleSize = sdev.extruders[extruder].extNozzle,
|
||||||
firstOffset = nozzleSize / 2,
|
firstOffset = nozzleSize / 2,
|
||||||
shellOffset = nozzleSize,
|
shellOffset = nozzleSize,
|
||||||
|
fillOffsetMult = 1.0 - bound(spro.sliceFillOverlap, 0, 0.8),
|
||||||
fillSpacing = nozzleSize,
|
fillSpacing = nozzleSize,
|
||||||
fillOffset = nozzleSize * settings.synth.fillOffsetMult,
|
fillOffset = nozzleSize * fillOffsetMult,
|
||||||
sliceFillAngle = spro.sliceFillAngle,
|
sliceFillAngle = spro.sliceFillAngle,
|
||||||
view = widget.mesh && widget.mesh.newGroup ? widget.mesh.newGroup() : null;
|
view = widget.mesh && widget.mesh.newGroup ? widget.mesh.newGroup() : null;
|
||||||
|
|
||||||
// console.log({slice:widget.id, metadata, extruder, nozzleSize});
|
|
||||||
|
|
||||||
if (!(sliceHeight > 0 && sliceHeight < 100)) {
|
if (!(sliceHeight > 0 && sliceHeight < 100)) {
|
||||||
return ondone("invalid slice height");
|
return ondone("invalid slice height");
|
||||||
}
|
}
|
||||||
|
|
@ -737,8 +740,6 @@ let gs_kiri_fdm = exports;
|
||||||
lines = 0,
|
lines = 0,
|
||||||
bytes = 0;
|
bytes = 0;
|
||||||
|
|
||||||
// console.log({print: print.widgets, meta:settings.widget, extruders, nozzleSize, filamentSize});
|
|
||||||
|
|
||||||
(process.gcodePauseLayers || "").split(",").forEach(function(lv) {
|
(process.gcodePauseLayers || "").split(",").forEach(function(lv) {
|
||||||
let v = parseInt(lv);
|
let v = parseInt(lv);
|
||||||
if (v >= 0) pause.push(v);
|
if (v >= 0) pause.push(v);
|
||||||
|
|
|
||||||
|
|
@ -1628,6 +1628,22 @@ var gs_kiri_init = exports;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// SPACE.mouse.onHover(function(d,me) {
|
||||||
|
// if (d) {
|
||||||
|
// console.log(d,d.object.widget.id,d.face.materialIndex)
|
||||||
|
// // d.object.material.vertexColors = true;
|
||||||
|
// // d.object.material.needsUpdate = true;
|
||||||
|
// // d.face.vertexColors = [
|
||||||
|
// // new THREE.Color(0xffaa88),
|
||||||
|
// // new THREE.Color(0xffaa88),
|
||||||
|
// // new THREE.Color(0xffaa88)
|
||||||
|
// // ];
|
||||||
|
// // d.face.materialIndex = 1;
|
||||||
|
// } else {
|
||||||
|
// return API.widgets.meshes();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
SPACE.mouse.onDrag(function(delta) {
|
SPACE.mouse.onDrag(function(delta) {
|
||||||
let dev = settings().device;
|
let dev = settings().device;
|
||||||
let bmaxx = dev.bedWidth/2;
|
let bmaxx = dev.bedWidth/2;
|
||||||
|
|
|
||||||
|
|
@ -649,7 +649,6 @@ let gs_kiri_widget = exports;
|
||||||
|
|
||||||
widget.settings = settings;
|
widget.settings = settings;
|
||||||
widget.clearSlices();
|
widget.clearSlices();
|
||||||
|
|
||||||
onupdate(0.0001, "slicing");
|
onupdate(0.0001, "slicing");
|
||||||
|
|
||||||
if (remote) {
|
if (remote) {
|
||||||
|
|
|
||||||
14
js/kiri.js
14
js/kiri.js
|
|
@ -812,14 +812,6 @@ self.kiri.copyright = exports.COPYRIGHT;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function fillOffsetMult() {
|
|
||||||
return 1.0-bound(settings.process.sliceFillOverlap, 0, 0.8);
|
|
||||||
}
|
|
||||||
|
|
||||||
function diffOffset() {
|
|
||||||
return (settings.device.nozzleSize / 2) * fillOffsetMult();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** ******************************************************************
|
/** ******************************************************************
|
||||||
* Selection Functions
|
* Selection Functions
|
||||||
******************************************************************* */
|
******************************************************************* */
|
||||||
|
|
@ -1349,9 +1341,6 @@ self.kiri.copyright = exports.COPYRIGHT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.synth.fillOffsetMult = fillOffsetMult();
|
|
||||||
settings.synth.diffOffsetMult = diffOffset();
|
|
||||||
|
|
||||||
return settings;
|
return settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1872,8 +1861,8 @@ self.kiri.copyright = exports.COPYRIGHT;
|
||||||
clearWidgetCache();
|
clearWidgetCache();
|
||||||
SPACE.update();
|
SPACE.update();
|
||||||
UI.modeFDM.setAttribute('class', MODE === MODES.FDM ? 'buton' : '');
|
UI.modeFDM.setAttribute('class', MODE === MODES.FDM ? 'buton' : '');
|
||||||
UI.modeLASER.setAttribute('class', MODE === MODES.LASER ? 'buton' : '');
|
|
||||||
UI.modeCAM.setAttribute('class', MODE === MODES.CAM ? 'buton' : '');
|
UI.modeCAM.setAttribute('class', MODE === MODES.CAM ? 'buton' : '');
|
||||||
|
UI.modeLASER.setAttribute('class', MODE === MODES.LASER ? 'buton' : '');
|
||||||
UI.mode.style.display = lock ? 'none' : '';
|
UI.mode.style.display = lock ? 'none' : '';
|
||||||
UI.modeTable.style.display = lock ? 'none' : '';
|
UI.modeTable.style.display = lock ? 'none' : '';
|
||||||
if (camStock) {
|
if (camStock) {
|
||||||
|
|
@ -1884,6 +1873,7 @@ self.kiri.copyright = exports.COPYRIGHT;
|
||||||
if (then) then();
|
if (then) then();
|
||||||
triggerSettingsEvent();
|
triggerSettingsEvent();
|
||||||
platformUpdateSelected();
|
platformUpdateSelected();
|
||||||
|
updateFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
function currentDeviceName() {
|
function currentDeviceName() {
|
||||||
|
|
|
||||||
|
|
@ -156,51 +156,42 @@
|
||||||
<span class="sel-span">
|
<span class="sel-span">
|
||||||
<label class="label">scale</label>
|
<label class="label">scale</label>
|
||||||
<div class="sel-pop">
|
<div class="sel-pop">
|
||||||
<table>
|
<table><tr>
|
||||||
<tr>
|
|
||||||
<th></th>
|
<th></th>
|
||||||
<td><label>size</label></td>
|
<td><label>size</label></td>
|
||||||
<td><label>scale</label></td>
|
<td><label>scale</label></td>
|
||||||
<td><label>lock</label></td>
|
<td><label>lock</label></td>
|
||||||
</tr>
|
</tr><tr>
|
||||||
<tr>
|
|
||||||
<td><label>x</label></td>
|
<td><label>x</label></td>
|
||||||
<td><input id="size_x" size="8" class="value"/></td>
|
<td><input id="size_x" size="8" class="value"/></td>
|
||||||
<td><input id="scale_x" size="3" class="value" value="1"/></td>
|
<td><input id="scale_x" size="3" class="value" value="1"/></td>
|
||||||
<td><input id="lock_x" type="checkbox" checked/></td>
|
<td><input id="lock_x" type="checkbox" checked/></td>
|
||||||
</tr>
|
</tr><tr>
|
||||||
<tr>
|
|
||||||
<td><label>y</label></td>
|
<td><label>y</label></td>
|
||||||
<td><input id="size_y" size="8" class="value"/></td>
|
<td><input id="size_y" size="8" class="value"/></td>
|
||||||
<td><input id="scale_y" size="3" class="value" value="1"/></td>
|
<td><input id="scale_y" size="3" class="value" value="1"/></td>
|
||||||
<td><input id="lock_y" type="checkbox" checked/></td>
|
<td><input id="lock_y" type="checkbox" checked/></td>
|
||||||
</tr>
|
</tr><tr>
|
||||||
<tr>
|
|
||||||
<td><label>z</label></td>
|
<td><label>z</label></td>
|
||||||
<td><input id="size_z" size="8" class="value"/></td>
|
<td><input id="size_z" size="8" class="value"/></td>
|
||||||
<td><input id="scale_z" size="3" class="value" value="1"/></td>
|
<td><input id="scale_z" size="3" class="value" value="1"/></td>
|
||||||
<td><input id="lock_z" type="checkbox" checked/></td>
|
<td><input id="lock_z" type="checkbox" checked/></td>
|
||||||
</tr>
|
</tr></table>
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
<span class="sel-span">
|
<span class="sel-span">
|
||||||
<label class="label">rotate</label>
|
<label class="label">rotate</label>
|
||||||
<div class="sel-pop">
|
<div class="sel-pop">
|
||||||
<table>
|
<table><tr><td>
|
||||||
<tr><td>
|
|
||||||
<label>z</label>
|
<label>z</label>
|
||||||
<input id="rot_z" class="value" size="5"/ value="0">
|
<input id="rot_z" class="value" size="5"/ value="0">
|
||||||
</td></tr>
|
</td></tr><tr><td>
|
||||||
<tr><td>
|
|
||||||
<label>y</label>
|
<label>y</label>
|
||||||
<input id="rot_y" class="value" size="5"/ value="0">
|
<input id="rot_y" class="value" size="5"/ value="0">
|
||||||
</td></tr>
|
</td></tr><tr><td>
|
||||||
<tr><td>
|
|
||||||
<label>x</label>
|
<label>x</label>
|
||||||
<input id="rot_x" class="value" size="5"/ value="0">
|
<input id="rot_x" class="value" size="5"/ value="0">
|
||||||
</td></tr>
|
</td></tr></table>
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
<span id="ext-sel" class="sel-span">
|
<span id="ext-sel" class="sel-span">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue