Changeset 187 for trunk/includes/pages/nodes/nodes_plot_link.php
- Timestamp:
- 12/10/2008 04:45:22 PM (3 years ago)
- File:
-
- 1 edited
-
trunk/includes/pages/nodes/nodes_plot_link.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/pages/nodes/nodes_plot_link.php
r146 r187 59 59 $this->tpl['a_node_elevation'] = $a_node_data['elevation']; 60 60 $this->tpl['b_node_elevation'] = $b_node_data['elevation']; 61 61 62 62 $a_node_total_elevation = $this->tpl['a_node_geo_elevation'] + $this->tpl['a_node_elevation']; 63 63 $b_node_total_elevation = $this->tpl['b_node_geo_elevation'] + $this->tpl['b_node_elevation']; 64 64 65 65 $this->tpl['distance'] = $geocalc->GCDistance($a_node_data['latitude'], $a_node_data['longitude'], $b_node_data['latitude'], $b_node_data['longitude']); 66 $this->tpl['a_node_tilt'] = rad2deg(atan(($b_node_total_elevation - $a_node_total_elevation) / ($this->tpl['distance'] * 1000))); 67 $this->tpl['b_node_tilt'] = rad2deg(atan(($a_node_total_elevation - $b_node_total_elevation) / ($this->tpl['distance'] * 1000))); 66 if ($this->tpl['distance'] != 0) { 67 $this->tpl['a_node_tilt'] = rad2deg(atan(($b_node_total_elevation - $a_node_total_elevation) / ($this->tpl['distance'] * 1000))); 68 $this->tpl['b_node_tilt'] = rad2deg(atan(($a_node_total_elevation - $b_node_total_elevation) / ($this->tpl['distance'] * 1000))); 69 } 70 else { // For links between nodes in the same place but with different elevations (e.g. link between rooftop and floor) 71 // FIXME: plotlink function of geoimage class does not plot anything in that (admitedly rare) case, but perhaps it should(?) 72 $sign = 0; 73 $elev = $b_node_total_elevation - $a_node_total_elevation; 74 if ($elev != 0) $sign = ($elev>0)?1:-1; 75 $this->tpl['a_node_tilt'] = ($elev!=0?$sign:0) * 90; 76 $this->tpl['b_node_tilt'] = -($this->tpl['a_node_tilt']); 77 } 68 78 $this->tpl['distance'] = sqrt( pow($this->tpl['distance'] * 1000, 2) + pow( abs($a_node_total_elevation - $b_node_total_elevation), 2 ) ) / 1000; 69 79 $this->tpl['gearth'] = makelink(array("page" => "gearth", "subpage" => "download", "node" => get('a_node'), "node2" => get('b_node'), "show_p2p" => "1", "show_aps" => "1", "show_clients" => "1", "show_unlinked" => "1", "show_links_p2p" => "1", "show_links_client" => "1")); 70 $this->tpl['frequency'] = (integer) $_POST['frequency'];80 $this->tpl['frequency'] = (integer)(isset($_POST['frequency'])?$_POST['frequency']:2450); 71 81 if ($this->tpl['frequency'] <= 0) $this->tpl['frequency'] = 2450; 72 82 $frequency = $this->tpl['frequency'] * 1000000; … … 74 84 $this->tpl['fsl'] = 20 * log10(4 * pi() * $this->tpl['distance'] * ($frequency / $c)); 75 85 76 $this->tpl['plot_image'] = makelink(array("page" => "nodes", "subpage" => "plot", "a_node" => $this->tpl['a_node'], "b_node" => $this->tpl['b_node'], "frequency" => $ _POST['frequency']));86 $this->tpl['plot_image'] = makelink(array("page" => "nodes", "subpage" => "plot", "a_node" => $this->tpl['a_node'], "b_node" => $this->tpl['b_node'], "frequency" => $this->tpl['frequency'])); 77 87 } 78 88
Note: See TracChangeset
for help on using the changeset viewer.
