📄 liccfg.tcl
字号:
# .tS# pageProcess(licConfig)# .tE## PARAMETERS: N/A## RETURNS: 1 if successful## ERRORS: N/A#proc pageProcess(licConfig) {} { global ctrlVals setupVals lmVals global returnValue global licConfigReturn if { [isGUImode] } { controlEnable wizardDialog.nextButt 0 controlEnable wizardDialog.backButt 0 # test automation...store licenses information if { $ctrlVals(useInputScript) } { for {set ix 0} {$ix < [llength $lmVals(lmLicensedProductNames)]} {incr ix} { set featureName [lindex $lmVals(lmLicensedProductNames) $ix] set fAvailable [lmFeaturesValueGet lmFeaturesAvailable $featureName] if {$lmVals(lmLicMode) == "floating"} { set lmVals(lmFeaturesRequested) \ [lreplace $lmVals(lmFeaturesRequested) $ix $ix $fAvailable] } else { set lmVals(lmFeaturesRequested) \ [lreplace $lmVals(lmFeaturesRequested) $ix $ix 1] } } } # GUI 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 } { dialog ok_with_title "ERROR: License Request" \ [strTableGet LICCFG_ZERO_ERROR] controlEnable wizardDialog.nextButt 1 controlEnable wizardDialog.backButt 1 return 0 } # SPR 76046 # detect if the host has been configured previously if { $setupVals(lmInstType) == "nodeLocked" } { if { [hasExistingNL] } { set ans [dialog yes_no_cancel "NodeLocked license" \ [strTableGet LICCFG_TO_RELOAD]] if { $ans == 0 } { # yes set lmVals(reload) 1 updateToNLRequest } elseif {$ans == 1} { # no set lmVals(reload) 0 } else { # cancel controlEnable wizardDialog.nextButt 1 controlEnable wizardDialog.backButt 1 return 0 } } } } licConfigDlgCreate if {[isUnix]} { pageRemove lmStartupOptions } controlEnable wizardDialog.nextButt 1 controlEnable wizardDialog.backButt 1 } else { # text mode # return to lmOptions if an error occurs in licConfigCallBack if { $licConfigReturn } { # remove autoInst or nodeLock page list rmPageList # Return to lmInstOptions page and set to email option set setupVals(lmInstOptions) "onEmail" return [calcPage lmInstOptions] } if {[isUnix]} { pageRemove lmStartupOptions } } return $returnValue}############################################################################### rmPageList() - helper function to remove autoInst or nodeLock page list, # depends on setupVals(lmInstType)## This procedure will remove the autoInst or nodeLocke page list## SYNOPSIS# .tS# rmPageList# .tE## PARAMETERS: N/A## RETURNS: N/A## ERRORS: N/A#proc rmPageList {} { global setupVals if {$setupVals(lmInstType) == "nodeLocked"} { pageListRemove nodeLock } elseif {$setupVals(lmInstType) == "floating"} { pageListRemove autoInst }}############################################################################### licenseConfirmInit() - Display License Summary information## This procedure will display license summary## SYNOPSIS# .tS# licenseConfirmInit(isFloatLIc)# .tE## PARAMETERS: isFloatLic - 1 if floating license, else 0## RETURNS: 1 if ok or 0 if cancel## ERRORS: N/A#proc licConfirmDlgInit {} { global lmVals ctrlVals lmHostFeaturesNum set hostIndex [lsearch $lmVals(lmHosts) $lmVals(lmHostName)] set numberOfFeatures [lindex $lmHostFeaturesNum $hostIndex] # Fill in the informational text box for the users if {$lmVals(lmLicMode) == "floating"} { for {set ix 0} {$ix < [llength $lmVals(lmFeaturesTotal)]} {incr ix} { set feature [lindex $lmVals(lmFeaturesTotal) $ix] set featureName [lindex $feature 0] set fHostAllocated 0 for {set ixf 0} {$ixf < $numberOfFeatures} {incr ixf} { # only if the feature is previously allocated on this host # (name match), retrieve allocated value if { $featureName == [lmLicProdInfoGet prodName $lmVals(lmHostName) $ixf] } { set fHostAllocated \ [lmLicProdInfoGet licAllocated $lmVals(lmHostName) $ixf] } } set line1 [format "%s\r\n" \ [lindex $lmVals(lmLicensedProductNames) $ix]] set line2 [format "%s\r\n" \ [expr [lindex $lmVals(lmFeaturesRequested) $ix] + $fHostAllocated]] append output1 $line1 append output2 $line2 } controlTextSet licConfirmDlg.floatSummary1 $output1 controlTextSet licConfirmDlg.floatSummary2 $output2 } else { # node locked # for Reload, display all feature names retrieved from database if {$lmVals(reload)} { for {set ix 0} {$ix < [llength $lmVals(lmFeaturesTotal)]} {incr ix} { set feature [lindex $lmVals(lmFeaturesTotal) $ix] set featureName [lindex $feature 0] set fHostAllocated 0 for {set ixf 0} {$ixf < $numberOfFeatures} {incr ixf} { # only if the feature is previously allocated on this host # (name match), display that feature name if { $featureName == [lmLicProdInfoGet prodName $lmVals(lmHostName) $ixf] } { set fHostAllocated \ [lmLicProdInfoGet licAllocated $lmVals(lmHostName) $ixf] } } if { $fHostAllocated != 0 } { set line [format "%s\r\n" [lindex $lmVals(lmLicensedProductNames) $ix]] append output $line } } } else { # otherwise, display features selected for {set ix 0} {$ix < [llength $lmVals(lmLicensedProductNames)]} {incr ix} { if {[lindex $lmVals(lmFeaturesRequested) $ix] == 1} { set line [format "%s\r\n" [lindex $lmVals(lmLicensedProductNames) $ix]] append output $line } } } controlTextSet licConfirmDlg.nodelockSummary $output }}############################################################################### licenseConfirm() - Display License Summary## This procedure will display license summary## SYNOPSIS# .tS# licenseConfirm()# .tE## PARAMETERS: N/A## RETURNS: 1 if ok or 0 if cancel## ERRORS: N/A#proc licenseConfirm {} { global ctrlVals setupVals lmVals lmHostFeaturesNum set ctrlVals(dlgRetVal) 0 if { $setupVals(lmInstType) == "floating" } { set isFloatLic 1 } else { set isFloatLic 0 } set hostIndex [lsearch $lmVals(lmHosts) $lmVals(lmHostName)] if { [isGUImode] } { # Automation: skip display summary and populate autoSetupLog if { $ctrlVals(useInputScript) } { set ctrlVals(dlgRetVal) 1 if {$lmVals(reload)} { autoSetupLog "Reload Existing License File Summary Page: skipped" autoSetupLog "[strTableGet LICCFG_DLGRLD_1]" } elseif {$lmVals(lmLicMode) == "floating"} { autoSetupLog "Floating License Configuration Summary Page: skipped" autoSetupLog "[strTableGet LICCFG_DLGMSG_1]" } else { autoSetupLog "NodeLocked License Configuration Summary Page: skipped" autoSetupLog "[strTableGet LICCFG_NODELOCK_DLGMSG_1]" } # display values set hostIndex [lsearch $lmVals(lmHosts) $lmVals(lmHostName)] set numberOfFeatures [lindex $lmHostFeaturesNum $hostIndex] for {set ix 0} {$ix < [llength $lmVals(lmFeaturesTotal)]} {incr ix} { set feature [lindex $lmVals(lmFeaturesTotal) $ix] set featureName [lindex $feature 0] set fHostAllocated 0 for {set ixf 0} {$ixf < $numberOfFeatures} {incr ixf} { # only if the feature is previously allocated on # this host (name match), retrieve allocated value if { $featureName == [lmLicProdInfoGet prodName $lmVals(lmHostName) $ixf] } { set fHostAllocated \ [lmLicProdInfoGet licAllocated $lmVals(lmHostName) $ixf] } } if {$lmVals(reload)} { autoSetupLog "\t$featureName: $fHostAllocated license(s) \ after this transaction" } elseif {$lmVals(lmLicMode) == "floating"} { autoSetupLog "\t$featureName: \ [expr [lindex $lmVals(lmFeaturesRequested) $ix] + \ $fHostAllocated] license(s) after this transaction" } else { # Node Locked autoSetupLog "\t$featureName" } } } else { # create Summary page if {$lmVals(reload)} { set dlgTitle "Summary: Reload Existing License File" set dlgControls [list \ [list label -title [strTableGet LICCFG_DLGRLD_1] \ -x 10 -y 10 -w 200 -h 25]] } elseif {$isFloatLic} { set dlgTitle "Summary: Floating License" set dlgControls [list \ [list label -title [strTableGet LICCFG_DLGMSG_1] \ -x 10 -y 10 -w 200 -h 25]] } else { set dlgTitle "Summary: Node Locked License" set dlgControls [list \ [list label -title [strTableGet LICCFG_NODELOCK_DLGMSG_1] \ -x 10 -y 10 -w 200 -h 25]] } if {$isFloatLic} { lappend dlgControls \ [list button -name okbutt -title "OK" \ -x 50 -y 135 -w 50 -h 15 \ -callback {onLicConfirmDlg 1} ] \ [list button -name cancelButt -title "Cancel" \ -x 120 -y 135 -w 50 -h 15 \ -callback {onLicConfirmDlg 0} ] \ [list label -name sumCol1 \ -title [strTableGet LICCFG_SUMMSG_1] \ -x 10 -y 40 -w 60 -h 12] \ [list label -name sumCol2 \ -title [strTableGet LICCFG_SUMMSG_2] \ -x 100 -y 37 -w 69 -h 23] \ [list frame -name frm2 -gray \ -x 10 -y 57 -w 190 -h 1] \ [list label -name floatSummary1 -title "" -left \ -x 10 -y 63 -w 90 -h 60] \ [list label -name floatSummary2 -title "" -right \ -x 105 -y 63 -w 25 -h 60] \ [list frame -name frm2 -gray \ -x 10 -y 129 -w 190 -h 1] } else { lappend dlgControls \ [list button -name okbutt -title "OK" \ -x 50 -y 135 -w 50 -h 15 \ -callback {onLicConfirmDlg 1} ] \ [list button -name cancelButt -title "Cancel" \ -x 120 -y 135 -w 50 -h 15 \ -callback {onLicConfirmDlg 0} ] \ [list label -name nodelockSummary -title "" -left \ -x 25 -y 45 -w 190 -h 62] }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -