public function __construct(&$result_object, &$result_file = null, $extra_attributes = null)
 {
     parent::__construct($result_object, $result_file, $extra_attributes);
     $this->i['iveland_view'] = true;
     $this->i['graph_orientation'] = 'HORIZONTAL';
     $this->i['identifier_height'] = -1;
 }
 public function __construct($rows, $columns, $table_data, &$result_file)
 {
     parent::__construct();
     if ($result_file instanceof pts_result_file) {
         $this->is_multi_way = $result_file->is_multi_way_comparison();
     }
     if ($this->is_multi_way) {
         foreach ($columns as &$c_str) {
             // in multi-way comparisons this will be reported above, so don't need to report it in the column header as it kills space
             if (($c = strpos($c_str, ':')) !== false) {
                 $c_str = substr($c_str, $c + 1);
             }
         }
     }
     $this->rows = $rows;
     $this->columns = $columns;
     $this->table_data = $table_data;
     // Do some calculations
     $this->longest_column_identifier = pts_strings::find_longest_string($this->columns);
     $this->longest_row_identifier = pts_strings::find_longest_string($this->rows);
     $this->i['graph_max_value'] = $this->find_longest_string_in_table_data($this->table_data);
     foreach ($this->columns as &$column) {
         if ($column instanceof pts_graph_ir_value == false) {
             $column = new pts_graph_ir_value($column);
         }
     }
 }
 public function __construct(&$result_object, &$result_file = null, $extra_attributes = null)
 {
     parent::__construct($result_object, $result_file, $extra_attributes);
     $this->i['graph_value_type'] = 'ABSTRACT';
     $this->i['hide_graph_identifiers'] = true;
     $this->graph_data_title = array('PASSED', 'FAILED');
 }
 public static function init_files()
 {
     // Don't let the process run multiple times...
     if (pts_config::$init_process_ran) {
         return false;
     }
     pts_config::$init_process_ran = true;
     // The main PTS user client config
     pts_config::user_config_generate();
     // Generate the graph config
     $json_pre = null;
     if (is_file(PTS_USER_PATH . 'graph-config.json')) {
         $json_pre = file_get_contents(PTS_USER_PATH . 'graph-config.json');
     } else {
         if (PTS_IS_CLIENT && is_file($t = PTS_CORE_STATIC_PATH . 'graph-config-template-' . phodevi::read_property('system', 'vendor-identifier') . '.json')) {
             $json_pre = file_get_contents($t);
         } else {
             if (is_file(PTS_CORE_STATIC_PATH . 'graph-config-template.json')) {
                 $json_pre = file_get_contents(PTS_CORE_STATIC_PATH . 'graph-config-template.json');
             }
         }
     }
     $json_graph = array();
     pts_graph_core::set_default_graph_values($json_graph);
     if ($json_pre != null) {
         $json_pre = json_decode($json_pre, true);
         if (is_array($json_pre)) {
             $json_graph = array_merge($json_graph, $json_pre);
         }
     }
     pts_graph_core::init_graph_config($json_graph);
     file_put_contents(PTS_USER_PATH . 'graph-config.json', pts_arrays::json_encode_pretty_string($json_graph));
 }
 public function __construct(&$result_object, &$result_file = null, $extra_attributes = null)
 {
     parent::__construct($result_object, $result_file, $extra_attributes);
     $this->i['hide_y_title'] = true;
     $this->i['graph_value_type'] = 'ABSTRACT';
     $this->i['hide_graph_identifiers'] = true;
     $this->i['iveland_view'] = true;
 }
 public function __construct(&$result_object, &$result_file = null, $extra_attributes = null)
 {
     parent::__construct($result_object, $result_file, $extra_attributes);
     $this->i['iveland_view'] = true;
     $this->i['graph_orientation'] = 'HORIZONTAL';
     $this->i['identifier_height'] = -1;
     if (isset($extra_attributes['make_identifiers_web_links']) && !empty($extra_attributes['make_identifiers_web_links'])) {
         $this->make_identifiers_web_links = $extra_attributes['make_identifiers_web_links'];
     }
 }
 public function __construct($result_file)
 {
     $result_object = null;
     parent::__construct($result_object, $result_file);
     // System Identifiers
     if ($result_file->is_multi_way_comparison()) {
         // Multi way comparisons currently render the overview graph as blank
         $this->skip_graph = true;
         return;
     }
     $this->system_identifiers = $result_file->get_system_identifiers();
     if (count($this->system_identifiers) < 2) {
         // No point in generating this when there is only one identifier
         $this->skip_graph = true;
         return;
     }
     $result_objects = array();
     $test_titles = array();
     foreach ($result_file->get_result_objects() as $result_object) {
         if ($result_object->test_profile->get_display_format() == 'BAR_GRAPH') {
             array_push($result_objects, $result_object);
             array_push($test_titles, $result_object->test_profile->get_title());
             foreach ($result_object->test_result_buffer->buffer_items as &$buffer_item) {
                 pts_arrays::unique_push($this->graph_identifiers, $buffer_item->get_result_identifier());
             }
         }
     }
     $result_object_count = count($result_objects);
     if ($result_object_count < 3) {
         // No point in generating this if there aren't many tests
         $this->skip_graph = true;
         return;
     }
     $result_file->override_result_objects($result_objects);
     // Test Titles
     $this->i['identifier_size'] = 6.5;
     $this->i['graph_width'] = 1000;
     list($longest_title_width, $longest_title_height) = pts_svg_dom::estimate_text_dimensions(pts_strings::find_longest_string($test_titles), $this->i['identifier_size']);
     $this->i['left_start'] += 20;
     $this->graphs_per_row = min(count($this->system_identifiers) > 10 ? 6 : 10, floor(($this->i['graph_width'] - $this->i['left_start'] - $this->i['left_end_right']) / ($longest_title_width + 4)));
     $this->graph_item_width = floor(($this->i['graph_width'] - $this->i['left_start'] - $this->i['left_end_right']) / $this->graphs_per_row);
     $this->graph_row_count = ceil($result_object_count / $this->graphs_per_row);
     $this->i['top_start'] += 20 + count($this->system_identifiers) / 3 * $this->i['identifier_size'];
     $height = $this->i['top_start'] + $this->graph_row_count * ($this->graph_row_height + 15);
     $this->graph_title = $result_file->get_title();
     $this->graph_y_title = null;
     $this->i['graph_proportion'] = 'HIB';
     $this->i['show_background_lines'] = true;
     $this->update_graph_dimensions($this->i['graph_width'], $height, true);
     $this->result_file = $result_file;
     return true;
 }
 public function __construct(&$result_object, &$result_file = null, $extra_attributes = null)
 {
     parent::__construct($result_object, $result_file, $extra_attributes);
     $this->i['show_graph_key'] = true;
     $this->i['show_background_lines'] = true;
     $this->i['iveland_view'] = true;
     $this->i['min_time'] = 0;
     $this->i['max_time'] = 0;
     $this->i['spread_time'] = 0;
     $this->i['plot_overview_text'] = true;
     $this->i['min_identifier_size'] = 6.5;
     //$this->i['graph_width'] = 1400;
     //$this->i['graph_height'] = 600;
     //$this->update_graph_dimensions(-1, -1, true);
 }
 public function __construct(&$result_file, $intent = false)
 {
     parent::__construct();
     $this->intent = is_array($intent) ? $intent : array(array(), array());
     $this->graph_title = $result_file->get_title();
     $hw = array();
     $sw = array();
     foreach ($result_file->get_systems() as $system) {
         array_push($hw, $system->get_hardware());
         array_push($sw, $system->get_software());
     }
     $hw = pts_result_file_analyzer::system_component_string_to_array(array_shift($hw));
     $sw = pts_result_file_analyzer::system_component_string_to_array(array_shift($sw));
     $this->components = array_merge($hw, $sw);
     pts_render::report_system_notes_to_table($result_file, $this);
 }
 public function __construct($rows, $columns, $table_data)
 {
     parent::__construct();
     $this->rows = $rows;
     $this->columns = $columns;
     $this->table_data = $table_data;
     // Do some calculations
     $this->longest_column_identifier = pts_strings::find_longest_string($this->columns);
     $this->longest_row_identifier = pts_strings::find_longest_string($this->rows);
     foreach ($this->columns as &$column) {
         if ($column instanceof pts_graph_ir_value == false) {
             $column = new pts_graph_ir_value($column);
         }
     }
     $this->column_heading_vertical = false;
 }
 public function __construct(&$result_file)
 {
     $result_object = null;
     parent::__construct($result_object, $result_file);
     // System Identifiers
     $system_identifiers = array();
     foreach ($result_file->get_systems() as $system) {
         array_push($system_identifiers, $system->get_identifier());
     }
     if ($result_file->is_multi_way_comparison() || count($system_identifiers) < 3) {
         // Multi way comparisons currently render the overview graph as blank
         // If there aren't more than 3 tests then don't render
         // If there aren't 3 or more systems then don't render
         $this->skip_graph = true;
         return;
     }
     $result_objects = $result_file->get_result_objects();
     usort($result_objects, array('pts_RadarOverviewGraph', 'cmp_result_object_sort'));
     foreach ($result_objects as &$r) {
         if (count($r->test_result_buffer->get_buffer_items()) != count($system_identifiers)) {
             continue;
         }
         if ($r->normalize_buffer_values() == false) {
             continue;
         }
         $r_multiple = max($r->test_result_buffer->get_values());
         if ($r_multiple > 10 || $r_multiple < 1.02) {
             continue;
         }
         $this->i['graph_max_value'] = max($this->i['graph_max_value'], $r_multiple);
         $r->test_result_buffer->sort_buffer_values(false);
         array_push($this->result_objects, $r);
     }
     if (count($this->result_objects) < 3) {
         // No point in generating this if there aren't many valid tests
         $this->skip_graph = true;
         return;
     }
     $this->i['identifier_size'] = 6.5;
     $this->i['graph_height'] = $this->i['graph_width'];
     $this->i['left_start'] = 35;
     $this->graph_title = $result_file->get_title();
     $this->graph_data_title = $system_identifiers;
     $this->i['iveland_view'] = true;
     $this->result_file =& $result_file;
     return true;
 }
 protected function graph_key_height()
 {
     if (isset($this->i['force_simple_keys']) && $this->i['force_simple_keys']) {
         return parent::graph_key_height();
     }
     if ($this->test_result->test_result_buffer->get_count() < 2 && $this->i['show_graph_key'] == false) {
         return 0;
     }
     $this->i['key_line_height'] = 16;
     $this->i['key_longest_string_width'] = self::text_string_width($this->test_result->test_result_buffer->get_longest_identifier(), self::$c['size']['key']);
     $item_width_spacing = 32;
     $this->i['key_item_width'] = $this->i['key_longest_string_width'] + $this->get_stat_word_width() * 3 + $item_width_spacing;
     // if there are <=4 data sets, then use a single column, otherwise, try and multi-col it
     if ($this->test_result->test_result_buffer->get_count() < 3) {
         $this->i['keys_per_line'] = 1;
     } else {
         $this->i['keys_per_line'] = max(1, floor(($this->i['graph_left_end'] - $this->i['left_start']) / $this->i['key_item_width']));
     }
     $statistics_header_height = $this->getStatisticsHeaderHeight();
     $extra_spacing = 16;
     return ceil($this->test_result->test_result_buffer->get_count() / $this->i['keys_per_line']) * $this->i['key_line_height'] + $statistics_header_height + $extra_spacing;
 }
 public static function init_graph_config($external_config = null)
 {
     self::set_default_graph_values(self::$c);
     if ($external_config && is_array($external_config)) {
         self::$c = array_merge(self::$c, $external_config);
     }
 }