📄 liccfg.tcl
字号:
"^[eE][xX][iI][tT]$" { set returnValue 0 return 0 } default { puts "Error: Invalid input. You are requesting to\ reload the existing license file." while {[prompt "Press <Enter> to continue."] != "" } { } } } } elseif {$isFloatLic} { #floating license configuration puts "\n\n[strTableGet LICCFG_FLOAT_2_TEXT]\n" set totalProd [llength $lmVals(lmFeaturesAvailable)] set ret [prompt] switch -regexp -- $ret { "^$" { if { [isLMFeaturesRequestedNull] } { puts "Warning: Please enter the number of\ license\(s\) for all products" } else { set ret [licConfigCallBack] if { $ret == 1} { set licConfigReturn 0 nextCallback return 0 } elseif { $ret == -1 } { set licConfigReturn 1 nextCallback return 0 } elseif { $ret == 0 } { return 0 } else { return [pageCreate(licConfig)] } } } "^-$" { backCallback return 0 } "^[eE][xX][iI][tT]$" { set returnValue 0 return 0 } "[ ]+" { puts "Error: please enter select only one item" while {[prompt "Press <Enter> to continue."] != "" } { } } "([1-9])+" { if { $ret > $totalProd } { puts [strTableGet 3145_COMP_SELECT_CHANGE_INVALID] while {[prompt "Press <Enter> to continue."] != "" } { } } else { floatingLicRequestedUpdate [expr $ret - 1] } } default { puts "Error: Invalid input." while {[prompt "Press <Enter> to continue."] != "" } { } } } } else { # nodelock end user mode puts "\n[strTableGet LICCFG_NODELOCK_2_TEXT]" set totalProd [llength $lmVals(lmFeaturesAvailable)] set ret [prompt] switch -regexp -- $ret { "^$" { if { [isLMFeaturesRequestedNull] } { puts "Error: At least one product must be selected." while {[prompt "Press <Enter> to continue."] != "" } { } } else { set ret [licConfigCallBack] if { $ret == 1} { set licConfigReturn 0 nextCallback return 0 } elseif { $ret == -1 } { set licConfigReturn 1 nextCallback return 0 } elseif { $ret == 0 } { return 0 } else { return [pageCreate(licConfig)] } } } "^-$" { backCallback return 0 } "[eE][xX][iI][tT]" { set returnValue 0 return 0 } "([1-9])+" { set okFlag 1 foreach index $ret { if { $index > $totalProd } { set okFlag 0 } } if { $okFlag == 0 } { puts [strTableGet 3145_COMP_SELECT_CHANGE_INVALID] while {[prompt "Press <Enter> to continue."] != "" } { } } else { foreach index $ret { nodelockLicRequestedUpdate [expr $index - 1] } } } default { puts "Warning: The list you have entered is invalid." while {[prompt "Press <Enter> to continue."] != "" } { } } } } }}############################################################################### licConfigDlgCreate() - Create License Configuration dialog## This procedure will create License Configuration dialog## SYNOPSIS# .tS# licConfigDlgCreate() # .tE## PARAMETERS: N/A## RETURNS: N/A## ERRORS: N/A#proc licConfigDlgCreate {} { global ctrlVals global setupVals global env if { [windHostTypeGet] == "x86-linux2"} { dialogCreate \ -name licConfigDlg \ -notitle \ -parent $ctrlVals(parentDialog) \ -helpfile $setupVals(setupHelp) \ -width 250 -height 32 \ -init { controlPropertySet licConfigDlg.message1 -bold 1; \ windowTimerCallbackSet licConfigDlg \ -milliseconds 200 licConfigCallBack } \ -controls [list \ [list label -name "message1" -center \ -title [strTableGet LICCFG_BANNER] \ -x 35 -y 12 -w 200 -h 10 ] ] } else { dialogCreate \ -name licConfigDlg \ -notitle \ -parent $ctrlVals(parentDialog) \ -helpfile $setupVals(setupHelp) \ -width 250 -height 32 \ -init { controlPropertySet licConfigDlg.message1 -bold 1; \ windowTimerCallbackSet licConfigDlg \ -milliseconds 200 licConfigCallBack } \ -controls [list \ [list bitmap -name bmp -stretch -title \ "[cdFileNameGet \ [file join RESOURCE BITMAPS SETUPICO.BMP]]" \ -x 10 -y 5 -w 20 -h 20] \ [list label -name "message1" -center \ -title [strTableGet LICCFG_BANNER] \ -x 35 -y 12 -w 200 -h 10 ] ] }}############################################################################### licConfigCallBack() - Callback routine to send the license request## This procedure will send the license request## SYNOPSIS# .tS# licConfigCallBack() # .tE## PARAMETERS: N/A## RETURNS: ## GUI MODE:# 1 - to go onto the next page# 0 - to redisplay LICCFG page# [calcPage lmInstOptions] - to go back to lmInstOptions page## TEXT MODE:# 2 - to redisplay LICCFG page# 1 - to go onto the next page# 0 - exit SETUP# -1 - to go back to lmInstOptions page### ERRORS: N/A#proc licConfigCallBack {} { global setupVals ctrlVals global lmVals global LicFileConfigRequest CommitRequest global env global returnValue set hostRec {} if { ![isGUImode] } { # TEXT mode: for update, prompt error if user entered all 0 for requests if { !$lmVals(reload) } { set isAllZero 1 for {set ix 0} {$ix < [llength $lmVals(lmFeaturesRequested)]} {incr ix} { if { [lindex $lmVals(lmFeaturesRequested) $ix] != 0 } { set isAllZero 0 } } if { $isAllZero } { puts "[strTableGet LICCFG_ZERO_ERROR]\n\n\Press <Enter> to return\ to the License Configuration page and enter license\(s\) for\ at least one feature." while { [prompt] != "" } { } return 2 } } } if { [isGUImode] } { windowTimerCallbackSet licConfigDlg 0 "" } else { puts "[strTableGet LICCFG_BANNER]\n" } # license calculation and error checking here... set lmVals(token) 0 # format the parameters to send to the ALD set configList {} for {set ix 0} {$ix < [llength $lmVals(lmLicensedProductNames)]} {incr ix} { set featureSet "" append featureSet "[lindex $lmVals(lmLicensedProductNames) $ix]:" append featureSet "[lindex $lmVals(lmLicensedFeatureIds) $ix]:" append featureSet "[lindex $lmVals(lmFeaturesRequested) $ix]" set featureSet [string trim $featureSet] if {$ix != [expr [llength $lmVals(lmLicensedProductNames)]- 1]} { append featureSet "|" } append configList $featureSet } # check that if port is NULL use 27000 if {$lmVals(lmPort) == ""} { set lmVals(lmPort) $lmVals(defaultServPort) } set hostRec \ "$lmVals(lmHostName)|$lmVals(lmHostId)|$lmVals(lmPort)|$configList" set params [format "%s|%s|%s|%s" \ $setupVals(WRSLicense) $setupVals(prodVer) \ $setupVals(lmInstType) $hostRec] # send to ALD set reply 0 while {$reply == 0} { set reply [sendToALD $LicFileConfigRequest $params] if { [isGUImode] } { # if an error occurs either retry or go to lm options # if error occurs during test automation, exit SETUP if {[isNumeric $reply]} { if {$reply == 1} { if { $ctrlVals(useInputScript) } { autoSetupLog "ERROR in sendToALD: $CommitRequest $params" autoSetupLog "Reply: $reply" autoSetupLog "Application Exit\n" set setupVals(cancel) 1 applicationExit set returnValue 0 return $returnValue } else { controlEnable wizardDialog.nextButt 1 controlEnable wizardDialog.backButt 1 windowClose licConfigDlg # remove autoInst or nodelock page list rmPageList if {[instTypeGet] == "license"} { # Return to lmInstOptions page and set to email option set setupVals(lmInstOptions) "onEmail" set returnValue [calcPage lmInstOptions] } else { # Return to lmAutoManChoice page and set to manual # option set setupVals(lmAutoManChoice) "onManual" set returnValue [calcPage lmAutoManChoice] controlHide $ctrlVals(mainWindow).bitmap 0 } return $returnValue } } } } else { # TEXT MODE # if an error occurs go to lm options page
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -