Commit cf5385cf authored by Valentin Platzgummer's avatar Valentin Platzgummer

update altitude problem inside wima view solved

parent 5303a227
......@@ -458,7 +458,9 @@ int MissionController::insertComplexMissionItemFromKMLOrSHP(QString itemName, QS
int MissionController::_insertComplexMissionItemWorker(ComplexMissionItem* complexItem, int i)
{
int sequenceNumber = _nextSequenceNumber();
bool surveyStyleItem = qobject_cast<SurveyComplexItem*>(complexItem) || qobject_cast<CorridorScanComplexItem*>(complexItem);
bool surveyStyleItem = qobject_cast<SurveyComplexItem*>(complexItem)
|| qobject_cast<CorridorScanComplexItem*>(complexItem)
|| qobject_cast<CircularSurveyComplexItem*>(complexItem);
if (surveyStyleItem) {
bool rollSupported = false;
......@@ -511,7 +513,9 @@ void MissionController::removeMissionItem(int index)
return;
}
bool removeSurveyStyle = _visualItems->value<SurveyComplexItem*>(index) || _visualItems->value<CorridorScanComplexItem*>(index);
bool removeSurveyStyle = _visualItems->value<SurveyComplexItem*>(index)
|| _visualItems->value<CorridorScanComplexItem*>(index)
|| _visualItems->value<CircularSurveyComplexItem*>(index);
VisualMissionItem* item = qobject_cast<VisualMissionItem*>(_visualItems->removeAt(index));
_deinitVisualItem(item);
......@@ -521,7 +525,9 @@ void MissionController::removeMissionItem(int index)
// Determine if the mission still has another survey style item in it
bool foundSurvey = false;
for (int i=1; i<_visualItems->count(); i++) {
if (_visualItems->value<SurveyComplexItem*>(i) || _visualItems->value<CorridorScanComplexItem*>(i)) {
if ( _visualItems->value<SurveyComplexItem*>(i)
|| _visualItems->value<CorridorScanComplexItem*>(i)
|| _visualItems->value<CircularSurveyComplexItem*>(i)) {
foundSurvey = true;
break;
}
......
......@@ -26,6 +26,7 @@
#include "QmlObjectListModel.h"
class SurveyComplexItem;
class CircularSurveyComplexItem;
class SimpleMissionItem;
class MissionController;
#ifdef UNITTEST_BUILD
......@@ -151,6 +152,7 @@ private:
static const char* _jsonParam4Key;
friend class SurveyComplexItem;
friend class CircularSurveyComplexItem;
friend class SimpleMissionItem;
friend class MissionController;
#ifdef UNITTEST_BUILD
......
......@@ -79,12 +79,12 @@ Rectangle {
//onUpdated: rSlider.value = missionItem.deltaR.value
}
QGCLabel { text: qsTr("Delta R") }
FactTextField {
fact: missionItem.deltaR
Layout.fillWidth: true
//onUpdated: rSlider.value = missionItem.deltaR.value
}
// QGCLabel { text: qsTr("Delta R") }
// FactTextField {
// fact: missionItem.deltaR
// Layout.fillWidth: true
// //onUpdated: rSlider.value = missionItem.deltaR.value
// }
/*QGCSlider {
id: rSlider
......@@ -110,7 +110,7 @@ Rectangle {
QGCSlider {
id: angleSlider
minimumValue: 0.3
maximumValue: 5
maximumValue: 10
stepSize: 0.1
tickmarksEnabled: false
Layout.fillWidth: true
......
......@@ -6,7 +6,7 @@
"units": "m",
"min": 0.3,
"decimalPlaces": 1,
"defaultValue": 20
"defaultValue": 20.0
},
{
"name": "DeltaAlpha",
......@@ -15,6 +15,6 @@
"units": "Deg",
"min": 0.3,
"decimalPlaces": 1,
"defaultValue": 5
"defaultValue": 5.0
}
]
......@@ -22,7 +22,6 @@ CircularSurveyComplexItem::CircularSurveyComplexItem(Vehicle *vehicle, bool flyV
, _autoGenerated (false)
{
_editorQml = "qrc:/qml/CircularSurveyItemEditor.qml";
connect(&_deltaR, &Fact::valueChanged, this, &CircularSurveyComplexItem::_setDirty);
connect(&_deltaAlpha, &Fact::valueChanged, this, &CircularSurveyComplexItem::_setDirty);
connect(this, &CircularSurveyComplexItem::refPointChanged, this, &CircularSurveyComplexItem::_setDirty);
......
#include "CircularSurveyComplexItem.h"
const char* CircularSurveyComplexItem::settingsGroup = "Survey";
CircularSurveyComplexItem::CircularSurveyComplexItem(Vehicle *vehicle, bool flyView, const QString &kmlOrShpFile, QObject *parent)
: TransectStyleComplexItem (vehicle, flyView, settingsGroup, parent)
{
}
bool CircularSurveyComplexItem::load(const QJsonObject &complexObject, int sequenceNumber, QString &errorString)
{
return TransectStyleComplexItem::load(complexObject, sequenceNumber, errorString);
}
void CircularSurveyComplexItem::save(QJsonArray &planItems)
{
TransectStyleComplexItem::save(planItems);
}
void CircularSurveyComplexItem::appendMissionItems(QList<MissionItem *> &items, QObject *missionItemParent)
{
}
void CircularSurveyComplexItem::applyNewAltitude(double newAltitude)
{
}
double CircularSurveyComplexItem::timeBetweenShots()
{
return 1;
}
bool CircularSurveyComplexItem::readyForSave() const
{
return false;
}
double CircularSurveyComplexItem::additionalTimeDelay() const
{
return 0;
}
void CircularSurveyComplexItem::_rebuildTransectsPhase1()
{
}
void CircularSurveyComplexItem::_recalcComplexDistance()
{
}
void CircularSurveyComplexItem::_recalcCameraShots()
{
}
/*!
\class CircularSurveyComplexItem
\inmodule Wima
\brief The \c CircularSurveyComplexItem class provides a survey mission item with circular transects around a point of interest.
CircularSurveyComplexItem class provides a survey mission item with circular transects around a point of interest. Within the
\c Wima module it's used to scan a defined area with constant angle (circular transects) to the base station (point of interest).
\sa WimaArea
*/
# pragma once
#include "TransectStyleComplexItem.h"
class CircularSurveyComplexItem :public TransectStyleComplexItem
{
Q_OBJECT
public:
/// @param vehicle Vehicle which this is being contructed for
/// @param flyView true: Created for use in the Fly View, false: Created for use in the Plan View
/// @param kmlOrShpFile Polygon comes from this file, empty for default polygon
CircularSurveyComplexItem(Vehicle* vehicle, bool flyView, const QString& kmlOrShpFile, QObject* parent);
// Overrides from ComplexMissionItem
bool load (const QJsonObject& complexObject, int sequenceNumber, QString& errorString) final;
QString mapVisualQML (void) const final { return QStringLiteral("SpericalSurveyMapVisual.qml"); }
// Overrides from TransectStyleComplexItem
void save (QJsonArray& planItems) final;
bool specifiesCoordinate (void) const final { return true; }
void appendMissionItems (QList<MissionItem*>& items, QObject* missionItemParent) final;
void applyNewAltitude (double newAltitude) final;
double timeBetweenShots (void) final;
// Overrides from VisualMissionionItem
QString commandDescription (void) const final { return tr("Spherical Survey"); }
QString commandName (void) const final { return tr("SphericalSurvey"); }
QString abbreviation (void) const final { return tr("Sph.S"); }
bool readyForSave (void) const final;
double additionalTimeDelay (void) const final;
static const char* settingsGroup;
private slots:
// Overrides from TransectStyleComplexItem
void _rebuildTransectsPhase1 (void) final;
void _recalcComplexDistance (void) final;
void _recalcCameraShots (void) final;
};
......@@ -139,6 +139,19 @@ QGCView {
}
}
Component {
id: applyNewAltitude
QGCViewMessage {
message: qsTr("You have changed the default altitude for mission items. Would you like to apply that altitude to all the items in the current mission?")
function accept() {
hideDialog()
_missionController.applyDefaultMissionAltitude()
}
}
}
Component {
id: activeMissionUploadDialogComponent
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment