29 #include "actuatorcommand.h"
32 #include "manualcontrolsettings.h"
44 Q_ASSERT(m_uavObjectManager);
54 if (m_outputChannel < 0 && channel < ActuatorCommand::CHANNEL_NUMELEM) {
56 m_outputChannel = channel;
57 m_safeValue = safeValue;
59 qDebug() <<
"Starting output for channel " << m_outputChannel <<
"...";
61 ActuatorCommand *actuatorCommand = ActuatorCommand::GetInstance(m_uavObjectManager);
62 Q_ASSERT(actuatorCommand);
63 UAVObject::Metadata metaData = actuatorCommand->getMetadata();
64 m_savedActuatorCommandMetadata = metaData;
67 m_savedActuatorCommandData = actuatorCommand->getData();
75 metaData.gcsTelemetryUpdatePeriod = 100;
78 actuatorCommand->setMetadata(metaData);
79 actuatorCommand->updated();
81 qDebug() <<
"Output for channel " << m_outputChannel <<
" started.";
87 if (m_outputChannel >= 0) {
88 qDebug() <<
"Stopping output for channel " << m_outputChannel <<
"...";
91 qDebug() <<
"Settings output for channel " << m_outputChannel <<
" to " << m_safeValue;
94 ActuatorCommand *actuatorCommand = ActuatorCommand::GetInstance(m_uavObjectManager);
95 Q_ASSERT(actuatorCommand);
97 actuatorCommand->setMetadata(m_savedActuatorCommandMetadata);
98 actuatorCommand->updated();
100 qDebug() <<
"Output for channel " << m_outputChannel <<
" stopped.";
102 m_outputChannel = -1;
108 if (m_outputChannel >= 0) {
110 qDebug() <<
"Setting output value for channel " << m_outputChannel <<
" to " << value
112 ActuatorCommand *actuatorCommand = ActuatorCommand::GetInstance(m_uavObjectManager);
113 Q_ASSERT(actuatorCommand);
114 ActuatorCommand::DataFields
data = actuatorCommand->getData();
115 data.Channel[m_outputChannel] = value;
116 actuatorCommand->setData(data);
static void SetFlightAccess(Metadata &meta, AccessMode mode)
Core plugin system that manages the plugins, their life cycle and their registered objects...
static void SetGcsTelemetryAcked(Metadata &meta, quint8 val)
static void SetFlightTelemetryUpdateMode(Metadata &meta, UpdateMode val)
void setChannelOutputValue(quint16 value)
void startChannelOutput(quint16 channel, quint16 safeValue)
OutputCalibrationUtil(QObject *parent=nullptr)
static void SetGcsTelemetryUpdateMode(Metadata &meta, UpdateMode val)