📄 licmanual.tcl
字号:
# .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 } } } } }}############################################################################### 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" } { set isOK 0 # for nodelock, check to see if at least one of the fields is checked for {set ix 0} {$ix < [llength $lmVals(lmLicensedProductNames)]} {incr ix} { if { [controlChecked wizardDialog.${ix}Boolean] == 1 } { set isOK 1 } } } elseif { $lmVals(reload) == 0 } { # update set isOK 1 # for updates, check to see that all fields are entered for {set ix 0} {$ix < [llength $lmVals(lmLicensedProductNames)]} {incr ix} { if { [controlValuesGet wizardDialog.${ix}Requested] == "" } { set isOK 0 } } } return $isOK}############################################################################### manualLicRequestedUpdate ## This procedure does the work for the manual license text box callback# procedures. It updates the temporary array to be displayed on the # Email or Phone/Fax License Request Summary page and controls# enabling or disabling of the Next button.## SYNOPSIS# .tS# manualRequestedUpdate ix# .tE## PARAMETERS: N/A# ix - the index or order in which the licensed product is displayed## RETURNS: n/a## ERRORS: N/A#proc manualLicRequestedUpdate {ix} { global ctrlVals lmVals setupVals if { [isGUImode] } { if {[controlValuesGet wizardDialog.${ix}Requested] != ""} { set input [controlValuesGet wizardDialog.${ix}Requested] if {[isNumeric $input "License Count Input Error" wizardDialog.${ix}Requested]} { #update licensed product(s) information set lmVals(lmFeaturesRequested) \ [lreplace $lmVals(lmFeaturesRequested) $ix $ix $input] } } else { set lmVals(lmFeaturesRequested) \ [lreplace $lmVals(lmFeaturesRequested) $ix $ix 0] } if { [checkLMFeaturesRequestedFields] } { controlEnable wizardDialog.nextButt 1 } else { controlEnable wizardDialog.nextButt 0 } } else { # TEXT mode set name [lindex $lmVals(lmLicensedProductNames) $ix] puts "Enter the number of licenses to be requested for $name product." set ret [prompt] switch -regexp -- $ret { "^-$" { pageCreate(licManual) } "[ ]+" { puts "Error: Invalid input." while {[prompt "Press <Enter> to continue."] != "" } { } pageCreate(licManual) } "^[0-9]+" { set lmVals(lmFeaturesRequested) \ [lreplace $lmVals(lmFeaturesRequested) $ix $ix $ret] } "[eE][xX][iI][tT]" { return 0 } default { puts "Error: Invalid input." while {[prompt "Press <Enter> to continue."] != "" } { } pageCreate(licManual) } } }}############################################################################### manualNodelockBooleanCB## This procedure does the work for the node locked license check box # callback procedures. It updates the temporary array to be displayed on# the Email or Phone/Fax License Request Summary page## SYNOPSIS# .tS# manualNodelockBooleanCB ix# .tE## PARAMETERS: N/A# ix - the index or order in which the licensed product is displayed## RETURNS: n/a## ERRORS: N/A#proc manualNodelockBooleanCB {ix} { global ctrlVals lmVals setupVals if { [isGUImode] } { if {[controlChecked wizardDialog.${ix}Boolean] == 1} { #update licensed product(s) information set lmVals(lmFeaturesRequested) \ [lreplace $lmVals(lmFeaturesRequested) $ix $ix 1] } else { set lmVals(lmFeaturesRequested) \ [lreplace $lmVals(lmFeaturesRequested) $ix $ix 0] } if { [checkLMFeaturesRequestedFields] } { controlEnable wizardDialog.nextButt 1 } else { controlEnable wizardDialog.nextButt 0 } } else { # TEXT mode set oldValue [lindex $lmVals(lmFeaturesRequested) $ix] if { $oldValue == 1 } { set lmVals(lmFeaturesRequested) \ [lreplace $lmVals(lmFeaturesRequested) $ix $ix 0] } else { set lmVals(lmFeaturesRequested) \ [lreplace $lmVals(lmFeaturesRequested) $ix $ix 1] } }}####################################################################### Dialog Text Messages######################################################################set strTable(LICMANUAL_TITLE_EMAIL) "Email License Configuration"set strTable(LICMANUAL_TITLE_PHONE) "Phone/Fax License Configuration"set strTable(LICMANUAL_MSG_COMMON) \ "Please refer to the Sales Acknowledgement Agreement for \ the number of licenses available for the installed product(s)."set strTable(LICMANUAL_UPDATE1) \ "Please enter the number of licenses to be requested for\ this host for all the installed product(s) listed below. \ [strTableGet LICMANUAL_MSG_COMMON]"set strTable(LICMANUAL_TEXT) \ "Enter the item number for the products for which you\ would like to request a license or press \<Return\> to\ accept this configuration."set strTable(LICMANUAL_UPDATE2) \ "After configuring floating licenses, click <Next> to continue."set strTable(LICMANUAL_NODELOCK1) \ "Please select the node locked licenses desired for this host from\ the following list of installed product(s):"set strTable(LICMANUAL_NODELOCK2) \ "After configuring node locked licenses, click <Next> to continue."set strTable(LICMANUAL_ZERO_ERROR) \ "You must enter a non-zero value for at least one product."set strTable(LICMANUAL_COL1) "Licensed Product"set strTable(LICMANUAL_COL2) "Feature ID"set strTable(LICMANUAL_COL3) "No. of licenses\nto be allocated"set strTable(LICMANUAL_NODELOCK) "Check to request\na license"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -