set drill warning to emit on register
This commit is contained in:
parent
c3c474185a
commit
8b74f61a98
1 changed files with 11 additions and 4 deletions
|
|
@ -1955,12 +1955,19 @@ function createPopOp(type, map) {
|
||||||
const settings = conf.get();
|
const settings = conf.get();
|
||||||
const {tool} = new CAM.Tool(settings,op.rec.tool); //get tool by id
|
const {tool} = new CAM.Tool(settings,op.rec.tool); //get tool by id
|
||||||
const opType = op.rec.type
|
const opType = op.rec.type
|
||||||
const drillOrRegister = opType == "drill" || opType == "register"
|
|
||||||
|
|
||||||
if ( !drillOrRegister && tool.type == "drill"){
|
const register = opType === "register";
|
||||||
alerts.show(`Warning: Drills should not be used for ${opType} operations.`)
|
const drillOp = opType === "drill";
|
||||||
|
const drillRegister = register && op.rec.axis !== '-'
|
||||||
|
|
||||||
|
console.log({drillRegister},op.rec)
|
||||||
|
|
||||||
|
const drillPath = drillOp || drillRegister;
|
||||||
|
|
||||||
|
if( !drillPath && tool.type == "drill"){
|
||||||
|
alerts.show(`Warning: Drills should not be used for non-drill operations.`)
|
||||||
}
|
}
|
||||||
else if ( drillOrRegister && tool.type != "drill"){
|
else if ( drillPath && tool.type != "drill"){
|
||||||
alerts.show(`Warning: Only drills should be used for drilling operations.`)
|
alerts.show(`Warning: Only drills should be used for drilling operations.`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue