-
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.
Show all com.victronenergy.battery services in Device List
gui-v2 need two separate battery lists, like this: - In the Overview Battery drilldown, show all batteries from the list in com.victronenergy.system/Batteries - In the Device List, show all battery services under com.victronenergy.battery.* Fix Global.batteries.model to contain all battery services under com.victronenergy.battery.*. The Overview Battery list can be created specifically when requested, when the Battery widget is clicked. Fixes regression from 5ebe756. Fixes #1357
- Loading branch information
Showing
9 changed files
with
138 additions
and
49 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
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) 2023 Victron Energy B.V. | ||
** See LICENSE.txt for license information. | ||
*/ | ||
|
||
import QtQuick | ||
import Victron.VenusOS | ||
|
||
QtObject { | ||
property Instantiator batteryObjects: Instantiator { | ||
model: VeQItemSortTableModel { | ||
dynamicSortFilter: true | ||
filterRole: VeQItemTableModel.UniqueIdRole | ||
filterRegExp: "^dbus/com\.victronenergy\.battery\." | ||
model: Global.dataServiceModel | ||
} | ||
|
||
delegate: Battery { | ||
id: battery | ||
serviceUid: model.uid | ||
|
||
onValidChanged: { | ||
if (!!Global.batteries) { | ||
if (valid) { | ||
Global.batteries.addBattery(battery) | ||
} else { | ||
Global.batteries.removeBattery(battery) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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,31 @@ | ||
/* | ||
** Copyright (C) 2023 Victron Energy B.V. | ||
** See LICENSE.txt for license information. | ||
*/ | ||
|
||
import QtQuick | ||
import Victron.VenusOS | ||
|
||
QtObject { | ||
property Instantiator batteryObjects: Instantiator { | ||
model: VeQItemTableModel { | ||
uids: ["mqtt/battery"] | ||
flags: VeQItemTableModel.AddChildren | VeQItemTableModel.AddNonLeaves | VeQItemTableModel.DontAddItem | ||
} | ||
|
||
delegate: Battery { | ||
id: battery | ||
serviceUid: model.uid | ||
|
||
onValidChanged: { | ||
if (!!Global.batteries) { | ||
if (valid) { | ||
Global.batteries.addBattery(battery) | ||
} else { | ||
Global.batteries.removeBattery(battery) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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