IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13595


Ignore:
Timestamp:
Jun 3, 2007, 10:24:09 AM (19 years ago)
Author:
eugene
Message:

better links

Location:
trunk/ippMonitor
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/Makefile

    r12083 r13595  
    3232
    3333DEFSRC = \
     34$(DESTBIN)/keptDetrendFrames.php \
    3435$(DESTBIN)/masterDetrendFrames.php \
    3536$(DESTBIN)/masterDetrendImfiles.php \
  • trunk/ippMonitor/def/detInputExp.d

    r13566 r13595  
    1414ARGS  ARG2  detProcessedImfile.iteration=$detInputExp.iteration
    1515
     16HEAD PHP if ($_GET['detInputExp_det_id']) {
     17HEAD PHP   echo "<a href=detResidExp.php?" . $ID['link'] . "> resid </a>";
     18HEAD PHP   echo "<a href=detProcessedExp.php?" . $ID['link'] . "> proc </a>"; }
     19
    1620#     field                  width      name        show         link to                 extras
    1721FIELD detInputExp.det_id,    7,         det_id
  • trunk/ippMonitor/def/detProcessedExp.d

    r13264 r13595  
    1616ARGS  ARG1 basename=$detProcessedExp.path_base
    1717
     18OP    OP1  $detProcessedExp.bg / $detProcessedExp.bg_stdev
     19
    1820#     field                    size     name       show          link to                 extras
    1921FIELD detProcessedExp.det_id,     7,    Det ID,    value
     
    2426FIELD detProcessedExp.bg_mean_stdev, 8, [stdev],   value
    2527FIELD detProcessedExp.bg_stdev,   8,    stdev,     value
    26 FIELD detProcessedExp.recipe,    15,    Recipe,    value
     28FIELD *,                          8,    S/N,       op=OP1
     29FIELD rawExp.dateobs,             8,    obs date,  value
     30FIELD rawExp.filter,              8,    filter,    value
     31FIELD rawExp.exp_time,            8,    exptime,   value
     32FIELD rawExp.ccd_temp,            8,    ccd temp,  value
     33FIELD rawExp.airmass,             8,    airmass,   value
    2734FIELD detProcessedExp.path_base, 20,    path_base, none
    2835
  • trunk/ippMonitor/def/detResidExp.d

    r13566 r13595  
    2020ARGS  ARG2 basename=$detResidExp.path_base
    2121
     22OP    OP1  $detResidExp.bg / $detResidExp.bg_stdev
     23
    2224#     field                   size    name       show         link to              linkargs
    2325FIELD detResidExp.det_id,        7,   Det ID,    value
     26FIELD rawExp.camera,            10,   camera,    value
    2427FIELD detResidExp.exp_tag,      15,   Exposure,  value,       rawImfile.php,       ARG1
     28FIELD detResidExp.iteration,     5,   iter,      value
     29FIELD *,                         8,   image,     image=JPEG2, detResidImfile.php,  ARG2
    2530FIELD detResidExp.bg,            8,   backgnd,   value
    2631FIELD detResidExp.bg_mean_stdev, 8,   [stdev]
    2732FIELD detResidExp.bg_stdev,      8,   stdev,     value
    28 FIELD detResidExp.iteration,     5,   iter,      value
    29 FIELD *,                         8,   image,     image=JPEG2, detResidImfile.php,  ARG2
     33FIELD *,                         8,   S/N,       op=OP1
     34FIELD rawExp.dateobs,            8,   obs date,  value
     35FIELD rawExp.filter,             8,   filter,    value
     36FIELD rawExp.exp_time,           8,   exptime,   value
     37FIELD rawExp.ccd_temp,           8,   ccd temp,  value
     38FIELD rawExp.airmass,            8,   airmass,   value
    3039FIELD detResidExp.accept,        4,   keep,      value
    31 FIELD detResidExp.path_base,    20,   path_base,  none
    32 FIELD rawExp.camera,            20,   camera,     none
     40FIELD detResidExp.path_base,    20,   path_base, none
    3341
    3442TD_CLASS list_off $detResidExp.accept == 0
  • trunk/ippMonitor/def/detResidImfile.d

    r13282 r13595  
    1414# FIELD uri,        20,   uri
    1515# FIELD recipe,     20,   recipe
    16 # FIELD path_base,  20,   path_base
     16FIELD path_base,  20,   path_base
    1717
    1818TAIL PHP insert_image ('PPIMAGE.JPEG1');
  • trunk/ippMonitor/def/detRun.d

    r13264 r13595  
    44MENU  ipp.detrend.dat
    55
    6 ARGS  ARG1 det_id=$det_id
     6ARGS  ARG1 detRunSummary.det_id=$det_id
    77
    8 #     field       width name         show    link to              extras
    9 FIELD det_id,        7,   det ID,      value,  detRunSummary.php,   ARG1
    10 FIELD iteration,     5,   iteration
    11 FIELD det_type,      8,   det_type
     8ARGS  ARG2 detInputExp.det_id=$det_id
     9ARGS  ARG2 detInputExp.iteration=$iteration
     10
     11ARGS  ARG3 detProcessedExp.det_id=$det_id
     12
     13ARGS  ARG4 detResidExp.det_id=$det_id
     14ARGS  ARG4 detResidExp.iteration=$iteration
     15
     16#     field       width name            show         link to                extras
     17FIELD det_id,        5,   det ID,       value,       detRunSummary.php,     ARG1
     18FIELD iteration,     3,   iter
     19FIELD det_type,      5,   type
    1220FIELD state,         5,   state
     21FIELD *,             5,   choose,       value=input, detInputExp.php,       ARG2
     22FIELD *,             5,   choose,       value=proc,  detProcessedExp.php,   ARG3
     23FIELD *,             5,   choose,       value=resid, detResidExp.php,       ARG4
    1324FIELD mode,          5,   mode
    1425FIELD filter,       10,   filter     
  • trunk/ippMonitor/def/detRunSummary.d

    r13264 r13595  
    44MENU  ipp.detrend.dat
    55
    6 ARGS  ARG1  det_id=$det_id
    7 ARGS  ARG1  iteration=$iteration
     6ARGS  ARG1  detInputExp.det_id=$detRunSummary.det_id
     7ARGS  ARG1  detInputExp.iteration=$detRunSummary.iteration
    88
    9 #     field      name             show         link to           extras
    10 FIELD det_id,    7,    det_id   
    11 FIELD iteration, 5,    iter
    12 FIELD accept,    4,    keep
    13 FIELD *,         20,   choose,    value=input, detInputExp.php,  ARG1
    14 FIELD *,         20,   choose,    value=resid, detResidExp.php,  ARG1
    15 FIELD bg,        20,   bg
    16 FIELD bg_stdev,  20,   bg_stdev
    17 # FIELD bg_mean_stdev, 20,   bg_mean_stdev
     9ARGS  ARG2  detResidExp.det_id=$detRunSummary.det_id
     10ARGS  ARG2  detResidExp.iteration=$detRunSummary.iteration
     11
     12#     field                     name  show      link to           extras
     13FIELD detRunSummary.det_id,     7,    det_id   
     14FIELD detRunSummary.iteration,  5,    iter
     15FIELD detRunSummary.accept,     4,    keep
     16FIELD *,                       20,    choose,    value=input, detInputExp.php,  ARG1
     17FIELD *,                       20,    choose,    value=proc,  detProcessedExp.php,      ARG3
     18FIELD *,                       20,    choose,    value=resid, detResidExp.php,  ARG2
     19FIELD detRunSummary.bg,        20,    bg
     20FIELD detRunSummary.bg_stdev,  20,    bg_stdev
     21
     22TD_CLASS list_off $detRunSummary.accept == 0
  • trunk/ippMonitor/def/masterDetrendFrames.d

    r13566 r13595  
    2323
    2424#     field                    width name          show         link to                   extras
    25 FIELD detRunSummary.det_id,    7,    det_id,       value,       detRunSummary.php,        ARG1
    26 FIELD detRunSummary.iteration, 5,    iter
     25FIELD detRunSummary.det_id,    5,    det ID,       value,       detRunSummary.php,        ARG1
     26FIELD detRunSummary.iteration, 3,    iter
    2727FIELD detRun.det_type,         5,    type
     28FIELD detRun.state,            5,    state
    2829FIELD *,                       20,   choose,       value=input, detInputExp.php,          ARG2
    2930FIELD *,                       20,   choose,       value=proc,  detProcessedExp.php,      ARG3
  • trunk/ippMonitor/generate

    r13566 r13595  
    7373        }
    7474
    75         # the ARGS commands defines arguments to FIELDS commands
     75        # the ARGS commands define arguments to FIELDS commands
    7676        if ($key eq "ARGS") {
    7777            push @linkargs, $value;
     78        }
     79
     80        # the OP commands define field operations
     81        if ($key eq "OP") {
     82            push @opwords, $value;
    7883        }
    7984
     
    123128    }
    124129
     130    foreach $opword (@opwords) {
     131        &parse_opwords ($opword);
     132    }
     133
    125134    if (0) {
    126135        print STDERR "show: $show[0]\n";
     
    219228    # add column sorting elements here
    220229    for ($i = 0; $i < @field; $i++) {
     230        ($label, $value, $string) = &parse_label ($show[$i]);
    221231        if ($show[$i] eq "none")  { next; }
    222232        # printf FILE "echo \"<th class=\\\"list\\\"> $name[$i] </th>\\n\";\n";
    223         printf FILE "write_table_header (\"list\", \"$name[$i]\", \"$field[$i]\", \$buttonLink, \$ID, '$myFile');\n";
     233        if ($label eq "op") {
     234            printf FILE "write_table_header (\"list\", \"$name[$i]\", \"$opf{$value}\", \$buttonLink, \$ID, '$myFile');\n";
     235        } else {
     236            printf FILE "write_table_header (\"list\", \"$name[$i]\", \"$field[$i]\", \$buttonLink, \$ID, '$myFile');\n";
     237        }
    224238    }
    225239}
     
    292306        }
    293307
     308        if ($label eq "op") {
     309            # create the basic link variable
     310            if ($link[$i]) {
     311                printf FILE "  \$link = \"$link[$i]\" . \"?menu=$MENU&\" . \$ID['link'];\n";
     312                # add extra GET data to target
     313                if ($extras[$i]) { &parse_extras ($linkarg{$extras[$i]}); }
     314                $myLink = "\$link";
     315            } else {
     316                $myLink = "\"\"";
     317            }
     318            printf FILE "  write_table_cell (\$class, $myLink, $ops{$value});\n";
     319            next;
     320        }
     321
    294322        if (($label eq "image") && !$link[$i]) {
    295323            # print the actual table cell line with the image...
     
    485513}
    486514
     515sub parse_opwords {
     516    my ($value) = $_[0];
     517
     518    @words = split (" ", $value);
     519    $name = shift (@words);
     520
     521    $opline = "";
     522    foreach $word (@words) {
     523        $fword = &parse_fieldname ($word);
     524        push @outwords, $fword;
     525        if ($word =~ m|^\$|) {
     526            $word = substr ($word, 1);
     527        }
     528        push @outfields, $word;
     529    }
     530    $outline = join (" ", @outwords);
     531    $ops{$name} = $outline;
     532    $outline = join (" ", @outfields);
     533    $opf{$name} = $outline;
     534
     535    return 1;
     536}
     537
    487538sub init_key {
    488539    my ($key)   = $_[0];
  • trunk/ippMonitor/raw/ipp.detrend.dat

    r12083 r13595  
    2727
    2828menutop   | menutop      | plain   | &nbsp;                       |
     29menulink  | menuselect   | link    | Detrend Kept                 | keptDetrendFrames.php
    2930menulink  | menuselect   | link    | Detrend Frames               | masterDetrendFrames.php
    3031menulink  | menuselect   | link    | Detrend Runs                 | detRun.php             
  • trunk/ippMonitor/raw/ipp.php

    r13566 r13595  
    99}
    1010
    11 function loginform () {
     11function loginform ($username) {
    1212  echo '<form action="Login.php" method="POST">', "\n";
    13   echo 'Username: <input type="text" name="username"><br>', "\n";
     13  if ($username) {
     14    echo "Username: <input type=\"text\" name=\"username\" value=\"$username\"><br>\n";
     15  } else {
     16    echo "Username: <input type=\"text\" name=\"username\"><br>\n";
     17  }
    1418  echo 'Password: <input type="text" name="password"><br>', "\n";
    1519  echo '<input type="submit" name="login" value="login">', "\n";
     
    1923function projectform ($ID) {
    2024    menu ('ipp.menu.dat', 'Select Project', 'ipp.css', $ID['link'], $ID['proj']);
     25    if ($_GET['new'] && $_GET['proj']) {
     26      echo "<p> Project is now <b>" . $_GET['proj'] . "</b></p>\n";
     27    }
    2128    echo "<p> Please select the project of interest </p>\n";
    22     echo "<form action=\"SelectProject.php\" method=\"POST\">\n";
    23     echo "Project: <input type=\"text\" name=\"proj\"><br>\n";
    24     echo "<input type=\"submit\" name=\"project\">\n";
     29    // echo "<form action=\"SelectProject.php\" method=\"POST\">\n";
     30    // echo "Project: <input type=\"text\" name=\"proj\"><br>\n";
     31    // echo "<input type=\"submit\" name=\"project\">\n";
    2532
    2633    $pass = $ID['pass'];
    27     echo "<input type=\"hidden\" name=\"pass\" value=\"$pass\">\n";
    28     echo "</form>\n";
     34    // echo "<input type=\"hidden\" name=\"pass\" value=\"$pass\">\n";
     35    // echo "</form>\n";
    2936
    3037    $db = dbconnect('ippadmin');
     
    4249    echo "<tr class=select><th class=select> projects </th></tr>\n";
    4350    while ($qry->fetchInto($row)) {
    44       echo "<tr class=select><td class=select> $row[0] </td></tr>\n";
     51      // add a link here to set the database
     52      $tmp_proj = $row[0];
     53      $tmp_link = "pass=$pass";
     54      echo "<tr class=select><td class=select><a href=\"SelectProject.php?$tmp_link&proj=$tmp_proj&new=1\"> $row[0] </a></td></tr>\n";
     55      // echo "<tr class=select><td class=select> $row[0] </td></tr>\n";
    4556    }
    4657    echo "</table>\n";
     
    7788  $password = $_POST[password];
    7889
     90  // if password is not specified, keep username and ask again
     91  if ($password == "") {
     92    menu ('ipp.menu.dat', 'Login', 'ipp.css', '', '');
     93    loginform ($username);
     94    menu_end ();
     95  }
     96
    7997  $db = dbconnect('ippadmin');
    8098
     
    84102  $qry = $db->query($sql);
    85103  if (DB::iserror($db)) {
     104    menu ('ipp.menu.dat', 'Login', 'ipp.css', '', '');
    86105    echo "<b>error reading users table</b><br>\n";
    87106    echo "Login Failed, please try again<br>\n";
    88     loginform ();
     107    loginform ("");
    89108    menu_end();
    90109  }
     
    94113    menu ('ipp.menu.dat', 'Login', 'ipp.css', '', '');
    95114    echo "Login Failed, please try again<br>\n";
    96     loginform ();
     115    loginform ("");
    97116    menu_end ();
    98117    exit ();
     
    179198    menu('ipp.menu.dat', 'Login', 'ipp.css', '', '');
    180199    logintext ();   
    181     loginform ();
     200    loginform ("");
    182201    menu_end ();
    183202  }
     
    185204  $db = dbconnect ('ippadmin');
    186205
    187   // make this a DB lookup
    188206  $pass = $ID['pass'];
     207
     208  // search for password
    189209  $sql = "SELECT username FROM cookies WHERE cookie = '$pass'";
    190210  $qry = $db->query($sql);
     
    192212    echo "<b>error reading users table</b><br>\n";
    193213    echo "Login Failed, please try again<br>\n";
    194     loginform ();
     214    loginform ("");
    195215    menu_end();
    196216  }
    197217 
    198   # $success = (($username == "eugene") && ($password == "test"));
    199218  $success = $qry->fetchInto($row);
    200219  if (! $success) {
    201220    menu('ipp.menu.dat', 'Login', 'ipp.css', '', '');
    202221    echo "unknown user, please login again<br>\n";
    203     loginform ();
     222    loginform ("");
    204223    menu_end ();
    205224  }
Note: See TracChangeset for help on using the changeset viewer.