diff --git a/libnymea-app/models/newlogsmodel.cpp b/libnymea-app/models/newlogsmodel.cpp index bdd3dcd0..1d72bce4 100644 --- a/libnymea-app/models/newlogsmodel.cpp +++ b/libnymea-app/models/newlogsmodel.cpp @@ -411,7 +411,7 @@ void NewLogsModel::logsReply(int commandId, const QVariantMap &data) QVariantMap values = map.value("values").toMap(); NewLogEntry *entry = new NewLogEntry(source, timestamp, values, this); entries.append(entry); - + qCDebug(dcLogEngine()) << "Log entry:" << entry->timestamp() << entry->values();; } m_canFetchMore = entries.count() >= m_blockSize; diff --git a/nymea-app/ui/customviews/StateChart.qml b/nymea-app/ui/customviews/StateChart.qml index 6af4cc36..edc18e28 100644 --- a/nymea-app/ui/customviews/StateChart.qml +++ b/nymea-app/ui/customviews/StateChart.qml @@ -59,7 +59,7 @@ Item { startTime: new Date(d.startTime.getTime() - d.range * 1.1 * 60000) endTime: new Date(d.endTime.getTime() + d.range * 1.1 * 60000) sampleRate: d.sampleRate - sortOrder: Qt.DescendingOrder + sortOrder: Qt.AscendingOrder Component.onCompleted: { // print("****** completed") @@ -345,24 +345,24 @@ Item { borderWidth: 2 lowerSeries: LineSeries { id: zeroSeries - XYPoint { x: dateTimeAxis.max.getTime(); y: 0 } XYPoint { x: dateTimeAxis.min.getTime(); y: 0 } + XYPoint { x: dateTimeAxis.max.getTime(); y: 0 } function ensureValue(timestamp) { if (count == 0) { append(timestamp, 0) } else if (count == 1) { if (timestamp.getTime() < at(0).x) { - append(timestamp, 0) - } else { insert(0, timestamp, 0) + } else { + append(timestamp, 0) } } else { if (timestamp.getTime() > at(0).x) { - remove(0) - insert(0, timestamp, 0) - } else if (timestamp.getTime() < at(1).x) { remove(1) append(timestamp, 0) + } else if (timestamp.getTime() < at(1).x) { + remove(0) + insert(0, timestamp, 0) } } }