17 QObject(parent), _label(
label), _paramIndex(paramIndex)
19 for (
int i = 0; i < channelConfigs.
count(); ++i) {
21 QString param = channelConfig->
parameter();
22 QString sparamIndex = QString::number(paramIndex + channelConfig->indexOffset());
23 param.replace(
"${i}", sparamIndex);
29 fact =
new FactBitset(channelConfig, fact, paramIndex + channelConfig->indexOffset());
35 qCDebug(ActuatorOutputsLog) <<
"ActuatorOutputChannel: Param does not exist:" << param;
39 _configInstances->append(instance);
45 _channelConfigs->append(channelConfig);
51 _channels->append(channel);
59 _primaryParam = param;
61 _params->append(param);
66 : QObject(parent), _label(
label), _groupVisibilityCondition(groupVisibilityCondition)
68 if (_groupVisibilityCondition.fact()) {
69 connect(_groupVisibilityCondition.fact(), &Fact::rawValueChanged, this, &ActuatorOutput::groupsVisibleChanged);
75 _subgroups->append(subgroup);
85 _params->append(param);
92 allFunctions.append(fact);
97 bool hasExistingOutputFunction =
false;
100 [[maybe_unused]]
Fact *fact) { hasExistingOutputFunction =
true; });
101 return hasExistingOutputFunction;
106 for (
int subgroupIdx = 0; subgroupIdx < _subgroups->count(); subgroupIdx++) {
108 for (
int channelIdx = 0; channelIdx < subgroup->
channels()->count(); channelIdx++) {
110 for (
int configIdx = 0; configIdx < channel->
configInstances()->count(); configIdx++) {
112 Fact* fact = configInstance->
fact();
114 callback(subgroup, configInstance, fact);
123 for (
int subgroupIdx = 0; subgroupIdx < _subgroups->count(); subgroupIdx++) {
125 for (
int channelIdx = 0; channelIdx < subgroup->
channels()->count(); channelIdx++) {
127 for (
int configIdx = 0; configIdx < channel->
configInstances()->count(); configIdx++) {
129 Fact* fact = configInstance->
fact();
131 callback(channel, fact);
#define QGC_LOGGING_CATEGORY(name, categoryStr)
ActuatorOutputChannel(QObject *parent, const QString &label, int paramIndex, QmlObjectListModel &channelConfigs, ParameterManager *parameterManager, std::function< void(Fact *)> factAddedCb)
const QString & label() const
QmlObjectListModel * configInstances()
void addConfigParam(ConfigParameter *param)
void addChannel(ActuatorOutputChannel *channel)
void addChannelConfig(ChannelConfig *channelConfig)
void channelConfigsChanged()
QmlObjectListModel * channels()
ActuatorOutput(QObject *parent, const QString &label, const Condition &groupVisibilityCondition)
void forEachOutputFunction(std::function< void(ActuatorOutputSubgroup *, ChannelConfigInstance *, Fact *)> callback) const
void getAllChannelFunctions(QList< Fact * > &allFunctions) const
void addConfigParam(ConfigParameter *param)
const QString & label() const
bool hasExistingOutputFunctionParams() const
void forEachChannelFunction(std::function< void(ActuatorOutputChannel *, Fact *)> callback) const
void addSubgroup(ActuatorOutputSubgroup *subgroup)
ChannelConfig * channelConfig() const
const QString & parameter() const
ChannelConfig(QObject *parent, const Parameter ¶m, Function function, const Condition &visibilityCondition)
Function function() const
Function function() const
@ Primary
Primary parameter to configure the group of outputs.
@ Enable
Parameter to enable/disable the outputs.
A Fact is used to hold a single value within the system.
bool parameterExists(int componentId, const QString ¶mName) const
Fact * getParameter(int componentId, const QString ¶mName)
static constexpr int defaultComponentId
Q_INVOKABLE QObject * get(int index)
int count() const override final
@ Bitset
integer displayed as boolean (checkbox), where the index defines the bit
@ BoolTrueIfPositive
Show checkbox for float/int value.