Changeset 488
- Timestamp:
- Feb 23, 2013, 5:48:30 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/temp/meteo/load_meteo.php
r487 r488 24 24 'AbsHumidity' => 4.6, 25 25 'DewPoint' => 0.4, 26 'Time' => time(), 26 27 ); 27 28 $this->Data = $Data; … … 43 44 'RelHumidity' => trim($XmlData->relhumidity), 44 45 'AbsHumidity' => trim($XmlData->abshumidity), 45 'DewPoint' => trim($XmlData->dewpoint) 46 'DewPoint' => trim($XmlData->dewpoint), 47 'Time' => time(), 46 48 ); 47 49 $this->Data = $Data; … … 50 52 function SaveDataToDb() 51 53 { 52 53 'Time' => TimeToMysqlDateTime(time()), 'MeteoStation' => $this->Data['MeteoStation'],54 55 56 57 58 59 54 $this->Database->insert('MeteoStationMeasure', array( 55 'Time' => TimeToMysqlDateTime(time()), 'MeteoStation' => $this->Data['MeteoStation'], 56 'WindSpeed' => $this->Data['WindSpeed'], 'WindDir' => $this->Data['WindDir'], 57 'WindGust' => $this->Data['WindGust'], 'Pressure' => $this->Data['Pressure'], 58 'SysTemp' => $this->Data['SysTemp'], 'Temperature' => $this->Data['Temperature'], 59 'BarAltitude' => $this->Data['BarAltitude'], 'WindChill' => $this->Data['WindChill'], 60 'RelHumidity' => $this->Data['RelHumidity'], 'AbsHumidity' => $this->Data['AbsHumidity'], 61 'DewPoint' => $this->Data['DewPoint'])); 60 62 } 61 63 … … 73 75 $Image->Line(0, $Height - 1, $Width - 1, $Height - 1); 74 76 $Image->Line(0, 0, $Width - 1, 0); 77 $Image->Line(0, 16, $Width - 1, 16); 75 78 $Image->Font->Color = COLOR_BLACK; 76 $Text = 'Meteostanice'; 77 $Image->TextOut(10 + ($Width - $Image->TextWidth($Text)), 10, $Text); 78 $Image->TextOut(10, 30, $this->Name); 79 $Image->TextOut(10, 50, 'Teplota: '.$this->Data['Temperature'].' °C'); 80 $Image->TextOut(10, 50, 'Pocitová: '.$this->Data['Temperature'].' °C'); 81 $Image->TextOut(10, 70, 'Tlak: '.$this->Data['Pressure'].' hPa'); 79 $Image->TextOut(($Width - $Image->TextWidth($this->Name)) / 2, 13, $this->Name); 80 $Image->Font->Size = 30; 81 $Text = $this->Data['Temperature'].'°C'; 82 $Image->TextOut(($Width - $Image->TextWidth($Text)) / 2, 56, $Text); 83 $Image->Font->Size = 10; 84 $Text = 'Pocitová: '.$this->Data['Temperature'].' °C'; 85 $Image->TextOut(($Width - $Image->TextWidth($Text)) / 2, $Height - 70, $Text); 86 $Text = 'Rel. vlhkost: '.$this->Data['RelHumidity'].' %'; 87 $Image->TextOut(($Width - $Image->TextWidth($Text)) / 2, $Height - 54, $Text); 88 $Text = 'Tlak: '.$this->Data['Pressure'].' hPa'; 89 $Image->TextOut(($Width - $Image->TextWidth($Text)) / 2, $Height - 38, $Text); 90 $Text = 'Vítr: '.$this->Data['WindSpeed'].' m/s'; 91 $Image->TextOut(($Width - $Image->TextWidth($Text)) / 2, $Height - 22, $Text); 92 $Text = date("d.m.Y H:i:s", $this->Data['Time']); 93 $Image->TextOut(($Width - $Image->TextWidth($Text)) / 2, $Height - 6, $Text); 82 94 $Image->SaveToFile($FileName); 83 95 } … … 96 108 $Meteo->URL = 'http://meteo-koliba.zdechov.net/status.xml'; 97 109 $Meteo->Name = 'Koliba Zděchov'; 98 $Meteo->LoadTestData();99 //$Meteo->DownloadData();110 //$Meteo->LoadTestData(); 111 $Meteo->DownloadData(); 100 112 $Meteo->CreateImage('koliba.png'); 101 113
Note:
See TracChangeset
for help on using the changeset viewer.