IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21415


Ignore:
Timestamp:
Feb 6, 2009, 5:51:59 PM (17 years ago)
Author:
bills
Message:

various changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/web/request.php

    r20153 r21415  
    1919// BEGIN Local configuration
    2020
    21 $WORKDIR = "/export/data1/bills/pstamp/work";
    22 
    23 $PSCONFDIR = "/export/data0/bills/psconfig";
    24 $PSCONFIG  = "debug";
    25 $PSBINDIR  = "$PSCONFDIR/$PSCONFIG.linrh64/bin";
    26 
    27 $dsroot = "/export/data1/datastore/dsroot";
    28 $dbname = "gpc1";
     21$WORKDIR = "XXXX/pstamp-work/web";
     22$dsroot = "XXXX/datastore/dsroot";
     23$dbname = "XXXX";
     24
     25$PSCONFDIR = "XXXX";
     26$PSCONFIG  = "XXXX";
     27$PSBINDIR  = "$PSCONFDIR/$PSCONFIG.lin64/bin";
    2928
    3029// END Local configuration
     
    4948$file_checked = "";
    5049$coord_checked = "";
     50$diff_checked = "";
    5151$list_checked = "";
    5252$pstamp_checked = "";
     
    9595import_request_variables("gp", "rvar_");
    9696
    97 if ($rvar_project == "gpc1") {
     97if ($rvar_project == "gpc1_rel_200901") {
    9898    $gpc1_selected = "selected";
    9999    $require_class_id = 1;
    100 } else if ($rvar_project == "simtest") {
     100} else if ($rvar_project == "megacam-mops") {
     101    $mops_selected = "selected";
     102    $require_class_id = 0;
     103} else { //    if ($rvar_project == "simtest") {
    101104    $simtest_selected = "selected";
    102     $require_class_id = 0;
    103 } else {
    104     $mops_selected = "selected";
    105105    $require_class_id = 0;
    106106}
     
    114114} else if ($rvar_select_by == "coord") {
    115115    $coord_checked = "CHECKED";
     116} else if ($rvar_select_by == "diff_image_id") {
     117    $diff_checked = "CHECKED";
    116118} else {
    117119    // nothing checked default to By Exposure
     
    248250    global $rvar_X, $rvar_Y;
    249251    global $rvar_W, $rvar_H;
    250     global $exp_checked, $file_checked, $coord_checked;
     252    global $exp_checked, $file_checked, $coord_checked, $diff_checked;
    251253    global $rvar_img_type;
    252254    global $rvar_id, $rvar_class_id;
     
    317319    if ($exp_checked) {
    318320        if (! $rvar_id ) {
    319             throw new Exception('Must set Exposure ID.');
     321            throw new Exception('Must set ID to the Exposure ID.');
    320322        }
    321323        $cmd .= " -byexp $rvar_img_type $rvar_id";
    322324    } else if ($file_checked) {
    323325        if (! $rvar_id ) {
    324             throw new Exception('Must set ID.');
     326            throw new Exception('Must set ID to the exposure name.');
    325327        }
    326328        $cmd .= " -byid $rvar_img_type $rvar_id";
     
    330332        $exp_checked = "checked";
    331333        throw new Exception("Image selection by coordinate not implemented yet.");
     334    } else if ($diff_checked) {
     335        if (! $rvar_id ) {
     336            throw new Exception('Must set ID to Diff Image ID.');
     337        }
     338        $cmd .= " -bydiff $rvar_img_type $rvar_id";
    332339    }
    333340
     
    385392    $doURL = 1;
    386393    if ($doURL) {
    387 //        echo "output_line: $line\n";
     394// echo "<pre>output_line: $line\n</pre>";
     395        // Parse the output from pstamp_list_jobs.pl
    388396        $elements = explode(" ", $line);
    389         if (count($elements) == 3) {
     397        if (count($elements) == 6) {
    390398            $job_id   = $elements[0];
    391399            $state    = $elements[1];
    392             $path     = $elements[2];
     400            $fault    = $elements[2];
     401            $req_name = $elements[3];
     402            $product  = $elements[4];
     403            $path     = $elements[5];
    393404            $fileName = basename($path);
    394405            if ($state == "stop") {
    395406                global $dsroot;
    396                 $fullpath = "$dsroot" . "$path";
    397                 if (file_exists($fullpath)) {
     407                $dirName  = "$dsroot/$product/$req_name";
     408                $filesetURL = "/ds/$product/$req_name";
     409                $fullpath = "$dirName/$fileName";
     410// echo "<pre>fullpath: $fullpath filesetURL: $filesetURL\n</pre>";
     411                if (file_exists($dirName)) {
    398412                    // this job is done, list the url as a link
    399                     echo "<a href=\"http:$path\" target=\"_blank\" type=\"image/fits\">";
    400                     echo $fileName;
     413                    // echo "<a href=\"http:$path\" target=\"_blank\" type=\"image/fits\">";
     414                    echo "<a href=\"http:$filesetURL\">";
     415#                    echo $fileName;
     416                    $filesetName = basename($dirName);
     417                    echo "Fileset: $filesetName";
    401418                    echo "</a>";
    402                     echo "&nbsp;&nbsp;&nbsp; request_id: $last_request_id &nbsp;&nbsp;";
     419                    echo "&nbsp;&nbsp;&nbsp; Base: $fileName &nbsp;&nbsp;&nbsp; request id: $last_request_id &nbsp;&nbsp;";
    403420                    echo "job_id: $job_id &nbsp;&nbsp;&nbsp; state: $state";
    404421                } else {
    405                     echo "request_id: $last_request_id  job_id: $job_id failed";
     422                    echo "request id: $last_request_id  job id: $job_id failed";
    406423                    echo "   $fullpath";
    407424                }
     
    549566    <tr><td><b>Project:</b>&nbsp;&nbsp;&nbsp;</td>
    550567        <td><select name="project">
    551            <option <?php echo $gpc1_selected;?> >gpc1
     568           <option <?php echo $gpc1_selected;?> >gpc1_rel_200901
    552569           <option <?php echo $mops_selected;?> >megacam-mops
    553570           <option <?php echo $simtest_selected;?> >simtest
     
    563580&nbsp;
    564581<input type=radio name="select_by" value="coord" <?php echo $coord_checked; ?> >Coordinates
     582&nbsp;
     583<input type=radio name="select_by" value="diff_image_id" <?php echo $diff_checked; ?> >Diff Image ID
    565584</td>
    566585</tr>
     
    592611&nbsp;&nbsp;&nbsp;&nbsp;
    593612<b>
    594 <?php if (0 && $rvar_project == "gpc1") {
     613<?php if (0 && $rvar_project == "gpc1_rel_200901") {
    595614        echo "Chip ID:";
    596615      } else {
     
    820839<pre>
    821840
    822 <!--- rvar_select_by = <?php echo $rvar_select_by; ?>
    823 --->
    824841
    825842<?php
     843
     844//    echo "select_by: $rvar_select_by diff_checked: $diff_checked exp_checked: $exp_checked file_checked: $file_checked coord_checked: $coord_checked\n";
     845
    826846    // dump parameters
    827847
Note: See TracChangeset for help on using the changeset viewer.