proc setFieldValues {formHandle buffer attTable bm_file sgAttribute oreRockType gradeAtt} {
$formHandle setField "planesGroupComboBox" [GuidoGetParamBufferValue $buffer "planeGroup"]
$formHandle setField "extendModeRadioPanel" [GuidoGetParamBufferValue $buffer "extendMode"]
$formHandle setField "startPlaneComboBox" [GuidoGetParamBufferValue $buffer "startPlane"]
$formHandle setField "endPlaneComboBox" [GuidoGetParamBufferValue $buffer "endPlane"]
$formHandle setField "objectStringNumberField" [GuidoGetParamBufferValue $buffer "objectNumber"]
$formHandle setField "nameField" [GuidoGetParamBufferValue $buffer "name"]
$formHandle setField "startColour" [GuidoGetParamBufferValue $buffer "colour"]
$formHandle setField "dipField" [GuidoGetParamBufferValue $buffer "dip"]
$formHandle setField "azimuthField" [GuidoGetParamBufferValue $buffer "azimuth"]
$formHandle setField "reportFileNameField" [GuidoGetParamBufferValue $buffer "reportFile"]
$formHandle setField "reportformat" [GuidoGetParamBufferValue $buffer "reportFormat"]
$formHandle setField "workingLayer" [GuidoGetParamBufferValue $buffer "workingLayer"]
$formHandle setField "evalBlockModel" [GuidoGetParamBufferValue $buffer "useBlockModel"]
set bmFileName [GuidoGetParamBufferValue $buffer "blockModelFile"]
if {$bmFileName != ""} {
$formHandle setField "bm_file" $bmFileName
updateBlockModelBrowsers $bm_file $sgAttribute $oreRockType $gradeAtt
}
$formHandle setField "specGravity" [GuidoGetParamBufferValue $buffer "sg"]
$formHandle setField "sgAttribute" [GuidoGetParamBufferValue $buffer "sgAttribute"]
$formHandle setField "sgValue" [GuidoGetParamBufferValue $buffer "sgValue"]
$formHandle setField "sgNegativeReplacement" [GuidoGetParamBufferValue $buffer "sgNegativeReplacement"]
$formHandle setField "usePartial" [GuidoGetParamBufferValue $buffer "usePartial"]
$formHandle setField "precision" [GuidoGetParamBufferValue $buffer "precision"]
$formHandle setField "oreRockType" [GuidoGetParamBufferValue $buffer "oreRockType"]
set nGrades "[GuidoGetParamBufferValue $buffer nGrades]"
set numberOfRowsToAdd [expr $nGrades - [$attTable getRowCount]];
if { $numberOfRowsToAdd > 0 } {
$attTable addRows $numberOfRowsToAdd
}
for {set i 0} {$i < $nGrades} {incr i} {
set tableName "attributesTable($i).gradeAtt"
$formHandle setField $tableName [GuidoGetParamBufferValue $buffer "grade_att_$i"]
set tableName "attributesTable($i).metal"
$formHandle setField $tableName [GuidoGetParamBufferValue $buffer "grade_metal_$i"]
set tableName "attributesTable($i).metalUnits"
$formHandle setField $tableName [GuidoGetParamBufferValue $buffer "grade_units_$i"]
set tableName "attributesTable($i).negativeReplacement"
$formHandle setField $tableName [GuidoGetParamBufferValue $buffer "grade_negativeReplacement_$i"]
}
}
proc validateProjectFileLoadingIfExists {formHandle projectBrowser attTable bm_file sgAttribute oreRockType gradeAtt} {
if {"$projectBrowser" != ""} {
set filename [$projectBrowser getCurrentValue]
if {"$filename" != ""} {
set buffer [GuidoExecServer getStopeDesignParameters [subst {file_name = "$filename"}]]
set loaded [GuidoGetParamBufferValue $buffer loaded]
if {"$loaded" == "true"} {
setFieldValues $formHandle $buffer $attTable $bm_file $sgAttribute $oreRockType $gradeAtt
} else {
set badname [GuidoGetParamBufferValue $buffer badname]
if {"$badname" == "true"} {
$projectBrowser setCurrentValue ""
}
}
}
}
}
GuidoScript scripts/StopeCommonFunctions.tcl
GuidoForm StopeDesign {
-default_buttons
-label STOPE_DESIGN_START_LABEL
GuidoTabbedPane mainTabPanel {
GuidoPanel projectDefinitionPanel {
-label "Project definition"
-width 45
-layout BoxLayout Y_AXIS
GuidoPanel layout1 {
-layout CentreLineLayout
GuidoPanel leftPanel1 {
}
GuidoPanel rightPanel1 {
-layout CentreLineLayout
GuidoPanel projectAndPlanesPanel {
-layout CentreLineLayout
GuidoFiller filler15 {
-height 0.1
}
GuidoFiller filler16 {
-height 0.1
}
GuidoFileBrowserField projectNameBrowser {
-display_length 16
-file_mask "*.sdproj"
-format none
-label "Project name"
-max_length 256
-null false
-translate lower
-tip STOPEDESIGN_2
-action focusLost {[validateProjectFileLoadingIfExists $StopeDesign $projectNameBrowser $attributesTable $bm_file $sgAttribute $oreRockType $gradeAtt]}
}
GuidoFiller filler1 {
-height 0.1
}
GuidoFiller filler2 {
-height 0.1
}
GuidoComboBox planesGroupComboBox {
-display_length 12
-label "Planes group"
-tip STOPEDESIGN_3
-exclusive false
-null false
}
$planesGroupComboBox setActionCallback valueChanged {[setPlaneSeries $startPlaneComboBox [$planesGroupComboBox getCurrentValue]]}
$planesGroupComboBox setActionCallback valueChanged {[setPlaneSeriesWithDefault $endPlaneComboBox [$planesGroupComboBox getCurrentValue] true]}
}
}
}
GuidoFiller filler3 {
-height 0.1
}
GuidoFiller filler4 {
-height 0.1
}
GuidoPanel designObjectPanel {
-border etched true
-label "Created design object"
-width 45
-layout CentreLineLayout
GuidoFiller filler5 {
-height 1
}
GuidoPanel extendParamsPanel {
-layout BoxLayout X_AXIS
GuidoPanel leftPanel {
GuidoLabel extrudeUsing {
-default "Extrude using"
}
}
GuidoButtonGroupPanel extendModeRadioPanel {
-layout BoxLayout Y_AXIS
GuidoRadioButton startEndPlanesButton {
-caption "start and end planes"
-selected_value "startendplanes"
-default true
-tip STOPEDESIGN_4
}
GuidoRadioButton awayTowardsButton {
-caption STOPEDESIGN_1
-selected_value "awaytowards"
-tip STOPEDESIGN_5
}
}
}
GuidoFiller filler6 {
-height 1
}
GuidoPanel objectDetailsPanel {
-layout CentreLineLayout
GuidoComboBox startPlaneComboBox {
-display_length 8
-label "Start plane"
-tip "Select the plane that you wish to start with"
-exclusive false
-null false
}
GuidoFiller filler7 {
-height 0.05
}
GuidoFiller filler8 {
-height 0.05
}
GuidoComboBox endPlaneComboBox {
-dependency {"[$extendModeRadioPanel getCurrentValue]" == "startendplanes"}
-display_length 8
-label "End plane"
-tip "Select the plane that you wish to end at"
-exclusive false
-null false
}
GuidoFiller filler9 {
-height 0.05
}
GuidoFiller filler10 {
-height 0.05
}
GuidoField objectStringNumberField {
-label "Object ID"
-display_length 3
-format integer
-low_bound 1
-null false
-default 1
-tip STOPEDESIGN_6
}
GuidoFiller filler11 {
-height 0.05
}
GuidoFiller filler12 {
-height 0.05
}
GuidoField nameField {
-label "Name"
-display_length 12
-null true
-tip STOPEDESIGN_7
}
GuidoFiller filler13 {
-height 0.05
}
GuidoFiller filler14 {
-height 0.05
}
GuidoColourBrowserField startColour {
-display_length 12.1
-exclusive true
-format colour
-label "Colour"
-default "red"
-max_length 32
-tip STOPEDESIGN_8
}
GuidoFiller filler13 {
-height 0.05
}
GuidoFiller filler14 {
-height 0.05
}
GuidoComboBox workingLayer {
-label "Working layer"
-display_length 12.6
-tip STOPEDESIGN_13
-exclusive false
-max_length 32
-null false
-default "design"
}
}
}
GuidoFiller filler17 {
-height 0.1
}
GuidoFiller filler18 {
-height 0.1
}
GuidoPanel layoutPanel2 {
-layout CentreLineLayout
-border etched true
-label STOPEDESIGN_12
-width 45
GuidoPanel leftPanel2 {
}
GuidoPanel rightPanel2 {
GuidoPanel oreBodyPanel {
-layout CentreLineLayout
GuidoField dipField {
-label "Dip"
-display_length 12
-format decimal_angle
-default 0
-low_bound -90
-high_bound 90
-tip STOPEDESIGN_9
}
GuidoField azimuthField {
-label "Dip direction"
-display_length 12
-format decimal_angle
-default 0
-low_bound -90
-high_bound 90
-tip STOPEDESIGN_10
}
}
}
}
GuidoFiller filler19 {
-height 0.1
}
GuidoFiller filler20 {
-height 0.1
}
GuidoPanel layoutPanel3 {
-layout CentreLineLayout
-border etched true
-label "Report Settings"
-width 45
GuidoPanel leftPanel3 {
}
GuidoPanel rightPanel3 {
GuidoPanel reportSettingsPanel {
-layout CentreLineLayout
GuidoField reportFileNameField {
-label "Report filename"
-display_length 24.5
-tip STOPEDESIGN_11
}
GuidoComboBox reportformat {
-label "Format"
-display_length 21.5
-null false
-tip "The file format nominated here will be the output report format."
-value_in ".not - Surpac Note File" ".csv - Comma Separated (Spreadsheet)" ".htm - Hypertext Markup Language (Web)" ".pdf - Adobe Acrobat" ".ps - Postscript"
}
}
}
}
}
GuidoPanel blockModelTab {
-label "Block Model"
-width 45
-layout BoxLayout Y_AXIS
GuidoScript forms/StopesBlockModelTab.tcl
}
}
-action initial {[loadAllPlaneGroups $planesGroupComboBox]}
-action initial {[setPlaneSeries $startPlaneComboBox [$planesGroupComboBox getCurrentValue] ]}
-action initial {[setPlaneSeriesWithDefault $endPlaneComboBox [$planesGroupComboBox getCurrentValue] true]}
-action initial {[validateProjectFileLoadingIfExists $StopeDesign $projectNameBrowser $attributesTable $bm_file $sgAttribute $oreRockType $gradeAtt]}
}
