Skip to content

Commit d65884d

Browse files
committed
added channel-data dirty flag and check
1 parent 8a24235 commit d65884d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

app/x32Types/channel.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ public slots:
6969
QList<QString> *props;
7070
QTimer *refreshTimer;
7171

72+
QBool stateDirty = false;
73+
7274
public:
7375
qint8 getNumber() { return this->number; }
7476

@@ -99,6 +101,8 @@ public slots:
99101

100102
if(address.mid(7, 6) == "config") {
101103
if(address.mid(14, 4) == "name") {
104+
this->stateDirty = true;
105+
102106
QString name = data.getValue(0)->toString();
103107
name.remove('"');
104108
name.remove('"');
@@ -109,6 +113,8 @@ public slots:
109113

110114
if(address.mid(7, 3) == "mix") {
111115
if(address.mid(11,2) == "on") {
116+
this->stateDirty = true;
117+
112118
bool isOn;
113119
QString isOnTmp = data.getValue(0)->toString();
114120

@@ -125,7 +131,10 @@ public slots:
125131
}
126132
}
127133

128-
emit updated(this);
134+
if(this->stateDirty) {
135+
emit updated(this);
136+
this->stateDirty = false;
137+
}
129138

130139
console->removeMessage(data);
131140
}

0 commit comments

Comments
 (0)