12 emit visibleChanged();
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;
66 : QObject(parent), _label(label), _groupVisibilityCondition(groupVisibilityCondition)
68 if (_groupVisibilityCondition.
fact()) {
75 _subgroups->
append(subgroup);
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);
#define QGC_LOGGING_CATEGORY(name, categoryStr)
ActuatorOutputChannel(QObject *parent, const QString &label, int paramIndex, QmlObjectListModel &channelConfigs, ParameterManager *parameterManager, std::function< void(Fact *)> factAddedCb)
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 groupsVisibleChanged()
void forEachOutputFunction(std::function< void(ActuatorOutputSubgroup *, ChannelConfigInstance *, Fact *)> callback) const
void getAllChannelFunctions(QList< Fact * > &allFunctions) const
void addConfigParam(ConfigParameter *param)
bool hasExistingOutputFunctionParams() const
void addSubgroup(ActuatorOutputSubgroup *subgroup)
ChannelConfig * channelConfig() const
const QString & parameter() const
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.
void rawValueChanged(const QVariant &value)
bool parameterExists(int componentId, const QString ¶mName) const
Fact * getParameter(int componentId, const QString ¶mName)
static constexpr int defaultComponentId
void append(QObject *object)
Caller maintains responsibility for object ownership and deletion.
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.