-
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.
Remove Global.dcLoads and DcLoad.qml
Global.dcLoads does nothing except provide a global model, so move this model into AllDevicesModel. DcLoad.qml is not needed as the Device List delegate does not need the individual DcLoad properties. Part of #1400
- Loading branch information
Showing
16 changed files
with
103 additions
and
178 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,40 @@ | ||
/* | ||
** Copyright (C) 2024 Victron Energy B.V. | ||
** See LICENSE.txt for license information. | ||
*/ | ||
|
||
import QtQuick | ||
import Victron.VenusOS | ||
|
||
// Provides a generic DeviceModel for a set of service types. | ||
// | ||
// All services found for the specified types will be added and removed as Device objects. | ||
|
||
DeviceModel { | ||
id: root | ||
|
||
required property var serviceTypes | ||
|
||
readonly property Instantiator _serviceObjects: Instantiator { | ||
model: root.serviceTypes | ||
delegate: Instantiator { | ||
required property string modelData | ||
readonly property ServiceModelLoader modelLoader: ServiceModelLoader { | ||
serviceType: modelData | ||
} | ||
|
||
model: modelLoader.item | ||
delegate: Device { | ||
id: device | ||
serviceUid: model.uid | ||
onValidChanged: { | ||
if (valid) { | ||
root.addDevice(device) | ||
} else { | ||
root.removeDevice(device.serviceUid) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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,32 @@ | ||
/* | ||
** Copyright (C) 2024 Victron Energy B.V. | ||
** See LICENSE.txt for license information. | ||
*/ | ||
|
||
import QtQuick | ||
import Victron.VenusOS | ||
|
||
Loader { | ||
id: root | ||
|
||
required property string serviceType | ||
|
||
sourceComponent: BackendConnection.type === BackendConnection.MqttSource ? _mqttModelComponent | ||
: _dbusOrMockModelComponent | ||
|
||
readonly property Component _dbusOrMockModelComponent: Component { | ||
VeQItemSortTableModel { | ||
dynamicSortFilter: true | ||
filterRole: VeQItemTableModel.UniqueIdRole | ||
filterRegExp: "^%1/com\.victronenergy\.%2\.".arg(BackendConnection.uidPrefix()).arg(root.serviceType) | ||
model: Global.dataServiceModel | ||
} | ||
} | ||
|
||
readonly property Component _mqttModelComponent: Component { | ||
VeQItemTableModel { | ||
uids: [ "mqtt/" + root.serviceType ] | ||
flags: VeQItemTableModel.AddChildren | VeQItemTableModel.AddNonLeaves | VeQItemTableModel.DontAddItem | ||
} | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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.