add optional CAM operation notes
This commit is contained in:
parent
3bccdb7a03
commit
e6b71dde2d
4 changed files with 62 additions and 7 deletions
|
|
@ -21,6 +21,7 @@ Full docs @ https://docs.grid.space/projects/kiri-moto
|
||||||
* add CAM Z bottom visualization, make it relative to stock instead of part
|
* add CAM Z bottom visualization, make it relative to stock instead of part
|
||||||
* add CAM z bottom inversion option to flip operator
|
* add CAM z bottom inversion option to flip operator
|
||||||
* add CAM custom gcode operator
|
* add CAM custom gcode operator
|
||||||
|
* add optional CAM operation notes
|
||||||
* extend url loading of workspaces to all formats
|
* extend url loading of workspaces to all formats
|
||||||
* alert when healing is enabled and non-manifold geometries are detected
|
* alert when healing is enabled and non-manifold geometries are detected
|
||||||
* fix thin output start and end point tracking which broke retraction
|
* fix thin output start and end point tracking which broke retraction
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ let isAnimate,
|
||||||
|
|
||||||
let zaxis = { x: 0, y: 0, z: 1 },
|
let zaxis = { x: 0, y: 0, z: 1 },
|
||||||
popOp = {},
|
popOp = {},
|
||||||
|
seed = Date.now(),
|
||||||
func = {
|
func = {
|
||||||
hover: noop,
|
hover: noop,
|
||||||
hoverUp: noop
|
hoverUp: noop
|
||||||
|
|
@ -304,7 +305,7 @@ CAM.init = function(kiri, api) {
|
||||||
html.appendAll([
|
html.appendAll([
|
||||||
`<div id="${mark+i}" class="draggable">`,
|
`<div id="${mark+i}" class="draggable">`,
|
||||||
`<label class="label">${rec.type}</label>`,
|
`<label class="label">${rec.type}</label>`,
|
||||||
`<label id="${mark+i}-x" class="del"><i class="fas fa-times"></i></label>`,
|
`<label id="${mark+i}-x" class="del"><i class="fa-regular fa-circle-xmark"></i></label>`,
|
||||||
`</div>`
|
`</div>`
|
||||||
]);
|
]);
|
||||||
bind[mark+i] = rec;
|
bind[mark+i] = rec;
|
||||||
|
|
@ -350,6 +351,7 @@ CAM.init = function(kiri, api) {
|
||||||
poprec.use(rec);
|
poprec.use(rec);
|
||||||
hoveredOp = el;
|
hoveredOp = el;
|
||||||
el.appendChild(poprec.div);
|
el.appendChild(poprec.div);
|
||||||
|
poprec.addNote();
|
||||||
// option click event appears latent
|
// option click event appears latent
|
||||||
// and overides the sticky settings
|
// and overides the sticky settings
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
@ -1212,7 +1214,7 @@ function createPopOp(type, map) {
|
||||||
}
|
}
|
||||||
return rec;
|
return rec;
|
||||||
},
|
},
|
||||||
hideshow: () => {
|
hideshow: (abc) => {
|
||||||
for (let inp of Object.values(op.inputs)) {
|
for (let inp of Object.values(op.inputs)) {
|
||||||
let parent = inp.parentElement;
|
let parent = inp.parentElement;
|
||||||
if (parent.setVisible && parent.__opt.show) {
|
if (parent.setVisible && parent.__opt.show) {
|
||||||
|
|
@ -1220,8 +1222,33 @@ function createPopOp(type, map) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
group: []
|
addNote: () => {
|
||||||
|
if (!op.note && type !== 'flip') {
|
||||||
|
const divid = `div-${++seed}`;
|
||||||
|
const noteid = `note-${++seed}`;
|
||||||
|
const div = document.createElement('div');
|
||||||
|
div.setAttribute('id', divid);
|
||||||
|
div.classList.add('pop-tics')
|
||||||
|
op.div.appendChild(div);
|
||||||
|
div.innerHTML = h.build(
|
||||||
|
h.div([
|
||||||
|
h.label({id: noteid, _: `${poppedRec.note || ''}`})
|
||||||
|
])
|
||||||
|
);
|
||||||
|
op.note = { divid, noteid };
|
||||||
|
$(divid).onclick = () => {
|
||||||
|
let note = op.x = prompt('Edit Note for Operation', poppedRec.note || '');
|
||||||
|
if (note !== undefined && note !== null) {
|
||||||
|
poppedRec.note = note || poppedRec.note;
|
||||||
|
$(noteid).innerText = note;
|
||||||
|
API.conf.save();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
group: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
UC.restore({
|
UC.restore({
|
||||||
addTo: op.div,
|
addTo: op.div,
|
||||||
bindTo: op.bind,
|
bindTo: op.bind,
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,10 @@ let h = exports({
|
||||||
|
|
||||||
raw: ( text ) => {
|
raw: ( text ) => {
|
||||||
return { raw: text }
|
return { raw: text }
|
||||||
|
},
|
||||||
|
|
||||||
|
build: (data) => {
|
||||||
|
return build(data, []).join('');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -832,6 +832,26 @@ th, tr, td, label {
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
.pop-tics {
|
||||||
|
position: absolute;
|
||||||
|
left: -1px;
|
||||||
|
right: -1px;
|
||||||
|
bottom: 100%;
|
||||||
|
margin: 0 0 2px 0;
|
||||||
|
}
|
||||||
|
.pop-tics > div {
|
||||||
|
gap: 3px;
|
||||||
|
padding: 5px;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
font-size: 11px;
|
||||||
|
flex-direction: row;
|
||||||
|
background-color: rgba(255,255,255,0.6);
|
||||||
|
border-radius: 5px;
|
||||||
|
word-break: break-word;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
#oplist > div, .opdiv {
|
#oplist > div, .opdiv {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
@ -855,20 +875,23 @@ th, tr, td, label {
|
||||||
}
|
}
|
||||||
#oplist div .del {
|
#oplist div .del {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -1px;
|
top: 0px;
|
||||||
right: 2px;
|
right: 0px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: rgba(0,0,0,0);
|
color: rgba(0,0,0,0);
|
||||||
}
|
}
|
||||||
#oplist > div.editing {
|
#oplist > div.editing {
|
||||||
background-color: rgba(220,230,220,0.8);
|
background-color: rgba(220,230,220,0.8);
|
||||||
}
|
}
|
||||||
|
.dark #oplist div:hover .del {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
#oplist div:hover .del {
|
#oplist div:hover .del {
|
||||||
color: #aaa;
|
color: #888;
|
||||||
z-index: 10000;
|
z-index: 10000;
|
||||||
}
|
}
|
||||||
#oplist div .del:hover {
|
#oplist div .del:hover {
|
||||||
color: #000;
|
color: #000 !important;
|
||||||
}
|
}
|
||||||
#oplist div .opop {
|
#oplist div .opop {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue