checkpoint cam-op-pop editing

This commit is contained in:
Stewart Allen 2020-12-24 00:11:38 -05:00
commit fd3eb613aa
7 changed files with 311 additions and 219 deletions

View file

@ -1637,102 +1637,102 @@
(UI.ssmClr = UC.newButton(undefined, onButtonClick, {icon:'<i class="fas fa-trash-alt"></i>'})) (UI.ssmClr = UC.newButton(undefined, onButtonClick, {icon:'<i class="fas fa-trash-alt"></i>'}))
], {modes:FDM, class:"ext-buttons f-row"}), ], {modes:FDM, class:"ext-buttons f-row"}),
camRough: UC.newGroup(LANG.cr_menu, null, {modes:CAM, class:"rough"}), // camRough: UC.newGroup(LANG.cr_menu, null, {modes:CAM, class:"rough"}),
camRoughTool: UC.newSelect(LANG.cc_tool, {modes:CAM}), // camRoughTool: UC.newSelect(LANG.cc_tool, {modes:CAM}),
camSep: UC.newBlank({class:"pop-sep"}), // camSep: UC.newBlank({class:"pop-sep"}),
camRoughSpindle: UC.newInput(LANG.cc_spnd_s, {title:LANG.cc_spnd_l, convert:UC.toInt, modes:CAM, visible:spindleShow}), // camRoughSpindle: UC.newInput(LANG.cc_spnd_s, {title:LANG.cc_spnd_l, convert:UC.toInt, modes:CAM, visible:spindleShow}),
camRoughDown: UC.newInput(LANG.cc_sdwn_s, {title:LANG.cc_sdwn_l, convert:UC.toFloat, modes:CAM, units:true}), // camRoughDown: UC.newInput(LANG.cc_sdwn_s, {title:LANG.cc_sdwn_l, convert:UC.toFloat, modes:CAM, units:true}),
camRoughOver: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, bound:UC.bound(0.01,1.0), modes:CAM}), // camRoughOver: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, bound:UC.bound(0.01,1.0), modes:CAM}),
camRoughSpeed: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, modes:CAM, units:true}), // camRoughSpeed: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, modes:CAM, units:true}),
camRoughPlunge: UC.newInput(LANG.cc_plng_s, {title:LANG.cc_plng_l, convert:UC.toInt, modes:CAM, units:true}), // camRoughPlunge: UC.newInput(LANG.cc_plng_s, {title:LANG.cc_plng_l, convert:UC.toInt, modes:CAM, units:true}),
camRoughStock: UC.newInput(LANG.cr_lsto_s, {title:LANG.cr_lsto_l, convert:UC.toFloat, modes:CAM, units:true}), // camRoughStock: UC.newInput(LANG.cr_lsto_s, {title:LANG.cr_lsto_l, convert:UC.toFloat, modes:CAM, units:true}),
camSep: UC.newBlank({class:"pop-sep"}), // camSep: UC.newBlank({class:"pop-sep"}),
camRoughVoid: UC.newBoolean(LANG.cr_clrp_s, onBooleanClick, {title:LANG.cr_clrp_l, modes:CAM}), // camRoughVoid: UC.newBoolean(LANG.cr_clrp_s, onBooleanClick, {title:LANG.cr_clrp_l, modes:CAM}),
camRoughFlat: UC.newBoolean(LANG.cr_clrf_s, onBooleanClick, {title:LANG.cr_clrf_l, modes:CAM}), // camRoughFlat: UC.newBoolean(LANG.cr_clrf_s, onBooleanClick, {title:LANG.cr_clrf_l, modes:CAM}),
camRoughTop: UC.newBoolean(LANG.cr_clrt_s, onBooleanClick, {title:LANG.cr_clrt_l, modes:CAM}), // camRoughTop: UC.newBoolean(LANG.cr_clrt_s, onBooleanClick, {title:LANG.cr_clrt_l, modes:CAM}),
camRoughIn: UC.newBoolean(LANG.cr_olin_s, onBooleanClick, {title:LANG.cr_olin_l, modes:CAM}), // camRoughIn: UC.newBoolean(LANG.cr_olin_s, onBooleanClick, {title:LANG.cr_olin_l, modes:CAM}),
camSep: UC.newBlank({class:"pop-sep"}), // camSep: UC.newBlank({class:"pop-sep"}),
camRoughAdd: UC.newRow([ // camRoughAdd: UC.newRow([
UI.crAdd = UC.newButton('add', onButtonClick, {class: "f-col grow a-center"}) // UI.crAdd = UC.newButton('add', onButtonClick, {class: "f-col grow a-center"})
], { modes: CAM, class: "ext-buttons f-row grow" }), // ], { modes: CAM, class: "ext-buttons f-row grow" }),
//
camOutline: UC.newGroup(LANG.co_menu, null, {modes:CAM, class:"outline"}), // camOutline: UC.newGroup(LANG.co_menu, null, {modes:CAM, class:"outline"}),
camOutlineTool: UC.newSelect(LANG.cc_tool, {modes:CAM}), // camOutlineTool: UC.newSelect(LANG.cc_tool, {modes:CAM}),
camSep: UC.newBlank({class:"pop-sep"}), // camSep: UC.newBlank({class:"pop-sep"}),
camOutlineSpindle: UC.newInput(LANG.cc_spnd_s, {title:LANG.cc_spnd_l, convert:UC.toInt, modes:CAM, visible:spindleShow}), // camOutlineSpindle: UC.newInput(LANG.cc_spnd_s, {title:LANG.cc_spnd_l, convert:UC.toInt, modes:CAM, visible:spindleShow}),
camOutlineDown: UC.newInput(LANG.cc_sdwn_s, {title:LANG.cc_sdwn_l, convert:UC.toFloat, modes:CAM, units:true}), // camOutlineDown: UC.newInput(LANG.cc_sdwn_s, {title:LANG.cc_sdwn_l, convert:UC.toFloat, modes:CAM, units:true}),
camOutlineOver: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, modes:CAM, bound:UC.bound(0.01,1.0), units:true, show:() => { return UI.camOutlineWide.checked }}), // camOutlineOver: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, modes:CAM, bound:UC.bound(0.01,1.0), units:true, show:() => { return UI.camOutlineWide.checked }}),
camOutlineSpeed: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, modes:CAM, units:true}), // camOutlineSpeed: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, modes:CAM, units:true}),
camOutlinePlunge: UC.newInput(LANG.cc_plng_s, {title:LANG.cc_plng_l, convert:UC.toInt, modes:CAM, units:true}), // camOutlinePlunge: UC.newInput(LANG.cc_plng_s, {title:LANG.cc_plng_l, convert:UC.toInt, modes:CAM, units:true}),
camSep: UC.newBlank({class:"pop-sep"}), // camSep: UC.newBlank({class:"pop-sep"}),
camOutlineDogbone: UC.newBoolean(LANG.co_dogb_s, onBooleanClick, {title:LANG.co_dogb_l, modes:CAM, show:() => { return !UI.camOutlineWide.checked }}), // camOutlineDogbone: UC.newBoolean(LANG.co_dogb_s, onBooleanClick, {title:LANG.co_dogb_l, modes:CAM, show:() => { return !UI.camOutlineWide.checked }}),
camOutlineIn: UC.newBoolean(LANG.co_olin_s, onBooleanClick, {title:LANG.co_olin_l, modes:CAM, show:() => { return !UI.camOutlineOut.checked }}), // camOutlineIn: UC.newBoolean(LANG.co_olin_s, onBooleanClick, {title:LANG.co_olin_l, modes:CAM, show:() => { return !UI.camOutlineOut.checked }}),
camOutlineOut: UC.newBoolean(LANG.co_olot_s, onBooleanClick, {title:LANG.co_olot_l, modes:CAM, show:() => { return !UI.camOutlineIn.checked }}), // camOutlineOut: UC.newBoolean(LANG.co_olot_s, onBooleanClick, {title:LANG.co_olot_l, modes:CAM, show:() => { return !UI.camOutlineIn.checked }}),
camOutlineWide: UC.newBoolean(LANG.co_wide_s, onBooleanClick, {title:LANG.co_wide_l, modes:CAM, show:() => { return !UI.camOutlineIn.checked }}), // camOutlineWide: UC.newBoolean(LANG.co_wide_s, onBooleanClick, {title:LANG.co_wide_l, modes:CAM, show:() => { return !UI.camOutlineIn.checked }}),
camSep: UC.newBlank({class:"pop-sep"}), // camSep: UC.newBlank({class:"pop-sep"}),
camOutlineAdd: UC.newRow([ // camOutlineAdd: UC.newRow([
UI.coAdd = UC.newButton('add', onButtonClick, {class: "f-col grow a-center"}) // UI.coAdd = UC.newButton('add', onButtonClick, {class: "f-col grow a-center"})
], { modes: CAM, class: "ext-buttons f-row grow" }), // ], { modes: CAM, class: "ext-buttons f-row grow" }),
//
camContour: UC.newGroup(LANG.cn_menu, null, {modes:CAM}), // camContour: UC.newGroup(LANG.cn_menu, null, {modes:CAM}),
camContourTool: UC.newSelect(LANG.cc_tool, {modes:CAM}), // camContourTool: UC.newSelect(LANG.cc_tool, {modes:CAM}),
camSep: UC.newBlank({class:"pop-sep"}), // camSep: UC.newBlank({class:"pop-sep"}),
camContourSpindle: UC.newInput(LANG.cc_spnd_s, {title:LANG.cc_spnd_l, convert:UC.toInt, modes:CAM, visible:spindleShow}), // camContourSpindle: UC.newInput(LANG.cc_spnd_s, {title:LANG.cc_spnd_l, convert:UC.toInt, modes:CAM, visible:spindleShow}),
camContourOver: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, bound:UC.bound(0.01,1.0), modes:CAM}), // camContourOver: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, bound:UC.bound(0.01,1.0), modes:CAM}),
camContourSpeed: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, modes:CAM, units:true}), // camContourSpeed: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, modes:CAM, units:true}),
camContourAngle: UC.newInput(LANG.cf_angl_s, {title:LANG.cf_angl_l, convert:UC.toFloat, bound:UC.bound(45,90), modes:CAM}), // camContourAngle: UC.newInput(LANG.cf_angl_s, {title:LANG.cf_angl_l, convert:UC.toFloat, bound:UC.bound(45,90), modes:CAM}),
camTolerance: UC.newInput(LANG.ou_toll_s, {title:LANG.ou_toll_l, convert:UC.toFloat, bound:UC.bound(0,10.0), modes:CAM, units:true}), // camTolerance: UC.newInput(LANG.ou_toll_s, {title:LANG.ou_toll_l, convert:UC.toFloat, bound:UC.bound(0,10.0), modes:CAM, units:true}),
camSep: UC.newBlank({class:"pop-sep"}), // camSep: UC.newBlank({class:"pop-sep"}),
camContourCurves: UC.newBoolean(LANG.cf_curv_s, onBooleanClick, {title:LANG.cf_curv_l, modes:CAM}), // camContourCurves: UC.newBoolean(LANG.cf_curv_s, onBooleanClick, {title:LANG.cf_curv_l, modes:CAM}),
camContourIn: UC.newBoolean(LANG.cf_olin_s, onBooleanClick, {title:LANG.cf_olin_l, modes:CAM}), // camContourIn: UC.newBoolean(LANG.cf_olin_s, onBooleanClick, {title:LANG.cf_olin_l, modes:CAM}),
camSep: UC.newBlank({class:"pop-sep"}), // camSep: UC.newBlank({class:"pop-sep"}),
camOutlineAdd: UC.newRow([ // camOutlineAdd: UC.newRow([
UI.ccxAdd = UC.newButton('add x', onButtonClick, {class: "f-col grow a-center"}), // UI.ccxAdd = UC.newButton('add x', onButtonClick, {class: "f-col grow a-center"}),
UI.ccyAdd = UC.newButton('add y', onButtonClick, {class: "f-col grow a-center"}) // UI.ccyAdd = UC.newButton('add y', onButtonClick, {class: "f-col grow a-center"})
], { modes: CAM, class: "ext-buttons f-row grow" }), // ], { modes: CAM, class: "ext-buttons f-row grow" }),
//
camTracing: UC.newGroup(LANG.cu_menu, null, {modes:CAM}), // camTracing: UC.newGroup(LANG.cu_menu, null, {modes:CAM}),
camTraceTool: UC.newSelect(LANG.cc_tool, {modes:CAM}), // camTraceTool: UC.newSelect(LANG.cc_tool, {modes:CAM}),
camSep: UC.newBlank({class:"pop-sep"}), // camSep: UC.newBlank({class:"pop-sep"}),
camTraceType: UC.newSelect(LANG.cu_type_s, {title:LANG.cu_type_l, modes:CAM}, "trace"), // camTraceType: UC.newSelect(LANG.cu_type_s, {title:LANG.cu_type_l, modes:CAM}, "trace"),
camTraceSpeed: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, modes:CAM}), // camTraceSpeed: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, modes:CAM}),
camTracePlunge: UC.newInput(LANG.cc_plng_s, {title:LANG.cc_plng_l, convert:UC.toFloat, modes:CAM, units:true}), // camTracePlunge: UC.newInput(LANG.cc_plng_s, {title:LANG.cc_plng_l, convert:UC.toFloat, modes:CAM, units:true}),
camSep: UC.newBlank({class:"pop-sep"}), // camSep: UC.newBlank({class:"pop-sep"}),
camTraceSelect: UC.newRow([ // camTraceSelect: UC.newRow([
(UI.traceAdd = UC.newButton(undefined, onButtonClick, {icon:'<i class="fas fa-plus"></i>'})), // (UI.traceAdd = UC.newButton(undefined, onButtonClick, {icon:'<i class="fas fa-plus"></i>'})),
(UI.traceDun = UC.newButton(undefined, onButtonClick, {icon:'<i class="fas fa-check"></i>'})), // (UI.traceDun = UC.newButton(undefined, onButtonClick, {icon:'<i class="fas fa-check"></i>'})),
(UI.traceClr = UC.newButton(undefined, onButtonClick, {icon:'<i class="fas fa-trash-alt"></i>'})) // (UI.traceClr = UC.newButton(undefined, onButtonClick, {icon:'<i class="fas fa-trash-alt"></i>'}))
], {modes:CAM, class:"ext-buttons f-row"}), // ], {modes:CAM, class:"ext-buttons f-row"}),
//
camDrill: UC.newGroup(LANG.cd_menu, null, {modes:CAM}), // camDrill: UC.newGroup(LANG.cd_menu, null, {modes:CAM}),
camDrillTool: UC.newSelect(LANG.cc_tool, {modes:CAM}), // camDrillTool: UC.newSelect(LANG.cc_tool, {modes:CAM}),
camSep: UC.newBlank({class:"pop-sep"}), // camSep: UC.newBlank({class:"pop-sep"}),
camDrillSpindle: UC.newInput(LANG.cc_spnd_s, {title:LANG.cc_spnd_l, convert:UC.toInt, modes:CAM, visible:spindleShow}), // camDrillSpindle: UC.newInput(LANG.cc_spnd_s, {title:LANG.cc_spnd_l, convert:UC.toInt, modes:CAM, visible:spindleShow}),
camDrillDown: UC.newInput(LANG.cd_plpr_s, {title:LANG.cd_plpr_l, convert:UC.toFloat, modes:CAM, units:true}), // camDrillDown: UC.newInput(LANG.cd_plpr_s, {title:LANG.cd_plpr_l, convert:UC.toFloat, modes:CAM, units:true}),
camDrillDownSpeed: UC.newInput(LANG.cc_plng_s, {title:LANG.cc_plng_l, convert:UC.toFloat, modes:CAM, units:true}), // camDrillDownSpeed: UC.newInput(LANG.cc_plng_s, {title:LANG.cc_plng_l, convert:UC.toFloat, modes:CAM, units:true}),
camDrillDwell: UC.newInput(LANG.cd_dwll_s, {title:LANG.cd_dwll_l, convert:UC.toFloat, modes:CAM}), // camDrillDwell: UC.newInput(LANG.cd_dwll_s, {title:LANG.cd_dwll_l, convert:UC.toFloat, modes:CAM}),
camDrillLift: UC.newInput(LANG.cd_lift_s, {title:LANG.cd_lift_l, convert:UC.toFloat, modes:CAM, units:true}), // camDrillLift: UC.newInput(LANG.cd_lift_s, {title:LANG.cd_lift_l, convert:UC.toFloat, modes:CAM, units:true}),
camSep: UC.newBlank({class:"pop-sep"}), // camSep: UC.newBlank({class:"pop-sep"}),
// camDrillingOn: UC.newBoolean(LANG.enable, onBooleanClick, {modes:CAM}), // // camDrillingOn: UC.newBoolean(LANG.enable, onBooleanClick, {modes:CAM}),
camDrillAdd: UC.newRow([ // camDrillAdd: UC.newRow([
UI.drAdd = UC.newButton('add', onButtonClick, {class: "f-col grow a-center"}) // UI.drAdd = UC.newButton('add', onButtonClick, {class: "f-col grow a-center"})
], { modes: CAM, class: "ext-buttons f-row grow" }), // ], { modes: CAM, class: "ext-buttons f-row grow" }),
camSep: UC.newBlank({class:"pop-sep"}), // camSep: UC.newBlank({class:"pop-sep"}),
camSep: UC.newBlank({class:"pop-sep"}), // camSep: UC.newBlank({class:"pop-sep"}),
camDrillAdd: UC.newRow([ // camDrillAdd: UC.newRow([
UC.newLabel('registrations', {class: "f-col grow center"}) // UC.newLabel('registrations', {class: "f-col grow center"})
], { modes: CAM, class: "ext-buttons f-row" }), // ], { modes: CAM, class: "ext-buttons f-row" }),
// camDrillReg: UC.newSelect(LANG.cd_regi_s, {modes:CAM, title:LANG.cd_regi_l}, "drillreg"), // // camDrillReg: UC.newSelect(LANG.cd_regi_s, {modes:CAM, title:LANG.cd_regi_l}, "drillreg"),
camDrillAdd: UC.newRow([ // camDrillAdd: UC.newRow([
UI.drX2Add = UC.newButton('x axis 2', onButtonClick, {class: "f-col grow a-center"}), // UI.drX2Add = UC.newButton('x axis 2', onButtonClick, {class: "f-col grow a-center"}),
UI.drX3Add = UC.newButton('x axis 3', onButtonClick, {class: "f-col grow a-center"}), // UI.drX3Add = UC.newButton('x axis 3', onButtonClick, {class: "f-col grow a-center"}),
], { modes: CAM, xclass: "ext-buttons f-row grow" }), // ], { modes: CAM, xclass: "ext-buttons f-row grow" }),
camDrillAdd: UC.newRow([ // camDrillAdd: UC.newRow([
UI.drY2Add = UC.newButton('y axis 2', onButtonClick, {class: "f-col grow a-center"}), // UI.drY2Add = UC.newButton('y axis 2', onButtonClick, {class: "f-col grow a-center"}),
UI.drY3Add = UC.newButton('y axis 3', onButtonClick, {class: "f-col grow a-center"}), // UI.drY3Add = UC.newButton('y axis 3', onButtonClick, {class: "f-col grow a-center"}),
], { modes: CAM, xclass: "ext-buttons f-row grow" }), // ], { modes: CAM, xclass: "ext-buttons f-row grow" }),
//
camSep1: UC.newGroup(null, null, {modes:CAM, class:"set-sep"}), // camSep1: UC.newGroup(null, null, {modes:CAM, class:"set-sep"}),
camTabs: UC.newGroup(LANG.ct_menu, null, {modes:CAM, marker:true}), camTabs: UC.newGroup(LANG.ct_menu, null, {modes:CAM, marker:true}),
camTabsWidth: UC.newInput(LANG.ct_wdth_s, {title:LANG.ct_wdth_l, convert:UC.toFloat, bound:UC.bound(0.005,100), modes:CAM, units:true}), camTabsWidth: UC.newInput(LANG.ct_wdth_s, {title:LANG.ct_wdth_l, convert:UC.toFloat, bound:UC.bound(0.005,100), modes:CAM, units:true}),

View file

@ -157,13 +157,6 @@
{ name: "4", id: 4 }, { name: "4", id: 4 },
{ name: "8", id: 8 } { name: "8", id: 8 }
], ],
// drillreg: [
// { name: "none" },
// { name: "x axis" },
// { name: "y axis" },
// { name: "x axis 3" },
// { name: "y axis 3" }
// ],
detail: [ detail: [
{ name: "best" }, { name: "best" },
{ name: "good" }, { name: "good" },

View file

@ -19,7 +19,7 @@
current, current,
API, FDM, SPACE, STACKS, MODES, VIEWS, UI, UC, LANG; API, FDM, SPACE, STACKS, MODES, VIEWS, UI, UC, LANG;
let traceOp = { type: "trace" }, let traceOp = { type: "trace", mode:"follow", tool: 1000, rate: 1000, plunge: 200 },
zaxis = { x: 0, y: 0, z: 1 }, zaxis = { x: 0, y: 0, z: 1 },
popOp = {}, popOp = {},
func = {}; func = {};
@ -65,7 +65,7 @@
UI.label.export.innerText = 'export'; UI.label.export.innerText = 'export';
} else { } else {
UI.label.slice.innerText = 'start'; UI.label.slice.innerText = 'start';
checkOutlineSettings(api.conf.get()); // checkOutlineSettings(api.conf.get());
} }
// do not persist traces across page reloads // do not persist traces across page reloads
func.traceClear(); func.traceClear();
@ -81,15 +81,15 @@
func.opRender(); func.opRender();
}); });
function checkOutlineSettings(settings) { // function checkOutlineSettings(settings) {
let ui = api.ui, proc = settings.process; // let ui = api.ui, proc = settings.process;
// fix invalid in/out enabled condition // // fix invalid in/out enabled condition
if (ui.camOutlineIn.checked && ui.camOutlineOut.checked) { // if (ui.camOutlineIn.checked && ui.camOutlineOut.checked) {
proc.camOutlineIn = proc.camOutlineOut = false; // proc.camOutlineIn = proc.camOutlineOut = false;
ui.camOutlineIn.checked = ui.camOutlineOut.checked = false; // ui.camOutlineIn.checked = ui.camOutlineOut.checked = false;
api.uc.refresh(); // api.uc.refresh();
} // }
} // }
api.event.on("settings.saved", (settings) => { api.event.on("settings.saved", (settings) => {
current = settings; current = settings;
@ -110,7 +110,7 @@
if (wannot.tab && wannot.tab.length) hasTabs = true; if (wannot.tab && wannot.tab.length) hasTabs = true;
if (wannot.trace && wannot.trace.length) hasTraces = true; if (wannot.trace && wannot.trace.length) hasTraces = true;
}); });
checkOutlineSettings(settings); // checkOutlineSettings(settings);
// show/hide dots in enabled process pop buttons // show/hide dots in enabled process pop buttons
api.ui.camTabs.marker.style.display = hasTabs ? 'flex' : 'none'; api.ui.camTabs.marker.style.display = hasTabs ? 'flex' : 'none';
api.ui.camStock.marker.style.display = proc.camStockOn ? 'flex' : 'none'; api.ui.camStock.marker.style.display = proc.camStockOn ? 'flex' : 'none';
@ -154,31 +154,43 @@
} }
}); });
// TAB/TRACE BUTTON HANDLERS $('op-add').onmouseenter = () => {
api.event.on("button.click", target => { if (func.unpop) func.unpop();
};
$('op-add-list').onclick = (ev) => {
let settings = API.conf.get(); let settings = API.conf.get();
let { process, device } = settings; let { process, device } = settings;
let drill; switch (ev.target.innerText) {
switch (target) { case "rough":
case api.ui.tabAdd: func.opAddRough();
return func.tabAdd();
case api.ui.tabDun:
return func.tabDone();
case api.ui.tabClr:
api.uc.confirm("clear tabs?").then(ok => {
if (ok) func.tabClear();
});
break; break;
case api.ui.traceAdd: case "outline":
return func.traceAdd(); func.opAddOutline();
case api.ui.traceDun:
return func.traceDone();
case api.ui.traceClr:
api.uc.confirm("clear traces?").then(ok => {
if (ok) func.traceClear();
});
break; break;
case api.ui.crAdd: case "contour x":
func.opAddContour('x');
break;
case "contour y":
func.opAddContour('y');
break;
case "register x":
func.opAddRegister('X', 2);
break;
case "register y":
func.opAddRegister('Y', 2);
break;
case "drill":
func.opAddDrill();
break;
case "trace":
func.opAdd(traceOp);
break;
}
};
func.opAddRough = () => {
let process = API.conf.get().process;
func.opAdd({ func.opAdd({
type: "rough", type: "rough",
tool: process.camRoughTool, tool: process.camRoughTool,
@ -193,8 +205,10 @@
inside: process.camRoughIn, inside: process.camRoughIn,
top: process.camRoughTop top: process.camRoughTop
}); });
break; };
case api.ui.coAdd:
func.opAddOutline = () => {
let process = API.conf.get().process;
func.opAdd({ func.opAdd({
type: "outline", type: "outline",
tool: process.camOutlineTool, tool: process.camOutlineTool,
@ -208,10 +222,12 @@
inside: process.camOutlineIn, inside: process.camOutlineIn,
wide: process.camOutlineWide wide: process.camOutlineWide
}); });
break; };
case api.ui.ccxAdd:
func.opAddContour = (axis) => {
let process = API.conf.get().process;
func.opAdd({ func.opAdd({
type: "contour x", type: "contour",
tool: process.camContourTool, tool: process.camContourTool,
spindle: process.camContourSpindle, spindle: process.camContourSpindle,
step: process.camContourOver, step: process.camContourOver,
@ -219,23 +235,13 @@
angle: process.camContourAngle, angle: process.camContourAngle,
tolerance: process.camTolerance, tolerance: process.camTolerance,
curves: process.camContourCurves, curves: process.camContourCurves,
inside: process.camContourIn inside: process.camContourIn,
axis: axis.toUpperCase()
}); });
break; };
case api.ui.ccyAdd:
func.opAdd({ func.opAddDrill = () => {
type: "contour y", let process = API.conf.get().process;
tool: process.camContourTool,
spindle: process.camContourSpindle,
step: process.camContourOver,
rate: process.camContourSpeed,
angle: process.camContourAngle,
tolerance: process.camTolerance,
curves: process.camContourCurves,
inside: process.camContourIn
});
break;
case api.ui.drAdd:
func.opAdd({ func.opAdd({
type: "drill", type: "drill",
tool: process.camDrillTool, tool: process.camDrillTool,
@ -245,21 +251,10 @@
dwell: process.camDrillDwell, dwell: process.camDrillDwell,
lift: process.camDrillLift lift: process.camDrillLift
}); });
break; };
case api.ui.drX2Add:
drill = { axis: "X", points: 2 }; func.opAddRegister = (axis, points) => {
break; let process = API.conf.get().process;
case api.ui.drX3Add:
drill = { axis: "X", points: 3 };
break;
case api.ui.drY2Add:
drill = { axis: "Y", points: 2 };
break;
case api.ui.drY3Add:
drill = { axis: "Y", points: 3 };
break;
}
if (drill) {
func.opAdd({ func.opAdd({
type: "register", type: "register",
tool: process.camDrillTool, tool: process.camDrillTool,
@ -268,9 +263,63 @@
rate: process.camDrillDownSpeed, rate: process.camDrillDownSpeed,
dwell: process.camDrillDwell, dwell: process.camDrillDwell,
lift: process.camDrillLift, lift: process.camDrillLift,
points: drill.points, points: points,
axis: drill.axis axis: axis.toUpperCase()
}); });
};
// TAB/TRACE BUTTON HANDLERS
api.event.on("button.click", target => {
let process = API.conf.get().process;
switch (target) {
case api.ui.tabAdd:
return func.tabAdd();
case api.ui.tabDun:
return func.tabDone();
case api.ui.tabClr:
api.uc.confirm("clear tabs?").then(ok => {
if (ok) func.tabClear();
});
break;
case api.ui.traceAdd:
case api.ui.traceAdd2:
return func.traceAdd();
case api.ui.traceDun:
case api.ui.traceDun2:
return func.traceDone();
case api.ui.traceClr:
case api.ui.traceClr2:
api.uc.confirm("clear traces?").then(ok => {
if (ok) func.traceClear();
});
break;
case api.ui.crAdd:
func.opAddRough();
break;
case api.ui.coAdd:
func.opAddOutline();
break;
case api.ui.ccxAdd:
func.opAddContour('x');
break;
case api.ui.ccyAdd:
func.opAddContour('y');
break;
case api.ui.drAdd:
func.opAddDrill();
break;
case api.ui.drX2Add:
func.opAddRegister("X", 2);
break;
case api.ui.drX3Add:
func.opAddRegister("X", 3);
break;
case api.ui.drY2Add:
func.opAddRegister("Y", 2);
break;
case api.ui.drY3Add:
func.opAddRegister("Y", 3);
break;
} }
}); });
@ -301,10 +350,8 @@
if (!isCamMode) return; if (!isCamMode) return;
let mark = Date.now(); let mark = Date.now();
let html = []; let html = [];
let ops = current.process.ops; let oplist = current.process.ops;
let oplist = ops && ops.length > 0 ? ops : [{ $('ophint').style.display = oplist.length === 0 ? 'flex' : 'none';
type: "use right menu to add milling operations ... drag & drop to re-order"
}];
let bind = {}; let bind = {};
let scale = API.view.unit_scale(); let scale = API.view.unit_scale();
oplist.forEach((rec,i) => { oplist.forEach((rec,i) => {
@ -343,7 +390,7 @@
}; };
el.onmouseenter = (ev) => { el.onmouseenter = (ev) => {
if (unpop) unpop(); if (unpop) unpop();
unpop = el.unpop; unpop = func.unpop = el.unpop;
inside = true; inside = true;
poprec.use(rec); poprec.use(rec);
el.appendChild(poprec.div); el.appendChild(poprec.div);
@ -380,9 +427,9 @@
ev.stopPropagation(); ev.stopPropagation();
ev.preventDefault(); ev.preventDefault();
} }
ops.length = 0; oplist.length = 0;
for (let child of listel.childNodes) { for (let child of listel.childNodes) {
ops.push(child.rec); oplist.push(child.rec);
} }
API.conf.save(); API.conf.save();
func.opRender(); func.opRender();
@ -747,8 +794,9 @@
wide: UC.newBoolean(LANG.co_wide_s, undefined, {title:LANG.co_wide_l, show:(op) => { return !op.inputs.inside.checked }}) wide: UC.newBoolean(LANG.co_wide_s, undefined, {title:LANG.co_wide_l, show:(op) => { return !op.inputs.inside.checked }})
}; };
createPopOp('contour x').inputs = { createPopOp('contour').inputs = {
tool: UC.newSelect(LANG.cc_tool, {}, "tools"), tool: UC.newSelect(LANG.cc_tool, {}, "tools"),
axis: UC.newSelect(LANG.cd_axis, {}, "regaxis"),
sep: UC.newBlank({class:"pop-sep"}), sep: UC.newBlank({class:"pop-sep"}),
spindle: UC.newInput(LANG.cc_spnd_s, {title:LANG.cc_spnd_l, convert:UC.toInt, show:hasSpindle}), spindle: UC.newInput(LANG.cc_spnd_s, {title:LANG.cc_spnd_l, convert:UC.toInt, show:hasSpindle}),
step: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, bound:UC.bound(0.01,1.0)}), step: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, bound:UC.bound(0.01,1.0)}),
@ -760,21 +808,20 @@
inside: UC.newBoolean(LANG.cf_olin_s, undefined, {title:LANG.cf_olin_l}) inside: UC.newBoolean(LANG.cf_olin_s, undefined, {title:LANG.cf_olin_l})
}; };
createPopOp('contour y').inputs = { createPopOp('trace').inputs = {
tool: UC.newSelect(LANG.cc_tool, {}, "tools"), tool: UC.newSelect(LANG.cc_tool, {}, "tools"),
sep: UC.newBlank({class:"pop-sep"}), sep: UC.newBlank({class:"pop-sep"}),
spindle: UC.newInput(LANG.cc_spnd_s, {title:LANG.cc_spnd_l, convert:UC.toInt, show:hasSpindle}), mode: UC.newSelect(LANG.cu_type_s, {title:LANG.cu_type_l}, "trace"),
step: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, bound:UC.bound(0.01,1.0)}),
rate: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, units:true}), rate: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, units:true}),
angle: UC.newInput(LANG.cf_angl_s, {title:LANG.cf_angl_l, convert:UC.toFloat, bound:UC.bound(45,90)}), plunge: UC.newInput(LANG.cc_plng_s, {title:LANG.cc_plng_l, convert:UC.toInt, units:true}),
tolerance: UC.newInput(LANG.ou_toll_s, {title:LANG.ou_toll_l, convert:UC.toFloat, bound:UC.bound(0,10.0), units:true}),
sep: UC.newBlank({class:"pop-sep"}), sep: UC.newBlank({class:"pop-sep"}),
curves: UC.newBoolean(LANG.cf_curv_s, undefined, {title:LANG.cf_curv_l}), select: UC.newRow([
inside: UC.newBoolean(LANG.cf_olin_s, undefined, {title:LANG.cf_olin_l}) UC.newButton(undefined, func.traceAdd, {icon:'<i class="fas fa-plus"></i>'}),
UC.newButton(undefined, func.traceDone, {icon:'<i class="fas fa-check"></i>'}),
UC.newButton(undefined, func.traceClear, {icon:'<i class="fas fa-trash-alt"></i>'})
], {class:"ext-buttons f-row"}),
}; };
createPopOp('trace').inputs = { };
createPopOp('drill').inputs = { createPopOp('drill').inputs = {
tool: UC.newSelect(LANG.cc_tool, {}, "tools"), tool: UC.newSelect(LANG.cc_tool, {}, "tools"),
sep: UC.newBlank({class:"pop-sep"}), sep: UC.newBlank({class:"pop-sep"}),

View file

@ -871,8 +871,7 @@
"shadow": OpShadow, "shadow": OpShadow,
"rough": OpRough, "rough": OpRough,
"outline": OpOutline, "outline": OpOutline,
"contour x": OpContour, "contour": OpContour,
"contour y": OpContour,
"trace": OpTrace, "trace": OpTrace,
"drill": OpDrill, "drill": OpDrill,
"register": OpRegister "register": OpRegister

View file

@ -22,8 +22,9 @@
let { state, contour, onupdate, ondone } = opt; let { state, contour, onupdate, ondone } = opt;
let { widget, settings, tshadow, center, tabs } = opt.state; let { widget, settings, tshadow, center, tabs } = opt.state;
let density = parseInt(settings.controller.animesh) * 2500, let density = parseInt(settings.controller.animesh) * 2500,
contourX = contour.type === "contour x", axis = contour.axis.toLowerCase(),
contourY = contour.type === "contour y", contourX = axis === "x",
contourY = axis === "y",
bounds = widget.getBoundingBox().clone(), bounds = widget.getBoundingBox().clone(),
tolerance = contour.tolerace, tolerance = contour.tolerace,
proc = settings.process, proc = settings.process,

View file

@ -560,7 +560,7 @@ th, tr, td, label {
margin-right: 5px; margin-right: 5px;
padding: 5px; padding: 5px;
} }
#oplist > div { #oplist > div, .opdiv {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@ -570,6 +570,7 @@ th, tr, td, label {
margin: 0 2px 0 2px; margin: 0 2px 0 2px;
padding: 2px 10px 2px 10px; padding: 2px 10px 2px 10px;
background-color: rgba(255,255,255,0.75); background-color: rgba(255,255,255,0.75);
white-space: nowrap;
} }
#oplist .drag { #oplist .drag {
background-color: var(--highlight) !important; background-color: var(--highlight) !important;
@ -605,6 +606,38 @@ th, tr, td, label {
#oplist div:hover .opop { #oplist div:hover .opop {
display: flex; display: flex;
} }
#op-add-pop {
position: absolute;
display: none;
padding: 5px;
bottom: 35px;
}
#op-add:hover #op-add-pop {
display: flex;
}
#op-add-list {
padding: 4px;
display: flex;
align-items: stretch;
flex-direction: column-reverse;
}
#op-add-list > div {
padding: 3px 5px 3px 5px;
display: flex;
flex-direction: column;
border-radius: 3px;
}
#op-add-list > div:hover {
background-color: rgba(0,0,0,0.2);
border-bottom: 1px rgba(0,0,0,0.5);
}
#op-add-contour-menu, #op-add-register-menu {
position: absolute;
right: 0;
top: 0;
xtransform: translateX(-100%);
xtransform: translateY(-50%);
}
#progress { #progress {
display: none; display: none;

View file

@ -415,6 +415,25 @@
<div id="camops" class="f-row a-stretch j-center"> <div id="camops" class="f-row a-stretch j-center">
<div class="left"></div> <div class="left"></div>
<div id="oplist" class="f-row j-center"></div> <div id="oplist" class="f-row j-center"></div>
<div id="ophint" class="f-row">
<div class="opdiv">use + menu to add milling operations</div>
<div class="opdiv">drag to re-order</div>
</div>
<div id="op-add" class="opdiv">
<i class="fas fa-plus"></i>
<div id="op-add-pop" class="f-col">
<div id="op-add-list" class="opdiv">
<div>rough</div>
<div>outline</div>
<div>trace</div>
<div>drill</div>
<div>contour x</div>
<div>contour y</div>
<div>register x</div>
<div>register y</div>
</div>
</div>
</div>
<div class="right"></div> <div class="right"></div>
</div> </div>
</div> </div>