Added Gcode preview feature
This commit is contained in:
parent
7777ea6932
commit
c90474a90f
6 changed files with 21 additions and 0 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -3,3 +3,5 @@ tmp
|
||||||
.DS_Store
|
.DS_Store
|
||||||
node_modules
|
node_modules
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
logs/*
|
||||||
|
data/*
|
||||||
|
|
@ -619,6 +619,7 @@
|
||||||
exportOcto: false,
|
exportOcto: false,
|
||||||
exportGhost: false,
|
exportGhost: false,
|
||||||
exportLocal: true,
|
exportLocal: true,
|
||||||
|
exportCodePreview: false,
|
||||||
decimate: true,
|
decimate: true,
|
||||||
detail: "good",
|
detail: "good",
|
||||||
animesh: "200"
|
animesh: "200"
|
||||||
|
|
|
||||||
|
|
@ -425,6 +425,9 @@
|
||||||
let octo = set.controller.exportOcto && MODE !== MODES.CAM;
|
let octo = set.controller.exportOcto && MODE !== MODES.CAM;
|
||||||
let ghost = set.controller.exportGhost;
|
let ghost = set.controller.exportGhost;
|
||||||
let local = set.controller.exportLocal;
|
let local = set.controller.exportLocal;
|
||||||
|
let codepreview = set.controller.exportCodePreview;
|
||||||
|
$('code-preview-head').style.display = codepreview ? '' : 'none';
|
||||||
|
$('code-preview').style.display = codepreview ? '' : 'none';
|
||||||
$('print-download').onclick = download;
|
$('print-download').onclick = download;
|
||||||
$('print-filament-head').style.display = fdm ? '' : 'none';
|
$('print-filament-head').style.display = fdm ? '' : 'none';
|
||||||
$('print-filament-info').style.display = fdm ? '' : 'none';
|
$('print-filament-info').style.display = fdm ? '' : 'none';
|
||||||
|
|
@ -486,6 +489,9 @@
|
||||||
$('admin-gridlocal').onclick = admin_gridlocal;
|
$('admin-gridlocal').onclick = admin_gridlocal;
|
||||||
} catch (e) { console.log(e) }
|
} catch (e) { console.log(e) }
|
||||||
|
|
||||||
|
// preview of the generated GCODE
|
||||||
|
if (codepreview && gcode) $('code-preview-textarea').value = gcode;
|
||||||
|
|
||||||
// show dialog
|
// show dialog
|
||||||
API.modal.show('print');
|
API.modal.show('print');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,7 @@
|
||||||
control.exportOcto = UI.exportOcto.checked;
|
control.exportOcto = UI.exportOcto.checked;
|
||||||
control.exportGhost = UI.exportGhost.checked;
|
control.exportGhost = UI.exportGhost.checked;
|
||||||
control.exportLocal = UI.exportLocal.checked;
|
control.exportLocal = UI.exportLocal.checked;
|
||||||
|
control.exportCodePreview = UI.exportCodePreview.checked;
|
||||||
control.decimate = UI.decimate.checked;
|
control.decimate = UI.decimate.checked;
|
||||||
SPACE.view.setZoom(control.reverseZoom, control.zoomSpeed);
|
SPACE.view.setZoom(control.reverseZoom, control.zoomSpeed);
|
||||||
platform.layout();
|
platform.layout();
|
||||||
|
|
@ -1502,6 +1503,7 @@
|
||||||
exportOcto: UC.newBoolean(`OctoPrint`, booleanSave),
|
exportOcto: UC.newBoolean(`OctoPrint`, booleanSave),
|
||||||
exportGhost: UC.newBoolean(`Grid:Host`, booleanSave),
|
exportGhost: UC.newBoolean(`Grid:Host`, booleanSave),
|
||||||
exportLocal: UC.newBoolean(`Grid:Local`, booleanSave),
|
exportLocal: UC.newBoolean(`Grid:Local`, booleanSave),
|
||||||
|
exportCodePreview: UC.newBoolean(`Code Preview`, booleanSave),
|
||||||
|
|
||||||
parts: UC.newGroup(LANG.pt_menu, $('prefs-prt'), {inline: true}),
|
parts: UC.newGroup(LANG.pt_menu, $('prefs-prt'), {inline: true}),
|
||||||
detail: UC.newSelect(LANG.pt_qual_s, {title: LANG.pt_qual_l, action: detailSave}, "detail"),
|
detail: UC.newSelect(LANG.pt_qual_s, {title: LANG.pt_qual_l, action: detailSave}, "detail"),
|
||||||
|
|
|
||||||
|
|
@ -645,6 +645,11 @@ th, tr, td, label {
|
||||||
#print-download {
|
#print-download {
|
||||||
min-height: 4em !important;
|
min-height: 4em !important;
|
||||||
}
|
}
|
||||||
|
#code-preview-textarea {
|
||||||
|
width: 100%;
|
||||||
|
height: 250px;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
.mod-end {
|
.mod-end {
|
||||||
height: 10px;
|
height: 10px;
|
||||||
border-bottom-left-radius: 10px;
|
border-bottom-left-radius: 10px;
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,11 @@
|
||||||
<div><label>printed weight (g)</label><input id="print-weight" size="12" disabled="true" /></div>
|
<div><label>printed weight (g)</label><input id="print-weight" size="12" disabled="true" /></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="code-preview-head" class="header"><label>code preview</label></div>
|
||||||
|
<div id="code-preview" class="f-col box">
|
||||||
|
<div><textarea id="code-preview-textarea"></textarea></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="header"><label>gcode</label></div>
|
<div class="header"><label>gcode</label></div>
|
||||||
<div class="f-row box">
|
<div class="f-row box">
|
||||||
<button id="print-download" class="grow">download</button>
|
<button id="print-download" class="grow">download</button>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue