GuidoApp check_db "CHECK DATABASE CONNECTED"
$check_db setParam "databasesession" "GeologyDatabase"
set result [$check_db invoke]
$check_db destroy
if {$result == "0"} {
GuidoApp select "SELECT HOLE"
GuidoApp composite "CREATE COMPOSITE"
set databuf [ GuidoExecServer GetComposites {} ]
set status [GuidoGetParamBufferValue $databuf status]
if {$status >= 0} {
set code [GuidoGetParamBufferValue $databuf "composite_code"]
}
GuidoForm form {
-default_buttons
-label "Code For New Composites"
-tip DB_COMPOSITE_CODE_TIP
-layout CentreLineLayout
GuidoField composite_code {
-display_length 12
-format string
-label "Default composite code"
-max_length 20
-null true
-tip DB_COMPOSITE_OPT_COMP_CODE_TIP
}
}
$composite_code setCurrentValue $code
set return_code [$form interact]
if {$return_code == "apply"} {
set code [$composite_code getCurrentValue]
$select setParam report "off"
set hole_id "-"
while {$hole_id > ""} {
$select setParam marker "location"
$select setParam prompt "DB_SELECT_COMPOSITE_START"
$select setParam hole_id ""
$select setParam single_click "true"
set result [$select invoke]
set buffer [ GuidoExecServer GetSelectedHoleId {} ]
set hole_id [ GuidoGetParamBufferValue $buffer hole_id ]
if {$hole_id > ""} {
set depth_from [ GuidoGetParamBufferValue $buffer depth ]
$select setParam hole_id $hole_id
$select setParam marker "off"
$select setParam prompt "DB_SELECT_COMPOSITE_END"
$select setParam single_click "true"
set result [$select invoke]
set buffer [ GuidoExecServer GetSelectedHoleId {} ]
catch {
set depth_to [ GuidoGetParamBufferValue $buffer depth ]
$composite setParam hole_id $hole_id
$composite setParam depth_from $depth_from
$composite setParam depth_to $depth_to
$composite setParam code $code
$composite invoke
}
}
}
}
$select destroy
$composite destroy
$form destroy
}
