IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 11, 2011, 2:49:34 PM (15 years ago)
Author:
eugene
Message:

merge changes from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101205/ippMonitor/raw/czartool_exposures.php

    r30446 r30579  
    1717else {$myMenu = "ipp.imfiles.dat";}
    1818
    19 menu($myMenu, 'Czartool on '.$lastUpdateTime, 'ipp.css', $ID['link'], $ID['proj']);
    20 
    2119$pass = $ID['pass'];
    2220$proj = $ID['proj'];
    2321$menu = $ID['menu'];
    2422
    25 $today = date("Y-m-d");
    26 
     23$date = $_POST['date'];
     24$survey = $_POST['survey'];
     25
     26// if no date chosen, use today
     27if ($date == "") $date = date("Y-m-d");
     28if ($survey == "") $survey = "";
     29
     30menu($myMenu, 'Exposure summary for '.$date , 'ipp.css', $ID['link'], $ID['proj']);
     31
     32// set up the form
     33echo "<form action=\"czartool_exposures.php\" method=\"POST\">\n";
     34
     35echo "<input type=\"hidden\" name=\"pass\" value=\"$pass\">\n";
     36echo "<input type=\"hidden\" name=\"proj\" value=\"$proj\">\n";
     37echo "<input type=\"hidden\" name=\"menu\" value=\"$menu\">\n";
     38
     39
     40echo "<form method=post action=czartool_exposures.php?pass=$pass&proj=$proj&date=$date&survey=$survey>";
     41echo "<p  align=\"center\"> Current status of all exposures taken on (UTC) <input type=text name=date value='$date'>";
     42echo " for survey <input type=text name=survey value='$survey'> (leave blank for all surveys)";
     43echo "<input type=submit value=Submit>";
    2744echo "</p>";
    28 echo "<p  align=\"center\"> Current status of all exposures taken $today UTC </p>";
    29 
    30 createTableForThisSurvey($gpc1db, $today, "");
     45
     46echo "</form>\n";
     47
     48createTableForThisSurvey($gpc1db, $date, $survey);
    3149
    3250menu_end();
     
    5876    $qry->fetchInto($count);
    5977
    60     if ($surveyStr == "") $surveyText = "all surveys"; 
     78    if ($surveyStr == "") $surveyText = "all surveys";
    6179    else $surveyText = "$surveyStr survey";
    6280
     
    83101    $ssDiffProduced = array(); getSSDiffProduced($db, $date, $surveyStr, &$ssDiffProduced);
    84102
    85     $class = "list";
    86     echo "<table class=$class >\n";
     103    // create table
     104    echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     105
     106    // table headers
    87107    echo "<tr><td></td>\n";
    88     write_header_cell($class, "");
    89     write_header_cell($class, "");
    90     write_header_cell($class, "");
    91     write_header_cell($class, "");
    92     write_header_cell($class, "Raw");
    93     write_header_cell($class, "Chip");
    94     write_header_cell($class, "Camera");
    95     write_header_cell($class, "Warp");
    96     write_header_cell($class, "Stack");
    97     write_header_cell($class, "Warp-Stack Diff");
    98     write_header_cell($class, "Warp-Warp1 Diff");
    99     write_header_cell($class, "Warp-Warp2 Diff");
    100     write_header_cell($class, "Stack-Stack Diff");
     108    echo "<th></th>";
     109    echo "<th></th>";
     110    echo "<th></th>";
     111    echo "<th></th>";
     112    echo "<th>Raw</th>";
     113    echo "<th>Chip</th>";
     114    echo "<th>Camera</th>";
     115    echo "<th>Warp</th>";
     116    echo "<th>Stack</th>";
     117    echo "<th>Warp-Stack Diff</th>";
     118    echo "<th>Warp-Warp1 Diff</th>";
     119    echo "<th>Warp-Warp2 Diff</th>";
     120    echo "<th>Stack-Stack Diff</th>";
    101121    echo "<tr><td></td>\n";
    102     write_header_cell($class, "Exp ID");
    103     write_header_cell($class, "Exp Name");
    104     write_header_cell($class, "Filter");
    105     write_header_cell($class, "Comment");
    106     write_header_cell($class, "state");
    107     write_header_cell($class, "state/dist?");
    108     write_header_cell($class, "state/dist?");
    109     write_header_cell($class, "state/dist?");
    110     write_header_cell($class, "total/dist");
    111     write_header_cell($class, "total/dist");
    112     write_header_cell($class, "total/dist");
    113     write_header_cell($class, "total/dist");
    114     write_header_cell($class, "total/dist");
     122    echo "<th>Exp ID</th>";
     123    echo "<th>Exp Name</th>";
     124    echo "<th>Filter</th>";
     125    echo "<th>Comment</th>";
     126    echo "<th>state</th>";
     127    echo "<th>state/dist?</th>";
     128    echo "<th>state/dist?</th>";
     129    echo "<th>state/dist?</th>";
     130    echo "<th>total/dist</th>";
     131    echo "<th>total/dist</th>";
     132    echo "<th>total/dist</th>";
     133    echo "<th>total/dist</th>";
     134    echo "<th>total/dist</th>";
    115135
    116136    $sql =
     
    147167        echo "<tr><td></td>\n";
    148168
     169        echo "<TD>$exp_id</td>";
     170        echo "<TD>$exp_name</td>";
     171        echo "<TD>$filter</td>";
     172        echo "<TD>$comment</td>";
     173        echo "<TD>$rawExp</td>";
     174
    149175        // chip
    150176        if (!$chipDist[$exp_id]) $chipDistStr = "N";
    151177        else $chipDistStr = $chipDist[$exp_id];
     178        echo "<TD>$chipState/$chipDistStr</td>";
    152179
    153180        // cam
    154181        if (!$camDist[$exp_id]) $camDistStr = "N";
    155182        else $camDistStr = $camDist[$exp_id];
     183        echo "<TD>$camState/$camDistStr</td>";
    156184
    157185        // warp
    158186        if (!$warpDist[$exp_id]) $warpDistStr = "N";
    159187        else $warpDistStr = $warpDist[$exp_id];
     188        echo "<TD>$warpState/$warpDistStr</td>";
    160189
    161190        // stack
    162         if (!$stack_hash[$exp_id] && !$stackDist[$exp_id]) $stackDistStr = "";
     191        if (!$stack_hash[$exp_id] && !$stackDist[$exp_id]) $stackDistStr = "&nbsp;";
    163192        else $stackDistStr = $stack_hash[$exp_id] . "/" . $stackDist[$exp_id];
     193        $color = getColour($stack_hash[$exp_id], $stackDist[$exp_id]);
     194        echo "<TD bgcolor=\"$color\" >$stackDistStr</td>";
    164195
    165196        // WS diff
    166         if (!$wsDiffProduced[$exp_id] && !$wsDiffDist[$exp_id]) $wsDistStr = "";
     197        if (!$wsDiffProduced[$exp_id] && !$wsDiffDist[$exp_id]) $wsDistStr = "&nbsp;";
    167198        else $wsDistStr = $wsDiffProduced[$exp_id] . "/" . $wsDiffDist[$exp_id];
     199        $color = getColour($wsDiffProduced[$exp_id], $wsDiffDist[$exp_id]);
     200        echo "<TD bgcolor=\"$color\" >$wsDistStr</td>";
    168201
    169202        // WW1 diff
    170         if (!$ww1DiffProduced[$exp_id] && !$ww1DiffDist[$exp_id]) $ww1DistStr = "";
     203        if (!$ww1DiffProduced[$exp_id] && !$ww1DiffDist[$exp_id]) $ww1DistStr = "&nbsp;";
    171204        else $ww1DistStr = $ww1DiffProduced[$exp_id] . "/" . $ww1DiffDist[$exp_id];
     205        $color = getColour($ww1DiffProduced[$exp_id], $ww1DiffDist[$exp_id]);
     206        echo "<TD bgcolor=\"$color\" >$ww1DistStr</td>";
    172207
    173208        // WW2 dist
    174         if (!$ww2DiffProduced[$exp_id] && !$ww2DiffDist[$exp_id]) $ww2DistStr = "";
     209        if (!$ww2DiffProduced[$exp_id] && !$ww2DiffDist[$exp_id]) $ww2DistStr = "&nbsp;";
    175210        else $ww2DistStr =  $ww2DiffProduced[$exp_id] . "/" . $ww2DiffDist[$exp_id];
     211        $color = getColour($ww2DiffProduced[$exp_id], $ww2DiffDist[$exp_id]);
     212        echo "<TD bgcolor=\"$color\" >$ww2DistStr</td>";
    176213
    177214        // SS dist
    178         if (!$ssDiffProduced[$exp_id] && !$ssDiffDist[$exp_id]) $ssDistStr = "";
     215        if (!$ssDiffProduced[$exp_id] && !$ssDiffDist[$exp_id]) $ssDistStr = "&nbsp;";
    179216        else $ssDistStr = $ssDiffProduced[$exp_id] . "/" . $ssDiffDist[$exp_id];
    180 
    181         write_table_cell($class, '%s', "", $exp_id);
    182         write_table_cell($class, '%s', "", $exp_name);
    183         write_table_cell($class, '%s', "", $filter);
    184         write_table_cell($class, '%s', "", $comment);
    185         write_table_cell($class, '%s', "", $rawExp);
    186         write_table_cell($class, '%s', "", "$chipState/$chipDistStr");
    187         write_table_cell($class, '%s', "", "$camState/$camDistStr");
    188         write_table_cell($class, '%s', "", "$warpState/$warpDistStr");
    189         write_table_cell($class, '%s', "", $stackDistStr);
    190         write_table_cell($class, '%s', "", $wsDistStr);
    191         write_table_cell($class, '%s', "", $ww1DistStr);
    192         write_table_cell($class, '%s', "", $ww2DistStr);
    193         write_table_cell($class, '%s', "", $ssDistStr);
     217        $color = getColour($ssDiffProduced[$exp_id], $ssDiffDist[$exp_id]);
     218        echo "<TD bgcolor=\"$color\" >$ssDistStr</td>";
    194219
    195220        echo "</tr>\n";
     
    199224}
    200225
     226###########################################################################
     227#
     228# Gets the right cell colour provided number created and distributed
     229#
     230###########################################################################
     231function getColour($created, $distributed) {
     232
     233    if ($distributed > 0 && $created > 0 && $distributed % $created != 0) return "red";
     234    return "";
     235}
    201236
    202237###########################################################################
Note: See TracChangeset for help on using the changeset viewer.