求教proc MOM_rapid_move { } {
#=============================================================
global rapid_spindle_inhibit rapid_traverse_inhibit
global spindle_first is_from
global mom_cycle_spindle_axis traverse_axis1 traverse_axis2
global mom_motion_event
ABORT_EVENT_CHECK
set spindle_first NONE
set aa(0) X ; set aa(1) Y ; set aa(2) Z
RAPID_SET
set rapid_spindle_blk {G_motion G_mode X Y Z Mcool}
set rapid_spindle_x_blk {G_motion G_mode X Mcool}
set rapid_spindle_y_blk {G_motion G_mode Y Mcool}
set rapid_spindle_z_blk {G_motion G_mode Z Mcool}
set rapid_traverse_blk {G_feed G_motion G_mode X Y Z Mcool}
set rapid_traverse_xy_blk {G_feed G_motion G_mode X Y Mcool}
set rapid_traverse_yz_blk {G_feed G_motion G_mode Y Z Mcool}
set rapid_traverse_xz_blk {G_feed G_motion G_mode X Z Mcool}
set rapid_traverse_mod {}
set rapid_spindle_mod {}
global mom_sys_control_out mom_sys_control_in
set co "$mom_sys_control_out"
set ci "$mom_sys_control_in"
if { ![info exists mom_cycle_spindle_axis] } {
set mom_cycle_spindle_axis 2
}
if { ![info exists spindle_first] } {
set spindle_first NONE
}
if { ![info exists rapid_spindle_inhibit] } {
set rapid_spindle_inhibit FALSE
}
if { ![info exists rapid_traverse_inhibit] } {
set rapid_traverse_inhibit FALSE
}
switch $mom_cycle_spindle_axis {
0 {
if [llength $rapid_spindle_x_blk] {
set spindle_block rapid_spindle_x
PB_SET_RAPID_MOD $rapid_spindle_mod $rapid_spindle_x_blk aa mod_spindle
} else {
set spindle_block ""
}
if [llength $rapid_traverse_yz_blk] {
set traverse_block rapid_traverse_yz
PB_SET_RAPID_MOD $rapid_traverse_mod $rapid_traverse_yz_blk aa mod_traverse
} else {
set traverse_block ""
}
}
1 {
if [llength $rapid_spindle_y_blk] {
set spindle_block rapid_spindle_y
PB_SET_RAPID_MOD $rapid_spindle_mod $rapid_spindle_y_blk aa mod_spindle
} else {
set spindle_block ""
}
if [llength $rapid_traverse_xz_blk] {
set traverse_block rapid_traverse_xz
PB_SET_RAPID_MOD $rapid_traverse_mod $rapid_traverse_xz_blk aa mod_traverse
} else {
set traverse_block ""
}
}
2 {
if [llength $rapid_spindle_z_blk] {
set spindle_block rapid_spindle_z
PB_SET_RAPID_MOD $rapid_spindle_mod $rapid_spindle_z_blk aa mod_spindle
} else {
set spindle_block ""
}
if [llength $rapid_traverse_xy_blk] {
set traverse_block rapid_traverse_xy
PB_SET_RAPID_MOD $rapid_traverse_mod $rapid_traverse_xy_blk aa mod_traverse
} else {
set traverse_block ""
}
}
default {
set spindle_block rapid_spindle
set traverse_block rapid_traverse
PB_SET_RAPID_MOD $rapid_spindle_mod $rapid_spindle_blk aa mod_spindle
PB_SET_RAPID_MOD $rapid_traverse_mod $rapid_traverse_blk aa mod_traverse
}
}
if { ![string compare $spindle_first "TRUE"] } {
if { ![string compare $rapid_spindle_inhibit "FALSE"] } {
if { [string compare $spindle_block ""] } {
PB_FORCE Once $mod_spindle
MOM_do_template $spindle_block
} else {
MOM_output_literal "$co Rapid Spindle Block is empty! $ci"
}
}
if { ![string compare $rapid_traverse_inhibit "FALSE"] } {
if { [string compare $traverse_block ""] } {
PB_FORCE Once $mod_traverse
MOM_do_template $traverse_block
} else {
MOM_output_literal "$co Rapid Traverse Block is empty! $ci"
}
}
} elseif { ![string compare $spindle_first "FALSE"] } {
if { ![string compare $rapid_traverse_inhibit "FALSE"] } {
if { [string compare $traverse_block ""] } {
PB_FORCE Once $mod_traverse
MOM_do_template $traverse_block
} else {
MOM_output_literal "$co Rapid Traverse Block is empty! $ci"
}
}
if { ![string compare $rapid_spindle_inhibit "FALSE"] } {
if { [string compare $spindle_block ""] } {
PB_FORCE Once $mod_spindle
MOM_do_template $spindle_block
} else {
MOM_output_literal "$co Rapid Spindle Block is empty! $ci"
}
}
} else {
PB_FORCE Once $mod_traverse
MOM_do_template rapid_traverse
}