|
|
proc PB_CMD_collect_point { } {
#=============================================================
global mom_operation_name suppress_all_output
global mom_main_mcs
global mom_main_mcs_fixture_offset_pos
global mom_fixture_offset_value
global mom_fixture_offset_value
set fix $mom_fixture_offset_value
global mom_pos
global xmin xmax
global ymin ymax
global zmin zmax
global amin amax
global mom_out_angle_pos
if {$xmin > $mom_pos(0)} { set xmin $mom_pos(0)}
if {$xmax < $mom_pos(0)} { set xmax $mom_pos(0)}
if {$ymin > $mom_pos(1)} { set ymin $mom_pos(1)}
if {$ymax < $mom_pos(1)} { set ymax $mom_pos(1)}
if {$zmin > $mom_pos(2)} { set zmin $mom_pos(2)}
if {$zmax < $mom_pos(2)} { set zmax $mom_pos(2)}
if {$amin > $mom_out_angle_pos(0)} { set amin $mom_out_angle_pos(0)}
if {$amax < $mom_out_angle_pos(0)} { set amax $mom_out_angle_pos(0)}
global mom_template_type
global mom_out_angle_pos
global mom_tool_adjust_register
global dtj
set x_out $mom_pos(0)
set y_out $mom_pos(1)
set z_out $mom_pos(2)
set b_out $mom_out_angle_pos(0)
set x_fmt [format "%.3f" $x_out]
set y_fmt [format "%.3f" $y_out]
set z_fmt [format "%.3f" $z_out]
set b_fmt [format "%.3f" $b_out]
if {$dtj == 0} {
if {$fix >= 1} {
MOM_output_literal "G[expr 53 + $mom_fixture_offset_value]"
} elseif {$fix < 0} {
# 负数 → G54.1 Pxx
MOM_output_literal "G54.1 P[expr {-$fix}]"
} else {
# 其他默认G54
MOM_output_literal "G54"
}
MOM_output_literal "G0 G90 B[format "%.3f" $mom_out_angle_pos(0)]"
MOM_output_literal "G0 G90 G94 G43 M08 Z[format "%.3f" $mom_pos(2)] H[format "%.0f" $mom_tool_adjust_register]"
}
set dtj 1.0
}
}
我这个程序错在哪。请大神帮忙
|
|