Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PPRZ Center] Add @AIRCRAFT placeholder constant. #1217

Merged
merged 2 commits into from
Jul 6, 2015

Conversation

esden
Copy link
Member

@esden esden commented Jun 25, 2015

When you use @aircraft as a constant parameter to a program in your
session, it will be automatically replaced by the name selected in the
A/C dropdown combo box of the Paparazzi Center. This makes it possible
to create generic sessions that start programs which need to know which
aircraft is of interest. For example settings.

This is a possible solution to the #1215 issue.

[edit] Changed the comment here to reflect the final patch, decrease confusion.

@gautierhattenberger
Copy link
Member

I would prefer @AIRCRAFT as keyword to be consistent with other variable parameters in airframe file.

@esden
Copy link
Member Author

esden commented Jun 25, 2015

I agree, I have amended the patch to reflect that. :)

@fvantienen
Copy link
Member

Coul we maybe also add an aircraft id? Since some programs use that (like natnet2ivy).

@esden
Copy link
Member Author

esden commented Jun 26, 2015

Can you point me to an example session that uses natnet2ivy, so I can add it too?

Why is natnet2ivy using the ID, most tools are using the aircraft name instead. Should it not be consistent with the rest of tools and use the name?

@gautierhattenberger
Copy link
Member

I know I'm being annoying :), but we usually use AC_ID to point to the aircraft ID

@fvantienen
Copy link
Member

Because natnet2ivy is written in c and doesnt parse the xml files.
I wanted to be consistent at the start but didn't want to put time in a xml parser in c.

Example session:
natnet2ivy -ac @AC_ID 1

@esden
Copy link
Member Author

esden commented Jun 27, 2015

@gautierhattenberger So we use @aircraft and @AC_ID? That is not very consistent euther... Unless we use @ac and @AC_ID.

@fvantienen This is off topic of this pull request, but I think you should use a small xml parser still, and maybe create a library that implements getters for simple items. I am sure there will be more C programs in the future, so creating facilities for those is a very good idea. (libpprz.so) We use the name of the aircraft throughout the ground system to stay consistent, so we should stay in that habit I think.

@gautierhattenberger
Copy link
Member

It is consistent in the way that we use AIRCRAFT to give the name of plane to the makefile rule in order to compile the airborne code and we use AC_ID to get the numerical id in the airborne code itself.
It is not like this choice is the best, but I don't think changing it is a good idea now.

@flixr
Copy link
Member

flixr commented Jun 29, 2015

I agree with @gautierhattenberger here...
Also wondering how the added session should be named, it is called "setup actuators" now, but it not in the least specific to that. It's just messages and settings...

@esden
Copy link
Member Author

esden commented Jun 29, 2015

Raw Settings?
No GCS Settings?
Raw Messages and Settings?
...

the setup actuators is descriptive in the sense that this is the intended purpose at the moment. It should be superseded by a dedicated script that does not use settings for this but has an easier to use interface for that particular purpose.

@flixr
Copy link
Member

flixr commented Jul 6, 2015

@esden could you plz change AIRCRAFT_ID to AC_ID as @gautierhattenberger suggested?
Also maybe disable the logging in server for the "setup actuators" session?
I would vote to name the session "Messages and Settings" or something like that...

esden added 2 commits July 6, 2015 14:18
When you use @aircraft as a constant parameter to a program in your
session, it will be automatically replaced by the name selected in the
A/C dropdown combo box of the Paparazzi Center. This makes it possible
to create generic sessions that start programs which need to know which
aircraft is of interest. For example settings.

This is a possible solution to the paparazzi#1215 issue.
Refactored the placeholder magic constant code to make it bit prettier
and easier to expand.
@esden
Copy link
Member Author

esden commented Jul 6, 2015

@flixr sorry, I was convinced that I already did fix the AC_ID part. None the less I have made all the suggested changes and pushed an updated patch set.

flixr added a commit that referenced this pull request Jul 6, 2015
[PPRZ Center] Add #AIRCRAFT# placeholder constant.

When you use #AIRCRAFT# as a constant parameter to a program in your
session, it will be automatically replaced by the name selected in the
A/C dropdown combo box of the Paparazzi Center. This makes it possible
to create generic sessions that start programs which need to know which
aircraft is of interest. For example settings.

The #AC_ID# is handled in the same way, but replaces it with the numeric aircraft id.
@flixr flixr merged commit 3518cd6 into paparazzi:master Jul 6, 2015
hooperfly added a commit to hooperfly/paparazzi that referenced this pull request Jul 6, 2015
@esden esden changed the title [PPRZ Center] Add #AIRCRAFT# placeholder constant. [PPRZ Center] Add @AIRCRAFT placeholder constant. Jul 7, 2015
@esden esden deleted the ac_program_parameter branch August 17, 2015 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants