Skip to content

Commit

Permalink
supresses m130 media calls in Mills
Browse files Browse the repository at this point in the history
  • Loading branch information
pan261 committed Sep 27, 2021
1 parent 379fe6b commit 63a2274
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 10 deletions.
19 changes: 16 additions & 3 deletions Haas_Mills_BIDC/Bechtel DT.cps
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,13 @@ properties = {/*
type: "boolean",
value: true,
scope: "post"
},
displayMediaCalls: {
title: "M130 Media calls",
description: "Enable to include M130 part images with the NC file..",
group: 4,
value: false,
scope: "post"
}
};

Expand Down Expand Up @@ -2063,7 +2070,10 @@ function previewImage() {
}
}
if (images.length > 0) {
writeBlock(mFormat.format(130), "(" + images[images.length - 1] + ")");
getProperty("displayMediaCalls") ?
writeBlock(mFormat.format(130), "(" + images[images.length - 1] + ")")
:
writeOptionalBlock(mFormat.format(130), "(" + images[images.length - 1] + ")");
}
}
}
Expand Down Expand Up @@ -2473,7 +2483,10 @@ function onSection() {
if (insertToolCall || operationNeedsSafeStart) {
if (staticProperties.useM130PartImages) {
writeBlock(mFormat.format(130), "(tool" + tool.number + ".png)");
getProperty("displayMediaCalls") ?
writeBlock(mFormat.format(130), "(tool" + tool.number + ".png)")
:
writeOptionalBlock(mFormat.format(130), "(tool" + tool.number + ".png)");
}

if (!isFirstSection() && staticProperties.optionalStop && insertToolCall) {
Expand Down Expand Up @@ -2831,7 +2844,7 @@ function onSection() {
// Displays a file: MP4, MOV, PNG, JPEG. 1920x1080
// Input: Absolute path to file
function displayMedia(file, isOptional) {
if (isOptional) {
if (isOptional || !getProperty("displayMediaCalls")) {
writeOptionalBlock(mFormat.format(130), formatComment("Net Share/Media/" + file));
} else {
writeBlock(mFormat.format(130), formatComment("Net Share/Media/" + file));
Expand Down
21 changes: 17 additions & 4 deletions Haas_Mills_BIDC/Bechtel VF2.cps
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,13 @@ properties = {/*
type: "boolean",
value: true,
scope: "post"
},
displayMediaCalls: {
title: "M130 Media calls",
description: "Enable to include M130 part images with the NC file..",
group: 4,
value: false,
scope: "post"
}
};

Expand Down Expand Up @@ -2063,7 +2070,10 @@ function previewImage() {
}
}
if (images.length > 0) {
writeBlock(mFormat.format(130), "(" + images[images.length - 1] + ")");
getProperty("displayMediaCalls") ?
writeBlock(mFormat.format(130), "(" + images[images.length - 1] + ")")
:
writeOptionalBlock(mFormat.format(130), "(" + images[images.length - 1] + ")");
}
}
}
Expand Down Expand Up @@ -2473,7 +2483,10 @@ function onSection() {
if (insertToolCall || operationNeedsSafeStart) {
if (staticProperties.useM130PartImages) {
writeBlock(mFormat.format(130), "(tool" + tool.number + ".png)");
getProperty("displayMediaCalls") ?
writeBlock(mFormat.format(130), "(tool" + tool.number + ".png)")
:
writeOptionalBlock(mFormat.format(130), "(tool" + tool.number + ".png)");
}

if (!isFirstSection() && staticProperties.optionalStop && insertToolCall) {
Expand Down Expand Up @@ -2831,7 +2844,7 @@ function onSection() {
// Displays a file: MP4, MOV, PNG, JPEG. 1920x1080
// Input: Absolute path to file
function displayMedia(file, isOptional) {
if (isOptional) {
if (isOptional || !getProperty("displayMediaCalls")) {
writeOptionalBlock(mFormat.format(130), formatComment("Net Share/Media/" + file));
} else {
writeBlock(mFormat.format(130), formatComment("Net Share/Media/" + file));
Expand Down Expand Up @@ -2894,7 +2907,7 @@ function getTA(file, seqNum, gotoRef) {
writeWords("N" + nFormat.format(seqNum),
gFormat.format(53), gFormat.format(0), zOutput.format(0.),
formatComment("Retract spindle"));
writeWords(mFormat.format(130), formatComment(file));
getProperty("displayMediaCalls");
writeWords(mFormat.format(0), formatComment("Halt Program"));
writeWords(mFormat.format(131));
writeWords("GOTO" + nFormat.format(gotoRef), formatComment("Return to beginning of operation"));
Expand Down
19 changes: 16 additions & 3 deletions Haas_Mills_BIDC/Bechtel VF4.cps
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,13 @@ properties = {/*
type: "boolean",
value: true,
scope: "post"
},
displayMediaCalls: {
title: "M130 Media calls",
description: "Enable to include M130 part images with the NC file..",
group: 4,
value: false,
scope: "post"
}
};

Expand Down Expand Up @@ -2062,7 +2069,10 @@ function previewImage() {
}
}
if (images.length > 0) {
writeBlock(mFormat.format(130), "(" + images[images.length - 1] + ")");
getProperty("displayMediaCalls") ?
writeBlock(mFormat.format(130), "(" + images[images.length - 1] + ")")
:
writeOptionalBlock(mFormat.format(130), "(" + images[images.length - 1] + ")");
}
}
}
Expand Down Expand Up @@ -2477,7 +2487,10 @@ function onSection() {
if (insertToolCall || operationNeedsSafeStart) {
if (staticProperties.useM130PartImages) {
writeBlock(mFormat.format(130), "(tool" + tool.number + ".png)");
getProperty("displayMediaCalls") ?
writeBlock(mFormat.format(130), "(tool" + tool.number + ".png)")
:
writeOptionalBlock(mFormat.format(130), "(tool" + tool.number + ".png)");
}

if (!isFirstSection() && staticProperties.optionalStop && insertToolCall) {
Expand Down Expand Up @@ -2835,7 +2848,7 @@ function onSection() {
// Displays a file: MP4, MOV, PNG, JPEG. 1920x1080
// Input: Absolute path to file
function displayMedia(file, isOptional) {
if (isOptional) {
if (isOptional || !getProperty("displayMediaCalls")) {
writeOptionalBlock(mFormat.format(130), formatComment("Net Share/Media/" + file));
} else {
writeBlock(mFormat.format(130), formatComment("Net Share/Media/" + file));
Expand Down

0 comments on commit 63a2274

Please sign in to comment.