IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19302


Ignore:
Timestamp:
Aug 31, 2008, 12:42:45 PM (18 years ago)
Author:
eugene
Message:

adding summary pages, mods to generate and ipp.php to support summary pages

Location:
trunk/ippMonitor
Files:
4 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/Makefile.in

    r19131 r19302  
    7171$(DESTWWW)/newImfile.php \
    7272$(DESTWWW)/guidePendingExp.php \
     73$(DESTWWW)/chipSummary.php \
    7374$(DESTWWW)/chipStageExp.php \
    7475$(DESTWWW)/chipPendingExp.php \
     
    7778$(DESTWWW)/chipProcessedImfile.php \
    7879$(DESTWWW)/chipProcessedImfile_failure.php \
     80$(DESTWWW)/camSummary.php \
    7981$(DESTWWW)/camStageExp.php \
    8082$(DESTWWW)/camPendingExp.php \
     
    8385$(DESTWWW)/camProcessedExp_failure.php \
    8486$(DESTWWW)/camProcessedImfile.php \
     87$(DESTWWW)/fakeSummary.php \
    8588$(DESTWWW)/fakeStageExp.php \
    8689$(DESTWWW)/fakePendingExp.php \
     
    105108$(DESTWWW)/summitExp.php \
    106109$(DESTWWW)/summitImfile.php \
     110$(DESTWWW)/warpSummary.php \
    107111$(DESTWWW)/warpStageExp.php \
    108112$(DESTWWW)/warpStageSkyfiles.php \
  • trunk/ippMonitor/def/autocode.php

    r18313 r19302  
    2727
    2828// get the result table count
    29 $sql = "SELECT count(*) FROM $TABLE $WHERE";
     29if ($MODE == "basic") {
     30  $sql = "SELECT count(*) FROM $TABLE $WHERE";
     31}
     32if ($MODE == "summary") {
     33  $sql = "SELECT count(*) FROM (SELECT $FIELDS FROM $TABLE $WHERE) as TEMP";
     34}
    3035
    3136$qry = $db->query($sql);
     
    5257
    5358// query the database
    54 $sql = "SELECT $FIELDS FROM $TABLE $WHERE LIMIT $dTABLE OFFSET $rowStart";
     59if ($MODE == "basic") {
     60  $sql = "SELECT $FIELDS FROM $TABLE $WHERE LIMIT $dTABLE OFFSET $rowStart";
     61}
     62if ($MODE == "summary") {
     63  $sql = "SELECT $FIELDS FROM $TABLE $WHERE LIMIT $dTABLE OFFSET $rowStart";
     64}
    5565
    5666$qry = $db->query($sql);
  • trunk/ippMonitor/raw/ipp.menu.dat

    r16617 r19302  
    2121menutop   | menutop      | link    | Detrend Steps                | ipp.detrend.php
    2222menutop   | menutop      | link    | Science Steps                | ipp.science.php
    23 menutop   | menutop      | link    | Warp Steps                   | ipp.warp.php
    2423menutop   | menutop      | link    | Stack Steps                  | ipp.stack.php
    25 menutop   | menutop      | link    | Diff Steps                   | ipp.diff.php
    2624menutop   | menutop      | link    | Cal Steps                    | ipp.cal.php
    2725menutop   | menutop      | link    | Imfile Tables                | ipp.imfiles.php
  • trunk/ippMonitor/raw/ipp.php

    r18970 r19302  
    416416}
    417417
    418 function check_ordering ($where) {
     418function check_ordering ($groups, $where) {
     419
     420  if ($groups != "") {
     421    $where = $where . " GROUP BY $groups";
     422  }
    419423
    420424  if ($_SERVER[REQUEST_METHOD] == 'GET') {
  • trunk/ippMonitor/raw/ipp.science.dat

    r19157 r19302  
    2626
    2727menutop   | menutop      | plain   |                         |
     28menulink  | menuselect   | link    | Chip Summary                 | chipSummary.php
    2829menulink  | menuselect   | link    | Chip-Stage Exp               | chipStageExp.php           
    2930menulink  | menuselect   | link    | Chip Pending Exp             | chipPendingExp.php             
     
    3435
    3536menutop   | menutop      | plain   |                         |
     37menulink  | menuselect   | link    | Cam Summary                 | camSummary.php
    3638menulink  | menuselect   | link    | Cam-Stage Exp                | camStageExp.php           
    3739menulink  | menuselect   | link    | Cam Pending Exp              | camPendingExp.php             
     
    4244
    4345menutop   | menutop      | plain   |                         |
     46menulink  | menuselect   | link    | Fake Summary                 | fakeSummary.php
    4447menulink  | menuselect   | link    | Fake-Stage Exp               | fakeStageExp.php           
    4548menulink  | menuselect   | link    | Fake Pending Exp             | fakePendingExp.php             
     
    5053
    5154menutop   | menutop      | plain   |                         |
     55menulink  | menuselect   | link    | Warp Summary                 | warpSummary.php
    5256menulink  | menuselect   | link    | Warp Stage Exp               | warpStageExp.php
    5357menulink  | menuselect   | link    | Warp Stage Skyfiles          | warpStageSkyfiles.php
  • trunk/ippMonitor/scripts/generate

    r18212 r19302  
    2727    &init_key ("MENU");
    2828    &init_key ("STYLE");
     29    &init_key ("MODE");
    2930    &init_key ("TABLE");
    3031    &init_key ("TITLE");
     
    3233
    3334    &init_key ("FIELDS");
     35    &init_key ("GROUPS");
    3436
    3537    foreach $line (@list) {
     
    4749            ($field, $width, $format, $name, $show, $link, $extras) = split (/,\s+/, $value, 7);
    4850            if (! $name) { die "table $ARGV[0] missing required elements\n"; }
    49             # ($field) = $field =~ m|\s*(\S+)\s*|;
    50 
     51            if ($field =~ m|\S+\s+as\s+\S+|) {
     52                ($fieldreal) = $field =~ m|\S+\s+as\s+(\S+)|;
     53            } else {
     54                $fieldreal = $field;
     55            }
     56           
    5157            if ($VERBOSE) { printf "%-20s %-20s %-20s %-20s %-20s %-20s\n", $field, $name, $format, $show, $link, $extras; }
    5258
    5359            if ($show eq "") {$show = "value";}
    54             push @field,   $field;
    55             push @width,   $width;
    56             push @format,  $format;
    57             push @name,    $name;
    58             push @show,    $show;
    59             push @link,    $link;
    60             push @extras,  $extras;
     60            push @field,     $field;
     61            push @fieldreal, $fieldreal;
     62            push @width,     $width;
     63            push @format,    $format;
     64            push @name,      $name;
     65            push @show,      $show;
     66            push @link,      $link;
     67            push @extras,    $extras;
    6168        }
    6269
     
    7380        if ($key eq "IMAGE") {
    7481            push @imagedefs, $value;
     82        }
     83
     84        # the GROUP entries are used in summary tables as arguments to the GROUP BY sql statement
     85        if ($key eq "GROUP") {
     86            push @group, $value;
    7587        }
    7688
     
    108120    &check_key ("MENU", "ipp.menu.dat");
    109121    &check_key ("STYLE", "ipp.css");
     122    &check_key ("MODE", "basic");
    110123    &check_key ("TABLE", "");
    111124    &check_key ("TITLE", "");
     
    115128    for ($i = 0; $i < @key; $i++) {
    116129        if ($key[$i] eq "MENU") { $MENU = $value[$i]; }
    117     }
     130        if ($key[$i] eq "MODE") {
     131            if ($value[$i] eq "summary") {
     132                if (@group == 0) {
     133                    print STDERR "a summary table must have at least one group\n";
     134                    exit 1;
     135                }
     136                &define_groups_string (@group);
     137            }
     138        }
     139    }
     140
     141    &check_key ("GROUPS", "none");
    118142
    119143    # define FIELDS and WHERE strings, add to keypairs
     
    246270            print FILE "write_sort_cell (\"list\", \"$opf{$value}\", \$buttonLink, \$ID, '$myFile');\n";
    247271        } else {
    248             print FILE "write_sort_cell (\"list\", \"$field[$i]\", \$buttonLink, \$ID, '$myFile');\n";
     272            print FILE "write_sort_cell (\"list\", \"$fieldreal[$i]\", \$buttonLink, \$ID, '$myFile');\n";
    249273        }
    250274    }
     
    281305    }   
    282306    for ($i = 0; $i < @field; $i++) {
    283         $value = $field[$i];
     307        $value = $fieldreal[$i];
    284308        if ($value eq "*") { next; }
    285309        if ($format[$i] eq "%s") {
     
    291315        }
    292316    }
    293     print FILE "\$WHERE = check_ordering (\$WHERE);\n";
     317    print FILE "\$WHERE = check_ordering ('$GROUPS', \$WHERE);\n";
    294318}
    295319
     
    298322
    299323    for ($i = 0; $i < @field; $i++) {
    300         $value = $field[$i];
     324        $value = $fieldreal[$i];
    301325        if ($value eq "*") { next; }
    302326        if ($format[$i] eq "%s") {
     
    323347        } else {
    324348            if ($format[$i] eq "%s") {
    325                 print FILE "write_query_row ('$field[$i]', $width[$i], 'string');\n";
     349                print FILE "write_query_row ('$fieldreal[$i]', $width[$i], 'string');\n";
    326350            } else {
    327                 print FILE "write_query_row ('$field[$i]', $width[$i], 'min');\n";
     351                print FILE "write_query_row ('$fieldreal[$i]', $width[$i], 'min');\n";
    328352            }
    329353        }
     
    336360            print FILE "echo \"<td> &nbsp; </td>\\n\";\n";
    337361        } else {
    338             print FILE "write_query_row ('$field[$i]', $width[$i], 'max');\n";
     362            print FILE "write_query_row ('$fieldreal[$i]', $width[$i], 'max');\n";
    339363        }
    340364    }
     
    421445}
    422446
     447sub define_groups_string {
     448    my (@array) = @_;
     449    my ($i);
     450
     451    $GROUPS = "$array[0]";
     452    for ($i = 1; $i < @array; $i++) {
     453        # skip * fields (not a valid query element
     454        if ($array[$i] eq "*") { next; }
     455        $GROUPS = "$GROUPS,$array[$i]";
     456    }
     457    set_keypair ("GROUPS", $GROUPS);
     458}
     459
    423460sub define_fields_count {
    424461    my ($i, $Nrow);
     
    502539            for ($i = 0; $i < @field; $i++) {
    503540                if ($field[$i] eq "*") { next; }
    504                 if ($value =~ m|^\$$field[$i]|) {
    505                     # print "field: $field[$i]\n";
    506                     ($name, $extra) = $value =~ m|^\$($field[$i])\@(\S+)|;
     541                if ($value =~ m|^\$$fieldreal[$i]|) {
     542                    # print "field: $fieldreal[$i]\n";
     543                    ($name, $extra) = $value =~ m|^\$($fieldreal[$i])\@(\S+)|;
    507544                    # print "name: $name\n";
    508545                    # print "extra: $extra\n";
     
    543580
    544581    for ($i = 0; $i < @field; $i++) {
    545         # print STDERR "$i: $field[$i] : $fieldname\n";
     582        # print STDERR "$i: $fieldreal[$i] : $fieldname\n";
    546583
    547584        if ($field[$i] eq "*") { next; }
    548         if ($fieldname ne $field[$i]) { next; }
     585        if ($fieldname ne $fieldreal[$i]) { next; }
    549586
    550587
Note: See TracChangeset for help on using the changeset viewer.