9 , _metaDataMap (
FactMetaData::createMapFromJsonFile(QStringLiteral(
":/json/CameraSpec.FactMetaData.json"), this))
10 , _sensorWidthFact (settingsGroup, _metaDataMap[_sensorWidthName])
11 , _sensorHeightFact (settingsGroup, _metaDataMap[_sensorHeightName])
12 , _imageWidthFact (settingsGroup, _metaDataMap[_imageWidthName])
13 , _imageHeightFact (settingsGroup, _metaDataMap[_imageHeightName])
14 , _focalLengthFact (settingsGroup, _metaDataMap[_focalLengthName])
15 , _landscapeFact (settingsGroup, _metaDataMap[_landscapeName])
16 , _fixedOrientationFact (settingsGroup, _metaDataMap[_fixedOrientationName])
17 , _minTriggerIntervalFact (settingsGroup, _metaDataMap[_minTriggerIntervalName])
19 QQmlEngine::setObjectOwnership(
this, QQmlEngine::CppOwnership);
46 json[_sensorWidthName] = _sensorWidthFact.
rawValue().toDouble();
47 json[_sensorHeightName] = _sensorHeightFact.
rawValue().toDouble();
48 json[_imageWidthName] = _imageWidthFact.
rawValue().toDouble();
49 json[_imageHeightName] = _imageHeightFact.
rawValue().toDouble();
50 json[_focalLengthName] = _focalLengthFact.
rawValue().toDouble();
51 json[_landscapeName] = _landscapeFact.
rawValue().toBool();
52 json[_fixedOrientationName] = _fixedOrientationFact.
rawValue().toBool();
53 json[_minTriggerIntervalName] = _minTriggerIntervalFact.
rawValue().toDouble();
58 QList<JsonParsing::KeyValidateInfo> keyInfoList = {
59 { _sensorWidthName, QJsonValue::Double,
true },
60 { _sensorHeightName, QJsonValue::Double,
true },
61 { _imageWidthName, QJsonValue::Double,
true },
62 { _imageHeightName, QJsonValue::Double,
true },
63 { _focalLengthName, QJsonValue::Double,
true },
64 { _landscapeName, QJsonValue::Bool,
true },
65 { _fixedOrientationName, QJsonValue::Bool,
true },
66 { _minTriggerIntervalName, QJsonValue::Double,
true },
72 _sensorWidthFact.
setRawValue (json[_sensorWidthName].toDouble());
73 _sensorHeightFact.
setRawValue (json[_sensorHeightName].toDouble());
74 _imageWidthFact.
setRawValue (json[_imageWidthName].toInt());
75 _imageHeightFact.
setRawValue (json[_imageHeightName].toInt());
76 _focalLengthFact.
setRawValue (json[_focalLengthName].toDouble());
77 _landscapeFact.
setRawValue (json[_landscapeName].toBool());
78 _fixedOrientationFact.
setRawValue (json[_fixedOrientationName].toBool());
79 _minTriggerIntervalFact.
setRawValue (json[_minTriggerIntervalName].toDouble());
bool validateKeys(const QJsonObject &jsonObject, const QList< KeyValidateInfo > &keyInfo, QString &errorString)
Validates that all required keys are present and that listed keys have the expected type.