Ignore:
Timestamp:
04/28/07 18:22:16 (18 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/datacenter/db
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/db/menu.js

    r8464 r8466  
    150150}
    151151
     152function showset2()
     153{
     154    var el = document.getElementById("set2");
     155    el.style.display="inline";
     156}
     157
     158function hideset2()
     159{
     160    var el = document.getElementById("set2");
     161    el.style.display="none";
     162}
     163
  • trunk/MagicSoft/Mars/datacenter/db/plot.php

    r8161 r8466  
    5555$labelfont="arialdb.ttf";
    5656$labelsize=10;
     57//colours
     58$colour=0x000000;
     59$setcolour=0x0080ff;
     60$set2colour=0xff0000;
     61
    5762if ($_GET["plot"]=="val")
    5863{
    5964    $column2=$_GET[$primary."Col2"];
    60     $c->addScatterLayer($val2, $val1, $column, CircleSymbol, $small, 0x000000, 0x000000);
     65    $c->addScatterLayer($val2, $val1, $column, CircleSymbol, $small, $colour, $colour);
    6166    if (!empty($_GET["Set"]))
    62         $c->addScatterLayer($Setval2, $Setval1, $column, CircleSymbol, $large, 0x0080ff, 0x0080ff);
     67        $c->addScatterLayer($Setval2, $Setval1, $column, CircleSymbol, $large, $setcolour, $setcolour);
    6368    if (!empty($_GET["Set2"]))
    64         $c->addScatterLayer($Set2val2, $Set2val1, $column, CircleSymbol, $large, 0xff0000, 0xff0000);
     69        $c->addScatterLayer($Set2val2, $Set2val1, $column, CircleSymbol, $large, $set2colour, $set2colour);
    6570    $c->yAxis->setTitle($column, $axisfont, $axissize);
    6671    $c->xAxis->setTitle($column2, $axisfont, $axissize);
     
    6974else
    7075{
    71     $c->addScatterLayer($prim, $val1, $column, CircleSymbol, $small, 0x000000, 0x000000);
     76    $c->addScatterLayer($prim, $val1, $column, CircleSymbol, $small, $colour, $colour);
    7277    if (!empty($_GET["Set"]))
    73         $c->addScatterLayer($Setprim, $Setval1, $column, CircleSymbol, $large, 0x0080ff, 0x0080ff);
     78        $c->addScatterLayer($Setprim, $Setval1, $column, CircleSymbol, $large, $setcolour, $setcolour);
    7479    if (!empty($_GET["Set2"]))
    75         $c->addScatterLayer($Set2prim, $Set2val1, $column, CircleSymbol, $large, 0xff0000, 0xff0000);
     80        $c->addScatterLayer($Set2prim, $Set2val1, $column, CircleSymbol, $large, $set2colour, $set2colour);
    7681    $c->yAxis->setTitle($column, $axisfont, $axissize);
    7782    $c->xAxis->setTitle($primary, $axisfont, $axissize);
  • trunk/MagicSoft/Mars/datacenter/db/plotdb.php

    r8464 r8466  
    11<?php
    22{
     3    function GetSequencesFromDataSet($onoff)
     4    {
     5        include("db.php");
     6        $db_id = mysql_pconnect($host, $user, $pw);
     7        if ($db_id==FALSE)
     8        {
     9            printf("mysql_connect returned the following error: %s\n", mysql_error());
     10            die("");
     11        }
     12        mysql_select_db($db);
     13        $query="SELECT fSequenceFirst FROM DataSetSequenceMapping WHERE fDataSetNumber IN (";
     14        $query .= str_replace(" ", ",", trim($_GET["Set"])) . ") AND fOnOff=" . $onoff;
     15//        printf("Q: %s<br>", $query);
     16        $result=mysql_query($query, $db_id);
     17
     18        $sequences="";
     19        while ($row = mysql_fetch_row($result))
     20            $sequences.= $row[0] . " ";
     21
     22        mysql_free_result($result);
     23        mysql_close($db_id);
     24
     25        $text="";
     26        if (!empty($sequences))
     27            $text.= str_replace(" ", "+", trim($sequences));
     28        return $text;
     29    }
     30 
    331    function PrintDiv($host, $user, $pw, $db, $column, $tables, $num)
    432    {
     
    81109    if (empty($_GET["Set2"]))
    82110        $_GET["Set2"]="";
     111    if (empty($_GET["set"]))
     112        $_GET["set"]="";
    83113
    84114    printf("<center>\n<table cellpadding='0'>\n");
     
    139169
    140170    printf("</table>\n");
    141 
    142     printf("<br>Set1: <input name='Set' type='text' size='20' maxlength='100' value='%s'>\n", $_GET["Set"]);
    143     printf("<br>Set2: <input name='Set2' type='text' size='20' maxlength='100' value='%s'>\n", $_GET["Set2"]);
    144 
    145     printf("<br><br><input class='Width' type='submit' value='Query Plot'><br>\n");
     171    printf("<br>\n");
     172
     173    printf("&nbsp;<input type='radio' name='set' value='sequences' onclick='showset2()' %s> sequences &nbsp;\n", $_GET["set"]=="sequences" ? "checked" : "");
     174    printf("&nbsp;<input type='radio' name='set' value='datasets' onclick='hideset2()' %s> datasets <br>\n", $_GET["set"]=="datasets" ? "checked" : "");
     175
     176    printf("<div id='set1' style='display:inline'>Set1: <input name='Set' type='text' size='20' maxlength='100' value='%s'>\n</div>\n<br>\n", $_GET["Set"]);
     177    if (empty($_GET["set"]) || $_GET["set"]=="sequences")
     178        printf("<div id='set2' style='display:inline'>Set2: <input name='Set2' type='text' size='20' maxlength='100' value='%s'>\n</div>\n<br>\n", $_GET["Set2"]);
     179    else
     180        printf("<div id='set2' style='display:none'>Set2: <input name='Set2' type='text' size='20' maxlength='100' value='%s'>\n</div>\n<br>\n", $_GET["Set2"]);
     181
     182    printf("<br><input class='Width' type='submit' value='Query Plot'><br>\n");
    146183    printf("<input class='Width' type='button' value='Reset' onClick='self.location.href=\"plotdb.php\"'><br>\n");
    147184
     
    154191        $img="plot.php?par=hallo";
    155192        foreach($_GET as $var => $val)
     193        {
     194            if ($var=="Set2" && $_GET["set"]=="datasets")
     195                continue;
     196            if ($var=="Set" && $_GET["set"]=="datasets" && !empty($val))
     197            {
     198                $img.= "&amp;Set=" . GetSequencesFromDataSet("1");
     199                $img.= "&amp;Set2=" . GetSequencesFromDataSet("2");
     200                continue;
     201            }
    156202            $img.="&amp;".$var ."=".$val;
     203        }
    157204//        printf("link: %s<br>", $img);
    158205        printf("<img src='%s' alt='plot'>", $img);
     
    161208    printf("<tr><td colspan='2'>\n");
    162209    printf("some remarks:\n<ul>");
    163     printf("<li>For Runs plotting the whole range (i.e. without giving a range or when giving a too large range) ");
     210    printf("<li>For Runs plotting the whole range (i.e. without giving a range or when giving a too large range) \n");
    164211    printf("doesn't work with ChartDirector.</li>\n");
    165     printf("<li>In Set1 and Set2 Sets can be given (e.g. on sequences in Set1 and off sequences in Set2) - they ");
    166     printf("are displayed in colour (Set: blue, Set2: red). Please give the numbers with space as separator (e.g. 40004 40022).</<li>\n");
    167     printf("<li>0 is not accepted in the ranges fields, please write .0 or 00</li>");
    168     printf("<li>Be aware, that plotting timestamps, e.g. fRunStart, doesn't work. </li>");
    169     printf("</ul></td></tr>\n");
     212    printf("<li>In Set1 and Set2 Sets can be given: <br>\n ");
     213    printf("If 'sequences' is selected e.g. on sequences in Set1 (displayed in blue) and off sequences in Set2 \n");
     214    printf("(diplayed in red). <br>\n ");
     215    printf("If 'datasets' is selected you can enter a dataset number as Set1. The on data is displayed in blue, \n");
     216    printf("the off data in red. <br>\n");
     217    printf("&nbsp;&nbsp;&nbsp;Please give the numbers with space as separator (e.g. 40004 40022).<br>\n</<li>\n");
     218    printf("<li>0 is not accepted in the ranges fields, please write .0 or 00</li>\n");
     219    printf("<li>Be aware, that plotting timestamps, e.g. fRunStart, and strings, e.g. fComment doesn't work. </li>\n");
     220    printf("</ul>\n</td>\n</tr>\n");
    170221
    171222    /*
    172     printf("<tr><td>\n");
     223    printf("<tr><td colspan='2'>\n");
    173224    $query=GetQuery($tables, $joins, "");
    174     printf("Q: %s</td></tr>", $query);
     225    printf("Q: %s<br>", $query);
     226    if (!empty($_GET["Set"]))
     227    {
     228        $query=GetQuery($tables, $joins, "Set");
     229        printf("Q: %s<br>", $query);
     230    }
     231    if (!empty($_GET["Set2"]))
     232    {
     233        $query=GetQuery($tables, $joins, "Set2");
     234        printf("Q: %s<br>", $query);
     235    }
     236    printf("</td></tr>");
    175237    */
    176238
Note: See TracChangeset for help on using the changeset viewer.