* * @package: The Blackbox Project. * @author: Peter 2013 * @license: GPLv3. * @revision: $Rev$ * **/ ### Prep include 'init.php'; //default styles $styles = array('small', 'medium', 'large'); //new page instance $form = new Form(); $page = new Page('template-setup.html'); //get module/dp definitions $blackbox = new Blackbox(); $modules = $blackbox->modules; //get incoming $do = getpost('do'); $id_view = getpost('id_view'); $id_element = getpost('id_element'); $series = getpost('series'); $name = getpost('name'); $panetag = getpost('panetag'); $position = getpost('position'); $datapt = getpost('datapt'); $resolution = getpost('resolution'); $style = getpost('style'); $width = getpost('width'); $height = getpost('height'); $ymax = getpost('ymax');
//define graph x axis times (24hr time of day) $graphset['start'] = "00"; $graphset['stop'] = "24"; $interval = $SETTINGS['sample_interval']; //minutes ### Read and process the module devices if (date('H') < $graphset['start']) { exit; } if (date('H') >= $graphset['stop']) { exit; } if ((int) date('i') % $interval != 0) { exit; } $blackbox = new Blackbox(); $blackbox->process_modules(); ### Render graphs $query = "\n\tselect * from blackboxelements\n\twhere type='g'\n\torder by panetag,position\n"; $params = array('id_view' => 1); $result = $db->query($query, $params) or codeerror('DB error', __FILE__, __LINE__); while ($row = $db->fetch_row($result)) { $id_element = $row['id_element']; $settings = unserialize($row['settings']); make_graph($id_element, $settings); } //all done print $profiler->dump(); exit; //MAKE_GRAPH function make_graph($id_element, $settings)