IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 10, 2011, 12:31:04 PM (15 years ago)
Author:
rhenders
Message:

Now highlighting cells in red when not distributed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/raw/czartool_exposures.php

    r30547 r30558  
    101101
    102102    $class = "list";
    103     echo "<table class=$class >\n";
     103    //echo "<table class=$class >\n";
     104        echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"4\" >\n";
     105
    104106    echo "<tr><td></td>\n";
    105     write_header_cell($class, "");
    106     write_header_cell($class, "");
    107     write_header_cell($class, "");
    108     write_header_cell($class, "");
    109     write_header_cell($class, "Raw");
    110     write_header_cell($class, "Chip");
    111     write_header_cell($class, "Camera");
    112     write_header_cell($class, "Warp");
    113     write_header_cell($class, "Stack");
    114     write_header_cell($class, "Warp-Stack Diff");
    115     write_header_cell($class, "Warp-Warp1 Diff");
    116     write_header_cell($class, "Warp-Warp2 Diff");
    117     write_header_cell($class, "Stack-Stack Diff");
     107    echo "<th></th>";
     108    echo "<th></th>";
     109    echo "<th></th>";
     110    echo "<th></th>";
     111    echo "<th>Raw</th>";
     112    echo "<th>Chip</th>";
     113    echo "<th>Camera</th>";
     114    echo "<th>Warp</th>";
     115    echo "<th>Stack</th>";
     116    echo "<th>Warp-Stack Diff</th>";
     117    echo "<th>Warp-Warp1 Diff</th>";
     118    echo "<th>Warp-Warp2 Diff</th>";
     119    echo "<th>Stack-Stack Diff</th>";
    118120    echo "<tr><td></td>\n";
    119     write_header_cell($class, "Exp ID");
    120     write_header_cell($class, "Exp Name");
    121     write_header_cell($class, "Filter");
    122     write_header_cell($class, "Comment");
    123     write_header_cell($class, "state");
    124     write_header_cell($class, "state/dist?");
    125     write_header_cell($class, "state/dist?");
    126     write_header_cell($class, "state/dist?");
    127     write_header_cell($class, "total/dist");
    128     write_header_cell($class, "total/dist");
    129     write_header_cell($class, "total/dist");
    130     write_header_cell($class, "total/dist");
    131     write_header_cell($class, "total/dist");
     121    echo "<th>Exp ID</th>";
     122    echo "<th>Exp Name</th>";
     123    echo "<th>Filter</th>";
     124    echo "<th>Comment</th>";
     125    echo "<th>state</th>";
     126    echo "<th>state/dist?</th>";
     127    echo "<th>state/dist?</th>";
     128    echo "<th>state/dist?</th>";
     129    echo "<th>total/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>";
    132134
    133135    $sql =
     
    164166        echo "<tr><td></td>\n";
    165167
     168        echo "<TD>$exp_id</td>";
     169        echo "<TD>$exp_name</td>";
     170        echo "<TD>$filter</td>";
     171        echo "<TD>$comment</td>";
     172        echo "<TD>$rawExp</td>";
     173
    166174        // chip
    167175        if (!$chipDist[$exp_id]) $chipDistStr = "N";
    168176        else $chipDistStr = $chipDist[$exp_id];
    169177
     178        if ($chipDistStr == "N") $color = "red"; else $color = "";
     179        echo "<TD bgcolor=\"$color\" >$chipState/$chipDistStr</td>";
     180
    170181        // cam
    171182        if (!$camDist[$exp_id]) $camDistStr = "N";
    172183        else $camDistStr = $camDist[$exp_id];
     184        if ($camDistStr == "N") $color = "red"; else $color = "";
     185        echo "<TD bgcolor=\"$color\" >$camState/$camDistStr</td>";
    173186
    174187        // warp
    175188        if (!$warpDist[$exp_id]) $warpDistStr = "N";
    176189        else $warpDistStr = $warpDist[$exp_id];
     190        if ($warpDistStr == "N") $color = "red"; else $color = "";
     191        echo "<TD bgcolor=\"$color\" >$warpState/$warpDistStr</td>";
    177192
    178193        // stack
    179         if (!$stack_hash[$exp_id] && !$stackDist[$exp_id]) $stackDistStr = "";
     194        if (!$stack_hash[$exp_id] && !$stackDist[$exp_id]) $stackDistStr = "&nbsp;";
    180195        else $stackDistStr = $stack_hash[$exp_id] . "/" . $stackDist[$exp_id];
     196        $color = getColour($stack_hash[$exp_id], $stackDist[$exp_id]);
     197        echo "<TD bgcolor=\"$color\" >$stackDistStr</td>";
    181198
    182199        // WS diff
    183         if (!$wsDiffProduced[$exp_id] && !$wsDiffDist[$exp_id]) $wsDistStr = "";
     200        if (!$wsDiffProduced[$exp_id] && !$wsDiffDist[$exp_id]) $wsDistStr = "&nbsp;";
    184201        else $wsDistStr = $wsDiffProduced[$exp_id] . "/" . $wsDiffDist[$exp_id];
     202        $color = getColour($wsDiffProduced[$exp_id], $wsDiffDist[$exp_id]);
     203        echo "<TD bgcolor=\"$color\" >$wsDistStr</td>";
    185204
    186205        // WW1 diff
    187         if (!$ww1DiffProduced[$exp_id] && !$ww1DiffDist[$exp_id]) $ww1DistStr = "";
     206        if (!$ww1DiffProduced[$exp_id] && !$ww1DiffDist[$exp_id]) $ww1DistStr = "&nbsp;";
    188207        else $ww1DistStr = $ww1DiffProduced[$exp_id] . "/" . $ww1DiffDist[$exp_id];
     208        $color = getColour($ww1DiffProduced[$exp_id], $ww1DiffDist[$exp_id]);
     209        echo "<TD bgcolor=\"$color\" >$ww1DistStr</td>";
    189210
    190211        // WW2 dist
    191         if (!$ww2DiffProduced[$exp_id] && !$ww2DiffDist[$exp_id]) $ww2DistStr = "";
     212        if (!$ww2DiffProduced[$exp_id] && !$ww2DiffDist[$exp_id]) $ww2DistStr = "&nbsp;";
    192213        else $ww2DistStr =  $ww2DiffProduced[$exp_id] . "/" . $ww2DiffDist[$exp_id];
     214        $color = getColour($ww2DiffProduced[$exp_id], $ww2DiffDist[$exp_id]);
     215        echo "<TD bgcolor=\"$color\" >$ww2DistStr</td>";
    193216
    194217        // SS dist
    195         if (!$ssDiffProduced[$exp_id] && !$ssDiffDist[$exp_id]) $ssDistStr = "";
     218        if (!$ssDiffProduced[$exp_id] && !$ssDiffDist[$exp_id]) $ssDistStr = "&nbsp;";
    196219        else $ssDistStr = $ssDiffProduced[$exp_id] . "/" . $ssDiffDist[$exp_id];
    197 
    198         write_table_cell($class, '%s', "", $exp_id);
    199         write_table_cell($class, '%s', "", $exp_name);
    200         write_table_cell($class, '%s', "", $filter);
    201         write_table_cell($class, '%s', "", $comment);
    202         write_table_cell($class, '%s', "", $rawExp);
    203         write_table_cell($class, '%s', "", "$chipState/$chipDistStr");
    204         write_table_cell($class, '%s', "", "$camState/$camDistStr");
    205         write_table_cell($class, '%s', "", "$warpState/$warpDistStr");
    206         write_table_cell($class, '%s', "", $stackDistStr);
    207         write_table_cell($class, '%s', "", $wsDistStr);
    208         write_table_cell($class, '%s', "", $ww1DistStr);
    209         write_table_cell($class, '%s', "", $ww2DistStr);
    210         write_table_cell($class, '%s', "", $ssDistStr);
     220        $color = getColour($ssDiffProduced[$exp_id], $ssDiffDist[$exp_id]);
     221        echo "<TD bgcolor=\"$color\" >$ssDistStr</td>";
    211222
    212223        echo "</tr>\n";
     
    216227}
    217228
     229###########################################################################
     230#
     231# Gets the right cell colour provided number created and distributed
     232#
     233###########################################################################
     234function getColour($created, $distributed) {
     235
     236    if ($distributed > 0 && $created > 0 && $distributed % $created != 0) return "red";
     237    return "";
     238}
    218239
    219240###########################################################################
Note: See TracChangeset for help on using the changeset viewer.