• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mcallegari / qlcplus / 19144422256

06 Nov 2025 05:33PM UTC coverage: 34.256% (-0.1%) from 34.358%
19144422256

push

github

mcallegari
Back to 5.1.0 debug

17718 of 51723 relevant lines covered (34.26%)

19528.23 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

30.38
/plugins/interfaces/qlcioplugin.cpp
1
/*
2
  Q Light Controller Plus
3
  qlcioplugin.cpp
4

5
  Copyright (c) Heikki Junnila
6
                Massimo Callegari
7

8
  Licensed under the Apache License, Version 2.0 (the "License");
9
  you may not use this file except in compliance with the License.
10
  You may obtain a copy of the License at
11

12
      http://www.apache.org/licenses/LICENSE-2.0.txt
13

14
  Unless required by applicable law or agreed to in writing, software
15
  distributed under the License is distributed on an "AS IS" BASIS,
16
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
  See the License for the specific language governing permissions and
18
  limitations under the License.
19
*/
20

21
#include "qlcioplugin.h"
22
#include <QDebug>
23

24
/*************************************************************************
25
 * Outputs
26
 *************************************************************************/
27

28
bool QLCIOPlugin::openOutput(quint32 output, quint32 universe)
×
29
{
30
    Q_UNUSED(universe)
31
    Q_UNUSED(output)
32
    return false;
×
33
}
34

35
void QLCIOPlugin::closeOutput(quint32 output, quint32 universe)
×
36
{
37
    Q_UNUSED(output)
38
    Q_UNUSED(universe)
39
}
×
40

41
QStringList QLCIOPlugin::outputs()
×
42
{
43
    return QStringList();
×
44
}
45

46
QString QLCIOPlugin::outputInfo(quint32 output)
×
47
{
48
    Q_UNUSED(output)
49
    return QString();
×
50
}
51

52
void QLCIOPlugin::writeUniverse(quint32 universe, quint32 output, const QByteArray &data, bool dataChanged)
×
53
{
54
    Q_UNUSED(universe)
55
    Q_UNUSED(output)
56
    Q_UNUSED(data)
57
    Q_UNUSED(dataChanged)
58
}
×
59

60
/*************************************************************************
61
 * Inputs
62
 *************************************************************************/
63

64
bool QLCIOPlugin::openInput(quint32 input, quint32 universe)
×
65
{
66
    Q_UNUSED(input)
67
    Q_UNUSED(universe)
68
    return false;
×
69
}
70

71
void QLCIOPlugin::closeInput(quint32 input, quint32 universe)
×
72
{
73
    Q_UNUSED(input)
74
    Q_UNUSED(universe)
75
}
×
76

77
QStringList QLCIOPlugin::inputs()
×
78
{
79
    return QStringList();
×
80
}
81

82
QString QLCIOPlugin::inputInfo(quint32 input)
×
83
{
84
    Q_UNUSED(input)
85
    return QString();
×
86
}
87

88
void QLCIOPlugin::sendFeedBack(quint32 universe, quint32 inputLine,
×
89
                               quint32 channel, uchar value, const QVariant &params)
90
{
91
    Q_UNUSED(universe)
92
    Q_UNUSED(inputLine)
93
    Q_UNUSED(channel)
94
    Q_UNUSED(value)
95
    Q_UNUSED(params)
96
}
×
97

98
/*************************************************************************
99
 * Configure
100
 *************************************************************************/
101

102
void QLCIOPlugin::configure()
×
103
{
104
}
×
105

106
bool QLCIOPlugin::canConfigure()
×
107
{
108
    return false;
×
109
}
110

111
void QLCIOPlugin::setParameter(quint32 universe, quint32 line,
5✔
112
                               Capability type, QString name, QVariant value)
113
{
114
    if (m_universesMap.contains(universe) == false)
5✔
115
        return;
×
116

117
    qDebug() << "[QLCIOPlugin] set parameter:" << universe << line << name << value;
5✔
118

119
    if (type == Input && m_universesMap[universe].inputLine == line)
5✔
120
        m_universesMap[universe].inputParameters[name] = value;
1✔
121
    else if (type == Output && m_universesMap[universe].outputLine == line)
4✔
122
        m_universesMap[universe].outputParameters[name] = value;
4✔
123
}
124

125
void QLCIOPlugin::unSetParameter(quint32 universe, quint32 line, QLCIOPlugin::Capability type, QString name)
×
126
{
127
    if (m_universesMap.contains(universe) == false)
×
128
        return;
×
129

130
    qDebug() << "[QLCIOPlugin] unset parameter:" << universe << line << name;
×
131

132
    if (type == Input && m_universesMap[universe].inputLine == line)
×
133
    {
134
        if (m_universesMap[universe].inputParameters.contains(name))
×
135
            m_universesMap[universe].inputParameters.take(name);
×
136
    }
137
    else if (type == Output && m_universesMap[universe].outputLine == line)
×
138
    {
139
        if (m_universesMap[universe].outputParameters.contains(name))
×
140
            m_universesMap[universe].outputParameters.take(name);
×
141
    }
142
}
143

144
QMap<QString, QVariant> QLCIOPlugin::getParameters(quint32 universe, quint32 line, QLCIOPlugin::Capability type)
3✔
145
{
146
    if (m_universesMap.contains(universe) == false)
3✔
147
        return QMap<QString, QVariant>();
×
148

149
    if (type == Input && m_universesMap[universe].inputLine == line)
3✔
150
        return m_universesMap[universe].inputParameters;
3✔
151
    else if (type == Output && m_universesMap[universe].outputLine == line)
×
152
        return m_universesMap[universe].outputParameters;
×
153

154
    return QMap<QString, QVariant>();
×
155
}
156

157
void QLCIOPlugin::addToMap(quint32 universe, quint32 line,
28✔
158
                           QLCIOPlugin::Capability type)
159
{
160
    PluginUniverseDescriptor desc;
28✔
161

162
    if (m_universesMap.contains(universe))
28✔
163
        desc = m_universesMap[universe];
22✔
164
    else
165
    {
166
        // initialize a new descriptor
167
        desc.inputLine = UINT_MAX;
6✔
168
        desc.outputLine = UINT_MAX;
6✔
169
    }
170

171
    if (type == Input)
28✔
172
    {
173
        desc.inputLine = line;
9✔
174
    }
175
    else if (type == Output)
19✔
176
    {
177
        desc.outputLine = line;
19✔
178
    }
179
    qDebug() << "[QLCIOPlugin] setting lines:" << universe << desc.inputLine << desc.outputLine;
28✔
180
    m_universesMap[universe] = desc;
28✔
181
}
28✔
182

183
void QLCIOPlugin::removeFromMap(quint32 universe, quint32 line, QLCIOPlugin::Capability type)
×
184
{
185
    if (m_universesMap.contains(universe) == false)
×
186
        return;
×
187

188
    if (type == Input && m_universesMap[universe].inputLine == line)
×
189
    {
190
        m_universesMap[universe].inputLine = UINT_MAX;
×
191
        m_universesMap[universe].inputParameters.clear();
×
192
        return;
×
193
    }
194
    else if (type == Output && m_universesMap[universe].outputLine == line)
×
195
    {
196
        m_universesMap[universe].outputLine = UINT_MAX;
×
197
        m_universesMap[universe].outputParameters.clear();
×
198
        return;
×
199
    }
200

201
    // check if we can completely remove this entry
202
    if (m_universesMap[universe].inputLine == UINT_MAX &&
×
203
        m_universesMap[universe].outputLine == UINT_MAX)
×
204
    {
205
        m_universesMap.take(universe);
×
206
    }
207
}
208

209
/*************************************************************************
210
 * RDM
211
 *************************************************************************/
212

213
bool QLCIOPlugin::sendRDMCommand(quint32 universe, quint32 line, uchar command, QVariantList params)
×
214
{
215
    Q_UNUSED(universe)
216
    Q_UNUSED(line)
217
    Q_UNUSED(command)
218
    Q_UNUSED(params)
219

220
    return false;
×
221
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc