*** empty log message ***

This commit is contained in:
Antoine Drouin
2005-08-18 11:38:14 +00:00
parent 56c47f221f
commit 1c758faaf1
4 changed files with 46 additions and 3 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ sub populate {
-callsign => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, ""],
flight_plan => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, undef],
airframe => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, "UNKNOWN"],
airframe => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, undef],
radio => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, "UNKNOWN"],
roll => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, 0.],
@@ -30,6 +30,7 @@ use strict;
use Paparazzi::IvyProtocol;
use Paparazzi::Aircraft;
use Paparazzi::Flightplan;
use Paparazzi::Airframe;
sub populate {
my ($self, $args) = @_;
@@ -93,6 +94,7 @@ sub on_config {
my $ac_id = $fields->{ac_id};
my $ac = $self->get('-aircrafts')->{$ac_id};
delete $fields->{ac_id};
my $fp_url = $fields->{flight_plan};
if (defined $fp_url) {
# print "in AircraftsManager : on_config creating new flight plan\n";
@@ -102,6 +104,11 @@ sub on_config {
# print "##### mission\n".Dumper($fp->get('-mission'));
$fields->{flight_plan} = $fp;
}
my $airframe_url = $fields->{airframe};
if (defined $airframe_url) {
my $af = Paparazzi::Airframe->new(-url => $airframe_url);
$fields->{airframe} = $af;
}
$ac->configure(%{$fields});
}
+36
View File
@@ -0,0 +1,36 @@
package Paparazzi::Airframe;
use Subject;
@ISA = ("Subject");
use strict;
use XML::DOM;
sub populate {
my ($self, $args) = @_;
$self->SUPER::populate($args);
$self->configspec(
-url => [S_NEEDINIT, S_PASSIVE, S_RDONLY, S_OVRWRT, S_NOPRPG, undef],
-name => [S_NOINIT, S_PASSIVE, S_RDONLY, S_OVRWRT, S_NOPRPG, undef],
);
}
sub completeinit {
my $self = shift;
$self->SUPER::completeinit();
my $airframe_url = $self->get('-url');
$airframe_url =~ /file:\/\/(.*)/;
my $filename = $1;
$self->parse_airframe($filename);
}
sub parse_airframe {
my ($self, $filename) = @_;
my $parser = XML::DOM::Parser->new();
my $doc = $parser->parsefile($filename);
my $airframe = $doc->getElementsByTagName('airframe')->[0];
$self->configure( -name => $airframe->getAttribute('name'));
}
1;
+2 -2
View File
@@ -47,8 +47,8 @@ sub populate {
}
# url
# NAV_UTM_EAST0
# NAV_UTM_NORTH0
# nav_utm_east0
# nav_utm_north0
# max_dist_from_home
# waypoints
# |-- name