proc updateBlockModelBrowsers { bm_file sgAttribute oreTypeAttribute gradeAttribute} {
set buffer [GuidoExecServer setCurrentModel [subst {modelName = "[$bm_file getCurrentValue]" headerOnly = "false"}]]
$sgAttribute updateBrowserList
$oreTypeAttribute updateBrowserList
$gradeAttribute updateBrowserList
$sgAttribute setExclusive "true"
$oreTypeAttribute setExclusive "true"
$gradeAttribute setExclusive "true"
}
proc loadPlaneGroups {planeGroup planeType prefix} {
set buffer [GuidoExecServer PlaneTreeStructure [subst {type = "$planeType"}]]
set nSeries "[GuidoGetParamBufferValue $buffer nSeries ]"
for {set i 0} {$i < $nSeries} {incr i} {
set pname $prefix
append pname "[GuidoGetParamBufferValue $buffer series_$i]"
$planeGroup addItem $pname
}
}
proc loadPlanOrInclinedPlanes {planeGroup} {
$planeGroup removeAllItems
loadPlaneGroups $planeGroup "Plan view" "plan/"
loadPlaneGroups $planeGroup "Incline sections" "inclined/"
$planeGroup setExclusive "true"
}
proc loadVerticalAndInclinedPlanes {planeGroup} {
$planeGroup removeAllItems
loadPlaneGroups $planeGroup "Vertical sections" "vertical/"
loadPlaneGroups $planeGroup "Incline sections" "inclined/"
$planeGroup setExclusive "true"
}
proc loadAllPlaneGroups {planeGroup} {
$planeGroup removeAllItems
loadPlaneGroups $planeGroup "Incline sections" "inclined/"
loadPlaneGroups $planeGroup "Plan view" "plan/"
loadPlaneGroups $planeGroup "Vertical sections" "vertical/"
$planeGroup setExclusive "true"
}
proc setPlaneSeries {planeComboBox planeSeries} {
setPlaneSeriesWithDefault $planeComboBox $planeSeries "false"
}
proc setPlaneSeriesWithDefault {planeComboBox planeSeries setLastPlane} {
if {$planeSeries != ""} {
set planeTokens [split $planeSeries "/"]
if {[lindex $planeTokens 0] == "vertical"} {
set containerName "Vertical sections"
} elseif {[lindex $planeTokens 0] == "inclined"} {
set containerName "Incline sections"
} else {
set containerName "Plan view"
}
set buffer [GuidoExecServer PlaneTreeStructure [subst {type = "$containerName" series = "[lindex $planeTokens 1]"}]]
set nPlanes "[GuidoGetParamBufferValue $buffer nPlanes_0]"
$planeComboBox removeAllItems
for {set i 0} {$i < $nPlanes} {incr i} {
set pname "[GuidoGetParamBufferValue $buffer plane_0_$i]"
$planeComboBox addItem $pname
}
if {$setLastPlane == "true"} {
$planeComboBox setCurrentValue [$planeComboBox getItemAt [expr [$planeComboBox getItemCount]-1] ]
}
}
$planeComboBox setExclusive "true"
}
