stub in support client/worker generator functions
This commit is contained in:
parent
253d232be5
commit
c191e8bc04
8 changed files with 36 additions and 15 deletions
2
app.js
2
app.js
|
|
@ -271,6 +271,7 @@ const script = {
|
|||
"kiri/db",
|
||||
"kiri/slice",
|
||||
"kiri/layers",
|
||||
"kiri/client",
|
||||
"mode/fdm/driver",
|
||||
"mode/fdm/client",
|
||||
"mode/sla/driver",
|
||||
|
|
@ -285,7 +286,6 @@ const script = {
|
|||
"kiri/widget",
|
||||
"kiri/print",
|
||||
"kiri/codec",
|
||||
"kiri/client",
|
||||
"kiri/conf",
|
||||
"kiri/main",
|
||||
"kiri/init",
|
||||
|
|
|
|||
2
notes.md
2
notes.md
|
|
@ -13,8 +13,6 @@
|
|||
# - redo automatic supports using faces instead of deltas
|
||||
# - bind process to z ranges or boxed regions
|
||||
# - non-planar actual
|
||||
# `all`
|
||||
# - improve device list, selection, management, customization
|
||||
|
||||
## `C` cosmetic, `F` functional, `P` performance, `B` bug fix
|
||||
|
||||
|
|
|
|||
|
|
@ -1619,6 +1619,9 @@
|
|||
fdmSep: UC.newBlank({class:"pop-sep", modes:FDM}),
|
||||
sliceSupportSpan: UC.newInput(LANG.sp_span_s, {title:LANG.sp_span_l, bound:UC.bound(0.0,200.0), convert:UC.toFloat, modes:FDM, show: () => UI.sliceSupportEnable.checked}),
|
||||
sliceSupportEnable: UC.newBoolean(LANG.sp_auto_s, onBooleanClick, {title: LANG.sp_auto_l, modes:FDM, trigger:true}),
|
||||
// sliceSupportGen: UC.newRow([
|
||||
// UI.ssaGen = UC.newButton('detect', onButtonClick)
|
||||
// ], { modes: FDM }),
|
||||
|
||||
fdmSep: UC.newBlank({class:"pop-sep", modes:FDM}),
|
||||
sliceSupportManual: UC.newRow([
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@
|
|||
func.tabDone();
|
||||
alert = api.show.alert("analyzing parts...", 1000);
|
||||
traceOn = true;
|
||||
KIRI.client.traces((ids) => {
|
||||
CAM.traces((ids) => {
|
||||
api.hide.alert(alert);
|
||||
alert = api.show.alert("[esc] key cancels trace editing");
|
||||
KIRI.api.widgets.opacity(0.5);
|
||||
|
|
|
|||
|
|
@ -25,11 +25,11 @@
|
|||
KIRI.loader.push(function(API) {
|
||||
|
||||
if (KIRI.client)
|
||||
KIRI.client.traces = function(ondone) {
|
||||
CAM.traces = function(ondone) {
|
||||
KIRI.client.sync();
|
||||
let settings = API.conf.get();
|
||||
let widgets = API.widgets.map();
|
||||
send("traces", { settings }, output => {
|
||||
send("cam_traces", { settings }, output => {
|
||||
let ids = [];
|
||||
KIRI.codec.decode(output).forEach(rec => {
|
||||
ids.push(rec.id);
|
||||
|
|
@ -41,7 +41,7 @@
|
|||
};
|
||||
|
||||
if (KIRI.worker)
|
||||
KIRI.worker.traces = function(data, send) {
|
||||
KIRI.worker.cam_traces = function(data, send) {
|
||||
const { settings } = data;
|
||||
const widgets = Object.values(cache);
|
||||
const fresh = widgets.filter(widget => CAM.traces(settings, widget));
|
||||
|
|
|
|||
|
|
@ -39,17 +39,21 @@
|
|||
});
|
||||
api.event.on("button.click", target => {
|
||||
switch (target) {
|
||||
case api.ui.ssmAdd:
|
||||
return func.sadd();
|
||||
case api.ui.ssmDun:
|
||||
return func.sdone();
|
||||
case api.ui.ssaGen: return func.sgen();
|
||||
case api.ui.ssmAdd: return func.sadd();
|
||||
case api.ui.ssmDun: return func.sdone();
|
||||
case api.ui.ssmClr:
|
||||
api.uc.confirm("clear supports?").then(ok => {
|
||||
return api.uc.confirm("clear supports?").then(ok => {
|
||||
if (ok) func.sclear();
|
||||
});
|
||||
break;
|
||||
}
|
||||
});
|
||||
api.event.on("fdm.supports.gen", func.sgen = () => {
|
||||
alert = api.show.alert("analyzing part...", 1000);
|
||||
FDM.support_generate(done => {
|
||||
api.hide.alert(alert);
|
||||
});
|
||||
});
|
||||
api.event.on("fdm.supports.add", func.sadd = () => {
|
||||
alert = api.show.alert("[esc] key cancels support editing");
|
||||
api.feature.hover = true;
|
||||
|
|
|
|||
|
|
@ -33,4 +33,20 @@
|
|||
return btoa("; filename = kirimoto.gcode\n; machine = dv1MW0A000\n" + gcode);
|
||||
};
|
||||
|
||||
// defer loading until KIRI.client and KIRI.worker exist
|
||||
KIRI.loader.push(function(API) {
|
||||
|
||||
if (KIRI.client)
|
||||
// FDM.support_generate = KIRI.client.fdm_support_generate = function(ondone) {
|
||||
FDM.support_generate = function(ondone) {
|
||||
send('fdm_support_generate', {}, ondone);
|
||||
};
|
||||
|
||||
if (KIRI.worker)
|
||||
KIRI.worker.fdm_support_generate = function(data, send) {
|
||||
send.done();
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@
|
|||
</div>
|
||||
<div id="mod-setup" class="mdialog f-row">
|
||||
<div class="f-col left a-stretch">
|
||||
<label class="header">select device type</label>
|
||||
<label class="header">select a device type</label>
|
||||
<div class="f-col">
|
||||
<table><tr>
|
||||
<th><button id="mode-fdm" class="dev-type"><label>FDM</label></button></th>
|
||||
|
|
@ -276,7 +276,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="f-col grow a-stretch">
|
||||
<label class="header">details of selected device</label>
|
||||
<label class="header">selected device</label>
|
||||
<div class="f-row">
|
||||
<div id="device1" class="f-col t-body t-inset overy grow"></div>
|
||||
<div class="t-pad"></div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue