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

📄 liccfg.tcl

📁 windml3.0
💻 TCL
📖 第 1 页 / 共 5 页
字号:
# LICCFG.TCL - Setup procedures for implementing license configuration page## Copyright 1999 Wind River Systems, Inc## modification history# --------------------# 03i,18sep02,bjl  select licensed product by default only if seats are#                  available (spr 80884).  # 03h,30jul02,wmd  Remvoe the Beta period limit of 10 licenses warning.# 03g,24apr02,j_w  Added detection for existing NL license (SPR 76046)# 03f,20mar02,bwd  SPR 72885: add pop-up dialog to warn user to install#                  correct number of floating licenses, not more# 03e,11mar02,bwd  For Beta period, limit to 10 licenses per host# 03d,11mar02,bwd  SPR 73927: modified default number of seats requested to 1# 03c,08mar02,bwd  Adjusted height for each row of products# 03b,05mar02,bwd  Modified SETUP to be non-tornado centric# 03a,12jun01,j_w  Added for Tornado 2.2# 03a,22nov00,bwd  SPR 35941: added a dialog to prompt user to exit if no more#                  licenses available for configuration.# 02z,01nov00,j_w  fixed summary page text display# 02y,30oct00,j_w  Added proc rmPageList to removed the correct page #                  list depends on the value of setupVals(lmInstType) #                  if transaction is canceled# 02x,02oct00,wmd  Update a user message for clarity.# 02w,19sep00,bwd  SPR 34462: reconstruct hostRec for commit request in proc#                  licConfigCallback# 02v,25aug00,bwd  Fixed TCL error - infinite loop when enter invalid input# 02u,30jul00,wmd  Add warning about consequences of configuring LM.# 02t,07jul00,j_w  fixed typo# 02s,28jun00,bwd  Changed host checking to use windHostTypeGet instead of#                  env(WIND_HOST_TYPE)# 02r,20jun00,wmd  Remove display of setupicon for linux host.# 02q,02jun00,bwd  Changed all "dialog ok" to use "dialog ok_with_title"# 02p,31may00,bwd  SPR 31564: uncheck boxes by default for node locked if#                  reload# 02o,19may00,bwd  Small bug fix in TEXT mode - SETUP should not exit when#                  user cancel the commit request.# 02n,18may00,bwd  SPR 31030 - modified codes to match new page list when#                  calling sendToALD# 02m,27apr00,j_w  Constructed hostRec after lmPort is being set# 02l,19apr00,bwd  Added a workaround to skip license configuration error#                  checking for Reload until the database is ready# 02k,13apr00,bwd  Fixed typo on variable names. Fixed error handling and#                  page displays when CGI errors arise.# 02j,13apr00,j_w  Updated parameters for licFileConfig and ackCommit# 02j,13apr00,bwd  Added a column on License Config page to display the no. of#                  licenses already allocated for current host.# 02i,12apr00,bwd  Added codes to check that user cannot enter 0 for all#                  features if first time configuring on this host# 02h,27mar00,bwd  Fixed error handling for LM Configuration when requesting#                  for licenses more than available.# 02g,24mar00,bwd  Fixed TEXT mode to correctly display License Config Summary#                  page# 02f,24mar00,bwd  Removed host name from the column headings on License#                  Configuration pages. Fixed default value to 0 for reload.# 02e,23mar00,bwd  Fixed lmValsPopulate to correctly populate lmVals with#                  the new format of data coming in from CGI. Changed codes #                  to manipulate new lmVals structure.# 02d,02mar00,bwd  Changed the title for the License Config summary page to #                  fit the dialog box. Fixed isLMFeaturesRequestedNull to #                  correctly handle inputs for both GUI and TEXT mode# 02c,14feb00,wmd  Change all references to prodCode to featureId.# 02b,03feb00,j_w  Remove commit in the parameter list of commit request call# 02a,02feb00,j_w  Add licServPort in lmValsPopulate# 01z,01feb00,bwd  Added a global variable licServPort to store port number#                  from the license file# 01y,31jan00,bwd  Fixed error handling for test automation - suppress exit#                  confirmation dialog# 01x,27jan00,bwd  Fixed error handlings for test automation and cleaned up#                  codes# 01w,25jan00,j_w  move lmValsPopulate to dbQuery page# 01v,21jan00,j_w  Set lmVals(lmPort) to default port number. # 01v,21jan00,bwd  Added codes to display this page for TEXT MODE (Phase 3)# 01u,20jan00,bwd  Added codes to display this page for TEXT MODE (Phase 2)# 01t,19jan00,wmd  Remove any requests to rollback database, no longer#                  required.# 01s,18jan00,bwd  Added codes to display this page for TEXT MODE# 01r,06jan00,bwd  No test automation for command line SETUP# 01q,17dec99,clc  change  switch statement patterns# 01p,14dec99,wmd  Add icon to wait banner.# 01p,02dec99,clc  add text mode# 01o,23nov99,wmd  Add output to setup.log to log license file that is written#                  to disk.# 01n,22nov99,bwd  Skipped license confirm display and more work on automating#                  Floating License installation# 01m,22nov99,bwd  Corrected TCL error for auto floating license installation# 01l,19nov99,bwd  Added sections for automatic LM installation# 01k,19nov99,wmd  Fix the Exceeds number of license error dialog to display#                  ammended value.# 01j,17nov99,wmd  Remove spaces from the commit command.# 01i,15nov99,wmd  Add more error handling.# 01h,13nov99,wmd  Add error handling.# 01g,09nov99,wmd  Need to add logic for the configuration of LM.# 01f,03nov99,wmd  Add code to send request to the database.# 01e,02nov99,wmd  Use the real data from the database.# 01d,01nov99,wmd  Fix the node locked license configuration screen to match#                  the design docs.# 01c,31oct99,wmd  Modify wording, and add edit boxes.# 01b,30oct99,wmd  Add a dlgTitle for nodedLock license Configuration.# 01a,07Oct99,j_w   written#global returnValueglobal licServPort############################################################################### pageCreate(licConfig) - Configure licenses on current host## This procedure will configure license on current host## SYNOPSIS# .tS# pageCreate(licConfig)# .tE## PARAMETERS: N/A## RETURNS: N/A## ERRORS: N/A#proc pageCreate(licConfig) {} {    global ctrlVals setupVals lmVals lmHostFeaturesNum    global licConfigReturn    global returnValue    if { $setupVals(lmInstType) == "floating" } {        set isFloatLic 1    } else {        set isFloatLic 0    }    if { [isGUImode] } {        if {$isFloatLic} {            # Warn user to configure number of floating licenses correctly             # (according to what is purchased)             dialog ok_with_title "Licenses Configuration" \                [strTableGet LICCFG_CONFIGURE_LICENSES_WARN]        }                       # hide the setup bitmap to allow more space on the page        controlHide $ctrlVals(mainWindow).bitmap 1        # set up constants to be used for control dimensions and spacing        set XCOL1 10        set XCOL2 70        set XCOL3 115        set XCOL4 165        set XCOL5 210        set XCOL6 260        set Y     35          set WIDTH 45        set HTHDR 25        set FEAT_HDR_HT  [expr $Y + $HTHDR + 7]        set HT    11        set TXTWIDTH 17        set INDENT 8        # if reload of current license file, change the labels appropriately        if {$lmVals(reload)} {            set ctrlVals(volatileFrm) [list \                [list label -name Label_1 \                        -title [strTableGet LICCFG_RELOAD_1] \                        -x $XCOL1 -y 15 -w 300 -h 20] \                [list label -name label_3 \                        -title [strTableGet LICCFG_RELOAD_2] \                        -x $XCOL1 -y 160 -w 300 -h 15]            ]        } elseif {$isFloatLic} {            set ctrlVals(volatileFrm) [list \                [list label -name Label_1 \                        -title [strTableGet LICCFG_FLOAT_1] \                        -x $XCOL1 -y 15 -w 300 -h 20] \                [list label -name label_3 \                        -title [strTableGet LICCFG_FLOAT_2] \                        -x $XCOL1 -y 160 -w 300 -h 17]             ]        } else {            set ctrlVals(volatileFrm) [list \                [list label -name Label_1 \                        -title [strTableGet LICCFG_NODELOCK_1] \                        -x $XCOL1 -y 15 -w 300 -h 20] \                [list label -name label_3 \                        -title [strTableGet LICCFG_NODELOCK_2]  \                        -x $XCOL1 -y 160 -w 300 -h 15]            ]        }        # floating or nodeLocked differences done here        if {$isFloatLic} {            lappend ctrlVals(volatileFrm) \                [list label -name col6 \                        -title [strTableGet LICCFG_COL6] \                        -x $XCOL6 -y $Y -w $WIDTH -h $HTHDR]        } else {            lappend ctrlVals(volatileFrm) \                [list label -name col6 \                        -title [strTableGet LICCFG_NODELOCK_COL6] \                        -x $XCOL6 -y $Y -w $WIDTH -h $HTHDR]        }        # add the common controls for both floating and nodelock        lappend ctrlVals(volatileFrm) \            [list label -name col1 \                        -title [strTableGet LICCFG_COL1] \                        -x $XCOL1 -y $Y -w $WIDTH -h $HTHDR] \            [list label -name col2 \                        -title [strTableGet LICCFG_COL2] \                        -x $XCOL2 -y $Y -w $WIDTH -h $HTHDR] \            [list label -name col3 \                        -title [strTableGet LICCFG_COL3] \                        -x $XCOL3 -y $Y -w $WIDTH -h $HTHDR] \            [list label -name col4 \                        -title [strTableGet LICCFG_COL4] \                        -x $XCOL4 -y $Y -w $WIDTH -h $HTHDR] \            [list label -name col5 \                        -title [strTableGet LICCFG_COL5] \                        -x $XCOL5 -y $Y -w $WIDTH -h $HTHDR] \            [list frame -name frm -gray \                            -x 10 -y 62 -w 285 -h 2]        # Add the edit box controls        set hostIndex [lsearch $lmVals(lmHosts) $lmVals(lmHostName)]        set numberOfFeatures [lindex $lmHostFeaturesNum $hostIndex]        for {set ix 0} {$ix < [llength $lmVals(lmLicensedProductNames)]} {incr ix} {            set feature [lindex $lmVals(lmLicensedProductNames) $ix]            set newY [expr $FEAT_HDR_HT + ($ix * $HT)]            set featureId [lindex $lmVals(lmLicensedFeatureIds) $ix]            set fHostAllocated 0            set fAllocated [lmFeaturesValueGet lmFeaturesAllocated $feature]            set fAvailable [lmFeaturesValueGet lmFeaturesAvailable $feature]            set fTotal [lmFeaturesValueGet lmFeaturesTotal $feature]            for {set ixf 0} {$ixf < $numberOfFeatures} {incr ixf} {                # only if the feature is previously allocated on this host                # (name match), retrieve allocated value                if { $feature == [lmLicProdInfoGet prodName $lmVals(lmHostName) $ixf] } {                    set fHostAllocated \                        [lmLicProdInfoGet licAllocated $lmVals(lmHostName) $ixf]                }            }            lappend ctrlVals(volatileFrm) \                [list label -name ${feature}LicProd \                    -title $feature \                    -x $XCOL1 -y $newY  -w $WIDTH -h $HT] \                [list label -name ${feature}Total -right \                    -title $fTotal \                    -x  [expr $XCOL2 + $INDENT] -y $newY -w $TXTWIDTH -h $HT] \                [list label -name ${feature}Allocated -right \                    -title $fAllocated \                    -x  [expr $XCOL3 + $INDENT] -y $newY -w $TXTWIDTH -h $HT] \                [list label -name ${feature}HostAllocated -right \                    -title $fHostAllocated \                    -x  [expr $XCOL4 + $INDENT] -y $newY -w $TXTWIDTH -h $HT] \                [list label -name ${feature}Available -right \                    -title $fAvailable \                    -x  [expr $XCOL5 + $INDENT] -y $newY -w $TXTWIDTH -h $HT] \            if {$isFloatLic} {                lappend ctrlVals(volatileFrm) \                    [list text -name ${ix}Requested  \                        -callback "floatTextCB $ix" \                        -x  [expr $XCOL6 + $INDENT] -y $newY -w 22 -h 12]            } else {                lappend ctrlVals(volatileFrm) \                    [list boolean -name ${ix}Boolean  -auto \                        -callback "nodelockBooleanCB $ix"\                        -x  [expr $XCOL6 + $INDENT] -y $newY -w 22 -h 12]            }        }                # Set title        if {$lmVals(reload)} {            set w [dlgFrmCreate [strTableGet LICCFG_TITLE_RELOAD]]        } elseif {$isFloatLic} {            set w [dlgFrmCreate [strTableGet LICCFG_TITLE_FLOATING]]        } else {            set w [dlgFrmCreate [strTableGet LICCFG_TITLE_NODELOCKED]]        }        controlEnable $w.backButt 1        controlEnable $w.nextButt 0        # place default values in the edit boxes or check boxes         if {$isFloatLic} {            if { $lmVals(reload) } {                # if reload, use existing license info - no new allocation                for {set ix 0} {$ix < [llength $lmVals(lmLicensedProductNames)]} \                    {incr ix} {                    controlValuesSet $w.${ix}Requested 0                }            } else {                 # otherwise, 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 lmFeaturesAvailable $prodName]                    if { $fInput <= 0 } {                        # no license left for this product. Default to 0 and Gray out box                        controlValuesSet $w.${ix}Requested 0                        controlEnable $w.${ix}Requested 0                    } else {                        # default to 1                        controlValuesSet $w.${ix}Requested 1                        set noLicenseAllProd 0                    }                }                # 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                }            }        } else { # node locked            # if reload, use existing license info - no new allocation            if { $lmVals(reload) } {                for {set ix 0} {$ix < [llength $lmVals(lmLicensedProductNames)]} \                    {incr ix} {                    controlCheckSet $w.${ix}Boolean 0                }            } else {                 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 lmFeaturesAvailable $prodName]                    if { $fInput <= 0 } {                        # no license left for this product. Default to 0 and Gray out box                        controlCheckSet $w.${ix}Boolean 0                        controlEnable $w.${ix}Boolean 0                    } else {                        # default to 1                        controlCheckSet $w.${ix}Boolean 1                        set noLicenseAllProd 0                    }                }                # 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                }            }        }

⌨️ 快捷键说明

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