1
0
Fork 0

Teaks ...

This commit is contained in:
curt 2001-03-24 02:55:07 +00:00
parent 7ad217b1f1
commit 29f155ae4a
2 changed files with 68 additions and 6 deletions

View file

@ -83,8 +83,8 @@ FGPolygon gen_area(Point3D origin, double angle, const FGPolygon& cart_list) {
for ( i = 0; i < rad_list.contour_size( 0 ); ++i) {
p = rad_list.get_pt( 0, i );
double theta = p.y() + angle;
while ( theta < SG_2PI ) {
theta += SG_2PI;
while ( theta < SGD_2PI ) {
theta += SGD_2PI;
}
p.sety( theta );
rad_list.set_pt( 0, i, p );

View file

@ -12,7 +12,8 @@ while ( <MAGVAR> ) {
($id, $city, $state, $type, $lat, $lon, $magvar, $rawfreq ) =
split( /\t/ );
$freq = sprintf("%.2f", $rawfreq);
$key = $id . $freq . $lat;
$keylat = sprintf("%.2f", $lat);
$key = $id . $freq . $keylat;
if ( $VAR{$key} ne "" ) {
print "warning, dup key = $key\n";
}
@ -37,18 +38,23 @@ while ( <NAV> ) {
if ( $_ eq "[End]\n" ) {
print $_;
print "\n";
exit;
break;
} else {
chomp();
($type, $lat, $lon, $elev, $freq, $range, $dme, $id, $magvar, $name) =
split( /\s+/, $_, 10);
$key = $id . $freq . $lat;
$keylat = sprintf("%.2f", $lat);
$key = $id . $freq . $keylat;
if ( $VAR{$key} eq "" ) {
# print "warning $id $freq not in magvar database\n";
} else {
# print "found $id $freq\n";
($junk, $junk, $junk, $junk, $junk, $junk, $magvar, $junk ) =
($junk, $junk, $junk, $junk, $lat, $lon, $magvar, $junk ) =
split( /\t/, $VAR{$key} );
if ( $lon > -100 && $lon < 100 ) {
$lon =~ s/\-/\-0/;
}
delete $VAR{$key};
}
if ( $lat >= 0 ) {
@ -68,3 +74,59 @@ while ( <NAV> ) {
$id, $magvar, $name );
}
}
close( NAV );
print "Unmatched:\n\n";
foreach $key (sort keys %VAR) {
($id, $city, $state, $basetype, $lat, $lon, $magvar, $rawfreq ) =
split( /\t/, $VAR{$key} );
if ( $basetype =~ m/NDB/ ) {
$type = "N";
} elsif ( $basetype =~ m/VOR/ ) {
$type = "V";
} else {
$type = "X";
}
if ( $basetype =~ m/DME/ || $basetype =~ m/VORTAC/ ) {
$dme = "Y";
} else {
$dme = "N";
}
$name = "$city";
if ( $basetype =~ m/NDB/ ) {
$name .= " NDB";
} elsif ( $basetype =~ m/VORTAC/ ) {
$name .= " VORTAC";
} elsif ( $basetype =~ m/VOR/ ) {
$name .= " VOR";
}
if ( $magvar eq "" ) {
$magvar = "XXX";
}
if ( $lat >= 0 ) {
$prettylat = " " . $lat;
} else {
$prettylat = $lat;
}
if ( $lon >= 0 ) {
$prettylon = " " . $lon;
} else {
$prettylon = $lon;
}
if ( $prettylon > -100 && $prettylon < 100 ) {
$prettylon =~ s/\-/\-0/;
}
$freq = sprintf("%.2f", $rawfreq);
printf("%s %s %s %5d %06.2f %4d %s %-4s %3s %s\n",
$type, $prettylat, $prettylon, $elev, $freq, $range, $dme,
$id, $magvar, $name );
}