add def file support
This commit is contained in:
+2
-1
@@ -5,4 +5,5 @@ vsc-extension-quickstart.md
|
|||||||
node_modules
|
node_modules
|
||||||
tsconfig.json
|
tsconfig.json
|
||||||
test
|
test
|
||||||
vite.config.js
|
vite.config.js
|
||||||
|
.prettierrc.json
|
||||||
@@ -16,7 +16,7 @@ export function formatCdlFile(content: string): string {
|
|||||||
return formattedLines.join("\n")
|
return formattedLines.join("\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
export function completionHandler(document: vscode.TextDocument, position: vscode.Position) {
|
export function completionHandlerCdl(document: vscode.TextDocument, position: vscode.Position) {
|
||||||
const linePrefix = document.lineAt(position).text.substring(0, position.character)
|
const linePrefix = document.lineAt(position).text.substring(0, position.character)
|
||||||
const categories = ["MILL", "LATHE", "DRILL"]
|
const categories = ["MILL", "LATHE", "DRILL"]
|
||||||
|
|
||||||
@@ -31,6 +31,13 @@ export function completionHandler(document: vscode.TextDocument, position: vscod
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (linePrefix.endsWith("TOGGLE ")) {
|
||||||
|
return [
|
||||||
|
new vscode.CompletionItem("off", vscode.CompletionItemKind.TypeParameter),
|
||||||
|
new vscode.CompletionItem("on", vscode.CompletionItemKind.TypeParameter)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
if (linePrefix.endsWith("CATEGORY ")) {
|
if (linePrefix.endsWith("CATEGORY ")) {
|
||||||
return categories.map(
|
return categories.map(
|
||||||
(cat) => new vscode.CompletionItem(cat, vscode.CompletionItemKind.TypeParameter)
|
(cat) => new vscode.CompletionItem(cat, vscode.CompletionItemKind.TypeParameter)
|
||||||
@@ -49,7 +56,7 @@ export function completionHandler(document: vscode.TextDocument, position: vscod
|
|||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
export function hoverHandler(document: vscode.TextDocument, position: vscode.Position) {
|
export function hoverCdlHandler(document: vscode.TextDocument, position: vscode.Position) {
|
||||||
const wordRange = document.getWordRangeAtPosition(position)
|
const wordRange = document.getWordRangeAtPosition(position)
|
||||||
const word = document.getText(wordRange)
|
const word = document.getText(wordRange)
|
||||||
const text = document.getText()
|
const text = document.getText()
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import * as vscode from "vscode"
|
import * as vscode from "vscode"
|
||||||
import { formatCdlFile, completionHandler, hoverHandler } from "./common/handlers"
|
import { formatCdlFile, completionHandlerCdl, hoverCdlHandler } from "./common/handlers"
|
||||||
|
|
||||||
export function activate(context: vscode.ExtensionContext) {
|
export function activate(context: vscode.ExtensionContext) {
|
||||||
const formatProvider = vscode.languages.registerDocumentFormattingEditProvider(
|
const formatCdlProvider = vscode.languages.registerDocumentFormattingEditProvider(
|
||||||
{ scheme: "file", language: "cdl" },
|
{ scheme: "file", language: "cdl" },
|
||||||
{
|
{
|
||||||
provideDocumentFormattingEdits(document: vscode.TextDocument): vscode.TextEdit[] {
|
provideDocumentFormattingEdits(document: vscode.TextDocument): vscode.TextEdit[] {
|
||||||
@@ -17,9 +17,9 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
context.subscriptions.push(formatProvider)
|
context.subscriptions.push(formatCdlProvider)
|
||||||
|
|
||||||
const completionProvider = vscode.languages.registerCompletionItemProvider(
|
const completionCdlProvider = vscode.languages.registerCompletionItemProvider(
|
||||||
{ scheme: "file", language: "cdl" },
|
{ scheme: "file", language: "cdl" },
|
||||||
{
|
{
|
||||||
provideCompletionItems(
|
provideCompletionItems(
|
||||||
@@ -28,14 +28,14 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
token: vscode.CancellationToken,
|
token: vscode.CancellationToken,
|
||||||
context: vscode.CompletionContext
|
context: vscode.CompletionContext
|
||||||
) {
|
) {
|
||||||
return completionHandler(document, position)
|
return completionHandlerCdl(document, position)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
" " // Trigger completion on space
|
" " // Trigger completion on space
|
||||||
)
|
)
|
||||||
context.subscriptions.push(completionProvider)
|
context.subscriptions.push(completionCdlProvider)
|
||||||
|
|
||||||
const hoverProvider = vscode.languages.registerHoverProvider(
|
const hoverCdlProvider = vscode.languages.registerHoverProvider(
|
||||||
{ scheme: "file", language: "cdl" },
|
{ scheme: "file", language: "cdl" },
|
||||||
{
|
{
|
||||||
provideHover(
|
provideHover(
|
||||||
@@ -43,11 +43,11 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
position: vscode.Position,
|
position: vscode.Position,
|
||||||
token: vscode.CancellationToken
|
token: vscode.CancellationToken
|
||||||
) {
|
) {
|
||||||
return hoverHandler(document, position)
|
return hoverCdlHandler(document, position)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
context.subscriptions.push(hoverProvider)
|
context.subscriptions.push(hoverCdlProvider)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function deactivate() {}
|
export function deactivate() {}
|
||||||
|
|||||||
@@ -32,6 +32,17 @@
|
|||||||
".cdl"
|
".cdl"
|
||||||
],
|
],
|
||||||
"configuration": "./language-configuration.json"
|
"configuration": "./language-configuration.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "def",
|
||||||
|
"aliases": [
|
||||||
|
"NX DEF",
|
||||||
|
"def"
|
||||||
|
],
|
||||||
|
"extensions": [
|
||||||
|
".def"
|
||||||
|
],
|
||||||
|
"configuration": "./language-configuration.json"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"grammars": [
|
"grammars": [
|
||||||
@@ -39,6 +50,11 @@
|
|||||||
"language": "cdl",
|
"language": "cdl",
|
||||||
"scopeName": "source.cdl",
|
"scopeName": "source.cdl",
|
||||||
"path": "./syntaxes/cdl.tmLanguage.json"
|
"path": "./syntaxes/cdl.tmLanguage.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"language": "def",
|
||||||
|
"scopeName": "source.def",
|
||||||
|
"path": "./syntaxes/def.tmLanguage.json"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -106,6 +106,15 @@
|
|||||||
"name": "variable.language.cdl"
|
"name": "variable.language.cdl"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.control.cdl",
|
||||||
|
"match": "\\bTOGGLE\\s+(OFF|ON|off|on)\\b",
|
||||||
|
"captures": {
|
||||||
|
"1": {
|
||||||
|
"name": "variable.other.constant"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -0,0 +1,154 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
||||||
|
"name": "DEF Support",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#comment"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#strings"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#variables"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#types"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#keywords"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#numbers"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#unquoted-strings"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"keywords": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "storage.type.def",
|
||||||
|
"match": "\\b(FORMAT|ADDRESS|FORMATTING|FORCE|LEADER|ZERO_FORMAT|TRAILER|OMIT|MAX|MIN)\\b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"strings": {
|
||||||
|
"name": "string.quoted.double.def",
|
||||||
|
"begin": "(?<!\\\\)\"",
|
||||||
|
"end": "(?<!\\\\)\"",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "constant.character.escape.def",
|
||||||
|
"match": "\\\\."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "variable.other.property",
|
||||||
|
"match": "\\$[_a-zA-Z][_a-zA-Z0-9]*(\\([_a-zA-Z][_a-zA-Z0-9]*\\))?"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"unquoted-strings": {
|
||||||
|
"name": "string.unquoted.def",
|
||||||
|
"match": "\\b[_a-zA-Z][_a-zA-Z0-9]*\\b"
|
||||||
|
},
|
||||||
|
"numbers": {
|
||||||
|
"name": "constant.numeric",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "constant.numeric",
|
||||||
|
"match": "\"\\d+\""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "constant.numeric",
|
||||||
|
"match": "\"\\d+.\\d+\""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "constant.numeric",
|
||||||
|
"match": "\\d+"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "constant.numeric",
|
||||||
|
"match": "\\d+.\\d+"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"types": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "storage.type.def",
|
||||||
|
"match": "(FORMAT|ZERO_FORMAT)\\s+([a-zA-Z_]+)\\b",
|
||||||
|
"captures": {
|
||||||
|
"2": {
|
||||||
|
"name": "storage.type.cs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"variables": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "keyword.control.cdl",
|
||||||
|
"match": "\\b(PARAM|EVENT)\\s+([a-zA-Z_]\\w*)\\b",
|
||||||
|
"captures": {
|
||||||
|
"2": {
|
||||||
|
"name": "variable.other.cdl"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.control.cdl",
|
||||||
|
"match": "\\bMACHINE\\s+([a-zA-Z_]\\w*)\\b",
|
||||||
|
"captures": {
|
||||||
|
"1": {
|
||||||
|
"name": "variable.other.cdl"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "variable.other.property",
|
||||||
|
"match": "\\$[_a-zA-Z][_a-zA-Z0-9]*(\\(\\$?[_a-zA-Z][_a-zA-Z0-9]*(,\\$?[_a-zA-Z][_a-zA-Z0-9]*)*\\))?"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "storage.type.def",
|
||||||
|
"match": "\\bFORCE\\s+(on|always|off)\\b",
|
||||||
|
"captures": {
|
||||||
|
"1": {
|
||||||
|
"name": "variable.other.constant"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"function": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "storage.type.function.def",
|
||||||
|
"match": "\\b(ADDRESS|BLOCK_TEMPLATE)\\s+([a-zA-Z_]\\w*)\\b",
|
||||||
|
"captures": {
|
||||||
|
"2": {
|
||||||
|
"name": "entity.name.function"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "entity.name.function",
|
||||||
|
"match": "[a-zA-Z_0-9]*\\["
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"comment": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "comment.line.def",
|
||||||
|
"match": "#.*"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"scopeName": "source.def"
|
||||||
|
}
|
||||||
@@ -0,0 +1,463 @@
|
|||||||
|
MACHINE Default
|
||||||
|
|
||||||
|
FORMATTING
|
||||||
|
{
|
||||||
|
FORMAT Int "%d"
|
||||||
|
|
||||||
|
ADDRESS TSE
|
||||||
|
{
|
||||||
|
FORMAT String
|
||||||
|
FORCE off
|
||||||
|
LEADER "TSE("
|
||||||
|
TRAILER ")"
|
||||||
|
}
|
||||||
|
ADDRESS cycle_70_first
|
||||||
|
{
|
||||||
|
FORMAT Coordinate
|
||||||
|
FORCE always
|
||||||
|
LEADER ""
|
||||||
|
ZERO_FORMAT Zero_int
|
||||||
|
}
|
||||||
|
|
||||||
|
ADDRESS cycle_70_parameters
|
||||||
|
{
|
||||||
|
FORMAT Coordinate
|
||||||
|
FORCE always
|
||||||
|
LEADER ","
|
||||||
|
ZERO_FORMAT Zero_int
|
||||||
|
}
|
||||||
|
|
||||||
|
ADDRESS cycle_70_int
|
||||||
|
{
|
||||||
|
FORMAT Int
|
||||||
|
FORCE always
|
||||||
|
LEADER ","
|
||||||
|
}
|
||||||
|
ADDRESS NN
|
||||||
|
{
|
||||||
|
FORMAT Int
|
||||||
|
FORCE always
|
||||||
|
LEADER "NN"
|
||||||
|
TRAILER ":"
|
||||||
|
}
|
||||||
|
ADDRESS header_program
|
||||||
|
{
|
||||||
|
FORMAT String
|
||||||
|
FORCE always
|
||||||
|
LEADER "%_N_"
|
||||||
|
TRAILER "_MPF"
|
||||||
|
}
|
||||||
|
ADDRESS S_A_TOOL
|
||||||
|
{
|
||||||
|
FORMAT String
|
||||||
|
FORCE always
|
||||||
|
LEADER "_S_A_TOOL = "
|
||||||
|
}
|
||||||
|
ADDRESS S_V_TOOL
|
||||||
|
{
|
||||||
|
FORMAT String
|
||||||
|
FORCE always
|
||||||
|
LEADER "_S_V_TOOL = "
|
||||||
|
}
|
||||||
|
ADDRESS RET
|
||||||
|
{
|
||||||
|
FORMAT String
|
||||||
|
FORCE always
|
||||||
|
LEADER "RET"
|
||||||
|
}
|
||||||
|
ADDRESS STOPRE
|
||||||
|
{
|
||||||
|
FORMAT String
|
||||||
|
FORCE always
|
||||||
|
LEADER "STOPRE"
|
||||||
|
}
|
||||||
|
ADDRESS T_Text
|
||||||
|
{
|
||||||
|
FORMAT String
|
||||||
|
FORCE always
|
||||||
|
LEADER ""
|
||||||
|
}
|
||||||
|
ADDRESS S_s_tec
|
||||||
|
{
|
||||||
|
FORMAT String
|
||||||
|
FORCE off
|
||||||
|
LEADER ["S="]
|
||||||
|
}
|
||||||
|
ADDRESS M_coolant_1
|
||||||
|
{
|
||||||
|
FORMAT String
|
||||||
|
FORCE off
|
||||||
|
LEADER "M"
|
||||||
|
OMIT "-"
|
||||||
|
}
|
||||||
|
ADDRESS M_coolant_2
|
||||||
|
{
|
||||||
|
FORMAT String
|
||||||
|
FORCE off
|
||||||
|
LEADER "M"
|
||||||
|
OMIT "-"
|
||||||
|
}
|
||||||
|
ADDRESS M_coolant_off
|
||||||
|
{
|
||||||
|
FORMAT String
|
||||||
|
FORCE off
|
||||||
|
LEADER "M"
|
||||||
|
OMIT "-"
|
||||||
|
}
|
||||||
|
ADDRESS U
|
||||||
|
{
|
||||||
|
FORMAT Coordinate
|
||||||
|
FORCE off
|
||||||
|
MAX 99999.999 Abort
|
||||||
|
MIN -99999.999 Abort
|
||||||
|
LEADER ["U"]
|
||||||
|
}
|
||||||
|
ADDRESS Path
|
||||||
|
{
|
||||||
|
FORMAT String
|
||||||
|
FORCE always
|
||||||
|
LEADER ";$PATH=/_N_WKS_DIR/_N_"
|
||||||
|
TRAILER ""
|
||||||
|
}
|
||||||
|
ADDRESS XC
|
||||||
|
{
|
||||||
|
FORMAT Coordinate
|
||||||
|
FORCE off
|
||||||
|
MAX 99999.999 Abort
|
||||||
|
MIN -99999.999 Abort
|
||||||
|
LEADER ["XC="]
|
||||||
|
}
|
||||||
|
ADDRESS G_motion_setting
|
||||||
|
{
|
||||||
|
FORMAT Digit_command
|
||||||
|
FORCE off
|
||||||
|
LEADER "G"
|
||||||
|
ZERO_FORMAT Zero_command
|
||||||
|
OMIT "99"
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE end_of_program
|
||||||
|
{
|
||||||
|
M[$mom_sys_rewind_code]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE return_home_value
|
||||||
|
{
|
||||||
|
Text[SUPA]
|
||||||
|
G_motion[$mom_sys_rapid_code]
|
||||||
|
X[$mom_retract_home_pos(0)]
|
||||||
|
Y[$mom_retract_home_pos(1)]
|
||||||
|
Z[$mom_retract_home_pos(2)]
|
||||||
|
D[0]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE return_wcs_value
|
||||||
|
{
|
||||||
|
G_motion[$mom_sys_rapid_code]
|
||||||
|
X[$mom_retract_home_pos(0)]
|
||||||
|
Y[$mom_retract_home_pos(1)]
|
||||||
|
Z[$mom_retract_home_pos(2)]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE tool_change_tse
|
||||||
|
{
|
||||||
|
TSE[\"$je_service_var(tc_vars)\"]
|
||||||
|
T_Text[" ; $je_service_var(T_Text)"]
|
||||||
|
Text["TCH"]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE tool_change
|
||||||
|
{
|
||||||
|
T[=$je_service_var(tc_vars)]
|
||||||
|
T_Text[" ; $je_service_var(T_Text)"]
|
||||||
|
Text["TCH"]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE rapid_move_fh
|
||||||
|
{
|
||||||
|
G_zero[$lib_main_zero_register]
|
||||||
|
G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)]\opt
|
||||||
|
#G_spin[$mom_sys_spindle_mode_code($spindle_mode)]\opt
|
||||||
|
G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt
|
||||||
|
G_motion[$mom_sys_rapid_code]
|
||||||
|
Y[0]
|
||||||
|
X[0]
|
||||||
|
Z[$mom_pos(2)]
|
||||||
|
fourth_axis[$mom_out_angle_pos(0)]
|
||||||
|
D[$mom_tool_adjust_register]\opt
|
||||||
|
M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)]\opt
|
||||||
|
M_range[$mom_sys_spindle_range_code($mom_spindle_range)]\opt
|
||||||
|
M_coolant[$mom_sys_coolant_code($mom_coolant_mode)]\opt
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE group_begin
|
||||||
|
{
|
||||||
|
cycle_call[GROUP_BEGIN]\nows
|
||||||
|
cycle_start_character[(]\nows
|
||||||
|
cycle_text_first[\$lib_parameter(group_begin,_LEVEL)]\nows
|
||||||
|
cycle_text[\"\$lib_parameter(group_begin,_NAME)\"]\nows
|
||||||
|
cycle_text[\$lib_parameter(group_begin,_SP)]\nows
|
||||||
|
cycle_text[\$lib_parameter(group_begin,_MODE)]\nows
|
||||||
|
cycle_end_character[)]\nows
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE group_end
|
||||||
|
{
|
||||||
|
cycle_call[GROUP_END]\nows
|
||||||
|
cycle_start_character[(]\nows
|
||||||
|
cycle_text_first[\$lib_parameter(group_begin,_LEVEL)]\nows
|
||||||
|
cycle_text[\$lib_parameter(group_begin,_SP)]\nows
|
||||||
|
cycle_end_character[)]\nows
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE CYCLE70
|
||||||
|
{
|
||||||
|
cycle_call[CYCLE70] \nows
|
||||||
|
cycle_start_character[(] \nows
|
||||||
|
cycle_70_first[\$lib_parameter(cycle70,_RTP)] \nows
|
||||||
|
cycle_70_parameters[\$lib_parameter(cycle70,_RFP)] \nows
|
||||||
|
cycle_70_parameters[\$lib_parameter(cycle70,_SDIS)] \nows
|
||||||
|
cycle_70_parameters[\$lib_parameter(cycle70,_DP)] \nows
|
||||||
|
cycle_70_parameters[\$lib_parameter(cycle70,_DIATH)] \nows
|
||||||
|
cycle_70_parameters[\$lib_parameter(cycle70,_H1)] \nows
|
||||||
|
cycle_70_parameters[\$lib_parameter(cycle70,_FAL)] \nows
|
||||||
|
cycle_70_parameters[\$lib_parameter(cycle70,_PIT)] \nows
|
||||||
|
cycle_70_int[\$lib_parameter(cycle70,_NT)] \nows
|
||||||
|
cycle_70_parameters[\$lib_parameter(cycle70,_MID)] \nows
|
||||||
|
cycle_text[\$lib_parameter(cycle70,_FFR)]\nows
|
||||||
|
cycle_70_int[\$lib_parameter(cycle70,_TYPTH)] \nows
|
||||||
|
cycle_text[\$lib_parameter(cycle70,_PA)] \nows
|
||||||
|
cycle_text[\$lib_parameter(cycle70,_PO)] \nows
|
||||||
|
cycle_text[\$lib_parameter(cycle70,_NSP)] \nows
|
||||||
|
cycle_70_int[\$lib_parameter(cycle70,_VARI)] \nows
|
||||||
|
cycle_text[1,,,,,100,1] \nows
|
||||||
|
cycle_end_character[)] \nows
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE PAL_AUSW
|
||||||
|
{
|
||||||
|
cycle_call[PAL_AUSW]\nows
|
||||||
|
cycle_start_character[(] \nows
|
||||||
|
cycle_text_first[\$je_service_var(pgm_count)] \nows
|
||||||
|
cycle_end_character[)] \nows
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE machine_mode_mill_init
|
||||||
|
{
|
||||||
|
G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)]\opt
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE external_subprogram
|
||||||
|
{
|
||||||
|
Text[$lib_spf(value,subprogram_output_name)]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE jump_mark
|
||||||
|
{
|
||||||
|
NN[$je_service_var(pgm_count,safe)]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE tool_var_S_A_TOOL
|
||||||
|
{
|
||||||
|
S_A_TOOL[\"$mom_tool_name\"]
|
||||||
|
Text[" ; $mom_tool_data($mom_tool_name,tool_description)"]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE tool_var_S_V_TOOL
|
||||||
|
{
|
||||||
|
S_V_TOOL[\"$mom_next_tool_name\"]
|
||||||
|
Text[" ; $mom_tool_data($mom_next_tool_name,tool_description)"]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE end_of_subprogram
|
||||||
|
{
|
||||||
|
STOPRE[ ]
|
||||||
|
RET[ ]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE tool_change_init
|
||||||
|
{
|
||||||
|
G_cutcom[40]
|
||||||
|
G_zero[99]
|
||||||
|
G_plane[99]
|
||||||
|
G_feed[0]
|
||||||
|
G_motion[99]
|
||||||
|
G_mode[99]
|
||||||
|
X[99999.999]
|
||||||
|
Y[99999.999]
|
||||||
|
Z[99999.999]
|
||||||
|
fourth_axis[9999.999]
|
||||||
|
fifth_axis[9999.999]
|
||||||
|
I[99999.999]
|
||||||
|
J[99999.999]
|
||||||
|
K[99999.999]
|
||||||
|
R[99999.999]
|
||||||
|
D[99]
|
||||||
|
M_spindle[$mom_sys_spindle_direction_code(OFF)]
|
||||||
|
F[0.0001]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE rapid_move
|
||||||
|
{
|
||||||
|
G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt
|
||||||
|
G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)]\opt
|
||||||
|
G_motion[$mom_sys_rapid_code]
|
||||||
|
X[$mom_pos(0)*$x_factor]
|
||||||
|
Y[$mom_pos(1)]
|
||||||
|
Z[$mom_pos(2)]
|
||||||
|
fourth_axis[$mom_out_angle_pos(0)]
|
||||||
|
fifth_axis[$mom_out_angle_pos(1)]
|
||||||
|
X_vector[$mom_tool_axis(0)]\opt
|
||||||
|
Y_vector[$mom_tool_axis(1)]\opt
|
||||||
|
Z_vector[$mom_tool_axis(2)]\opt
|
||||||
|
S[$mom_spindle_rpm]
|
||||||
|
D[$mom_tool_adjust_register]
|
||||||
|
M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)]\opt
|
||||||
|
M_range[$mom_sys_spindle_range_code($mom_spindle_range)]\opt
|
||||||
|
M_coolant_1[$coolant_on(1)]
|
||||||
|
M_coolant_2[$coolant_on(2)]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE rapid_move_turn_fh
|
||||||
|
{
|
||||||
|
G_plane[17]\opt
|
||||||
|
#G_spin[$mom_sys_spindle_mode_code($spindle_mode)]\opt
|
||||||
|
G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt
|
||||||
|
G_motion[$mom_sys_rapid_code]
|
||||||
|
X[$X_value]
|
||||||
|
Y[0]
|
||||||
|
Z[$mom_pos(2)]
|
||||||
|
fourth_axis[$mom_out_angle_pos(0)]
|
||||||
|
D[$mom_tool_adjust_register]\opt
|
||||||
|
# M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)]\opt
|
||||||
|
M_range[$mom_sys_spindle_range_code($mom_spindle_range)]\opt
|
||||||
|
M_coolant_1[$coolant_on(1)]
|
||||||
|
M_coolant_2[$coolant_on(2)]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE coolant_on
|
||||||
|
{
|
||||||
|
M_coolant_1[$coolant_on(1)]
|
||||||
|
M_coolant_2[$coolant_on(2)]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE coolant_init
|
||||||
|
{
|
||||||
|
M_coolant_1[99]
|
||||||
|
M_coolant_2[99]
|
||||||
|
M_coolant_off[99]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE coolant_off
|
||||||
|
{
|
||||||
|
M_coolant_off[$coolant_off(1)]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE wzw_pos
|
||||||
|
{
|
||||||
|
Text["WZW_POS"]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE reset_pos_XYZ
|
||||||
|
{
|
||||||
|
X[99999]
|
||||||
|
Y[99999]
|
||||||
|
Z[99999]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE geoax
|
||||||
|
{
|
||||||
|
cycle_call[GEOAX]\nows
|
||||||
|
cycle_start_character[(]\nows
|
||||||
|
cycle_text_first[\$je_service_var(geoax,n)]\nows
|
||||||
|
cycle_text[\$je_service_var(geoax,AXIS)]\nows
|
||||||
|
cycle_end_character[)] \nows
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE turning_plane_fh
|
||||||
|
{
|
||||||
|
D[$mom_tool_adjust_register]\opt
|
||||||
|
G_plane[18]\opt
|
||||||
|
XC[0]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE reset_u_axis
|
||||||
|
{
|
||||||
|
G_motion[$mom_sys_rapid_code]
|
||||||
|
G_spin[94]
|
||||||
|
U[0]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE path_header
|
||||||
|
{
|
||||||
|
Path["$je_service_var(wpd)"]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE header_program
|
||||||
|
{
|
||||||
|
header_program[$lib_spf(value,output_file_basename)]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE cycle_move_pre_pos
|
||||||
|
{
|
||||||
|
G_feed[$mom_sys_feed_rate_mode_code($feed_mode)]
|
||||||
|
G_motion[$mom_sys_linear_code]
|
||||||
|
X[$mom_cycle_rapid_to_pos(0)*$x_factor]
|
||||||
|
Y[$mom_cycle_rapid_to_pos(1)]
|
||||||
|
Z[$mom_cycle_rapid_to_pos(2)]
|
||||||
|
fourth_axis[$mom_out_angle_pos(0)]
|
||||||
|
fifth_axis[$mom_out_angle_pos(1)]
|
||||||
|
M_coolant[$mom_sys_coolant_code($mom_coolant_mode)]\opt
|
||||||
|
D[$mom_tool_adjust_register]\opt
|
||||||
|
F[$mom_feed_engage_value]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE rapid_move_s_tec
|
||||||
|
{
|
||||||
|
G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt
|
||||||
|
G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)]\opt
|
||||||
|
G_motion[$mom_sys_rapid_code]
|
||||||
|
X[$mom_pos(0)*$x_factor]
|
||||||
|
Y[$mom_pos(1)]
|
||||||
|
Z[$mom_pos(2)]
|
||||||
|
fourth_axis[$mom_out_angle_pos(0)]
|
||||||
|
fifth_axis[$mom_out_angle_pos(1)]
|
||||||
|
X_vector[$mom_tool_axis(0)]\opt
|
||||||
|
Y_vector[$mom_tool_axis(1)]\opt
|
||||||
|
Z_vector[$mom_tool_axis(2)]\opt
|
||||||
|
S_s_tec["R717"]
|
||||||
|
D[$mom_tool_adjust_register]
|
||||||
|
M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)]\opt
|
||||||
|
M_range[$mom_sys_spindle_range_code($mom_spindle_range)]\opt
|
||||||
|
M_coolant_1[$coolant_on(1)]
|
||||||
|
M_coolant_2[$coolant_on(2)]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE linear_move_s_tec
|
||||||
|
{
|
||||||
|
G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt
|
||||||
|
G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)]\opt
|
||||||
|
G_feed[$mom_sys_feed_rate_mode_code($feed_mode)]
|
||||||
|
G_motion[$mom_sys_linear_code]
|
||||||
|
G_mode[$mom_sys_output_code($mom_output_mode)]
|
||||||
|
X[$mom_pos(0)*$x_factor]
|
||||||
|
Y[$mom_pos(1)]
|
||||||
|
Z[$mom_pos(2)]
|
||||||
|
fourth_axis[$mom_out_angle_pos(0)]
|
||||||
|
fifth_axis[$mom_out_angle_pos(1)]
|
||||||
|
X_vector[$mom_tool_axis(0)]\opt
|
||||||
|
Y_vector[$mom_tool_axis(1)]\opt
|
||||||
|
Z_vector[$mom_tool_axis(2)]\opt
|
||||||
|
A5[$mom_contact_normal(0)]\opt
|
||||||
|
B5[$mom_contact_normal(1)]\opt
|
||||||
|
C5[$mom_contact_normal(2)]\opt
|
||||||
|
S_s_tec["R717"]
|
||||||
|
D[$mom_tool_adjust_register]\opt
|
||||||
|
M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)]\opt
|
||||||
|
M_range[$mom_sys_spindle_range_code($mom_spindle_range)]\opt
|
||||||
|
M_coolant[$mom_sys_coolant_code($mom_coolant_mode)]\opt
|
||||||
|
F[$feed]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE circular_move_s_tec
|
||||||
|
{
|
||||||
|
G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt
|
||||||
|
G_plane[$mom_sys_cutcom_plane_code($mom_pos_arc_plane)]\opt
|
||||||
|
G_feed[$mom_sys_feed_rate_mode_code($feed_mode)]
|
||||||
|
G_motion[$mom_sys_circle_code($mom_arc_direction)]\opt
|
||||||
|
G_mode[$mom_sys_output_code($mom_output_mode)]
|
||||||
|
X[$mom_pos(0)*$x_factor]
|
||||||
|
Y[$mom_pos(1)]
|
||||||
|
Z[$mom_pos(2)]
|
||||||
|
I[($mom_pos_arc_center(0) - $mom_prev_pos(0))*$i_factor]
|
||||||
|
J[$mom_pos_arc_center(1) - $mom_prev_pos(1)]
|
||||||
|
K[$mom_pos_arc_center(2) - $mom_prev_pos(2)]
|
||||||
|
R[$mom_arc_radius]
|
||||||
|
helix_turn[$mom_helix_turn_number]\opt
|
||||||
|
S_s_tec["R717"]
|
||||||
|
M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)]\opt
|
||||||
|
M_range[$mom_sys_spindle_range_code($mom_spindle_range)]\opt
|
||||||
|
M_coolant[$mom_sys_coolant_code($mom_coolant_mode)]\opt
|
||||||
|
F[$feed]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE cycle_feed_mode_s_tec
|
||||||
|
{
|
||||||
|
G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)]\opt
|
||||||
|
G_feed[$mom_sys_feed_rate_mode_code($mom_cycle_feed_rate_mode)]
|
||||||
|
S_s_tec["R717"]
|
||||||
|
M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)]\opt
|
||||||
|
M_range[$mom_sys_spindle_range_code($mom_spindle_range)]\opt
|
||||||
|
F[$feed]
|
||||||
|
}
|
||||||
|
BLOCK_TEMPLATE motion_settings
|
||||||
|
{
|
||||||
|
G_motion_setting[$je_service_var(motion_setting)]
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user