-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework trackers and improve SolarDeviceListPage performance
Add SolarInputModel to store the data for each tracker and PV inverter entry in the list. This allows the ListView to just create one list item for each entry in the model, instead of creating complex delegates with Column+Repeater objects when showing multiple trackers for a single solarcharger/multi/inverter service. Also, the model sorts its items to allow the use of ListView sections for creating the column headers. This makes the list load and scroll more quickly, especially when it contains a large number of trackers. Also, remove the tracker list from SolarDevice.qml as it is only required in specific pages, and those can load their own SolarTracker objects when needed. Fixes #1848
- Loading branch information
Showing
10 changed files
with
473 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
** Copyright (C) 2025 Victron Energy B.V. | ||
** See LICENSE.txt for license information. | ||
*/ | ||
|
||
import QtQuick | ||
import Victron.VenusOS | ||
|
||
QtObject { | ||
id: root | ||
|
||
required property SolarDevice device | ||
required property int trackerIndex | ||
|
||
readonly property string name: _name.value ?? "" | ||
readonly property real power: _power.isValid ? _power.value : NaN | ||
readonly property real voltage: _voltage.isValid ? _voltage.value : NaN | ||
readonly property real current: !power || !voltage ? NaN : power / voltage | ||
|
||
// If there is only 1 tracker (e.g. all common MPPTs), the voltage and power are provided via | ||
// /Pv/V and /Yield/Power instead of /Pv/0/V and /Pv/0/P. | ||
readonly property VeQuickItem _voltage: VeQuickItem { | ||
uid: root.device.trackerCount <= 1 ? `${root.device.serviceUid}/Pv/V` : `${root.device.serviceUid}/Pv/${root.trackerIndex}/V` | ||
} | ||
|
||
readonly property VeQuickItem _power: VeQuickItem { | ||
uid: root.device.trackerCount <= 1 ? `${root.device.serviceUid}/Yield/Power` : `${root.device.serviceUid}/Pv/${root.trackerIndex}/P` | ||
} | ||
|
||
readonly property VeQuickItem _name: VeQuickItem { | ||
uid: root.device.trackerCount <= 1 ? "" : `${root.device.serviceUid}/Pv/${root.trackerIndex}/Name` | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.