Changeset 19450 for trunk/www


Ignore:
Timestamp:
03/18/19 22:46:48 (6 years ago)
Author:
Daniela Dorner
Message:
fixed bug for two resumes scheduled without suspend inbetween
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/dch/obs_summary.php

    r18884 r19450  
    8080
    8181$suspend = false;
     82$doubleresume=false;
    8283$prev_data = array();
    8384
     
    9495        // Sanity check: There is not much we can do
    9596        if (empty($prev_data) || !$suspend)
     97        {
     98           $doubleresume=true;
    9699           continue;
     100        }
    97101
    98102        $prev_data['fStart'] = $array[$i]['fStart'];
     
    116120    $data .= "'".$array[$i]['fSourceName']."',";
    117121    $data .= fmt($array[$i]['fStart']).",";
    118     $data .= fmt($array[$i+1]['fStart']).",";
     122    // in case two resumes are scheduled without suspend inbetween, the stop of a later observations needs to be used
     123    if ($array[$i+1]['fMeasurementTypeName']=='Resume' && !$suspend)
     124        $data .= fmt($array[$i+2]['fStart']).",";
     125    else
     126        $data .= fmt($array[$i+1]['fStart']).",";
    119127    $data .= "],\n";
    120128
     
    122130    $html2 .= "  <td>".$array[$i]['fStart']."|</td>\n";
    123131    $html2 .= "  <td>".$array[$i]["fSourceName"]."</td>\n";
    124     $html2 .= "  <td>|".$array[$i+1]["fStart"]."|</td>\n";
     132    // in case two resumes are scheduled without suspend inbetween, the stop of a later observations needs to be used
     133    if ($array[$i+1]['fMeasurementTypeName']=='Resume' && !$suspend)
     134        $html2 .= "  <td>|".$array[$i+2]["fStart"]."|</td>\n";
     135    else
     136        $html2 .= "  <td>|".$array[$i+1]["fStart"]."|</td>\n";
    125137    $html2 .= " </tr>\n";
     138    $doubleresume=false;
    126139}
    127140
Note: See TracChangeset for help on using the changeset viewer.