Changeset 45 for trunk/Application/View


Ignore:
Timestamp:
Nov 24, 2009, 6:01:08 PM (15 years ago)
Author:
george
Message:
  • Přidáno: Kontrolér pro přidávání nových hodnot.
  • Opraveno: Informace o použité jednotce načítat z tabulky MeasureMethod.
Location:
trunk/Application/View
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/View/Graph.php

    r43 r45  
    3737    $Measure->Differential = $this->Config['Application']['DefaultVariables']['Differential'];
    3838    $Measure->Debug = $Debug;
     39    $DbResult2 = $this->Database->select('MeasureMethod', '*', 'Id='.$Measure->Data['Method']);
     40    $MeasureMethod = $DbResult2->fetch_assoc();
    3941
    4042    $FontSize = $this->Config['Application']['FontSize'];
     
    177179        $Y = $Height - 1 - ($VerticalLinesDistance * $I);
    178180        //$Y = $Height - 1 - ($VerticalLinesDistance * $I / ($MaxValue - $MinValue) * $this->Config['Application']['ValueToImageHeigthCoefficient'] * $Height);
    179         $Text = $this->System->AddPrefixMultipliers(round(($I * $VerticalLinesDistance / $Height / $this->Config['Application']['ValueToImageHeigthCoefficient'] * ($MaxValue - $MinValue) + $MinValue)), $Measure->Data['Unit'], 3);
     181        $Text = $this->System->AddPrefixMultipliers(round(($I * $VerticalLinesDistance / $Height / $this->Config['Application']['ValueToImageHeigthCoefficient'] * ($MaxValue - $MinValue) + $MinValue)), $MeasureMethod['Unit'], 3);
    180182        $BoundBox = imagettfbbox($FontSize, 0, $FontFile, $Text);
    181183        if(($Y - ($BoundBox[5] - $BoundBox[1]) / 2) > 10)
     
    185187
    186188      $Left = $Width - 10;
    187       $Text = '    Max. '.$this->System->AddPrefixMultipliers($MaxValue, $Measure->Data['Unit']);
     189      $Text = '    Max. '.$this->System->AddPrefixMultipliers($MaxValue, $MeasureMethod['Unit']);
    188190      $BoundingBox = imagettfbbox($FontSize, 0, $FontFile, $Text);
    189191      $Left -= ($BoundingBox[2] - $BoundingBox[0]);
    190192      imagettftext($Image, $FontSize, 0, $Left, 14, $Red, $FontFile, $Text);
    191193
    192       $Text = '    Avg.  '.$this->System->AddPrefixMultipliers($AvgValue, $Measure->Data['Unit']);
     194      $Text = '    Avg.  '.$this->System->AddPrefixMultipliers($AvgValue, $MeasureMethod['Unit']);
    193195      $BoundingBox = imagettfbbox($FontSize, 0, $FontFile, $Text);
    194196      $Left -= ($BoundingBox[2] - $BoundingBox[0]);
    195197      imagettftext($Image, $FontSize, 0, $Left, 14, $Green, $FontFile, $Text);
    196198
    197       $Text = '    Min.  '.$this->System->AddPrefixMultipliers($MinValue, $Measure->Data['Unit']);
     199      $Text = '    Min.  '.$this->System->AddPrefixMultipliers($MinValue, $MeasureMethod['Unit']);
    198200      $BoundingBox = imagettfbbox($FontSize, 0, $FontFile, $Text);
    199201      $Left -= ($BoundingBox[2] - $BoundingBox[0]);
  • trunk/Application/View/Main.php

    r44 r45  
    180180    $Output .= '</tr>';
    181181    $Result = $this->Database->select('Measure', '*', 'Enabled=1 ORDER BY Description');
    182     //echo($Database->error);
    183 
    184182    while($Measure = $Result->fetch_array())
    185183    {
     184      $DbResult2 = $this->Database->select('MeasureMethod', '*', 'Id='.$Measure['Method']);
     185      $MeasureMethod = $DbResult2->fetch_assoc();
    186186      $StopWatchStart = $this->System->GetMicrotime();
    187187      if(array_key_exists('Debug', $_GET))
     
    196196        $Row = $Result2->fetch_array();
    197197        $LastMeasureTime = date('j.n.Y G:i:s', $this->Database->MysqlDateTimeToTime($Row['Time']));
    198         $LastMeasureValue = $this->System->AddPrefixMultipliers($Row['Avg'], $Measure['Unit']);
     198        $LastMeasureValue = $this->System->AddPrefixMultipliers($Row['Avg'], $MeasureMethod['Unit']);
    199199      } else
    200200      {
Note: See TracChangeset for help on using the changeset viewer.