/** Copyright Stewart Allen -- All Rights Reserved */ export const client = { init, printDownload }; function init(kiri, api) { api.event.on("mode.set", (mode) => { if (mode === 'SLA') { api.ui.func.preview.classList.add('hide'); } else { api.ui.func.preview.classList.remove('hide'); } }); } function printDownload(output, api, names) { const { file, width, height, layers, volume } = output; const fileroot = names[0] || "print"; const filename = `${fileroot}-${new Date().getTime().toString(36)}`; api.modal.show('xsla'); // api.ajax("/kiri/output-sla.html", html => { // api.ui.print.innerHTML = html; let settings = api.conf.get(), process = settings.process, device = settings.device, print_sec = (process.slaBaseLayers * process.slaBaseOn) + (layers - process.slaBaseLayers) * process.slaLayerOn; // add peel lift/drop times to total print time for (let i=0; i { saveFile(api, file, ".photon") }; break; case 'Anycubic.Photon.S': download.innerText += " .photons"; download.onclick = () => { saveFile(api, file, ".photons") }; break; case 'Creality.Halot.Sky': default: download.innerText += " .cxdlp"; download.onclick = () => { saveFile(api, file, ".cxdlp") }; break; } // api.modal.show('print'); // }); } function saveFile(api, file, ext) { api.util.download(file, $('print-filename-sla').value + ext); api.modal.hide(); }