📄 compslct.tcl
字号:
set newState [lindex \ [controlItemPropertyGet $ctrlVals(mainWindow).optionList \ -checkstate] [currSelProdIndexGet gui]] # determine if customer is trying to uncheck a driverObject/Header prod set drvIndex [drvIndexGet $currProdIndex] set drvArch [drvArchGet $currProdIndex] set drvObjRestored 0 #dbgputs "drvArch: $drvArch" if {[info exists setupVals(tornadoIndex)] && $drvIndex != -1} { foreach torObj $setupVals(tornadoIndex) { set tornadoSelected [isCoreTorSelected [lindex $torObj 0]] #dbgputs "tornadoSelected: $tornadoSelected" #dbgputs "torObj: $torObj" #dbgputs "arch: [lindex $torObj 1]" if {$tornadoSelected && [lindex $torObj 1] == $drvArch} { set savedProdIndex -1 messageBox [strTableGet 5010_DRIVERS_INFO] -informationicon set index [guiMapCtrlIndexGet $drvIndex] controlItemPropertySet $ctrlVals(mainWindow).optionList \ -index $index -checkstate 1 set drvObjRestored 1 break } } } # warn user about non-native installations set desc [productInfoGet desc $currProdIndex] set hostType [hostVerGet] set prodHostType [prodHostTypeGet $desc] if {![productInfoGet instFlag $currProdIndex]} { if {$hostType != $prodHostType && $prodHostType != "unknown"} { set msg "The product, $desc, is not meant for installation \ on this host type of $hostType.\nContinuing with the \ installation may lead to an incomplete installation \ due to missing host tools." if { $ctrlVals(useInputScript) } { autoSetupLog "$msg" autoSetupLog "Please re-select the component\(s\)." autoSetupLog "Application Exit\n" set setupVals(cancel) 1 applicationExit return 0 } else { dialog ok_with_title "WARNING: Product Installation" $msg } } } # commit the user's selection if {!$drvObjRestored} { set savedProdIndex $currProdIndex productInfoSet instFlag $currProdIndex $newState if {$newState && $hasSubPart} { productGuiChkLstUpdate [currSelProdIndexGet gui] } productGuiSizeUpdate $newState productInfoSet stateCommit $currProdIndex productInfoSet childStateCommit $currProdIndex } # check if product just selected is tornado-obj, if so we must # re-select the driver object products set drvObjRestored 0 if {[info exists setupVals(tornadoIndex)]} { foreach torObj $setupVals(tornadoIndex) { set tornadoSelected [isCoreTorSelected [lindex $torObj 0]] set torIndex [lindex $torObj 0] set torArch [lindex $torObj 1] #dbgputs "tornadoSelected: $tornadoSelected" #dbgputs "torIndex: $torIndex" #dbgputs "torArch: $torArch" if {$setupVals(drvIndex) != -1 && $tornadoSelected && \ [expr $currProdIndex == $torIndex || \ $savedProdIndex == $torIndex] } { foreach drvObj $setupVals(drvIndex) { set index [lindex $drvObj 0] set arch [lindex $drvObj 1] set drvObjSelected [productInfoGet instFlag $index] #dbgputs "drvObjSelected: $drvObjSelected" #dbgputs "arch: $arch" if {!$drvObjSelected && $torArch == $arch} { messageBox [strTableGet 5010_DRIVERS_INFO] \ -informationicon productInfoSet instFlag $index 1 productGuiSizeUpdate 1 productInfoSet stateCommit $index productInfoSet childStateCommit $index set guiIndex [guiMapCtrlIndexGet $index] controlItemPropertySet \ $ctrlVals(mainWindow).optionList \ -index $guiIndex -checkstate 1 set drvObjRestored 1 break } } } if {$drvObjRestored} { break } } } }}############################################################################### guiMapCtrlIndexGet - return the GUI index of the selected product index## This procedure will return the GUI index of the selected product index## SYPSIS# .tS# guiMapCtrlIndexGet <prodIndex># .tE## PARAMETERS:# .IP prodIndex# product index## RETURNS: GUI mapped index of the product index## ERRORS: N/A#proc guiMapCtrlIndexGet {prodIndex} { global objGuiMap ctrlVals set retVal $objGuiMap(prod2gui,$prodIndex) return $retVal}############################################################################### productGuiChkLstCreate - create the check list of products in compSelect page## This procedure will create the check list of products in compSelect page## SYNOPSIS# .tS# productGuiChkLstCreate# .tE## PARAMETERS: N/A## RETURNS: N/A## ERRORS: N/A#proc productGuiChkLstCreate {} { global objGuiMap global ctrlVals global setupVals global productObj # populate the list of check button. set i 0 set chkList "" set totalSize 0 catch { unset objGuiMap } foreach prodIndex [cdInfoGet productIndexList] { # test automation # setupVals(compList) in the instCfg.tcl script must be seeded # with the product descripts, parts with WTX are auto-selected if { $ctrlVals(useInputScript) } { set desc [productInfoGet desc $prodIndex] if {[lsearch $setupVals(compList) "$desc"] < 0 && $setupVals(compList) != "ALL" } { productInfoSet instFlag $prodIndex 0 } foreach part [productInfoGet partIndexList $prodIndex] { set descp "[partInfoGet desc $part]" if [regexp WTX $descp] { partInfoSet instFlag $part 1 } } } set objGuiMap(gui2prod,$i) $prodIndex set objGuiMap(prod2gui,$prodIndex) $i set size [productInfoGet size $prodIndex] set formatMbSize [format "%7s MB" [byteToMbyte $size]] set desc " [productInfoGet desc $prodIndex]\t$formatMbSize " lappend chkList [list $desc [productInfoGet instFlag $prodIndex]] incr i } controlValuesSet $ctrlVals(mainWindow).optionList $chkList controlSelectionSet $ctrlVals(mainWindow).optionList -noevent 0 currSelProdIndexSet 0 # use the tri-state checkbox for {set ix 0} {$ix < $i} {incr ix} { set prodIndex $objGuiMap(gui2prod,$ix) set nCompSel 0 set totComps 0 foreach partIndex $productObj($prodIndex,partIndexList) { if {"[partInfoGet instFlag $partIndex]" == "1"} { incr nCompSel } incr totComps } if {[productInfoGet instFlag $prodIndex]} { if {$totComps != $nCompSel} { controlItemPropertySet $ctrlVals(mainWindow).optionList \ -index $objGuiMap(prod2gui,$prodIndex) -checkstate 2 } } } # uncheck the products not meant for this host type set hostType [hostVerGet] for {set ix 0} {$ix < $i} {incr ix} { set prodIndex $objGuiMap(gui2prod,$ix) set desc [productInfoGet desc $prodIndex] set prodHostType [prodHostTypeGet $desc] if {$hostType != $prodHostType && $prodHostType != "unknown"} { productInfoSet instFlag $prodIndex 0 controlItemPropertySet $ctrlVals(mainWindow).optionList \ -index $ix -checkstate 0 } } # test automation if { $ctrlVals(useInputScript) } { autoSetupLog "\tInstalled product(s):" # retrieve product name from the product list foreach i $chkList { autoSetupLog "\t $i" } }}############################################################################### productGuiChkLstUpdate - update the check list of products in the compSelect# page## This procedure will update the check list of products in the compSelect page## SYNOPSIS# .tS# productGuiChkLstUpdate <index># .tE## PARAMETERS:# .IP index# product index## RETURNS: N/A## ERRORS: N/A#proc productGuiChkLstUpdate {index} { global objGuiMap global ctrlVals global productObj set prodIndex [currSelProdIndexGet] set size [productInfoGet size $prodIndex] set formatMbSize [format "%7s MB" [byteToMbyte $size]] # add in indication of components/product selected # remove this section if a UITcl tristate button list is created set nCompSel 0 set totComps 0 foreach partIndex $productObj($prodIndex,partIndexList) { if {"[partInfoGet instFlag $partIndex]" == "1"} { incr nCompSel } incr totComps } set desc " [productInfoGet desc $prodIndex]\t$formatMbSize " set chkButt [list [list "$desc" [productInfoGet instFlag $prodIndex]]] controlValuesSet $ctrlVals(mainWindow).optionList -insert $index $chkButt controlValuesSet $ctrlVals(mainWindow).optionList -delete [expr $index + 1] controlSelectionSet $ctrlVals(mainWindow).optionList -noevent $index if {$totComps != $nCompSel} { if {[productInfoGet instFlag $prodIndex]} { set index $objGuiMap(prod2gui,$prodIndex) controlItemPropertySet $ctrlVals(mainWindow).optionList \ -index $index -checkstate 2 } }}############################################################################### productguisizeupdate - update the size of products in the compSelect page## This procedure will update the size of products in the compSelect page## SYNOPSIS# .tS# productGuiSizeUpdate [state]# .tE## PARAMETERS:# .IP state# init -- first time the sizes of products are updated## RETURNS: N/A## ERRORS: N/A#proc productGuiSizeUpdate {{state "init"}} { global ctrlVals global setupVals uiEventProcess set setupVals(availDiskSpace) "Unknown" if {[isUnix]} { set free [fspace [destDirGet]] if [regexp {^[0-9]+$} $free] { set setupVals(availDiskSpace) \ [format "%3.1f" [expr $free / 1024.0]] } } else { if {![catch {setupDiskSpaceGet [destDirGet]} diskSpace] && $diskSpace >= 0} { set setupVals(availDiskSpace) [kbyteToMbyte $diskSpace] } } set setupVals(reqDiskSpace) [cdInfoGet size] # add size of SETUP directory to total required space only if SETUP # directory is not present in destination directory if [file exists [file join [destDirGet] SETUP RESOURCE TCL INSTW32.TCL]] { set totalSize [byteToMbyte $setupVals(reqDiskSpace)] } else { set totalSize [expr [setupSizeGet] + \ [byteToMbyte $setupVals(reqDiskSpace)]] } detailShow controlValuesSet $ctrlVals(mainWindow).reqSpace \ [format "%7s MB" $totalSize] controlValuesSet $ctrlVals(mainWindow).availSpace \ [format "%7s MB" $setupVals(availDiskSpace)]}############################################################################### checkCoreProductDependency - check to see if dependencies for core # products installation are OK## This procedure is called in pageProcess during core products installation# to see if any dependencies are violated. If so, give warning or error## For core-CD installation, check:# - Check/warn if tornado is selected but a VxWorks is not selected.# - Check/give error is user attempts to install non-tornado products# such as optional products (i.e. WindView) over an empty tree. ## SYNOPSIS# .tS# checkCoreProductDependency# .tE## PARAMETERS: N/A## RETURNS: 1 if continue with installation# 0 if user needs to re-select the products## ERRORS: N/A#proc checkCoreProductDependency {} { global ctrlVals setupVals set tornadoSelected 0 # for core CD: # check both tornado and VxWorks are selected if { [info exists setupVals(tornadoIndex)] } { set tornadoSelected 0 foreach torObj $setupVals(tornadoIndex) { set tornadoSelected [isCoreTorSelected [lindex $torObj 0]] if { $tornado
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -