increase density of raft. better editing of gcode fragments

This commit is contained in:
Stewart Allen 2018-02-01 09:31:03 -05:00
commit fc6104df1c
6 changed files with 108 additions and 13 deletions

View file

@ -257,9 +257,9 @@ var gs_kiri_fdm = exports;
raft(nozzle/1, process.sliceFillAngle + 0 , nozzle * 6.0, process.firstLayerRate / 3, 4);
raft(nozzle/1, process.sliceFillAngle + 0 , nozzle * 6.0, process.firstLayerRate / 2, 4);
raft(nozzle/2, process.sliceFillAngle + 90, nozzle * 3.0, process.outputFeedrate, 2.0);
raft(nozzle/2, process.sliceFillAngle + 90, nozzle * 3.0, process.outputFeedrate, 2.5);
raft(nozzle/2, process.sliceFillAngle + 0 , nozzle * 1.0, process.outputFeedrate, 1.5);
raft(nozzle/2, process.sliceFillAngle + 0 , nozzle * 1.0, process.outputFeedrate, 1.0);
raft(nozzle/2, process.sliceFillAngle + 0 , nozzle * 1.0, process.outputFeedrate, 0.9);
// raise first layer off raft slightly to lessen adhesion
firstLayerHeight += process.outputRaftSpacing || 0;

View file

@ -44,6 +44,7 @@ self.kiri.license = exports.LICENSE;
gcodePre: 1,
gcodePost: 1,
gcodeProc: 1,
gcodePause: 1,
gcodeFExt: 1,
gcodeFan: 1,
gcodeTrack: 1,
@ -239,7 +240,8 @@ self.kiri.license = exports.LICENSE;
spindleMax: 0, // CAM
gcodePre: [], // FDM/CAM header script
gcodePost: [], // FDM/CAM footer script
gcodeProc: "", // FDM post processor script
gcodeProc: "", // FDM post processor script (encoding, etc)
gcodePause: [], // FDM pause script
gcodeFan: "", // FDM fan command
gcodeTrack: "", // FDM progress command
gcodeLayer: "", // FDM layer output
@ -1903,7 +1905,7 @@ self.kiri.license = exports.LICENSE;
["modal","catalog","devices","tools"].forEach(function(dialog) {
showing = showing || UI[dialog].style.display === 'block';
});
return showing;
return showing || UC.isPopped();
}
function showModal(which) {
@ -1918,9 +1920,10 @@ self.kiri.license = exports.LICENSE;
}
function showDialog(which, force) {
UC.hidePop();
["catalog","devices","tools","settings"].forEach(function(dialog) {
var style = UI[dialog].style;
style.display = (dialog === which && (force || style.display !== 'block') ? 'block' : 'none');
style.display = (dialog === which && (force || style.display !== 'flex') ? 'flex' : 'none');
});
}
@ -2210,14 +2213,15 @@ self.kiri.license = exports.LICENSE;
setDevice: UC.newGroup("gcode", $('device')),
setDeviceFan: UC.newInput("fan power", {title:"set cooling fan power", modes:FDM, size:15}),
setDeviceTrack: UC.newInput("progress", {title:"output on each % progress", modes:FDM, size:15}),
setDeviceLayer: UC.newInput("layer", {title:"output at each layer change", modes:FDM, size:14, height: 2}),
setDeviceLayer: UC.newText("layer", {title:"output at each layer change", modes:FDM, size:14, height: 2}),
setDeviceToken: UC.newBoolean("token spacing", null, {title:"gcode token spacing", modes:CAM}),
setDeviceStrip: UC.newBoolean("strip comments", null, {title:"strip gcode comments", modes:CAM}),
setDeviceFExt: UC.newInput("file ext", {title:"file name exension", modes:CAM, size:5}),
setDeviceDwell: UC.newInput("dwell", {title:"gcode dwell script", modes:CAM, size:14, height:2}),
setDeviceChange: UC.newInput("tool change", {title:"tool change script", modes:CAM, size:14, height:2}),
setDevicePre: UC.newInput("header", {title:"gcode header script", modes:FDM_CAM, size:14, height:3}),
setDevicePost: UC.newInput("footer", {title:"gcode footer script", modes:FDM_CAM, size:14, height:3}),
setDeviceDwell: UC.newText("dwell", {title:"gcode dwell script", modes:CAM, size:14, height:2}),
setDeviceChange: UC.newText("tool change", {title:"tool change script", modes:CAM, size:14, height:2}),
setDevicePause: UC.newText("pause", {title:"gcode pause script", modes:FDM, size:14, height:3}),
setDevicePre: UC.newText("header", {title:"gcode header script", modes:FDM_CAM, size:14, height:3}),
setDevicePost: UC.newText("footer", {title:"gcode footer script", modes:FDM_CAM, size:14, height:3}),
tools: $('tools'),
toolsSave: $('tools-save'),
@ -2910,7 +2914,8 @@ self.kiri.license = exports.LICENSE;
},
pre: UI.setDevicePre.value.split('\n'),
post: UI.setDevicePost.value.split('\n'),
'dwell': UI.setDeviceDwell.value.split('\n'),
pause: UI.setDevicePause.value.split('\n'),
dwell: UI.setDeviceDwell.value.split('\n'),
'tool-change': UI.setDeviceChange.value.split('\n'),
'file-ext': UI.setDeviceFExt.value,
'token-space': UI.setDeviceToken.checked ? ' ' : '',
@ -2949,6 +2954,7 @@ self.kiri.license = exports.LICENSE;
gcodePre: valueOf(code.pre, []),
gcodePost: valueOf(code.post, []),
gcodeProc: valueOf(code.proc, ''),
gcodePause: valueOf(code.pause, []),
gcodeDwell: valueOf(code.dwell, []),
gcodeChange: valueOf(code['tool-change'], []),
gcodeFExt: valueOf(code['file-ext'], 'gcode'),
@ -2966,6 +2972,7 @@ self.kiri.license = exports.LICENSE;
// common
UI.setDevicePre.value = dev.gcodePre.join('\n');
UI.setDevicePost.value = dev.gcodePost.join('\n');
UI.setDevicePause.value = dev.gcodePause.join('\n');
UI.setDeviceWidth.value = dev.bedWidth;
UI.setDeviceDepth.value = dev.bedDepth;
UI.setDeviceHeight.value = dev.maxHeight;
@ -2990,6 +2997,7 @@ self.kiri.license = exports.LICENSE;
UI.deviceName,
UI.setDevicePre,
UI.setDevicePost,
UI.setDevicePause,
UI.setDeviceDepth,
UI.setDeviceWidth,
UI.setDeviceHeight,
@ -3034,7 +3042,7 @@ self.kiri.license = exports.LICENSE;
saveSettings();
} catch (e) {
console.log({error:e, device:code});
alert("invalid or deprecated device. please select a new device.");
// alert("invalid or deprecated device. please select a new device.");
showDevices();
}
clearWidgetCache();
@ -3042,6 +3050,9 @@ self.kiri.license = exports.LICENSE;
}
function renderDevices(devices) {
UI.devices.onclick = UC.hidePop;
UC.hidePop();
var selectedIndex = -1,
selected = currentDeviceName(),
devs = settings.devices;

View file

@ -29,6 +29,9 @@ var gs_moto_ui = exports;
bound: bound,
toInt: toInt,
toFloat: toFloat,
hidePop: hidePop,
isPopped: isPopped,
newText: newTextArea,
newLabel: newLabel,
newRange: newRangeField,
newInput: newInputField,
@ -156,6 +159,62 @@ var gs_moto_ui = exports;
return div;
}
var lastPop = null;
function hidePop() {
if (lastPop) lastPop.style.display = "none";
lastPop = null;
}
function isPopped() {
return lastPop !== null;
}
function newTextArea(label, options) {
var opt = options || {},
row = newDiv(options),
btn = DOC.createElement("button"),
box = DOC.createElement("div"),
pop = DOC.createElement("div"),
lbl = DOC.createElement("label"),
txt = DOC.createElement("textarea");
pop.setAttribute("class", "poptext flow-col");
box.setAttribute("style", "position: relative");
btn.appendChild(box);
box.appendChild(pop);
pop.appendChild(lbl);
pop.appendChild(txt);
lbl.appendChild(DOC.createTextNode(label));
txt.setAttribute("cols", 30);
txt.setAttribute("rows", 20);
txt.setAttribute("wrap", "off");
btn.appendChild(DOC.createTextNode("edit"));
btn.onclick = function(ev) {
ev.stopPropagation();
if (ev.target === txt) return;
var showing = pop === lastPop;
hidePop();
if (!showing) {
pop.style.display = "flex";
lastPop = pop;
}
};
addModeControls(btn, opt);
addId(btn, opt);
lastDiv.appendChild(row);
row.appendChild(newLabel(label));
row.appendChild(btn);
row.setAttribute("class", ["flow-row",lastGroup].join(" "));
if (opt.title) row.setAttribute("title", options.title);
btn.setVisible = row.setVisible;
return txt;
}
function newInputField(label, options) {
var row = newDiv(options),
hide = options && options.hide,
@ -183,6 +242,9 @@ var gs_moto_ui = exports;
if (options.bound) ip.bound = options.bound;
if (options.action) action = options.action;
}
ip.addEventListener('focus', function(event) {
hidePop();
});
if (action) {
ip.addEventListener('keyup', function(event) {
if (event.keyCode === 13) action(event);

View file

@ -61,6 +61,7 @@
* preview doesn't show proper z offsets
* trim support offset from layer below
* optional startpoint based on fill origin when seek > retract distance
* feather sharp tips by reducing extrusion in area of overlap
* add option to reduce poly speed to match shortest/slowest segment
(helps when no k-factor support in firmware)

View file

@ -156,7 +156,7 @@
</div>
</div>
<!-- GCode filter editor -->
<div id="devices" class="dialog">
<div id="devices" class="dialog flex-col">
<div id="devices-body" class="flow-col">
<div id="device-labels" class="flow-row">
<span>device</span>
@ -170,6 +170,9 @@
<div id="device"></div>
</div>
</div>
<div style="position:relative">
<div id="insert" style="position:absolute"></div>
</div>
<div id="device-action" class="flow-row">
<button id="device-add">+</button>
<button id="device-del">-</button>

View file

@ -576,3 +576,21 @@ button[import="1"] {
text-align: left;
color: rgba(0,0,0,0.85);
}
.poptext {
display: none;
position: absolute;
margin-left: 55px;
border: 5px solid gray;
border-radius: 3px;
transform: translate(0, -25%);
}
.poptext textarea {
opacity: 0.95;
overflow-y: scroll !important;
}
.poptext label {
width: 100% !important;
text-align: center !important;
background-color: #ddd;
}