summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@ffgraz.net>2013-12-30 12:02:16 +0000
committerChristian Pointner <equinox@ffgraz.net>2013-12-30 12:02:16 +0000
commit7122687b9849911429072de1bf31071b830780c5 (patch)
tree86a0ea41d914ddbb9a41b9b1c2cdcea857ac3b66
parent70b378464945443b234380c5098ec7066bb0b15f (diff)
cleanup
-rw-r--r--data.php56
-rw-r--r--map.js21
2 files changed, 35 insertions, 42 deletions
diff --git a/data.php b/data.php
index 7f59f3f..a41d896 100644
--- a/data.php
+++ b/data.php
@@ -82,16 +82,16 @@ while ($data = $db->getNextObject()) {
// echo $ipnodelocname;
// echo "\n";
$channel="";
- $frequence="";
+ $frequency="";
$dnsname=$ipnodelocname.".".$nodelocname;
if($routerhash[$ip[$dnsname]][4]!=""){
$channel= $routerhash[$ip[$dnsname]][4];
}
if ($routerhash[$ip[$dnsname]][5]!=""){
- $frequence = $routerhash[$ip[$dnsname]][5];
+ $frequency = $routerhash[$ip[$dnsname]][5];
}
- if ($channel!="" or $frequence!=""){
- $data->dnsnames = $dnsname." (Kanal: ".$channel." / ".$frequence." GHz);".$data->dnsnames;
+ if ($channel!="" or $frequency!=""){
+ $data->dnsnames = $dnsname." (Kanal: ".$channel." / ".$frequency." GHz);".$data->dnsnames;
break 2;
}
}
@@ -101,15 +101,15 @@ while ($data = $db->getNextObject()) {
/* foreach($dnsnames[$data->locid] as $dnsname){
if(strpos($data->dnsnames,substr($dnsname,strpos($dnsname,".")))===false){
$channel="";
- $frequence="";
+ $frequency="";
if($routerhash[$ip[$dnsname]][4]!=""){
$channel= $routerhash[$ip[$dnsname]][4];
}
if ($routerhash[$ip[$dnsname]][5]!=""){
- $frequence = $routerhash[$ip[$dnsname]][5];
+ $frequency = $routerhash[$ip[$dnsname]][5];
}
- if ($channel!="" or $frequence!=""){
- $data->dnsnames = $dnsname." (Kanal: ".$channel." / ".$frequence."GHz);".$data->dnsnames;
+ if ($channel!="" or $frequency!=""){
+ $data->dnsnames = $dnsname." (Kanal: ".$channel." / ".$frequency."GHz);".$data->dnsnames;
break;
} else {
$data->dnsnames = $dnsname.";".$data->dnsnames;
@@ -171,7 +171,7 @@ foreach ($lines as $num => $line)
}
if ($routerhash[$ipfromLoc][5]!==""){
- $links[$jot]->frequence = $routerhash[$ipfromLoc][5];
+ $links[$jot]->frequency = $routerhash[$ipfromLoc][5];
}
} else if (array_key_exists($iptoLoc,$routerhash)){
@@ -179,18 +179,18 @@ foreach ($lines as $num => $line)
$links[$jot]->channel = $routerhash[$iptoLoc][4];
}
if ($routerhash[$iptoLoc][5]!==""){
- $links[$jot]->frequence = $routerhash[$iptoLoc][5];
+ $links[$jot]->frequency = $routerhash[$iptoLoc][5];
}
} else{
$links[$jot]->channel ="undef";
- $links[$jot]->frequence ="undef";
+ $links[$jot]->frequency ="undef";
// echo "keine IP\n";
}
if (array_key_exists($ipfromLoc,$routerhash)){
if($conf['acl']['auth']){
if (strpos($links[$jot]->dnsfrom ,$routerhash[$ipfromLoc][1])===false){
- $links[$jot]->dnsfrom =($routerhash[$ipfromLoc][1].' (Kanal: '.$links[$jot]->channel.' / '.$links[$jot]->frequence.' GHz)'.';'.($links[$jot]->dnsfrom));
+ $links[$jot]->dnsfrom =($routerhash[$ipfromLoc][1].' (Kanal: '.$links[$jot]->channel.' / '.$links[$jot]->frequency.' GHz)'.';'.($links[$jot]->dnsfrom));
}
}
@@ -202,7 +202,7 @@ foreach ($lines as $num => $line)
if($conf['acl']['auth']){
if (strpos($links[$jot]->dnsto ,$routerhash[$iptoLoc][1])===false){
// echo "B\n";
- $links[$jot]->dnsto =($routerhash[$iptoLoc][1].' (Kanal: '.$links[$jot]->channel.' / '.$links[$jot]->frequence.' GHz)'.';'.($links[$jot]->dnsto));
+ $links[$jot]->dnsto =($routerhash[$iptoLoc][1].' (Kanal: '.$links[$jot]->channel.' / '.$links[$jot]->frequency.' GHz)'.';'.($links[$jot]->dnsto));
}
}
if ($routerhash[$iptoLoc][3]==$ipfromLoc){
@@ -227,7 +227,7 @@ foreach ($lines as $num => $line)
}
if ($routerhash[$ipfromLoc][5]!==""){
- $links[$jot]->frequence = $routerhash[$ipfromLoc][5];
+ $links[$jot]->frequency = $routerhash[$ipfromLoc][5];
}
} else if (array_key_exists($iptoLoc,$routerhash)){
@@ -235,18 +235,18 @@ foreach ($lines as $num => $line)
$links[$jot]->channel = $routerhash[$iptoLoc][4];
}
if ($routerhash[$iptoLoc][5]!==""){
- $links[$jot]->frequence = $routerhash[$iptoLoc][5];
+ $links[$jot]->frequency = $routerhash[$iptoLoc][5];
}
} else{
$links[$jot]->channel ="undef";
- $links[$jot]->frequence ="undef";
+ $links[$jot]->frequency ="undef";
// echo "keine IP\n";
}
if (array_key_exists($ipfromLoc,$routerhash)){
if($conf['acl']['auth']){
if (strpos($links[$jot]->dnsto,$routerhash[$ipfromLoc][1])===false){
// echo "C\n";
- $links[$jot]->dnsto =($routerhash[$ipfromLoc][1].' (Kanal: '.$links[$jot]->channel.' / '.$links[$jot]->frequence.' GHz)'.';'.($links[$jot]->dnsto));
+ $links[$jot]->dnsto =($routerhash[$ipfromLoc][1].' (Kanal: '.$links[$jot]->channel.' / '.$links[$jot]->frequency.' GHz)'.';'.($links[$jot]->dnsto));
}
}
if ($routerhash[$ipfromLoc][3]==$iptoLoc){
@@ -257,7 +257,7 @@ foreach ($lines as $num => $line)
if($conf['acl']['auth']){
if (strpos($links[$jot]->dnsfrom,$routerhash[$iptoLoc][1])===false){
// echo "D\n";
- $links[$jot]->dnsfrom =($routerhash[$iptoLoc][1].' (Kanal: '.$links[$jot]->channel.' / '.$links[$jot]->frequence.' GHz)'.';'.($links[$jot]->dnsfrom));
+ $links[$jot]->dnsfrom =($routerhash[$iptoLoc][1].' (Kanal: '.$links[$jot]->channel.' / '.$links[$jot]->frequency.' GHz)'.';'.($links[$jot]->dnsfrom));
}
}
if ($routerhash[$iptoLoc][3]==$ipfromLoc){
@@ -280,7 +280,7 @@ foreach ($lines as $num => $line)
}
if ($routerhash[$ipfromLoc][5]!==""){
- $links[$i]->frequence = $routerhash[$ipfromLoc][5];
+ $links[$i]->frequency = $routerhash[$ipfromLoc][5];
}
} else if (array_key_exists($iptoLoc,$routerhash)){
@@ -288,24 +288,24 @@ foreach ($lines as $num => $line)
$links[$i]->channel = $routerhash[$iptoLoc][4];
}
if ($routerhash[$iptoLoc][5]!==""){
- $links[$i]->frequence = $routerhash[$iptoLoc][5];
+ $links[$i]->frequency = $routerhash[$iptoLoc][5];
}
} else{
$links[$i]->channel ="undef";
- $links[$i]->frequence ="undef";
+ $links[$i]->frequency ="undef";
// echo "keine IP\n";
}
$links[$i]->defaultroute = "0";
if($conf['acl']['auth']){
- $links[$i]->dnsfrom =$ipname[$ipfromLoc].'.'.$nodename[$ipfromLoc].'.'.$locname[$ipfromLoc].' (Kanal: '.$links[$i]->channel.' / '.$links[$i]->frequence.' GHz )';
- $links[$i]->dnsto =$ipname[$iptoLoc].'.'.$nodename[$iptoLoc].'.'.$locname[$iptoLoc].' (Kanal: '.$links[$i]->channel.' / '.$links[$i]->frequence.' GHz)';
+ $links[$i]->dnsfrom =$ipname[$ipfromLoc].'.'.$nodename[$ipfromLoc].'.'.$locname[$ipfromLoc].' (Kanal: '.$links[$i]->channel.' / '.$links[$i]->frequency.' GHz )';
+ $links[$i]->dnsto =$ipname[$iptoLoc].'.'.$nodename[$iptoLoc].'.'.$locname[$iptoLoc].' (Kanal: '.$links[$i]->channel.' / '.$links[$i]->frequency.' GHz)';
}
if (array_key_exists($ipfromLoc,$routerhash)){
if($conf['acl']['auth']){
- $links[$i]->dnsfrom =$routerhash[$ipfromLoc][1].' (Kanal: '.$links[$i]->channel.' / '.$links[$i]->frequence.' GHz)';
+ $links[$i]->dnsfrom =$routerhash[$ipfromLoc][1].' (Kanal: '.$links[$i]->channel.' / '.$links[$i]->frequency.' GHz)';
}
if ($routerhash[$ipfromLoc][3]==$iptoLoc){
$links[$i]->defaultroute = "1";
@@ -313,7 +313,7 @@ foreach ($lines as $num => $line)
}
if (array_key_exists($iptoLoc,$routerhash)){
if($conf['acl']['auth']){
- $links[$i]->dnsto =$routerhash[$iptoLoc][1].' (Kanal: '.$links[$i]->channel.' / '.$links[$i]->frequence.' GHz)';
+ $links[$i]->dnsto =$routerhash[$iptoLoc][1].' (Kanal: '.$links[$i]->channel.' / '.$links[$i]->frequency.' GHz)';
}
if ($routerhash[$iptoLoc][3]==$ipfromLoc){
@@ -341,7 +341,7 @@ foreach ($lines as $num => $line)
}
if (($nodename[$ipfromLoc] == "tunnel" && $locations[$locids[$ipfromLoc]]->locname=="housing") ||
($nodename[$iptoLoc] == "tunnel" && $locations[$locids[$iptoLoc]]->locname=="housing" )){
- $links[$i]->frequence ="LAN";
+ $links[$i]->frequency ="LAN";
$links[$i]->channel ="undef";
}
@@ -373,8 +373,8 @@ foreach ($links as $link)
$count[$data1->locid]=true;
$count[$data2->locid]=true;
- printf("\t" . '<link fromid="%s" from="%s" latfrom="%s" lngfrom="%s" toid="%s" to="%s" latto="%s" lngto="%s" value="%s" channel="%s" defaultroute="%s" frequence="%s" dnsfrom="%s" dnsto="%s"/>' . "\n",
- $data1->locid, $data1->locname, $data1->lat,$data1->lng,$data2->locid, $data2->locname, $data2->lat, $data2->lng, $link->label, $link->channel, $link->defaultroute, $link->frequence, $link->dnsfrom,$link->dnsto);
+ printf("\t" . '<link fromid="%s" from="%s" latfrom="%s" lngfrom="%s" toid="%s" to="%s" latto="%s" lngto="%s" value="%s" channel="%s" defaultroute="%s" frequency="%s" dnsfrom="%s" dnsto="%s"/>' . "\n",
+ $data1->locid, $data1->locname, $data1->lat,$data1->lng,$data2->locid, $data2->locname, $data2->lat, $data2->lng, $link->label, $link->channel, $link->defaultroute, $link->frequency, $link->dnsfrom,$link->dnsto);
}
echo "</links>\n";
diff --git a/map.js b/map.js
index a248b1c..7db6e43 100644
--- a/map.js
+++ b/map.js
@@ -5,7 +5,7 @@ var reloadcon = null;
var countboxText = null;
var overlays = new Array();
overlays["newmarker"] = null;
-overlays["ruler"] = new Array();
+//overlays["ruler"] = new Array();
overlays["locations"] = new Array();
overlays["links"] = new Array();
var locations = new Array();
@@ -106,7 +106,6 @@ function drawLocations(xmlData) {
locations[id] = new Location(element[i]);
var marker = new google.maps.Marker({position: locations[id].point, icon: makeIcon(locations[id].state)});
- marker.overlaytype = "location";
marker.locid = id;
google.maps.event.addListener(marker, "click", onLocationClick);
marker.setMap(map);
@@ -183,7 +182,6 @@ function drawLinks(xmlData) {
var line = new google.maps.Polyline({path: [links[id].frompoint, links[id].topoint], strokeColor: makeColor(Math.floor(links[id].value)), strokeWeight: makeWeight(Math.floor(links[id].value))});
line.name = id;
line.state = "Unbekannt";
- line.overlaytype = "link";
line.linkid = id;
line.dnsfrom = element[i].getAttribute("dnsfrom");
line.dnsto = element[i].getAttribute("dnsto");
@@ -263,8 +261,8 @@ function drawLinks(xmlData) {
function showLinkInfo(link, point) {
var html = '<div id="linkbox" class="box" style="border-color: ' + link.color + '">';
- if((links[link.name].frequence !== "undef") && (links[link.name].frequence !== "")){
- html += '<strong>Frequenz:</strong> ' + links[link.name].frequence + '<br />';
+ if((links[link.name].frequency !== "undef") && (links[link.name].frequency !== "")){
+ html += '<strong>Frequenz:</strong> ' + links[link.name].frequency + '<br />';
} else {
html += '<strong>Frequenz:</strong> undef <br />';
}
@@ -305,7 +303,7 @@ function Link(element) {
link.value = parseFloat(element.getAttribute("value"));
link.channel = element.getAttribute("channel");
link.defaultroute = element.getAttribute("defaultroute");
- link.frequence = element.getAttribute("frequence");
+ link.frequency = element.getAttribute("frequency");
return link;
}
@@ -442,9 +440,9 @@ function toggleVisible(element) {
case 'channel11': document.visibleform.elements["2.4channel"].checked=false; elements.overlays = overlays["links"]; elements.select = new Function("id", "return (links[overlays['links'][id].linkid].channel == '11');"); break;
case 'channel12': document.visibleform.elements["2.4channel"].checked=false; elements.overlays = overlays["links"]; elements.select = new Function("id", "return (links[overlays['links'][id].linkid].channel == '12');"); break;
case 'channel13': document.visibleform.elements["2.4channel"].checked=false; elements.overlays = overlays["links"]; elements.select = new Function("id", "return (links[overlays['links'][id].linkid].channel == '13');"); break;
- case 'undef': elements.overlays = overlays["links"]; elements.select = new Function("id", "return (links[overlays['links'][id].linkid].frequence == 'undef');"); break;
- case '2.4channel': elements.overlays = overlays["links"]; elements.select = new Function("id", "return (links[overlays['links'][id].linkid].frequence == '2.4');"); break;
- case '5channel': elements.overlays = overlays["links"]; elements.select = new Function("id", "return (links[overlays['links'][id].linkid].frequence !=='2.4' && links[overlays['links'][id].linkid].frequence !=='undef');"); break;
+ case 'undef': elements.overlays = overlays["links"]; elements.select = new Function("id", "return (links[overlays['links'][id].linkid].frequency == 'undef');"); break;
+ case '2.4channel': elements.overlays = overlays["links"]; elements.select = new Function("id", "return (links[overlays['links'][id].linkid].frequency == '2.4');"); break;
+ case '5channel': elements.overlays = overlays["links"]; elements.select = new Function("id", "return (links[overlays['links'][id].linkid].frequency !=='2.4' && links[overlays['links'][id].linkid].frequency !=='undef');"); break;
}
if(document.visibleform.elements[element].checked) {
@@ -629,7 +627,6 @@ function ReloadControl(controlDiv, map) {
//##// }
//##// distText.data = "Entfernung: " + dist;
//##// var poly = new GPolyline(line,'#FFFF00', 3, 1)
-//##// poly.overlaytype = "ruler";
//##// poly.overlaysubtype = "line";
//##// map.addOverlay(poly);
//##// }
@@ -665,13 +662,9 @@ function ReloadControl(controlDiv, map) {
//##//
//##// var pnt = map.getCenter();
//##// marker1 = new GMarker(pnt, {icon: makeIcon('ruler'), draggable: true});
-//##// marker1.overlaytype = "ruler";
-//##// marker1.overlaysubtype = "marker1";
//##// map.addOverlay(marker1);
//##//
//##// marker2 = new GMarker(pnt, {icon: makeIcon('ruler'), draggable: true});
-//##// marker2.overlaytype = "ruler";
-//##// marker2.overlaysubtype = "marker2";
//##// map.addOverlay(marker2);
//##//
//##// google.maps.event.addListener(marker1, "drag", function() { measure(); });