📄 licmanual.tcl
字号:
} else {
if { $setupVals(lmInstType) == "nodeLocked" } {
manualNodelockChoiceCB [expr $ret - 1]
} else {
manualLicRequestedUpdate [expr $ret - 1]
}
set valuesReset 0
pageCreate(licManual)
}
}
default {
puts "Error: Invalid input."
while {[prompt "Press <Enter> to continue."] != "" } {
}
pageCreate(licManual)
}
}
}
}
#############################################################################
#
# pageProcess(licManual) - process inputs from the licManual page
#
# This procedure will process inputs from the licManual page
#
# SYNOPSIS
# .tS
# pageProcess(licManual)
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: 1 if successful
#
# ERRORS: N/A
#
proc pageProcess(licManual) {} {
global setupVals lmVals ctrVals
global valuesReset
if { $lmVals(reload) == 0 } { # update
set isAllZero 1
foreach req $lmVals(lmFeaturesRequested) {
if { $req != 0 } {
set isAllZero 0
}
}
if { $isAllZero } {
if { [isGUImode] } {
dialog ok_with_title "ERROR: License Request" \
[strTableGet LICMANUAL_ZERO_ERROR]
return 0
} else {
puts "\n[strTableGet LICMANUAL_ZERO_ERROR]"
while {[prompt "Press <Enter> to continue."] != "" } {
}
pageCreate(licManual)
}
}
}
dbgputs "feature: $lmVals(lmLicensedProductNames)"
dbgputs "code: $lmVals(lmLicensedFeatureIds)"
dbgputs "request: $lmVals(lmFeaturesRequested)"
if { [isGUImode] } {
# re-enable the setup bitmap for next pages
controlHide wizardDialog.bitmap 0
}
# save user's selection
set valuesReset 0
return 1
}
#############################################################################
#
# lmValsRequestInit - initialize lmVals value for license request
#
# This procedure initializes the values in the lmVals data structure.
# The data that is populated are:
# lmLicensedProductNames
# lmLicensedFeatureIds
# lmFeaturesRequested
#
# SYNOPSIS
# .tS
# lmValsRequestInit
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: N/A
#
# ERRORS: N/A
#
proc lmValsRequestInit {} {
global lmVals setupVals ctrlVals
global valuesReset env
# If SETUP is NOT running from the CD or with the /L option
# use licensed products info from setup.log
if {[instTypeGet] == "licenseSetup" && $setupVals(runFromCD) == 0} {
set setupLocal 1
} else {
set setupLocal 0
}
if {$setupVals(lmError) != "" || $setupLocal == 1} {
# get WIND_BASE
if { [isTornadoProduct] } {
if { [info exist env(WIND_BASE)] } {
set setupLog [file join $env(WIND_BASE) setup.log]
} else {
messageBox "Error: WIND_BASE variable is not set!"
return ""
}
} else {
set setupLog [file join [destDirGet] setup.log]
}
# try opening setup.log file
if [catch {open $setupLog r} logfd] {
messageBox "Error: cannot open file $setupLog!"
return ""
} else {
set text [split [read $logfd] \n]
set nlines [llength $text]
close $logfd
for {set ix 0} {$ix < $nlines} {incr ix} {
# iterate each line and search for the licensed prod info
set textLine [split [lindex $text $ix]]
# search for line that begins with "licensed product:"
if { [split [lindex $textLine 1]] == "licensed" &&
[split [lindex $textLine 2]] == "product:" } {
# update license information
lappend lmVals(lmLicensedProductNames) \
[split [lindex $textLine 3]]
lappend lmVals(lmLicensedFeatureIds) \
[split [lindex $textLine 4]]
if { $setupVals(lmInstType) == "nodeLocked" } {
lappend lmVals(lmFeaturesRequested) 1
} else {
lappend lmVals(lmFeaturesRequested) 0
}
}
}
}
return
}
# get the featureId from the CD, based on what the key unlocks
# then, use featureId to find all licensed products
# then, select only licensed products that belong to this host
# then, add the products to the list to be displayed and
# configured. This has to be done this way because we have no
# access to database in the page to retrieve the list of
# licensed products that belong to this wind host
# check wind host type in order to display only native licensed products
set hostType [windHostTypeGet]
foreach featureId [cdInfoGet featureIdList] {
foreach prodIndex [cdInfoGet selectedProdIndexList] {
# choose only the licensed products
if { $featureId == [productInfoGet featureId $prodIndex] } {
# get to desc of the products to check for native products
set desc [productInfoGet desc $prodIndex]
set prodHostType [prodHostTypeGet $desc]
# if the product belongs to this wind host,
# add to the list to be displayed and configured
if { $hostType == $prodHostType } {
#update license information
lappend lmVals(lmLicensedProductNames) [productInfoGet name $prodIndex]
lappend lmVals(lmLicensedFeatureIds) [productInfoGet featureId $prodIndex]
if { $setupVals(lmInstType) == "nodeLocked" } {
lappend lmVals(lmFeaturesRequested) 1
} else {
lappend lmVals(lmFeaturesRequested) 0
}
}
}
}
}
}
#############################################################################
#
# onTableManualEvent - callback for manual floating license table event
#
# This procedure is the callback when a table event occurs. The current
# values in the table selection are retrieved to update the selected
# product label and the number of requested licenses in the text entry box.
#
# SYNOPSIS
# .tS
# onTableManualEvent
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: N/A
#
# ERRORS: N/A
#
#
proc onTableManualEvent {} {
global ctrlVals setupVals
# if the user is currently updating the entry in the text box
# or node locked radio choices, simply return so that the
# table callback does not update the input controls at the
# same time.
if {$ctrlVals(inputUpdate) == 1} {
return
}
# only perform an update for a selection change.
set event [controlEventGet $ctrlVals(mainWindow).licManualTable]
if {$event != "selchange"} {
return
}
# get the feature values from the table.
set featureVals [lindex \
[controlValuesGet $ctrlVals(mainWindow).licManualTable] \
[controlSelectionGet $ctrlVals(mainWindow).licManualTable]]
set requested [lindex $featureVals 2]
set prodName [lindex $featureVals 0]
# set the tableUpdate variable to 1 so that the text entry callback
# does not update the table at the same time.
set ctrlVals(tableUpdate) 1
# update the selected product label and text entry box with the
# selected table values.
controlValuesSet $ctrlVals(mainWindow).selectedProd $prodName
if {$setupVals(lmInstType) == "floating"} {
controlValuesSet $ctrlVals(mainWindow).textManualRequested $requested
} else {
# node locked
if {$requested == "Yes"} {
controlCheckSet $ctrlVals(mainWindow).yesManualChoice 1
controlCheckSet $ctrlVals(mainWindow).noManualChoice 0
} else {
controlCheckSet $ctrlVals(mainWindow).yesManualChoice 0
controlCheckSet $ctrlVals(mainWindow).noManualChoice 1
}
controlFocusSet $ctrlVals(mainWindow).licManualTable
}
set ctrlVals(tableUpdate) 0
}
#############################################################################
#
# checkLMFeaturesRequestedFields
# For nodelock: checks to see if at least of the fields is checked
# For updates : checks to see that all fields are entered
#
# SYNOPSIS
# .tS
# checkLMFeaturesRequestedFields
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: 1 if OK to proceed
# 0 if user needs to re-enter
#
# ERRORS: N/A
#
proc checkLMFeaturesRequestedFields {} {
global lmVals setupVals
set isOK 0
if { $setupVals(lmInstType) == "nodeLocked" } {
# for nodelock, don't need to check with radio controls
set isOK 1
} elseif { $lmVals(reload) == 0 } { # update
set isOK 1
# for updates, check to see that a value is entered
if { [controlValuesGet wizardDialog.textManualRequested] == "" } {
set isOK 0
}
}
return $isOK
}
#############################################################################
#
# floatTextManualCB - callback for text entry box
#
# This procedure is the callback for the floating license text entry box.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -