GuidoScript scripts/dtmutilities.tcl
global topDtmFile
global top_object_id
global top_obj_name
global top_trisolation_id
global top_tri_name
global bottomDtmFile
global bot_obj_name
global bot_object_id
global bot_trisolation_id
global bot_tri_name
proc storeOldValOne { location object_id trisolation_id } {
global location_old_val_one
if {![info exists location_old_val_one]} {
set location_old_val_one ""
}
set locCheck [$location getCurrentValue]
if {![info exists location_old_val_one]} {
set location_old_val_one ""
}
if { "$location_old_val_one" != "$locCheck" } {
clearFieldListOne $location $object_id $trisolation_id
}
set location_old_val_one [$location getCurrentValue]
}
proc clearFieldListOne { location object_id trisolation_id }  {
global location_old_val_one
if {![info exists location_old_val_one]} {
set location_old_val_one ""
}
set location_new_val [$location getCurrentValue]
if { "$location_old_val_one" != "$location_new_val" } {
$object_id setExclusive false
$object_id removeAllItems
eval [concat {$object_id} {setValues} 1 ]
$object_id setCurrentValue 1
$trisolation_id setExclusive false
$trisolation_id removeAllItems
eval [concat {$trisolation_id} {setValues} 1 ]
$trisolation_id setCurrentValue 1
}
set location_old_val_one $location_new_val
}
proc storeOldValTwo { location object_id trisolation_id } {
global location_old_val_two
if {![info exists location_old_val_two]} {
set location_old_val_two ""
}
set locCheck [$location getCurrentValue]
if {![info exists location_old_val_two]} {
set location_old_val_two ""
}
if { "$location_old_val_two" != "$locCheck"} {
clearFieldListTwo $location $object_id $trisolation_id
}
set location_old_val_two [$location getCurrentValue]
}
proc clearFieldListTwo { location object_id trisolation_id }  {
global location_old_val_two
if {![info exists location_old_val_two]} {
set location_old_val_two ""
}
set location_new_val [$location getCurrentValue]
if { "$location_old_val_two" != "$location_new_val" } {
$object_id setExclusive false
$object_id removeAllItems
eval [concat {$object_id} {setValues} 1 ]
$object_id setCurrentValue 1
$trisolation_id setExclusive false
$trisolation_id removeAllItems
eval [concat {$trisolation_id} {setValues} 1 ]
$trisolation_id setCurrentValue 1
}
set location_old_val_two $location_new_val
}
GuidoForm frm20195 {
-default_buttons
-help_id 815
-label "Block model report"
-layout BoxLayout Y_AXIS
-tip "20195_TIP_001"
GuidoScrollPane frm20195_1 {
-height 2.5
-label "Report description"
GuidoTextArea rpt_desc_1 {
-tip "20195_TIP_002"
}
}
GuidoFiller frm20195_2 {
-height 0.1
}
GuidoPanel frm20195_3 {
-layout CentreLineLayout VERTICAL LEFT
GuidoCheckBox Format_head {
-default true
-selected_value Yes
-tip BM_REPORT_FORMAT_HEAD_TIP
-unselected_value No
}
GuidoLabel Format_head_label {
-label "Format headers?"
}
}
GuidoPanel frm20195_4 {
-layout CentreLineLayout VERTICAL LEFT
GuidoCheckBox cullEmpty {
-default false
-selected_value Yes
-tip BM_REPORT_FORMAT_EMPTY_TIP
-unselected_value No
}
GuidoLabel Format_head_label {
-label "Remove lines with zero volume?"
}
}
GuidoPanel frm20195_5 {
-layout BoxLayout X_AXIS
GuidoFiller frm20195_6 {
-width 0.2
}
GuidoLabel frm20195_7 {
-label "Report volume and tonnes to"
-display_length 14
}
GuidoComboBox volDecimals {
-default "0 decimal places"
-tip BM_REPORT_FORMAT_DECIMAL_TIP
-value_in "0 decimal places" "1 decimal place" "2 decimal places" "3 decimal places"
-exclusive true
-null false
-display_length 10
-format none
-max_length 20
}
}
GuidoFiller frm20195_8 {
-height 0.1
}
GuidoScrollPane frm20195_9 {
-height 6
GuidoTable report_attributes {
-instances 1 1 200
-interactive true
-no_mlt
-row_headings a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az
GuidoComboBox rpt_attribute {
-display_length 12
-format none
-label "Report attributes"
-max_length BM_MAX_ATT_NAME_LEN
-exclusive false
-no_mlt
-legacy_action
-tip "20190_TIP_011"
}
GuidoCheckBox rpt_display {
-default true
-label "Display?"
-selected_value Yes
-unselected_value No
-tip "20195_TIP_003"
}
GuidoComboBox low_cut {
-display_length 4
-format double
-label "Low cut"
-null false
-tip "20195_TIP_006"
}
GuidoComboBox upper_cut {
-display_length 4
-format double
-label "Upper cut"
-null false
-tip "20195_TIP_007"
}
GuidoComboBox rpt_attribute_wt {
-default Mass
-display_length 5
-format none
-label "Weight by"
-max_length 6
-null false
-tip "20195_TIP_004"
-value_in Mass Volume None
}
GuidoComboBox rpt_attribute_avg {
-default Average
-display_length 8
-format none
-max_length 9
-null false
-label "Report"
-tip "20195_TIP_005"
-value_in Average Aggregate
}
GuidoField rpt_expression {
-display_length 18
-max_length 256
-label "Expression"
-legacy_validation
-tip "20195_TIP_008"
}
}
}
GuidoPanel left_panel {
-layout BoxLayout X_AXIS
GuidoPanel adjustmentsPanel {
-layout BoxLayout Y_AXIS
GuidoPanel frm20195_10 {
-layout BoxLayout Y_AXIS
-border etched true
-label "Volume adjustment"
-width  25.7
GuidoFiller space {
-height 0.05
}
GuidoPanel check_panel {
-layout CentreLineLayout VERTICAL LEFT
GuidoCheckBox use_vol {
-default false
-next_focus vol_att
-selected_value Yes
-tip BM_USE_VOL_ADJ_TIP
-unselected_value No
}
GuidoLabel use_vol_label {
-label "Use volume adjustment?"
}
}
GuidoPanel frm20195_11 {
-layout BoxLayout X_AXIS
GuidoFiller space {
-width 2
}
GuidoLabel vol_att_label {
-dependency {"[ $use_vol getCurrentValue]" == "Yes"}
-display_length 7
-label Attribute
}
GuidoComboBox vol_att {
-dependency {"[ $use_vol getCurrentValue]" == "Yes"}
-display_length 12.4
-format none
-max_length BM_MAX_ATT_NAME_LEN
-no_mlt
-null false
-tip BM_VOL_ADJ_TIP
}
}
GuidoFiller space {
-height 0.05
}
}
GuidoPanel geometryGroup {
-layout BoxLayout Y_AXIS
-border etched true
-label "Geometric grouping"
GuidoPanel typePanel {
-layout CentreLineLayout VERTICAL LEFT
GuidoComboBox geometryType {
-label "Group geometrically"
-display_length 12.5
-format none
-max_length 18
-exclusive true
-null false
-default "None"
-tip "20195_TIP_014"
}
}
GuidoFiller frm20195_17 {
-height 0.05
}
GuidoFiller frm20195_18 {
-height 0.05
}
GuidoPanel optionsOverlay {
-layout OverlayLayout
-height 11.5
GuidoPanel 3DMPanel {
-layout BoxLayout Y_AXIS
-dependency {"[ $geometryType getCurrentValue]" == "Solids"}
GuidoFiller frm20195_19 {
-height 0.05
}
GuidoPanel DTMFileP {
-layout CentreLineLayout VERTICAL LEFT
GuidoFileBrowserField DTMFile {
-label "File name"
-display_length 15
-file_mask *.dtm
-format none
-max_length 252
-translate lower
-tip "20195_TIP_015"
}
GuidoFiller frm20195_20 {
-height 0.05
}
GuidoFiller frm20195_201 {
-height 0.05
}
GuidoField DTMRange {
-label "Object range"
-display_length 14.95
-format range
-max_length MAX_RNG_LENGTH
-null true
-tip "20195_TIP_016"
}
}
}
GuidoPanel StringPanel {
-layout CentreLineLayout VERTICAL LEFT
-dependency {"[ $geometryType getCurrentValue]" == "Strings"}
GuidoFiller frm20195_21 {
-height 0.05
}
GuidoFiller frm20195_21 {
-height 0.05
}
GuidoFileBrowserField StringFile {
-label "File name"
-display_length 15
-file_mask *.str
-format none
-max_length 252
-translate lower
-tip "20195_TIP_017"
}
GuidoFiller frm20195_21 {
-height 0.05
}
GuidoFiller frm20195_21 {
-height 0.05
}
GuidoField StringRange {
-label "String range"
-display_length 15
-format range
-max_length MAX_RNG_LENGTH
-null true
-tip "20195_TIP_018"
}
GuidoFiller frm20195_21 {
-height 0.05
}
GuidoFiller frm20195_21 {
-height 0.05
}
GuidoComboBox extension {
-label "Extension direction"
-display_length 12.6
-format none
-max_length 3
-exclusive true
-null false
-value_in X Y Z
-default Z
-tip "20195_TIP_019"
}
GuidoFiller frm20195_21 {
-height 0.05
}
GuidoFiller frm20195_21 {
-height 0.05
}
GuidoField stringMin {
-label "Lower bound"
-display_length 15
-format double
-max_length 16
-null true
-tip "20195_TIP_020"
}
GuidoFiller frm20195_21 {
-height 0.05
}
GuidoFiller frm20195_21 {
-height 0.05
}
GuidoField stringMax {
-label "Upper bound"
-display_length 15
-format double
-max_length 16
-null true
-tip "20195_TIP_021"
}
}
GuidoPanel betweenDtm {
-dependency {"[ $geometryType getCurrentValue]" == "Between DTMS"}
-layout CentreLineLayout VERTICAL LEFT
GuidoLabel labelLoc {
-label "Top DTM file"
}
GuidoPanel frm00380_5 {
-layout BoxLayout X_AXIS
GuidoFileBrowserField topDtmFile {
-display_length 15
-format none
-null false
-max_length 256
-file_mask *.dtm
-tip "20195_TIP_022"
-next_focus top_object_id
}
GuidoButton readDtm1 {
-tip "TIP_POPULATE_TRI_TRIOBJ"
-icon "icons/12/refresh.png"
-action valueChanged {[getObjectsTrisolationsForMultipleDTMS $topDtmFile $top_object_id $top_obj_name $top_trisolation_id $top_tri_name]}
}
}
GuidoFiller frm20195_26 {
-height 0.05
}
GuidoFiller frm20195_27 {
-height 0.05
}
GuidoLabel obj_id_label {
-label "Object ID"
}
GuidoPanel frm20195_28 {
-layout CentreLineLayout VERTICAL LEFT
GuidoComboBox top_object_id {
-display_length 5
-action focusGained {[updateObjectDetailsForMultipleDtms $topDtmFile $top_object_id $top_trisolation_id ]}
-action valueChanged {[triobjectChanged $topDtmFile $top_object_id $top_obj_name $top_trisolation_id $top_tri_name]}
-format integer
-null false
-max_length 32
-translate none
-exclusive false
-tip "Select the object ID to process"
}
GuidoLabel top_obj_name {
-height	1
}
}
GuidoFiller frm20195_29 {
-height 0.05
}
GuidoFiller frm20195_30 {
-height 0.05
}
GuidoLabel trisolation_id_label {
-label "Trisolation ID"
}
GuidoPanel frm20195_31 {
-layout CentreLineLayout VERTICAL LEFT
GuidoComboBox top_trisolation_id {
-display_length 5
-format integer
-max_length 32
-null false
-exclusive false
-translate none
-action focusGained {[updateTrisolationDetailsForMultipleDtms $topDtmFile $top_object_id $top_trisolation_id ]}
-action valueChanged {[trisolationChanged $topDtmFile $top_object_id $top_trisolation_id $top_tri_name]}
-tip "Select the trisolation ID to process"
}
GuidoLabel top_tri_name {
-height 1
}
}
GuidoFiller frm20195_32 {
-height 0.05
}
GuidoFiller frm20195_33 {
-height 0.05
}
GuidoLabel labelLoc {
-label "Bottom DTM file"
}
GuidoPanel frm00380_5 {
-layout BoxLayout X_AXIS
GuidoFileBrowserField bottomDtmFile {
-display_length 15
-format none
-null false
-max_length 256
-file_mask *.dtm
-tip "20195_TIP_023"
-next_focus bot_object_id
}
GuidoButton readDtm2 {
-tip "TIP_POPULATE_TRI_TRIOBJ"
-icon "icons/12/refresh.png"
-action valueChanged {[getObjectsTrisolationsForMultipleDTMS $bottomDtmFile $bot_object_id $bot_obj_name $bot_trisolation_id $bot_tri_name]}
}
}
GuidoFiller frm20195_34 {
-height 0.05
}
GuidoFiller frm20195_35 {
-height 0.05
}
GuidoLabel bot_obj_id_label {
-label "Object ID"
}
GuidoPanel frm20195_36 {
-layout CentreLineLayout VERTICAL LEFT
GuidoComboBox bot_object_id {
-display_length 5
-action focusGained {[updateObjectDetailsForMultipleDtms $bottomDtmFile $bot_object_id $bot_trisolation_id ]}
-action valueChanged {[triobjectChanged $bottomDtmFile $bot_object_id $bot_obj_name $bot_trisolation_id $bot_tri_name]}
-format integer
-null false
-max_length 32
-translate none
-exclusive false
-tip "Select the object ID to process"
}
GuidoLabel bot_obj_name {
-height 1
}
}
GuidoFiller frm20195_37 {
-height 0.05
}
GuidoFiller frm20195_38 {
-height 0.05
}
GuidoLabel trisolation_id_lab {
-label "Trisolation ID"
}
GuidoPanel frm20195_39 {
-layout CentreLineLayout VERTICAL LEFT
GuidoComboBox bot_trisolation_id {
-display_length 5
-format integer
-max_length 32
-translate none
-null false
-exclusive false
-action focusGained {[updateTrisolationDetailsForMultipleDtms $bottomDtmFile $bot_object_id $bot_trisolation_id ]}
-action valueChanged {[trisolationChanged $bottomDtmFile $bot_object_id $bot_trisolation_id $bot_tri_name]}
-tip "Select the trisolation ID to process"
}
GuidoLabel bot_tri_name {
-height 1
}
}
GuidoFiller frm20195_40 {
-height 0.05
}
GuidoFiller frm20195_41 {
-height 0.05
}
GuidoFileBrowserField boundaryStringFile {
-label "Boundary string file"
-display_length 15
-format none
-null false
-max_length 256
-file_mask *.str
-tip "20195_TIP_024"
}
GuidoFiller frm20195_42 {
-height 0.05
}
GuidoFiller frm20195_43 {
-height 0.05
}
GuidoField boundaryStringRange {
-label "String range"
-display_length 14.95
-format range
-max_length 32
-tip "20195_TIP_025"
}
}
}
GuidoPanel partialPanel {
-layout BoxLayout Y_AXIS
GuidoPanel use_partialP {
-layout CentreLineLayout VERTICAL LEFT
GuidoCheckBox use_partial {
-dependency {"[$geometryType getCurrentValue]" != "None" && "[$use_vol getCurrentValue]" == "No"}
-default false
-selected_value Yes
-unselected_value No
-tip "20195_TIP_026"
}
GuidoLabel triobject {
-dependency {"[$geometryType getCurrentValue]" != "None" && "[$use_vol getCurrentValue]" == "No"}
-label "Use partial percentages?"
}
}
GuidoPanel frm20195_47 {
-layout CentreLineLayout VERTICAL LEFT
GuidoComboBox precision {
-dependency {"[$geometryType getCurrentValue]" != "None" && "[$use_partial getCurrentValue]" == "Yes" && "[$use_vol getCurrentValue]" == "No"}
-label "Precision"
-display_length 5
-format none
-max_length 18
-exclusive true
-null false
-value_in 1 2 3 4 5
-default 3
-tip "20195_TIP_027"
}
GuidoBMAttributeBrowser partialPercentAttr {
-dependency {"[$geometryType getCurrentValue]" != "None" && "[$use_partial getCurrentValue]" == "Yes" && "[$use_vol getCurrentValue]" == "No"}
-label "Attribute to store partial percentage values"
-attribute_types real calculated float
-display_length 5
-max_length BM_MAX_ATT_NAME_LEN
-format none
-exclusive false
-null true
-tip "20195_TIP_028"
}
$partialPercentAttr updateBrowserList
}
}
}
}
GuidoPanel right_panel1 {
-layout BoxLayout Y_AXIS
GuidoPanel frm20195_12 {
-layout BoxLayout X_AXIS
-label "Density adjustment"
-border etched true
-width 44
GuidoButtonGroupPanel vol_mult_factor {
-tip "20195_TIP_009"
-layout BoxLayout Y_AXIS
GuidoRadioButton frm20195_13 {
-caption None
-selected_value None
-height 1
}
GuidoRadioButton frm20195_14 {
-caption Attribute
-selected_value Attribute
-height 1
}
GuidoRadioButton frm20195_15 {
-caption Value
-selected_value Value
-height 1
}
}
GuidoFiller space {
-width 0.5
}
GuidoPanel opt_panel {
-layout BoxLayout Y_AXIS
GuidoFiller space {
-height 1.0
}
GuidoComboBox mult_factor_att_name {
-dependency {"[ $vol_mult_factor getCurrentValue]" == "Attribute"}
-display_length 7
-format none
-no_mlt
-max_length BM_MAX_ATT_NAME_LEN
-tip "20195_TIP_010"
}
GuidoFiller frm20195_16 {
-height 0.1
}
GuidoField mult_factor_value {
-dependency {"[ $vol_mult_factor getCurrentValue]" == "Value"}
-display_length 9.5
-format double
-max_length 16
-null false
-tip "20195_TIP_011"
}
}
}
GuidoPanel groupingAllPanel {
-layout BoxLayout X_AXIS
GuidoFiller space {
-width 0.5
}
GuidoPanel group_panel {
-layout BoxLayout X_AXIS
GuidoPanel left_panel {
-layout BoxLayout Y_AXIS
GuidoFiller space {
-height 0.05
}
GuidoScrollPane frm20195_44 {
-height 10
GuidoTable group_attributes {
-instances 1 1 10
-interactive true
GuidoComboBox group_field {
-display_length 17
-legacy_action
-format none
-label "Grouping attributes"
-no_mlt
-max_length BM_MAX_ATT_NAME_LEN
-tip "20195_TIP_012"
}
GuidoField numeric_range {
-display_length 20
-format range
-label "Numeric range"
-legacy_validation
-max_length MAX_RNG_LENGTH
-tip "20195_TIP_013"
-translate none
}
}
}
GuidoFiller frm20195_45 {
-height 0.3
}
GuidoPanel fillAllCellsP {
-layout CentreLineLayout VERTICAL LEFT
GuidoCheckBox fillAllCells {
-default "No"
-selected_value Yes
-tip BM_REPORT_FILL_ALL_CELLS_TIP
-unselected_value No
}
GuidoLabel frm20195_50 {
-label "Fill all cells for the group attribute?"
}
}
GuidoPanel reportSubTotalsP {
-layout CentreLineLayout VERTICAL LEFT
GuidoCheckBox pivotCompatible {
-default "No"
-selected_value Yes
-tip BM_REPORT_PIVOT_COMP
-unselected_value No
}
GuidoLabel frm20195_50 {
-label "Pivot compatible?"
}
}
}
}
}
}
}
$topDtmFile setActionCallback focusGained {[storeOldValOne $topDtmFile $top_object_id $top_trisolation_id]}
$topDtmFile setActionCallback valueChanged {[clearFieldListOne $topDtmFile $top_object_id $top_trisolation_id]}
$bottomDtmFile setActionCallback valueChanged {[clearFieldListTwo $bottomDtmFile $bot_object_id $bot_trisolation_id]}
$bottomDtmFile setActionCallback focusGained {[storeOldValTwo $bottomDtmFile $bot_object_id $bot_trisolation_id]}
}
