Changeset 656 for trunk/Modules/TimeMeasure/Main.php
- Timestamp:
- May 16, 2014, 10:44:07 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/TimeMeasure/Main.php
r655 r656 3 3 class PageMeasure extends Page 4 4 { 5 var $Months;6 5 var $GraphTimeRanges; 7 6 var $DefaultVariables; … … 23 22 'Differential' => 0, 24 23 ); 25 $this->Months = array('', 'Leden', 'Únor', 'Březen', 'Duben', 'Květen',26 'Červen', 'Červenec', 'Srpen', 'Září', 'Říjen', 'Listopad', 'Prosinec');27 24 $this->GraphTimeRanges = array 28 25 ( … … 56 53 function EditTime($Time) 57 54 { 55 global $MonthNames; 56 58 57 $Output = '<form style="display: inline;" action="?Operation=SetTime&Time='.$Time.'" method="post">'; 59 58 … … 72 71 // Month selection 73 72 $Output .= '<select name="Month">'; 74 foreach($ this->Months as $Index => $Month)73 foreach($MonthNames as $Index => $Month) 75 74 { 76 75 if($Index == $TimeParts['mon']) $Selected = ' selected="1"'; else $Selected = ''; … … 133 132 } 134 133 135 $Output = ' ';134 $Output = '<div style="text-align: center;">'; 136 135 137 136 if(!array_key_exists('Operation', $_GET)) $_GET['Operation'] = ''; … … 171 170 $Output .= '<a href="?TimeSpecify=1">Přesnější nastavení...</a><br>'; 172 171 } else { 173 $Output .= '<table cellspacing="0" cellpadding="2" border="0">';172 $Output .= '<table style="margin: 10px auto; " cellspacing="0" cellpadding="2" border="0">'; 174 173 $Output .= '<tr><td>Počátek:</td><td>'.$this->EditTime('TimeStart').'</td></tr>'; 175 174 $Output .= '<tr><td>Konec:</td><td>'.$this->EditTime('TimeEnd').'</td></tr>'; … … 198 197 { 199 198 $PrefixMultiplier = new PrefixMultiplier(); 200 $Output = '<table border="1" cellspacing="0" cellpadding="2" style="font-size: small;">'; 201 $Output .= '<tr><th>Měřená veličina</th><th>Poslední hodnota</th><th>Čas posledního měření</th><th>Interpolace</th><th>Poznámky</th>'; 202 if(array_key_exists('Debug', $_GET)) $Output .= '<th>Počet položek</th><th>Čas vykonání</th>'; 203 $Output .= '</tr>'; 204 $Result = $this->Database->select('Measure', '*', 'Enabled=1 ORDER BY Description'); 199 200 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `Measure` WHERE `Enabled`=1'); 201 $DbRow = $DbResult->fetch_row(); 202 $PageList = GetPageList($DbRow[0]); 203 204 $Output = $PageList['Output']; 205 $Output .= '<table class="WideTable" style="font-size: small;">'; 206 207 $TableColumns = array( 208 array('Name' => 'Name', 'Title' => 'Měřená veličina'), 209 array('Name' => 'LastValue', 'Title' => 'Poslední hodnota'), 210 array('Name' => 'LastValueTime', 'Title' => 'Čas posledního měření'), 211 array('Name' => 'Continuous', 'Title' => 'Interpolace'), 212 array('Name' => 'Description', 'Title' => 'Popis'), 213 ); 214 if(array_key_exists('Debug', $_GET)) 215 { 216 $TableColumns[] = array('Name' => 'ItemCount', 'Title' => 'Počet položek'); 217 $TableColumns[] = array('Name' => 'MeasureDuration', 'Title' => 'Čas vykonání'); 218 } 219 $Order = GetOrderTableHeader($TableColumns, 'Name', 0); 220 $Output .= $Order['Output']; 221 222 $Result = $this->Database->select('Measure', '*', '`Enabled`=1 '.$Order['SQL'].$PageList['SQLLimit']); 205 223 while($Measure = $Result->fetch_array()) 206 224 { 207 $DbResult2 = $this->Database->select('MeasureMethod', '*', ' Id='.$Measure['Method']);225 $DbResult2 = $this->Database->select('MeasureMethod', '*', '`Id`='.$Measure['Method']); 208 226 $MeasureMethod = $DbResult2->fetch_assoc(); 209 227 $StopWatchStart = GetMicrotime(); … … 234 252 } 235 253 $Output .= '</table>'; 254 $Output .= $PageList['Output']; 236 255 //echo(time()); 237 256 //print_r(gd_info()); … … 240 259 //ShowPage($Output); 241 260 //echo($PrefixMultiplier->Add('-0.000000071112345', 'B')); 261 $Output .= '</div>'; 242 262 return($Output); 243 263 } 244 264 } 265 266 class PageMeasureAddValue extends Page 267 { 268 function Show() 269 { 270 $this->ClearPage = true; 271 272 $Output = ''; 273 if(!array_key_exists('MeasureId', $_GET)) return('Nebylo zadáno Id měření.'); 274 if(!array_key_exists('Value', $_GET)) return('Nebyla zadána hodnota.'); 275 $Measure = new Measure($this->System); 276 $Measure->Load($_GET['MeasureId']); 277 if(!isset($Measure->Data['Id'])) return('Měření s Id '.$_GET['MeasureId'].' nenalezeno.'); 278 $Measure->AddValue(array('Min' => $_GET['Value'], 'Avg' => $_GET['Value'], 'Max' => $_GET['Value'])); 279 return($Output); 280 } 281 }
Note:
See TracChangeset
for help on using the changeset viewer.