⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 liccfg.tcl

📁 windml3.0
💻 TCL
📖 第 1 页 / 共 5 页
字号:
             # create the dialog box             dialogCreate \                    -name licConfirmDlg \                    -init licConfirmDlgInit \                    -parent $ctrlVals(mainWindow) \                    -title $dlgTitle\                    -width 220 -height 160 \                    -controls $dlgControls         }    } else { # text mode        # find the maximum width of the product names        set nameWidth [string length "Licensed Product"]        foreach name $lmVals(lmLicensedProductNames) {            if { [string length $name] > $nameWidth } {                set nameWidth [string length $name]            }        }        # print summary page text        if {$lmVals(reload)} {            printPageTitle "[strTableGet LICCFG_TITLE_RELOAD]: Summary"            puts "[strTableGet LICCFG_DLGRLD_1]\n"            puts [format "%-*s     %s" $nameWidth "Licensed Product" "Total licenses after"]            puts [format "%-*s     %s\r\n" $nameWidth "" "  this transaction "]        } elseif {$isFloatLic} {                printPageTitle "[strTableGet LICCFG_TITLE_FLOATING]: Summary"            puts "[strTableGet LICCFG_DLGMSG_1]\n\n"            puts [format "%-*s     %s" $nameWidth "Licensed Product" "Total licenses after"]            puts [format "%-*s     %s\r\n" $nameWidth "" "  this transaction "]        } else { # NODELOCK            printPageTitle "[strTableGet LICCFG_TITLE_NODELOCKED]: Summary"            puts "[strTableGet LICCFG_NODELOCK_DLGMSG_1]\n"         }        # 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)} {                puts [format "%-*s             %4s" $nameWidth $featureName $fHostAllocated]            } elseif {$isFloatLic} {                     puts [format "%-*s             %4s" $nameWidth $featureName\                      [expr [lindex $lmVals(lmFeaturesRequested) $ix] + $fHostAllocated]]            } else { # NODELOCK                if {[lindex $lmVals(lmFeaturesRequested) $ix] == 1} {                    puts [format "%s\r\n" $featureName]                }            }        }        if {$lmVals(reload)} {            set msg "\nPress <Enter> to continue."        } else {            set msg "\nPress <Enter> to continue or type '-' to change the settings."        }        set ret [prompt $msg]        switch -regexp -- $ret {            "^$"  {  set ctrlVals(dlgRetVal) 1  }            "^-$" {  set ctrlVals(dlgRetVal) 0  }             "[eE][xX][iI][tT]" {                puts "You must return to the previous page before exiting."                while {[prompt "Press <Enter> to return to previous page."] != "" } {                }            }            default {                set ctrlVals(dlgRetVal) -1            }        }    }    return $ctrlVals(dlgRetVal)}############################################################################### onLicConfirmDlg(val) - process licenseConfirm dialog## This procedure will process licenseConfirm dialog## SYNOPSIS# .tS# onLicConfirmDlg(val)# .tE## PARAMETERS: N/A## RETURNS: n/a## ERRORS: N/A#proc onLicConfirmDlg {val} {    global ctrlVals    # 1 if ok, 0 if cancel    set ctrlVals(dlgRetVal) $val    windowClose licConfirmDlg    }############################################################################### isLMFeaturesRequestedNull - checks if the no. of licenses requested is null## This procedure determines if all the license requested are null. ## SYNOPSIS# .tS# isLMFeaturesRequestedNull# .tE## PARAMETERS: N/A## RETURNS: n/A## ERRORS: N/A#proc isLMFeaturesRequestedNull {} {    global lmVals setupVals    set isNull 0    set input ""    if { $setupVals(lmInstType) == "floating" } {        set isFloatLic 1    } else {        set isFloatLic 0    }    if { [isGUImode] } {        if { $isFloatLic } {            for {set ix 0} {$ix < [llength $lmVals(lmLicensedProductNames)]} {incr ix} {                if { [controlValuesGet wizardDialog.${ix}Requested] == "" } {                    set isNull 1                }            }        } else {            set isNull 1            for {set ix 0} {$ix < [llength $lmVals(lmLicensedProductNames)]} {incr ix} {                if { [controlChecked wizardDialog.${ix}Boolean] == 1 } {                    set isNull 0                }            }        }    } else { # TEXT MODE        if { $isFloatLic } {            for {set ix 0} {$ix < [llength $lmVals(lmFeaturesRequested)]} {incr ix} {                if { [lindex $lmVals(lmFeaturesRequested) $ix] == "" } {                    set isNull 1                }            }        } else {            set isNull 1            for {set ix 0} {$ix < [llength $lmVals(lmFeaturesRequested)]} {incr ix} {                if { [lindex $lmVals(lmFeaturesRequested) $ix] != 0 } {                    set isNull 0                }            }        }    }    return $isNull}############################################################################### floatingLicRequestedUpdate ## This procedure does the work for the floating license text box callback# procedures.  It updates the lmVal(lmFeaturesRequested) array and controls# enabling or disabling of the Next button.## SYNOPSIS# .tS# floatingLicRequestedUpdate index# .tE## PARAMETERS: N/A# index - the index or order in which the licensed product is displayed## RETURNS: n/a## ERRORS: N/A#proc floatingLicRequestedUpdate {ix} {    global ctrlVals lmVals setupVals    global returnValue lmHostFeaturesNum    if { [isGUImode] } {        set input [controlValuesGet wizardDialog.${ix}Requested]        if {[isNumeric $input "License Count Input Error" wizardDialog.${ix}Requested]} {            # check if value entered exceeds number to allocate            set featureName [lindex $lmVals(lmLicensedProductNames) $ix]            set featureAllocated [lmFeaturesValueGet lmFeaturesAllocated $featureName]            set featureTotal [lmFeaturesValueGet lmFeaturesTotal $featureName]            if { $input <= [expr $featureTotal - $featureAllocated] } {                 set lmVals(lmFeaturesRequested) \                        [lreplace $lmVals(lmFeaturesRequested) $ix $ix $input]            } else {                if { $ctrlVals(useInputScript) } {                    # if error during automation, exit SETUP                    autoSetupLog "ERROR: the number of licenses exceeds the\                                 the number available for this feature."                    autoSetupLog "Application Exit\n"                    set setupVals(cancel) 1                    applicationExit                    return 0                } else {                    dialog ok_with_title "Floating License Configuration Error" \                                         [strTableGet REQ_INPUT_EXCEEDED]#                    set lmVals(lmFeaturesRequested) \#                            [lreplace $lmVals(lmFeaturesRequested) $ix $ix 0]                    controlValuesSet wizardDialog.${ix}Requested ""#                                         [lindex $lmVals(lmFeaturesRequested) $ix]                    return 0                 }            }        }        if {[isLMFeaturesRequestedNull]} {            controlEnable wizardDialog.nextButt 0        } else {            controlEnable wizardDialog.nextButt 1        }    } else { # TEXT MODE        set name [lindex $lmVals(lmLicensedProductNames) $ix]        puts "Enter the number of licenses for $name: \n"        set ret [prompt]        switch -regexp -- $ret {            "^-$" {  }            "^[eE][xX][iI][tT]$" {  }            "[ ]+" {                puts "Error: Invalid input."                while {[prompt "Press <Enter> to continue."] != "" } {                }             }            "^[0-9]+" {                 set lmVals(lmFeaturesRequested) \                        [lreplace $lmVals(lmFeaturesRequested) $ix $ix $ret]            }            default {                puts "Error: Invalid input."                while {[prompt "Press <Enter> to continue."] != "" } {                }            }        }    }}############################################################################### nodelockLicRequestedUpdate## This procedure does the work for the nodelocked license text box callback# procedures.  It updates the lmVal(lmFeaturesRequested) array and controls# enabling or disabling of the Next button.## SYNOPSISlmLicProdInfoGet# .tS# nodelockLicRequestedUpdate index# .tElmLicProdInfoGet## PARAMETERS: # index - the index or order in which the licensed product is displayed## RETURNS: n/a## ERRORS: N/A#proc nodelockLicRequestedUpdate {ix} {    global ctrlVals setupVals lmVals    if { [isGUImode] } {        if {[controlChecked wizardDialog.${ix}Boolean] != 0} {            set lmVals(lmFeaturesRequested) \                [lreplace $lmVals(lmFeaturesRequested) $ix $ix 1]        } else {            set lmVals(lmFeaturesRequested) \                [lreplace $lmVals(lmFeaturesRequested) $ix $ix 0]        }        if {[isLMFeaturesRequestedNull]} {            controlEnable wizardDialog.nextButt 0        } else {            controlEnable wizardDialog.nextButt 1        }    } 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) \lmLicProdInfoGet                    [lreplace $lmVals(lmFeaturesRequested) $ix $ix 1]        }        # check for at least one license is done in pageCreate    }}############################################################################### lmValsPopulate - fill the remaining values for lmVals for this host## This procedure fills the values pertaining for the current host in the# lmVals data structure. The data that is populated are:#       lmLicensedProductNames#       lmLicensedFeatureIds#       lmFeaturesAllocated#       lmPort## SYNOPSIS# .tS# lmValsPopulate currHost# .tE## PARAMETERS: # currHost - the current host o

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -