Commit 4dd68530 authored by Gus Grubba's avatar Gus Grubba

Adding support for booleans

Adding some more logging
parent eac9d306
...@@ -671,6 +671,7 @@ QGCCameraControl::_loadSettings(const QDomNodeList nodeList) ...@@ -671,6 +671,7 @@ QGCCameraControl::_loadSettings(const QDomNodeList nodeList)
qWarning() << QStringLiteral("Duplicate fact name:") << factName; qWarning() << QStringLiteral("Duplicate fact name:") << factName;
delete metaData; delete metaData;
} else { } else {
qCDebug(CameraControlLog) << "New parameter:" << factName;
_nameToFactMetaDataMap[factName] = metaData; _nameToFactMetaDataMap[factName] = metaData;
Fact* pFact = new Fact(_compID, factName, factType, this); Fact* pFact = new Fact(_compID, factName, factType, this);
QQmlEngine::setObjectOwnership(pFact, QQmlEngine::CppOwnership); QQmlEngine::setObjectOwnership(pFact, QQmlEngine::CppOwnership);
......
...@@ -37,6 +37,7 @@ QGCCameraParamIO::QGCCameraParamIO(QGCCameraControl *control, Fact* fact, Vehicl ...@@ -37,6 +37,7 @@ QGCCameraParamIO::QGCCameraParamIO(QGCCameraControl *control, Fact* fact, Vehicl
// probably be updated. // probably be updated.
switch (_fact->type()) { switch (_fact->type()) {
case FactMetaData::valueTypeUint8: case FactMetaData::valueTypeUint8:
case FactMetaData::valueTypeBool:
_mavParamType = MAV_PARAM_TYPE_UINT8; _mavParamType = MAV_PARAM_TYPE_UINT8;
break; break;
case FactMetaData::valueTypeInt8: case FactMetaData::valueTypeInt8:
...@@ -55,7 +56,7 @@ QGCCameraParamIO::QGCCameraParamIO(QGCCameraControl *control, Fact* fact, Vehicl ...@@ -55,7 +56,7 @@ QGCCameraParamIO::QGCCameraParamIO(QGCCameraControl *control, Fact* fact, Vehicl
_mavParamType = MAV_PARAM_TYPE_REAL32; _mavParamType = MAV_PARAM_TYPE_REAL32;
break; break;
default: default:
qWarning() << "Unsupported fact type" << _fact->type(); qWarning() << "Unsupported fact type" << _fact->type() << "for" << _fact->name();
// Fall through // Fall through
case FactMetaData::valueTypeInt32: case FactMetaData::valueTypeInt32:
_mavParamType = MAV_PARAM_TYPE_INT32; _mavParamType = MAV_PARAM_TYPE_INT32;
...@@ -119,6 +120,7 @@ QGCCameraParamIO::_sendParameter() ...@@ -119,6 +120,7 @@ QGCCameraParamIO::_sendParameter()
p.param_type = _mavParamType; p.param_type = _mavParamType;
switch (factType) { switch (factType) {
case FactMetaData::valueTypeUint8: case FactMetaData::valueTypeUint8:
case FactMetaData::valueTypeBool:
union_value.param_uint8 = (uint8_t)_fact->rawValue().toUInt(); union_value.param_uint8 = (uint8_t)_fact->rawValue().toUInt();
break; break;
case FactMetaData::valueTypeInt8: case FactMetaData::valueTypeInt8:
...@@ -137,7 +139,7 @@ QGCCameraParamIO::_sendParameter() ...@@ -137,7 +139,7 @@ QGCCameraParamIO::_sendParameter()
union_value.param_float = _fact->rawValue().toFloat(); union_value.param_float = _fact->rawValue().toFloat();
break; break;
default: default:
qCritical() << "Unsupported fact type" << factType; qCritical() << "Unsupported fact type" << factType << "for" << _fact->name();
// fall through // fall through
case FactMetaData::valueTypeInt32: case FactMetaData::valueTypeInt32:
union_value.param_int32 = (int32_t)_fact->rawValue().toInt(); union_value.param_int32 = (int32_t)_fact->rawValue().toInt();
......
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