Changeset 198

Show
Ignore:
Timestamp:
05/08/08 15:53:43
Author:
dan
Message:

Added command line option to pass optional style sheet in.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • obskml/trunk/QAQC/GenPlatformUptimeWebpage.pl

    r159 r198  
    1111#Set to 0 if running in a Linux/Unix environment. This mostly deals with how file paths are handled, as well as a couple 
    1212#of shell commands. 
     13############################################################################################################################## 
     14#Revisions 
     15#Rev: 1.1.0.0 
     16#Author: DWR 
     17#Changes: Added command line option to pass optional style sheet in. 
     18############################################################################################################################## 
    1319use constant MICROSOFT_PLATFORM => 0; 
    1420 
     
    2733my %CommandLineOptions; 
    2834GetOptions( \%CommandLineOptions, 
    29             "WorkingDir=s" ); 
     35            "WorkingDir=s", 
     36            "StyleSheet:s"); #DWR v1.1.0.0 
    3037 
    3138my $strWorkingDir   = $CommandLineOptions{"WorkingDir"};    
     
    3340{ 
    3441 
    35   die print( "Missing required field(s).\n". 
     42  die print( "Missing required field or fields.\n". 
    3643              "Command Line format: -WorkingDir\n".  
    37               "-WorkingDir provides the path to the directory where the $PLATFORMCSVFILE resides for a given provider. HTML file created will be created here as well.\n" );   
     44              "--WorkingDir provides the path to the directory where the $PLATFORMCSVFILE resides for a given provider. HTML file created will be created here as well.\n". 
     45              "--StyleSheet optional argument to give the style sheet to use in formatting the page.\n") ;   
    3846} 
    39  
     47#DWR v1.1.0.0 
     48my $strStyleSheet = $CommandLineOptions{"StyleSheet"};  
     49# If no style sheet provided, use the default. 
     50if( length( $strStyleSheet ) == 0 ) 
     51
     52  $strStyleSheet = 'http://carocoops.org/~dramage_prod/styles/main.css'; 
     53
    4054my $PlatformPercentCSVFile; 
    4155my $PlatformPercentHTMLFile; 
     
    5569print( $PlatformPercentHTMLFile  "<BODY>\n" ); 
    5670 
    57 print( $PlatformPercentHTMLFile "<link href=\"http://carocoops.org/~dramage_prod/styles/main.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />\n" ); 
     71print( $PlatformPercentHTMLFile "<link href=\"$strStyleSheet\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />\n" ); 
    5872my $iTestProfileNdx = 0; 
    5973#my @ReportIntervals; 
     
    7387        print( $PlatformPercentHTMLFile "<tr><td><BR></td></tr>" ); 
    7488             
    75           #  print( $PlatformPercentHTMLFile "</table><BR><BR>" ); 
    7689          } 
    7790          #Start a new table per new header. 
    78           #print( $PlatformPercentHTMLFile "<table border=\"1\">" ); 
    79  
    80           #For each new haeder, let's add a row to help show this. 
    81     #my $strBuf = "<CAPTION><H2>Sensor Reporting Percentage</H2></CAPTION>"; 
    82           #print( $PlatformPercentHTMLFile $strBuf ); 
    83            
     91   
    8492          $iTestProfileNdx++; 
    8593          $iWriteTableHeader = 1; 
     
    106114            #push( @ReportIntervals, $iInterval ); 
    107115          } 
    108                 print $PlatformPercentHTMLFile "<TH><STRONG>$strColumn</STRONG></TH>\n";           
     116                #print $PlatformPercentHTMLFile "<TH><STRONG>$strColumn</STRONG></TH>\n";          
     117      print $PlatformPercentHTMLFile "<TH>$strColumn</TH>\n";      
    109118        } 
    110119                print $PlatformPercentHTMLFile "</THEAD >\n";      
     
    117126        { 
    118127          my $strColumn = shift(@Columns); 
    119             my $rgbColor = RGB_DEFAULT;              
     128            #my $rgbColor = RGB_DEFAULT;             
     129      my $strBGColorID = "RGB_DEFAULT"; 
    120130          if( $iCnt >= 3 ) 
    121131          { 
    122132            if( $strColumn >= 90.0 ) 
    123133            { 
    124              $rgbColor = RGB_90THPERCENTILE; 
     134             #$rgbColor = RGB_90THPERCENTILE; 
     135         $strBGColorID = "RGB_90THPERCENTILE"; 
    125136            } 
    126137            elsif( $strColumn >= 70.0 ) 
    127138            { 
    128              $rgbColor = RGB_70THPERCENTILE;           
     139             #$rgbColor = RGB_70THPERCENTILE;          
     140         $strBGColorID = "RGB_70THPERCENTILE"; 
    129141            } 
    130142            else 
    131143            { 
    132               $rgbColor = RGB_UNDER70TH; 
     144              #$rgbColor = RGB_UNDER70TH; 
     145          $strBGColorID = "RGB_UNDER70TH"; 
    133146            } 
    134147          } 
     
    144157            } 
    145158          }        
    146                 print $PlatformPercentHTMLFile "<td bgcolor=\"$rgbColor\" >$strColumn</td>\n";                   
     159                #print $PlatformPercentHTMLFile "<td bgcolor=\"$rgbColor\" >$strColumn</td>\n";                  
     160      print $PlatformPercentHTMLFile "<td id=\"$strBGColorID\" >$strColumn</td>\n";              
    147161          $iCnt++; 
    148162        }