GuidoApp rdSetup "CHECK RING DESIGN SETUP"
set result [$rdSetup invoke]
$rdSetup destroy
if {$result == "0"} {
GuidoApp select "SELECT HOLE TO OFFSET"
$select setParam prompt "RD_SELECT_HOLE_OFFSET"
set hole_id ""
while {$hole_id != "-1"} {
set hole_id [$select invoke]
if {$hole_id == "0"} {
set hole_id "-1";
}
if {$hole_id != "-1"} {
GuidoForm form {
-default_buttons
-label "Offset Hole to Plane"
-tip RD_OFFSET_HOLE_TO_PLANE
-layout BoxLayout Y_AXIS
GuidoPanel toePanel {
-layout CentreLineLayout
GuidoField toeDistance {
-label "Offset toe distance"
-display_length 10
-format double
-max_length 20
-default "0.0"
-tip RD_OFFSET_TOE_DIST
-null false
}
}
GuidoPanel collarPanel {
-layout CentreLineLayout
-border etched true
GuidoCheckBox canOffsetCollar {
-label "Offset collar position?"
-selected_value "y"
-unselected_value "n"
-default "n"
-tip RD_OFFSET_COLLAR
}
GuidoField collarDistance {
-label "Offset collar distance"
-dependency {"[$canOffsetCollar getCurrentValue]" == "y"}
-display_length 10
-format double
-max_length 20
-default "0.0"
-tip RD_OFFSET_COLLAR_DIST
-null false
}
}
}
GuidoApp rdOffsets "GET HOLE OFFSETS"
$rdOffsets setParam hole "$hole_id"
$rdOffsets invoke
$rdOffsets destroy
set buffer [GuidoExecServer GetToeAndColOffsets {}]
set toeD [GuidoGetParamBufferValue $buffer toeOffset]
set colD [GuidoGetParamBufferValue $buffer collarOffset]
$toeDistance setCurrentValue [format "%.3f" $toeD]
$collarDistance setCurrentValue [format "%.3f" $colD]
if {$colD == "0.0"} {
$canOffsetCollar setCurrentValue "n"
} else {
$canOffsetCollar setCurrentValue "y"
}
set return_code [$form interact]
if {$return_code == "apply"} {
if {$toeDistance > ""} {
GuidoApp offset "OFFSET THE HOLE"
$offset setParam HoleID "$hole_id"
$offset setParam toeDist [$toeDistance getCurrentValue]
$offset setParam moveCollar [$canOffsetCollar getCurrentValue]
$offset setParam collarDist [$collarDistance getCurrentValue]
$offset invoke
$offset destroy
}
}
$form destroy
}
}
$select destroy
}
GuidoApp rdCleanUp "CHECK RING DESIGN CLEANUP"
set result [$rdCleanUp invoke]
$rdCleanUp destroy
