Added system item support, support for RGBControlers with multiple item backends, and item settings widgets
This commit is contained in:
parent
a761eb4317
commit
5fb9ca7cc0
56 changed files with 635 additions and 210 deletions
|
|
@ -9,7 +9,7 @@ void Microcontroller::relayToggle(int state, int relay)
|
|||
{
|
||||
char buffer[8];
|
||||
int length = sprintf(buffer, "%d \n", relay);
|
||||
state ? write("relay on ") : write("relay off ");
|
||||
state ? write("item on ") : write("item off ");
|
||||
write(buffer, length);
|
||||
}
|
||||
|
||||
|
|
@ -124,7 +124,7 @@ void Microcontroller::setIODevice(QIODevice *port)
|
|||
std::shared_ptr<Relay> Microcontroller::processRelayLine(const QString& buffer)
|
||||
{
|
||||
QStringList bufferList = buffer.split(' ');
|
||||
if(bufferList.size() >= 8 && buffer.startsWith("RELAY NUMBER:"))
|
||||
if(bufferList.size() >= 8 && buffer.startsWith("ITEM NUMBER:"))
|
||||
{
|
||||
QString name;
|
||||
for(int i = 8; i < bufferList.size(); i++) name.append(bufferList[i] + ' ');
|
||||
|
|
@ -139,7 +139,7 @@ std::shared_ptr<Relay> Microcontroller::processRelayLine(const QString& buffer)
|
|||
void Microcontroller::processList(const QString& buffer)
|
||||
{
|
||||
QStringList bufferList = buffer.split(' ');
|
||||
if(bufferList.size() >= 8 && buffer.startsWith("RELAY NUMBER:"))
|
||||
if(bufferList.size() >= 8 && buffer.startsWith("ITEM NUMBER:"))
|
||||
{
|
||||
relayList.push_back(processRelayLine(buffer));
|
||||
}
|
||||
|
|
@ -175,7 +175,7 @@ void Microcontroller::processMicroReturn()
|
|||
listMode = true;
|
||||
relayList.clear();
|
||||
}
|
||||
else if(_buffer.startsWith("RELAY NUMBER:"))processRelayState(_buffer);
|
||||
else if(_buffer.startsWith("ITEM NUMBER:"))processRelayState(_buffer);
|
||||
else if(_buffer.startsWith("SENSOR")) processSensorState(_buffer);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue