Some visual tweaks in the energy view
This commit is contained in:
parent
db64033d56
commit
908b805606
@ -400,7 +400,6 @@ Page {
|
|||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
alignment: app.landscape ? Qt.Horizontal : Qt.Vertical
|
alignment: app.landscape ? Qt.Horizontal : Qt.Vertical
|
||||||
checked: index === swipeView.currentIndex
|
checked: index === swipeView.currentIndex
|
||||||
height: tabBar.height
|
|
||||||
// anchors.verticalCenter: parent.verticalCenter
|
// anchors.verticalCenter: parent.verticalCenter
|
||||||
text: model.displayName
|
text: model.displayName
|
||||||
iconSource: "../images/" + model.icon + ".svg"
|
iconSource: "../images/" + model.icon + ".svg"
|
||||||
|
|||||||
@ -15,7 +15,7 @@ Item {
|
|||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: blurSource
|
id: blurSource
|
||||||
anchors.fill: toolTip
|
anchors.fill: parent
|
||||||
color: Style.backgroundColor
|
color: Style.backgroundColor
|
||||||
visible: false
|
visible: false
|
||||||
radius: Style.smallCornerRadius
|
radius: Style.smallCornerRadius
|
||||||
@ -27,10 +27,10 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FastBlur {
|
FastBlur {
|
||||||
anchors.fill: toolTip
|
anchors.fill: parent
|
||||||
source: blurSource
|
source: blurSource
|
||||||
radius: 32
|
radius: 32
|
||||||
visible: toolTip.visible
|
visible: root.visible
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|||||||
@ -53,7 +53,9 @@ ChartView {
|
|||||||
consumersSummation += consumers.get(i).stateByName("currentPower").value
|
consumersSummation += consumers.get(i).stateByName("currentPower").value
|
||||||
}
|
}
|
||||||
d.consumersSummation = consumersSummation;
|
d.consumersSummation = consumersSummation;
|
||||||
d.unknownSlice.value = Math.max(0, energyManager.currentPowerConsumption - consumersSummation)
|
if (d.unknownSlice) {
|
||||||
|
d.unknownSlice.value = Math.max(0, energyManager.currentPowerConsumption - consumersSummation)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,8 +86,9 @@ ChartView {
|
|||||||
var consumer = consumers.get(i)
|
var consumer = consumers.get(i)
|
||||||
let currentPowerState = consumer.stateByName("currentPower")
|
let currentPowerState = consumer.stateByName("currentPower")
|
||||||
let slice = consumersBalanceSeries.append(consumer.name, currentPowerState.value)
|
let slice = consumersBalanceSeries.append(consumer.name, currentPowerState.value)
|
||||||
// slice.color = root.colors[i % root.colors.length]
|
|
||||||
slice.color = NymeaUtils.generateColor(Style.generationBaseColor, i)
|
slice.color = NymeaUtils.generateColor(Style.generationBaseColor, i)
|
||||||
|
slice.borderWidth = 0
|
||||||
|
slice.borderColor = slice.color
|
||||||
colorMap[consumer] = slice.color
|
colorMap[consumer] = slice.color
|
||||||
currentPowerState.valueChanged.connect(function() {
|
currentPowerState.valueChanged.connect(function() {
|
||||||
slice.value = currentPowerState.value
|
slice.value = currentPowerState.value
|
||||||
@ -99,6 +102,8 @@ ChartView {
|
|||||||
print("Unknown consumption:", unknownConsumption, "consumption balance", energyManager.currentPowerConsumption, "consumers summation:", consumersSummation)
|
print("Unknown consumption:", unknownConsumption, "consumption balance", energyManager.currentPowerConsumption, "consumers summation:", consumersSummation)
|
||||||
d.unknownSlice = consumersBalanceSeries.append(qsTr("Unknown"), unknownConsumption)
|
d.unknownSlice = consumersBalanceSeries.append(qsTr("Unknown"), unknownConsumption)
|
||||||
d.unknownSlice.color = Style.gray
|
d.unknownSlice.color = Style.gray
|
||||||
|
d.unknownSlice.borderColor = Style.gray
|
||||||
|
d.unknownSlice.borderWidth = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
d.thingsColorMap = colorMap
|
d.thingsColorMap = colorMap
|
||||||
@ -230,6 +235,4 @@ ChartView {
|
|||||||
name: "down"
|
name: "down"
|
||||||
visible: !centerLayout.atYEnd
|
visible: !centerLayout.atYEnd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,22 +38,26 @@ ChartView {
|
|||||||
|
|
||||||
PieSlice {
|
PieSlice {
|
||||||
color: Style.red
|
color: Style.red
|
||||||
borderColor: Style.foregroundColor
|
borderColor: color
|
||||||
|
borderWidth: 0
|
||||||
value: consumptionBalanceSeries.fromGrid
|
value: consumptionBalanceSeries.fromGrid
|
||||||
}
|
}
|
||||||
PieSlice {
|
PieSlice {
|
||||||
color: Style.green
|
color: Style.green
|
||||||
borderColor: Style.foregroundColor
|
borderColor: color
|
||||||
|
borderWidth: 0
|
||||||
value: consumptionBalanceSeries.fromProduction
|
value: consumptionBalanceSeries.fromProduction
|
||||||
}
|
}
|
||||||
PieSlice {
|
PieSlice {
|
||||||
color: Style.orange
|
color: Style.orange
|
||||||
borderColor: Style.foregroundColor
|
borderColor: color
|
||||||
|
borderWidth: 0
|
||||||
value: consumptionBalanceSeries.fromStorage
|
value: consumptionBalanceSeries.fromStorage
|
||||||
}
|
}
|
||||||
PieSlice {
|
PieSlice {
|
||||||
color: Style.backgroundColor
|
color: Style.tileBackgroundColor
|
||||||
borderColor: Style.foregroundColor
|
borderColor: color
|
||||||
|
borderWidth: 0
|
||||||
value: consumptionBalanceSeries.fromGrid == 0 && consumptionBalanceSeries.fromProduction == 0 && consumptionBalanceSeries.fromStorage == 0 ? 1 : 0
|
value: consumptionBalanceSeries.fromGrid == 0 && consumptionBalanceSeries.fromProduction == 0 && consumptionBalanceSeries.fromStorage == 0 ? 1 : 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,22 +37,26 @@ ChartView {
|
|||||||
|
|
||||||
PieSlice {
|
PieSlice {
|
||||||
color: Style.red
|
color: Style.red
|
||||||
borderColor: Style.foregroundColor
|
borderColor: color
|
||||||
|
borderWidth: 0
|
||||||
value: productionBalanceSeries.toConsumers
|
value: productionBalanceSeries.toConsumers
|
||||||
}
|
}
|
||||||
PieSlice {
|
PieSlice {
|
||||||
color: Style.green
|
color: Style.green
|
||||||
borderColor: Style.foregroundColor
|
borderColor: color
|
||||||
|
borderWidth: 0
|
||||||
value: productionBalanceSeries.toGrid
|
value: productionBalanceSeries.toGrid
|
||||||
}
|
}
|
||||||
PieSlice {
|
PieSlice {
|
||||||
color: Style.orange
|
color: Style.orange
|
||||||
borderColor: Style.foregroundColor
|
borderColor: color
|
||||||
|
borderWidth: 0
|
||||||
value: productionBalanceSeries.toStorage
|
value: productionBalanceSeries.toStorage
|
||||||
}
|
}
|
||||||
PieSlice {
|
PieSlice {
|
||||||
color: Style.backgroundColor
|
color: Style.tooltipBackgroundColor
|
||||||
borderColor: Style.foregroundColor
|
borderColor: color
|
||||||
|
borderWidth: 0
|
||||||
value: productionBalanceSeries.toConsumers == 0 && productionBalanceSeries.toGrid == 0 && productionBalanceSeries.toStorage == 0 ? 1 : 0
|
value: productionBalanceSeries.toConsumers == 0 && productionBalanceSeries.toGrid == 0 && productionBalanceSeries.toStorage == 0 ? 1 : 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -100,10 +100,14 @@ StatsBase {
|
|||||||
valueAxis.adjustMax(production)
|
valueAxis.adjustMax(production)
|
||||||
}
|
}
|
||||||
var acquisition = root.energyManager.totalAcquisition - (start ? start.totalAcquisition : 0)
|
var acquisition = root.energyManager.totalAcquisition - (start ? start.totalAcquisition : 0)
|
||||||
d.acquisitionSet.replace(d.acquisitionSet.count - 1, acquisition)
|
if (d.acquisitionSet) {
|
||||||
|
d.acquisitionSet.replace(d.acquisitionSet.count - 1, acquisition)
|
||||||
|
}
|
||||||
valueAxis.adjustMax(acquisition)
|
valueAxis.adjustMax(acquisition)
|
||||||
var ret = root.energyManager.totalReturn - (start ? start.totalReturn : 0)
|
var ret = root.energyManager.totalReturn - (start ? start.totalReturn : 0)
|
||||||
d.returnSet.replace(d.returnSet.count - 1, ret)
|
if (d.returnSet) {
|
||||||
|
d.returnSet.replace(d.returnSet.count - 1, ret)
|
||||||
|
}
|
||||||
valueAxis.adjustMax(ret)
|
valueAxis.adjustMax(ret)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user