mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-31 12:23:23 +08:00
removed some bugs :)
This commit is contained in:
@@ -83,6 +83,7 @@
|
||||
<session name="soft sim 2">
|
||||
<variable name="ivy_bus" value="127:3333"/>
|
||||
<program name="receive"/>
|
||||
<program name="http server"/>
|
||||
<program name="sim"><arg flag="-a" constant="Thon1"/></program>
|
||||
<program name="sim"><arg flag="-a" constant="Thon2"/></program>
|
||||
<program name="cockpit"></program>
|
||||
|
||||
@@ -361,7 +361,7 @@ sub string_of_time {
|
||||
sub attach_to_aircraft {
|
||||
my ($self) = @_;
|
||||
my @options = ('airframe', 'flight_plan', 'ap_mode', 'rc_status', 'gps_mode', 'contrast_status', 'contrast_value',
|
||||
'flight_time', 'alt', 'target_alt', 'speed', 'climb', 'bat');
|
||||
'flight_time', 'alt', 'target_alt', 'speed', 'climb');#, 'bat');
|
||||
foreach my $option (@options) {
|
||||
$self->get('-aircraft')->attach($self, $option, [\&aircraft_config_changed]);
|
||||
}
|
||||
|
||||
@@ -49,8 +49,9 @@ sub populate {
|
||||
climb => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, 0.],
|
||||
|
||||
ap_mode => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, 'MANUAL'],
|
||||
lat_mode => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, 0.],
|
||||
gaz_mode => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, 0.],
|
||||
lat_mode => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, 0.],
|
||||
horiz_mode => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, 0.],
|
||||
gaz_mode => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, 0.],
|
||||
target_climb => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, 0.],
|
||||
target_alt => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, 0.],
|
||||
target_course=> [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, 0.],
|
||||
@@ -70,13 +71,7 @@ sub populate {
|
||||
target_north => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, 0.],
|
||||
|
||||
-engine_status => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, undef],
|
||||
# throttle => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, 0.],
|
||||
# rpm => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, 0.],
|
||||
# temp => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, 0.],
|
||||
# bat => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, 0.],
|
||||
# amp => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, 0.],
|
||||
# energy => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, 0.],
|
||||
|
||||
x
|
||||
-svsinfo => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, undef],
|
||||
|
||||
rc_status => [S_NOINIT, S_PASSIVE, S_RDWR, S_OVRWRT, S_NOPRPG, 'REALLY_LOST'],
|
||||
|
||||
@@ -21,7 +21,7 @@ sub completeinit {
|
||||
$self->SUPER::completeinit();
|
||||
my $airframe_url = $self->get('-url');
|
||||
my $airframe_xml = LWP::Simple::get($airframe_url);
|
||||
$self->parse_airframe($airframe_xml);
|
||||
$self->parse_airframe($airframe_xml) if defined $airframe_xml;
|
||||
}
|
||||
|
||||
sub parse_airframe {
|
||||
|
||||
@@ -86,7 +86,13 @@ sub completeinit {
|
||||
|
||||
# my $flight_plan_xml ="";
|
||||
my $flight_plan_xml = LWP::Simple::get($flight_plan_url);
|
||||
$self->configure( -compiled_xml => $flight_plan_xml);
|
||||
if (defined $flight_plan_xml) {
|
||||
$self->configure( -compiled_xml => $flight_plan_xml);
|
||||
}
|
||||
else {
|
||||
print "############WARNING : could not get $flight_plan_url\n";
|
||||
return;
|
||||
}
|
||||
|
||||
# print "#######flight_plan_xml\n".$flight_plan_xml;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user