GuidoScript scripts/geologyutilities.tcl
global dipstick_table
global dipstick_tbl
global dipstick_az_fld
global dipstick_dip_fld
global dipstick_position
global dipstick_offset
global dipstick_length
GuidoPanel dipstick_panelb {
-layout BoxLayout Y_AXIS
GuidoFiller attributes_filler_1 {
-height 1
}
GuidoPanel borderLayout {
-layout borderlayout
GuidoScrollPane scroller {
-width 41
GuidoTable dipstick_table {
-instances 1 0 200
-interactive true "insert|remove|add"
-position centre
GuidoDatabaseTableBrowser dipstick_tbl {
-display_length 5
-label "Table"
-database dbHandle
-action valueChanged {[updateTableName $dipstick_az_fld $dipstick_tbl]}
-action valueChanged {[updateTableName $dipstick_dip_fld $dipstick_tbl]}
-table_types "interval point"
-null true
-exclusive true
-tip DB_DIPSTICK_TBL_TIP
}
GuidoTableFieldBrowser dipstick_az_fld {
-display_length 5
-label "Azimuth field"
-format string
-null false
-exclusive true
-database dbHandle
-tip DB_DIPSTICK_AZ_FLD_TIP
-dependency {"[$dipstick_tbl getCurrentValue]" > ""}
}
GuidoTableFieldBrowser dipstick_dip_fld {
-display_length 5
-label "Dip field"
-format string
-null false
-exclusive true
-database dbHandle
-tip DB_DIPSTICK_DIP_FLD_TIP
-dependency {"[$dipstick_tbl getCurrentValue]" > ""}
}
GuidoComboBox dipstick_position {
-label "Position"
-display_length 3
-exclusive true
-null false
-max_length 6
-value_in left right centre
-default right
-tip DB_DIPSTICK_POSITION_TIP
}
GuidoField dipstick_offset {
-label "Offset"
-decimals 1
-display_length 3
-format double
-max_length 8
-null false
-default 0.0
-dependency {"[$dipstick_position getCurrentValue]" != "centre"}
-tip DB_DIPSTICK_OFFSET_TIP
}
GuidoField dipstick_length {
-label "Length"
-decimals 1
-display_length 3
-format double
-max_length 8
-null false
-default 1.0
-tip DB_DIPSTICK_LENGTH_TIP
}
}
}
}
}
$dipstick_panel add [eval "\$dipstick_panelb getObject"]
$dipstick_az_fld setDependency {[updateTableName $dipstick_az_fld $dipstick_tbl]}
$dipstick_dip_fld setDependency {[updateTableName $dipstick_dip_fld $dipstick_tbl]}
$dipstick_az_fld setActionCallback focusGained {[ updateTableName $dipstick_az_fld $dipstick_tbl ]}
$dipstick_dip_fld setActionCallback focusGained {[ updateTableName $dipstick_dip_fld $dipstick_tbl ]}
$dipstick_az_fld setValidationCallback {[validateTableFieldPair $dipstick_tbl $dipstick_az_fld]}
$dipstick_dip_fld setValidationCallback {[validateTableFieldPair $dipstick_tbl $dipstick_dip_fld]}
set databuf [ GuidoExecServer GetHoleDipsticks {} ]
set status [GuidoGetParamBufferValue $databuf status]
if {$status >= 0} {
set num_rows [GuidoGetParamBufferValue $databuf "num_rows"]
if {$num_rows > 0} {
$dipstick_table setInitialRows $num_rows 0 200
} else {
$dipstick_az_fld setInputAllowed 0 false
$dipstick_dip_fld setInputAllowed 0 false
}
for {set i 0} {$i < $num_rows} {incr i} {
$dipstick_tbl setCurrentValue $i [GuidoGetParamBufferValue $databuf "tbl($i)"]
$dipstick_az_fld setCurrentValue $i [GuidoGetParamBufferValue $databuf "az_fld($i)"]
$dipstick_dip_fld setCurrentValue $i [GuidoGetParamBufferValue $databuf "dip_fld($i)"]
$dipstick_position setCurrentValue $i [GuidoGetParamBufferValue $databuf "position($i)"]
$dipstick_length setCurrentValue $i [GuidoGetParamBufferValue $databuf "length($i)"]
$dipstick_offset setCurrentValue $i [GuidoGetParamBufferValue $databuf "offset($i)"]
}
}
$dipstick_tbl updateBrowserList
