📄 liccfg.tcl
字号:
-title "No" \
-x [expr $XCOL1 + 136] -y 144 -w 30 -h 12 \
-callback "nodelockChoiceCB"] \
}
# Set title for the dialog
if {$lmVals(reload)} {
set w [dlgFrmCreate [strTableGet LICCFG_TITLE_RELOAD]]
} elseif {$isFloatLic} {
if {$setupVals(ELMUser) == 1} {
set w [dlgFrmCreate [strTableGet LICCFG_TITLE_ELM]]
} else {
set w [dlgFrmCreate [strTableGet LICCFG_TITLE_FLOATING]]
}
} else {
set w [dlgFrmCreate [strTableGet LICCFG_TITLE_NODELOCKED]]
}
controlEnable $w.backButt 1
controlEnable $w.nextButt 0
if {$isFloatLic} {
# set initial values for requested licenses:
# if licenses are available, default to 1
# if no license available, gray out the box for that product
# if no license available for all products, display message
set noLicenseAllProd 1
set length [llength $lmVals(lmLicensedProductNames)]
for {set ix 0} {$ix < $length} {incr ix} {
# check if any lmLicProdInfoGetlicenses left
set prodName [lindex $lmVals(lmLicensedProductNames) $ix]
set fInput [lmFeaturesValueGet lmFLFeaturesAvailable $prodName]
# get all the values for the current feature
set featureVals [lindex [controlValuesGet $ctrlVals(mainWindow).licTable] $ix]
# then get just the first five values, the sixth value (requested)
# will be set here
set featureVals [lrange $featureVals 0 4]
if { $fInput <= 0 } {
# no license left for this product. Default to 0.
set lmVals(lmFeaturesRequested) \
[lreplace $lmVals(lmFeaturesRequested) $ix $ix 0]
lappend featureVals 0
} else {
# default to 1, or 0 if reload
if {$lmVals(reload)} {
# if reload, use existing license info - no new allocation
set lmVals(lmFeaturesRequested) \
[lreplace $lmVals(lmFeaturesRequested) $ix $ix 0]
lappend featureVals 0
} else {
set lmVals(lmFeaturesRequested) \
[lreplace $lmVals(lmFeaturesRequested) $ix $ix 1]
lappend featureVals 1
}
set noLicenseAllProd 0
}
lappend licTableVals $featureVals
}
} else { # node locked
if {$lmVals(reload) != 1} {
set noLicenseAllProd 1
} else {
set noLicenseAllProd 0
}
set length [llength $lmVals(lmLicensedProductNames)]
for {set ix 0} {$ix < $length} {incr ix} {
# check if any lmLicProdInfoGetlicenses left
set prodName [lindex $lmVals(lmLicensedProductNames) $ix]
set fInput [lmFeaturesValueGet lmNLFeaturesAvailable $prodName]
# also check to see if the customer has already configured a node-locked
# license for this product, if so set fInput = 0 to disable the checkbox
if {[lmLicHostIndexGet $lmVals(lmHostName)] > 0} {
if {[isNLSeatAllocated $prodName $lmVals(lmHostName)] == 1} {
set fInput 0
}
} else {
if {$fInput != 0} {
set fInput 1
}
}
# get all the values for the current feature
set featureVals [lindex [controlValuesGet $ctrlVals(mainWindow).licTable] $ix]
# then get just the first five values, the sixth value (requested)
# will be set here
set featureVals [lrange $featureVals 0 4]
set allocated [lindex $featureVals 3]
if { $fInput <= 0 || $allocated == 1} {
# no license left for this product or node locked
# license already allocated. Default to "No".
set lmVals(lmFeaturesRequested) \
[lreplace $lmVals(lmFeaturesRequested) $ix $ix 0]
lappend featureVals "No"
} else {
# default to "Yes"
set noLicenseAllProd 0
if {$lmVals(reload)} {
set lmVals(lmFeaturesRequested) \
[lreplace $lmVals(lmFeaturesRequested) $ix $ix 0]
lappend featureVals "No"
} else {
set lmVals(lmFeaturesRequested) \
[lreplace $lmVals(lmFeaturesRequested) $ix $ix 1]
lappend featureVals "Yes"
}
}
lappend licTableVals $featureVals
}
}
controlPropertySet $w.licTable -columnwidths $TABLEWIDTHS
# If no more licenses available for all products, prompt user
if { $noLicenseAllProd == 1 } {
dialog ok_with_title "No More Licenses" [strTableGet LICCFG_NO_LIC_ERROR]
controlEnable $w.nextButt 0
if {$isFloatLic} {
controlEnable $w.textRequested 0
} else {
controlEnable $w.yesChoice 0
controlEnable $w.noChoice 0
}
} else {
# fill in the table values
controlValuesSet $w.licTable $licTableVals
# focus on the first selection in the table
controlSelectionSet $w.licTable 0
controlFocusSet $w.licTable
if {[isLMFeaturesRequestedNull]} {
controlEnable wizardDialog.nextButt 0
} else {
controlEnable wizardDialog.nextButt 1
}
}
if {$lmVals(reload)} {
if {$isFloatLic} {
controlEnable $w.textRequested 0
} else {
# nodelocked
controlEnable $w.yesChoice 0
controlEnable $w.noChoice 0
}
controlEnable $w.nextButt 1
}
# test automation
if {$ctrlVals(useInputScript)} {
autoSetupLog "License Configuration Page: skipped"
nextCallback
}
} else { # text mode
doTextMode $isFloatLic
}
}
#############################################################################
#
# onTableEvent - callback for 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
# onTableEvent
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: N/A
#
# ERRORS: N/A
#
#
proc onTableEvent {} {
global ctrlVals lmVals setupVals
# if the user is currently updating the entry in the text box
# or node locked radio buttons, simply return so that the
# table callback does not update the text entry at the same time.
if {$ctrlVals(inputUpdate) == 1} {
return
}
# only perform an update for a selection change.
set event [controlEventGet $ctrlVals(mainWindow).licTable]
if {$event != "selchange"} {
return
}
# get the feature values from the table.
set featureVals [lindex \
[controlValuesGet $ctrlVals(mainWindow).licTable] \
[controlSelectionGet $ctrlVals(mainWindow).licTable]]
set requested [lindex $featureVals 5]
set available [lindex $featureVals 4]
set allocated [lindex $featureVals 3]
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).textRequested $requested
} else {
# nodelocked
if {$requested == "Yes"} {
controlCheckSet $ctrlVals(mainWindow).yesChoice 1
controlCheckSet $ctrlVals(mainWindow).noChoice 0
} else {
controlCheckSet $ctrlVals(mainWindow).yesChoice 0
controlCheckSet $ctrlVals(mainWindow).noChoice 1
}
controlFocusSet $ctrlVals(mainWindow).licTable
}
# disable the text box if no licenses are available or if
# reloading the license file.
if {$setupVals(lmInstType) == "floating"} {
if {$available == 0 || $lmVals(reload) == 1} {
controlEnable $ctrlVals(mainWindow).textRequested 0
} else {
controlEnable $ctrlVals(mainWindow).textRequested 1
}
} else {
# node-locked
if {$available == 0 || $lmVals(reload) == 1 || $allocated == 1} {
controlEnable $ctrlVals(mainWindow).yesChoice 0
controlEnable $ctrlVals(mainWindow).noChoice 0
} else {
controlEnable $ctrlVals(mainWindow).yesChoice 1
controlEnable $ctrlVals(mainWindow).noChoice 1
}
}
# table selection update is done.
set ctrlVals(tableUpdate) 0
}
#############################################################################
#
# licTableUpdate - updates floating license table with specified values
#
# This procedure updates the floating license table for the specified
# feature and number of licenses requested. This is called when the
# user updates the number of requsted licenses in the text entry box.
#
# SYNOPSIS
# .tS
# licTableUpdate
# .tE
#
# PARAMETERS:
# featIx - feature index, corresponding to the selection in the table
# numRequested - number of requested licenses
#
# RETURNS: N/A
#
# ERRORS: N/A
#
#
proc licTableUpdate {featIx numRequested} {
global lmVals ctrlVals setupVals
set length [llength $lmVals(lmLicensedProductNames)]
for {set ix 0} {$ix < $length} {incr ix} {
# get all the values for the current feature
set featureVals [lindex [controlValuesGet $ctrlVals(mainWindow).licTable] $ix]
if { $ix == $featIx } {
# then get just the first five values, the sixth value (requested)
# will be updated here
set featureVals [lrange $featureVals 0 4]
if {$setupVals(lmInstType) == "floating"} {
lappend featureVals $numRequested
} else {
# node-locked
if {$numRequested == 1} {
lappend featureVals "Yes"
} else {
lappend featureVals "No"
}
}
}
lappend licTableVals $featureVals
}
controlFocusSet $ctrlVals(mainWindow).licTable
controlValuesSet $ctrlVals(mainWindow).licTable $licTableVals
controlSelectionSet $ctrlVals(mainWindow).licTable $featIx
if {$ctrlVals(inputUpdate) == 1} {
# if the user is updating the text entry box, put focus
# back on the entry box
if {$setupVals(lmInstType) == "floating"} {
controlFocusSet $ctrlVals(mainWindow).textRequested
}
}
}
#############################################################################
#
# doTextMode
#
# This procedure will configure license on current host in text mode
#
# SYNOPSIS
# .tS
# doTextMode isFloatLic
# .tE
#
# PARAMETERS: isFloatLic - parameter indicating if license mode is floating
#
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -