Invert state chart painting

We need to paint from left to right in order to fill in values properly
This commit is contained in:
Michael Zanetti 2023-10-17 23:00:14 +02:00
parent 3e1b4fe7c7
commit 8f5e322239
2 changed files with 8 additions and 8 deletions

View File

@ -411,7 +411,7 @@ void NewLogsModel::logsReply(int commandId, const QVariantMap &data)
QVariantMap values = map.value("values").toMap(); QVariantMap values = map.value("values").toMap();
NewLogEntry *entry = new NewLogEntry(source, timestamp, values, this); NewLogEntry *entry = new NewLogEntry(source, timestamp, values, this);
entries.append(entry); entries.append(entry);
qCDebug(dcLogEngine()) << "Log entry:" << entry->timestamp() << entry->values();;
} }
m_canFetchMore = entries.count() >= m_blockSize; m_canFetchMore = entries.count() >= m_blockSize;

View File

@ -59,7 +59,7 @@ Item {
startTime: new Date(d.startTime.getTime() - d.range * 1.1 * 60000) startTime: new Date(d.startTime.getTime() - d.range * 1.1 * 60000)
endTime: new Date(d.endTime.getTime() + d.range * 1.1 * 60000) endTime: new Date(d.endTime.getTime() + d.range * 1.1 * 60000)
sampleRate: d.sampleRate sampleRate: d.sampleRate
sortOrder: Qt.DescendingOrder sortOrder: Qt.AscendingOrder
Component.onCompleted: { Component.onCompleted: {
// print("****** completed") // print("****** completed")
@ -345,24 +345,24 @@ Item {
borderWidth: 2 borderWidth: 2
lowerSeries: LineSeries { lowerSeries: LineSeries {
id: zeroSeries id: zeroSeries
XYPoint { x: dateTimeAxis.max.getTime(); y: 0 }
XYPoint { x: dateTimeAxis.min.getTime(); y: 0 } XYPoint { x: dateTimeAxis.min.getTime(); y: 0 }
XYPoint { x: dateTimeAxis.max.getTime(); y: 0 }
function ensureValue(timestamp) { function ensureValue(timestamp) {
if (count == 0) { if (count == 0) {
append(timestamp, 0) append(timestamp, 0)
} else if (count == 1) { } else if (count == 1) {
if (timestamp.getTime() < at(0).x) { if (timestamp.getTime() < at(0).x) {
append(timestamp, 0)
} else {
insert(0, timestamp, 0) insert(0, timestamp, 0)
} else {
append(timestamp, 0)
} }
} else { } else {
if (timestamp.getTime() > at(0).x) { if (timestamp.getTime() > at(0).x) {
remove(0)
insert(0, timestamp, 0)
} else if (timestamp.getTime() < at(1).x) {
remove(1) remove(1)
append(timestamp, 0) append(timestamp, 0)
} else if (timestamp.getTime() < at(1).x) {
remove(0)
insert(0, timestamp, 0)
} }
} }
} }