18 , _latitudeFact(new
Fact(0, _latitudeFactName,
FactMetaData::valueTypeDouble, this))
19 , _longitudeFact(new
Fact(0, _longitudeFactName,
FactMetaData::valueTypeDouble, this))
20 , _latitudeDMSFact(new
Fact(0, _latitudeDMSFactName,
FactMetaData::valueTypeString, this))
21 , _longitudeDMSFact(new
Fact(0, _longitudeDMSFactName,
FactMetaData::valueTypeString, this))
23 , _hemisphereFact(new
Fact(0, _hemisphereFactName,
FactMetaData::valueTypeUint8, this))
24 , _eastingFact(new
Fact(0, _eastingFactName,
FactMetaData::valueTypeDouble, this))
25 , _northingFact(new
Fact(0, _northingFactName,
FactMetaData::valueTypeDouble, this))
27 , _offsetEastFact(new
Fact(0, _offsetEastFactName,
FactMetaData::valueTypeDouble, this))
28 , _offsetNorthFact(new
Fact(0, _offsetNorthFactName,
FactMetaData::valueTypeDouble, this))
29 , _offsetUpFact(new
Fact(0, _offsetUpFactName,
FactMetaData::valueTypeDouble, this))
30 , _rotateDegreesCWFact(new
Fact(0, _rotateDegreesCWFactName,
FactMetaData::valueTypeDouble, this))
34 if (_metaDataMap.isEmpty()) {
35 _metaDataMap = FactMetaData::createMapFromJsonFile(QStringLiteral(
":/json/TransformPositionController.FactMetaData.json"), nullptr );
38 _latitudeFact->setMetaData(_metaDataMap[_latitudeFactName]);
39 _longitudeFact->setMetaData(_metaDataMap[_longitudeFactName]);
40 _latitudeDMSFact->setMetaData(_metaDataMap[_latitudeDMSFactName]);
41 _longitudeDMSFact->setMetaData(_metaDataMap[_longitudeDMSFactName]);
42 _zoneFact->setMetaData(_metaDataMap[_zoneFactName]);
43 _hemisphereFact->setMetaData(_metaDataMap[_hemisphereFactName]);
44 _eastingFact->setMetaData(_metaDataMap[_eastingFactName]);
45 _northingFact->setMetaData(_metaDataMap[_northingFactName]);
46 _mgrsFact->setMetaData(_metaDataMap[_mgrsFactName]);
47 _offsetEastFact->setMetaData(_metaDataMap[_offsetEastFactName]);
48 _offsetNorthFact->setMetaData(_metaDataMap[_offsetNorthFactName]);
49 _offsetUpFact->setMetaData(_metaDataMap[_offsetUpFactName]);
50 _rotateDegreesCWFact->setMetaData(_metaDataMap[_rotateDegreesCWFactName]);
81 if (!_coordinate.isValid()) {
85 _latitudeFact->setRawValue(_coordinate.latitude());
86 _longitudeFact->setRawValue(_coordinate.longitude());
93 _zoneFact->setRawValue(
zone);
94 _hemisphereFact->setRawValue(_coordinate.latitude() < 0);
95 _eastingFact->setRawValue(
easting);
96 _northingFact->setRawValue(
northing);
100 if (!
mgrs.isEmpty()) {
101 _mgrsFact->setRawValue(
mgrs);
127 qCDebug(TransformPositionControllerLog) << _eastingFact->rawValue().toDouble() << _northingFact->rawValue().toDouble() << _zoneFact->rawValue().toInt() << (_hemisphereFact->rawValue().toInt() == 1);
128 QGeoCoordinate newCoordinate;
129 if (
QGCGeo::convertUTMToGeo(_eastingFact->rawValue().toDouble(), _northingFact->rawValue().toDouble(), _zoneFact->rawValue().toInt(), _hemisphereFact->rawValue().toInt() == 1, newCoordinate)) {
130 qCDebug(TransformPositionControllerLog) << _eastingFact->rawValue().toDouble() << _northingFact->rawValue().toDouble() << _zoneFact->rawValue().toInt() << (_hemisphereFact->rawValue().toInt() == 1) << newCoordinate;