mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-28 06:24:10 +01:00
Merged in f5soh/librepilot/LP-601_WP_output_file_locale (pull request #517)
LP-601 Waypoint fixes Approved-by: Lalanne Laurent <f5soh@free.fr> Approved-by: Eric Price <corvuscorax@cybertrench.com>
This commit is contained in:
commit
62e72dbcc7
@ -604,8 +604,7 @@ static uint8_t conditionBelowError()
|
||||
/**
|
||||
* the AboveAltitude measures the flight altitude relative to home position
|
||||
* returns true if above critical altitude
|
||||
* WARNING! Altitudes are always negative (down coordinate)
|
||||
* Parameter 0: altitude in meters (negative!)
|
||||
* Parameter 0: altitude in meters
|
||||
*/
|
||||
static uint8_t conditionAboveAltitude()
|
||||
{
|
||||
@ -613,7 +612,7 @@ static uint8_t conditionAboveAltitude()
|
||||
|
||||
PositionStateGet(&positionState);
|
||||
|
||||
if (positionState.Down <= pathAction.ConditionParameters[0]) {
|
||||
if (-positionState.Down >= pathAction.ConditionParameters[0]) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -41,7 +41,7 @@ ProviderStrings::ProviderStrings()
|
||||
{
|
||||
// Google version strings
|
||||
VersionGoogleMap = "m@301";
|
||||
QString version = "810";
|
||||
QString version = "823";
|
||||
QString envVersion = qgetenv("GCS_GOOGLE_SAT_VERSION").constData();
|
||||
VersionGoogleSatellite = (envVersion.toInt() > version.toInt()) ? envVersion : version;
|
||||
VersionGoogleLabels = "h@301";
|
||||
|
@ -453,27 +453,27 @@ bool flightDataModel::writeToFile(QString fileName)
|
||||
waypoint.appendChild(field);
|
||||
|
||||
field = doc.createElement("field");
|
||||
field.setAttribute("value", obj->latPosition);
|
||||
field.setAttribute("value", QString::number(obj->latPosition, 'f', 16));
|
||||
field.setAttribute("name", "latitude");
|
||||
waypoint.appendChild(field);
|
||||
|
||||
field = doc.createElement("field");
|
||||
field.setAttribute("value", obj->lngPosition);
|
||||
field.setAttribute("value", QString::number(obj->lngPosition, 'f', 16));
|
||||
field.setAttribute("name", "longitude");
|
||||
waypoint.appendChild(field);
|
||||
|
||||
field = doc.createElement("field");
|
||||
field.setAttribute("value", obj->disRelative);
|
||||
field.setAttribute("value", QString::number(obj->disRelative, 'f', 16));
|
||||
field.setAttribute("name", "distance_to_home");
|
||||
waypoint.appendChild(field);
|
||||
|
||||
field = doc.createElement("field");
|
||||
field.setAttribute("value", obj->beaRelative);
|
||||
field.setAttribute("value", QString::number(obj->beaRelative, 'f', 16));
|
||||
field.setAttribute("name", "bearing_from_home");
|
||||
waypoint.appendChild(field);
|
||||
|
||||
field = doc.createElement("field");
|
||||
field.setAttribute("value", obj->altitudeRelative);
|
||||
field.setAttribute("value", QString::number(obj->altitudeRelative, 'f', 16));
|
||||
field.setAttribute("name", "altitude_above_home");
|
||||
waypoint.appendChild(field);
|
||||
|
||||
|
@ -89,6 +89,7 @@ modelMapProxy::overlayType modelMapProxy::overlayTranslate(int type)
|
||||
case MapDataDelegate::MODE_GOTOENDPOINT:
|
||||
case MapDataDelegate::MODE_FOLLOWVECTOR:
|
||||
case MapDataDelegate::MODE_VELOCITY:
|
||||
case MapDataDelegate::MODE_FIXEDATTITUDE:
|
||||
case MapDataDelegate::MODE_LAND:
|
||||
case MapDataDelegate::MODE_AUTOTAKEOFF:
|
||||
case MapDataDelegate::MODE_BRAKE:
|
||||
@ -98,8 +99,12 @@ modelMapProxy::overlayType modelMapProxy::overlayTranslate(int type)
|
||||
return OVERLAY_CIRCLE_RIGHT;
|
||||
|
||||
case MapDataDelegate::MODE_CIRCLELEFT:
|
||||
default:
|
||||
return OVERLAY_CIRCLE_LEFT;
|
||||
|
||||
case MapDataDelegate::MODE_SETACCESSORY:
|
||||
case MapDataDelegate::MODE_DISARMALARM:
|
||||
default:
|
||||
return OVERLAY_NOLINE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
|
||||
using namespace mapcontrol;
|
||||
class modelMapProxy : public QObject {
|
||||
typedef enum { OVERLAY_LINE, OVERLAY_CIRCLE_RIGHT, OVERLAY_CIRCLE_LEFT } overlayType;
|
||||
typedef enum { OVERLAY_LINE, OVERLAY_CIRCLE_RIGHT, OVERLAY_CIRCLE_LEFT, OVERLAY_NOLINE } overlayType;
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit modelMapProxy(QObject *parent, OPMapWidget *map, flightDataModel *model, QItemSelectionModel *selectionModel);
|
||||
|
@ -73,7 +73,7 @@ opmap_edit_waypoint_dialog::opmap_edit_waypoint_dialog(QWidget *parent, QAbstrac
|
||||
mapper->addMapping(ui->dsb_condParam1, flightDataModel::CONDITION_PARAMS0);
|
||||
mapper->addMapping(ui->dsb_condParam2, flightDataModel::CONDITION_PARAMS1);
|
||||
mapper->addMapping(ui->dsb_condParam3, flightDataModel::CONDITION_PARAMS2);
|
||||
mapper->addMapping(ui->dsb_condParam4, flightDataModel::CONDITION_PARAMS0);
|
||||
mapper->addMapping(ui->dsb_condParam4, flightDataModel::CONDITION_PARAMS3);
|
||||
|
||||
mapper->addMapping(ui->cbCommand, flightDataModel::COMMAND);
|
||||
mapper->addMapping(ui->sbJump, flightDataModel::JUMPDESTINATION);
|
||||
@ -290,8 +290,7 @@ void opmap_edit_waypoint_dialog::setupConditionWidgets()
|
||||
ui->condParam1->setEnabled(true);
|
||||
ui->dsb_condParam1->setEnabled(true);
|
||||
ui->condParam1->setText("Altitude (m):");
|
||||
ui->descriptionConditionLabel->setText(tr("<p>The AboveAltitude condition measures the flight altitude relative to home position, returns true if "
|
||||
"above critical altitude.</p><p><b>WARNING!</b> altitudes set here are always <b>negative</b> if above Home. (down coordinate)</p>"));
|
||||
ui->descriptionConditionLabel->setText(tr("<p>The AboveAltitude condition measures the flight altitude relative to home position, returns true if above critical altitude.</p>"));
|
||||
break;
|
||||
case MapDataDelegate::ENDCONDITION_ABOVESPEED:
|
||||
ui->condParam1->setEnabled(true);
|
||||
|
Loading…
Reference in New Issue
Block a user