mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
Ref T683, settings for "record gnd.elevation" (based on own aircraft)
This commit is contained in:
committed by
Mat Sutcliffe
parent
71e09b008f
commit
70a350ed66
@@ -125,6 +125,13 @@ namespace BlackMisc
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CSimulatorSettings::setRecordedGndRadius(CLength &radius)
|
||||
{
|
||||
if (radius == m_recordedGndRadius) { return false; }
|
||||
m_recordedGndRadius = radius;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CSimulatorSettings::resetPaths()
|
||||
{
|
||||
m_excludeDirectoryPatterns.clear();
|
||||
@@ -159,6 +166,7 @@ namespace BlackMisc
|
||||
case IndexComIntegration: return CVariant::fromValue(m_comIntegration);
|
||||
case IndexRecordOwnAircraftGnd: return CVariant::fromValue(m_recordGnd);
|
||||
case IndexCGSource: return CVariant::fromValue(m_cgSource);
|
||||
case IndexRecordOwnAircraftGndRadius: return m_recordedGndRadius.propertyByIndex(index.copyFrontRemoved());
|
||||
default: return CValueObject::propertyByIndex(index);
|
||||
}
|
||||
}
|
||||
@@ -174,7 +182,8 @@ namespace BlackMisc
|
||||
case IndexModelExcludeDirectoryPatterns: m_excludeDirectoryPatterns = variant.value<QStringList>(); break;
|
||||
case IndexComIntegration: this->setComIntegrated(variant.toBool()); break;
|
||||
case IndexRecordOwnAircraftGnd: this->setRecordOwnAircraftGnd(variant.toBool()); break;
|
||||
case IndexCGSource: m_cgSource = variant.toInt(); break;
|
||||
case IndexCGSource: m_cgSource = variant.toInt(); break;
|
||||
case IndexRecordOwnAircraftGndRadius: m_recordedGndRadius.setPropertyByIndex(index.copyFrontRemoved(), variant); break;
|
||||
default: CValueObject::setPropertyByIndex(index, variant); break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,11 @@
|
||||
#include "blackmisc/simulation/simulatorinfo.h"
|
||||
#include "blackmisc/network/textmessage.h"
|
||||
#include "blackmisc/weather/weatherscenario.h"
|
||||
#include "blackmisc/pq/length.h"
|
||||
#include "blackmisc/settingscache.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include "blackmisc/propertyindex.h"
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
|
||||
#include <QStringList>
|
||||
#include <QObject>
|
||||
@@ -41,8 +42,9 @@ namespace BlackMisc
|
||||
IndexModelDirectories,
|
||||
IndexModelExcludeDirectoryPatterns,
|
||||
IndexComIntegration, //!< COM unit integration
|
||||
IndexCGSource,
|
||||
IndexRecordOwnAircraftGnd,
|
||||
IndexCGSource
|
||||
IndexRecordOwnAircraftGndRadius
|
||||
};
|
||||
|
||||
//! Where we get the CG (aka vertical offset) from
|
||||
@@ -117,6 +119,12 @@ namespace BlackMisc
|
||||
//! Record GND values (of own aircraft)
|
||||
bool setRecordOwnAircraftGnd(bool record);
|
||||
|
||||
//! Record GND values with radius
|
||||
BlackMisc::PhysicalQuantities::CLength getRecordedGndRadius() const { return m_recordedGndRadius; }
|
||||
|
||||
//! Record GND values with radius
|
||||
bool setRecordedGndRadius(BlackMisc::PhysicalQuantities::CLength &radius);
|
||||
|
||||
//! Reset the paths
|
||||
void resetPaths();
|
||||
|
||||
@@ -139,6 +147,7 @@ namespace BlackMisc
|
||||
bool m_comIntegration = false; //!< COM integration
|
||||
bool m_recordGnd = false; //!< Record GND values (of own aircraft)
|
||||
int m_cgSource = static_cast<int>(CGFromSimulatorFirst); //!< CG source
|
||||
PhysicalQuantities::CLength m_recordedGndRadius { 250.0, PhysicalQuantities::CLengthUnit::m() };
|
||||
|
||||
BLACK_METACLASS(
|
||||
CSimulatorSettings,
|
||||
@@ -146,7 +155,9 @@ namespace BlackMisc
|
||||
BLACK_METAMEMBER(modelDirectories),
|
||||
BLACK_METAMEMBER(excludeDirectoryPatterns),
|
||||
BLACK_METAMEMBER(comIntegration),
|
||||
BLACK_METAMEMBER(cgSource)
|
||||
BLACK_METAMEMBER(cgSource),
|
||||
BLACK_METAMEMBER(recordGnd),
|
||||
BLACK_METAMEMBER(recordedGndRadius)
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user