proc initializeInstrumentList {instrument} {
set buffer [GuidoExecServer GetInstrumentList {}]
set count [GuidoGetParamBufferValue $buffer "count"]
$instrument removeAllItems
$instrument addItem ""
for {set i 0} {$i < $count} {incr i} {
set item "item($i)"
$instrument addItem [GuidoGetParamBufferValue $buffer $item]
}
}
proc instrumentChanged {instrument
angle_accuracy
inst_height_accuracy
targ_height_accuracy
dist_accuracy
inst_centring_accuracy
targ_centring_accuracy
dist_parts_per_million} {
set instrument_type_val  [$instrument getCurrentValue]
if { $instrument_type_val != "" } {
set buffer [GuidoExecServer GetInstrumentParams [subst {Instrument = "$instrument_type_val"}]]
set exists [GuidoGetParamBufferValue $buffer "exists"]
if { $exists == "true" } {
set angle [GuidoGetParamBufferValue $buffer "angle_accuracy"]
set inst_height [GuidoGetParamBufferValue $buffer "inst_height"]
set target_height [GuidoGetParamBufferValue $buffer "target_height"]
set distance [GuidoGetParamBufferValue $buffer "distance"]
set inst_centre [GuidoGetParamBufferValue $buffer "inst_centre"]
set target_centre [GuidoGetParamBufferValue $buffer "target_centre"]
set dist_error [GuidoGetParamBufferValue $buffer "dist_error"]
$angle_accuracy setCurrentValue $angle
$inst_height_accuracy setCurrentValue $inst_height
$targ_height_accuracy setCurrentValue $target_height
$dist_accuracy setCurrentValue $distance
$inst_centring_accuracy setCurrentValue $inst_centre
$targ_centring_accuracy setCurrentValue $target_centre
$dist_parts_per_million setCurrentValue $dist_error
}
}
}
proc saveInstruments {instrument
angle_accuracy
inst_height_accuracy
targ_height_accuracy
dist_accuracy
inst_centring_accuracy
targ_centring_accuracy
dist_parts_per_million} {
set instrument_type_val [$instrument getCurrentValue]
set angle_accuracy_val [$angle_accuracy getCurrentValue]
set inst_height_accuracy_val [$inst_height_accuracy getCurrentValue]
set targ_height_accuracy_val [$targ_height_accuracy getCurrentValue]
set dist_accuracy_val [$dist_accuracy getCurrentValue]
set inst_centring_accuracy_val [$inst_centring_accuracy getCurrentValue]
set targ_centring_accuracy_val [$targ_centring_accuracy getCurrentValue]
set dist_parts_per_million_val [$dist_parts_per_million getCurrentValue]
GuidoExecServer SaveInstrumentParams [subst {Instrument = "$instrument_type_val" angle = "$angle_accuracy_val"
inst_height = "$inst_height_accuracy_val" target_height = "$targ_height_accuracy_val" distance = "$dist_accuracy_val"
inst_centre = "$inst_centring_accuracy_val" target_centre = "$targ_centring_accuracy_val"
dist_parts = "$dist_parts_per_million_val"}]
}
