fix file export names for laser, sla. add device max power for lasers

This commit is contained in:
Stewart Allen 2024-12-04 13:56:35 -05:00
commit cbfa05e1da
9 changed files with 33 additions and 22 deletions

View file

@ -593,6 +593,7 @@ const conf = exports({
bedDepth: 200,
bedHeight: 2.5,
maxHeight: 100,
laserMaxPower: 255,
gcodePre: [],
gcodePost: [],
gcodeFExt: "",

View file

@ -209,6 +209,7 @@ gapp.register("kiri.devices", (root, exports) => {
ui.gcodeStrip,
ui.gcodeLaserOn,
ui.gcodeLaserOff,
ui.laserMaxPower,
ui.extPrev,
ui.extNext,
ui.extAdd,

View file

@ -109,36 +109,36 @@ function exportLaserDialog(data, names) {
function download_svg() {
api.util.download(
driver.exportSVG(settings, data),
$('print-filename').value + ".svg"
$('print-filename-laser').value + ".svg"
);
}
function download_dxf() {
api.util.download(
driver.exportDXF(settings, data),
$('print-filename').value + ".dxf"
$('print-filename-laser').value + ".dxf"
);
}
function download_gcode() {
api.util.download(
driver.exportGCode(settings, data),
$('print-filename').value + ".gcode"
$('print-filename-laser').value + ".gcode"
);
}
// api.ajax("/kiri/output-laser.html", function(html) {
api.modal.show('xlaser');
let segments = 0;
data.forEach(layer => { segments += layer.length });
// ui.print.innerHTML = html;
$('print-filename').value = filename;
$('print-lines').value = util.comma(segments);
$('print-svg').onclick = download_svg;
$('print-dxf').onclick = download_dxf;
$('print-lg').onclick = download_gcode;
// api.modal.show('print');
// });
api.modal.show('xlaser');
let segments = 0;
data.forEach(layer => { segments += layer.length });
$('print-filename-laser').value = filename;
$('print-lines').value = util.comma(segments);
$('print-svg').onclick = download_svg;
$('print-dxf').onclick = download_dxf;
$('print-lg').onclick = download_gcode;
console.log('laser export', { fileroot, filename });
}
function bindField(field, varname) {

View file

@ -996,6 +996,7 @@ gapp.register("kiri.init", (root, exports) => {
_____: newGroup(LANG.dv_gr_out, null, {group:"dgco", inline}),
gcodeStrip: newBoolean(LANG.dv_strc_s, onBooleanClick, {title:LANG.dv_strc_l, modes:CAM}),
gcodeSpace: newBoolean(LANG.dv_tksp_s, onBooleanClick, {title:LANG.dv_tksp_l, modes:CAM_LZR}),
laserMaxPower: newInput(LANG.ou_maxp_s, {title:LANG.ou_maxp_l, modes:LASER, size:7, text:true}),
useLaser: newBoolean(LANG.dv_lazr_s, onBooleanClick, {title:LANG.dv_lazr_l, modes:CAM}),
gcodeFExt: newInput(LANG.dv_fext_s, {title:LANG.dv_fext_l, modes:CAM_LZR, size:7, text:true}),
gcodeEd: newGroup(LANG.dv_gr_gco, $('dg'), {group:"dgcp", inline, modes:GCODE}),