Changeset 738 for trunk/Modules/Meteostation/Meteostation.php
- Timestamp:
- Apr 14, 2015, 10:20:16 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Meteostation/Meteostation.php
r586 r738 9 9 var $ShortTitle = 'Meteostanice'; 10 10 var $ParentClass = 'PagePortal'; 11 11 12 12 function Show() 13 13 { … … 24 24 var $Period; 25 25 var $URL; 26 26 27 27 function DownloadData() 28 28 { 29 29 $XmlData = simplexml_load_file($this->URL); 30 30 31 $Data = array('MeteoStation' => $this->Id, 31 $Data = array('MeteoStation' => $this->Id, 32 32 'WindSpeed' => trim($XmlData->windspeed), 33 33 'WindDir' => trim($XmlData->winddir), … … 43 43 ); 44 44 $this->Database->insert('MeteoStationMeasure', array( 45 'Time' => TimeToMysqlDateTime(time()), 'MeteoStation' => $Data['MeteoStation'], 46 'WindSpeed' => $Data['WindSpeed'], 'WindDir' => $Data['WindDir'], 47 'WindGust' => $Data['WindGust'], 'Pressure' => $Data['Pressure'], 45 'Time' => TimeToMysqlDateTime(time()), 'MeteoStation' => $Data['MeteoStation'], 46 'WindSpeed' => $Data['WindSpeed'], 'WindDir' => $Data['WindDir'], 47 'WindGust' => $Data['WindGust'], 'Pressure' => $Data['Pressure'], 48 48 'SysTemp' => $Data['SysTemp'], 'Temperature' => $Data['Temperature'], 49 49 'BarAltitude' => $Data['BarAltitude'], 'WindChill' => $Data['WindChill'], … … 52 52 $this->Data = $Data; 53 53 } 54 54 55 55 function CreateImage($FileName) 56 56 { … … 65 65 $Image->SaveToFile($FileName); 66 66 } 67 67 68 68 function LoadFromDb() 69 69 { … … 79 79 { 80 80 var $Data; 81 81 82 82 function __construct($System) 83 83 { … … 90 90 $this->Dependencies = array(); 91 91 } 92 92 93 93 function DownloadAll() 94 94 { … … 98 98 $MeteoStation = new MeteoStation(); 99 99 $MeteoStation->Id = $DbRow['Id']; 100 $MeteoStation->LoadFromDb(); 100 $MeteoStation->LoadFromDb(); 101 101 $MeteoStation->DownloadData(); 102 102 $MeteoStation->CreateImage('cache/'.$DbRow['Id'].'.png'); 103 103 } 104 104 } 105 106 105 106 107 107 function DoInstall() 108 108 { 109 109 } 110 110 111 111 function DoUninstall() 112 { 112 { 113 113 } 114 114 115 115 function DoStart() 116 116 { 117 117 $this->System->RegisterPage('meteo', 'PageMeteo'); 118 } 119 118 } 119 120 120 function DoStop() 121 { 121 { 122 122 } 123 123 }
Note:
See TracChangeset
for help on using the changeset viewer.