2013-03-18 01:15:50 -03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
2016-03-17 02:52:54 -03:00
|
|
|
# set -x
|
|
|
|
|
|
|
|
WP_Auth_Dir="$HOME/WP_Auth"
|
|
|
|
PARAMS_DIR="../buildlogs/Parameters"
|
2013-03-18 01:15:50 -03:00
|
|
|
|
2013-05-29 23:19:50 -03:00
|
|
|
# work from either APM directory or above
|
|
|
|
[ -d ArduPlane ] || cd APM
|
|
|
|
|
2016-03-17 02:52:54 -03:00
|
|
|
# generate combined parameters files for all vehicles:
|
2013-09-11 21:01:30 -03:00
|
|
|
./Tools/autotest/param_metadata/param_parse.py > param.out || {
|
|
|
|
echo "Parameter parsing failed"
|
|
|
|
exit 1
|
|
|
|
}
|
2016-03-17 02:52:54 -03:00
|
|
|
# copy combined parameters files away:
|
|
|
|
/bin/mkdir -p "$PARAMS_DIR"
|
|
|
|
/bin/cp Parameters.wiki Parameters.html *.pdef.xml "$PARAMS_DIR"
|
|
|
|
|
|
|
|
generate_parameters() {
|
|
|
|
VEHICLE="$1"
|
|
|
|
URL="$2"
|
|
|
|
AUTHFILE="$3"
|
|
|
|
POST_TITLE="$4"
|
|
|
|
|
|
|
|
# generate Parameters.html, Parameters.rst etc etc:
|
|
|
|
./Tools/autotest/param_metadata/param_parse.py --vehicle $VEHICLE
|
|
|
|
|
|
|
|
# (Possibly) upload to the Wiki:
|
|
|
|
if [ -d "$WP_Auth_Dir" ]; then
|
|
|
|
if [ "$URL" != "NONE" ]; then
|
|
|
|
AUTHFILEPATH="$WP_Auth_Dir/$AUTHFILE"
|
|
|
|
./Tools/scripts/update_wiki.py --url "$URL" $(cat $AUTHFILEPATH) --post-title="$POST_TITLE" Parameters.html
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# stash some of the results away:
|
|
|
|
VEHICLE_PARAMS_DIR="$PARAMS_DIR/$VEHICLE"
|
|
|
|
mkdir -p "$VEHICLE_PARAMS_DIR"
|
|
|
|
/bin/cp Parameters.wiki Parameters.html *.pdef.xml "$VEHICLE_PARAMS_DIR/"
|
2016-03-17 03:01:15 -03:00
|
|
|
if [ -e "Parameters.rst" ]; then
|
|
|
|
/bin/cp Parameters.rst "$VEHICLE_PARAMS_DIR/"
|
|
|
|
fi
|
2013-05-27 10:06:18 -03:00
|
|
|
}
|
2016-03-17 02:52:54 -03:00
|
|
|
|
|
|
|
|
2016-04-23 17:43:39 -03:00
|
|
|
generate_parameters ArduPlane http://plane.ardupilot.org plane.auth 'Plane Parameters'
|
2016-03-17 02:52:54 -03:00
|
|
|
|
2016-04-23 17:43:39 -03:00
|
|
|
generate_parameters ArduCopter http://copter.ardupilot.org copter.auth 'Copter Parameters'
|
2016-03-17 02:52:54 -03:00
|
|
|
|
2016-04-23 17:43:39 -03:00
|
|
|
generate_parameters APMrover2 http://rover.ardupilot.org rover.auth 'Rover Parameters'
|
2016-03-17 02:52:54 -03:00
|
|
|
|
2017-03-02 00:43:38 -04:00
|
|
|
generate_parameters ArduSub http://sub.ardupilot.org sub.auth 'Sub Parameters'
|
|
|
|
|
2016-03-17 02:52:54 -03:00
|
|
|
generate_parameters AntennaTracker NONE NONE 'AntennaTracker Parameters'
|