Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@
</span>
</InfoItem>
<!-- Ladung -->
<InfoItem heading="Geladen:" class="grid-col-4 grid-left">
<InfoItem heading="Geladen:" class="grid-col-4 grid-center">
<FormatWattH :watt-h="chargepoint.dailyYield" />
</InfoItem>
<InfoItem heading="Priorität:" class="grid-col-4 grid-right">
{{ chargepoint.priority }}
</InfoItem>
</div>
</div>
<div v-if="configmode" class="row m-0 mt-0 p-0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
/>
</h3>
<div class="d-flex align-items-center">
<WbBadge v-if="chargepoint.priority > 0" bgcolor="var(--color-menu)"
>Prio: {{ chargepoint.priority }}
</WbBadge>
<WbBadge v-if="chargepoint.isSocConfigured" :bgcolor="batcolor">
<BatterySymbol :soc="soc ?? 0" color="var(--color-bg)" class="me-2" />
<i
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="d-flex float-right justify-content-end align-items-center">
<span
v-if="chargepoint.priority > 0"
class="badge rounded-pill priobadge mx-2"
class="badge rounded-pill priobadge"
bgcolor="var(--color-menu)"
>Prio: {{ chargepoint.priority }}
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,10 @@ function drawGraph(graph: Selection<SVGGElement, unknown, HTMLElement, never>) {
function drawBarGraph(
graph: Selection<SVGGElement, unknown, HTMLElement, never>,
) {
console.log("drawbargraph")
console.log('drawbargraph')
if (animateUsageGraph) {
graph.selectAll('*').remove()

rects = graph
.selectAll('.usagebar')
.data(stackedSeries.value as [number, number][][])
Expand All @@ -339,7 +339,7 @@ function drawBarGraph(
.attr('y', () => yScale.value(0))
.attr('height', 0)
.attr('width', xScaleMonth.value.bandwidth())

rects
.transition()
.duration(duration)
Expand Down Expand Up @@ -382,16 +382,16 @@ function drawBarGraph(
.attr('height', (d) => {
console.log(d[1])
console.log(d[0])
console.log(yScale.value(d[1]/1000))
console.log(yScale.value(d[0]/1000))
console.log(yScale.value(d[1] / 1000))
console.log(yScale.value(d[0] / 1000))
console.log(yScale.value(d[1] / 1000) - yScale.value(d[0] / 1000))
return graphData.graphMode == 'year'
? yScale.value(d[1] / 1000) - yScale.value(d[0] / 1000)
: yScale.value(d[1]) - yScale.value(d[0])
})
})
.attr('width', xScaleMonth.value.bandwidth())
console.log(rects)
}
console.log(rects)
}
}

const autozoom = computed(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export function setGraphData(d: GraphDataItem[]) {
} else {
graphData.data = d
graphData.waitForData = false
console.log("graph data set")
console.log('graph data set')
}
}
// LIVE GRAPH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import {
updateEnergyValues,
} from './model'

import { registry, resetHistoricData } from '@/assets/js/model'
import { createPowerItem, registry, resetHistoricData } from '@/assets/js/model'
import { globalConfig } from '@/assets/js/themeConfig'
import { shDevices } from '../smartHome/model'
import { itemNames } from './model'
import { addCounter, Counter, counters } from '../counterList/model'
import { chargePoints } from '../chargePointList/model'
import { addConsumer, consumers } from '../consumerList/model'
import type { PowerItem } from '@/assets/js/types'
import { PowerItemType, type PowerItem } from '@/assets/js/types'
import { add } from '../mqttViewer/model'
// methods:
let gridCounters: string[] = []
Expand Down Expand Up @@ -140,7 +140,10 @@ function transformRow(currentRow: RawDayGraphDataItem): GraphDataItem {
if (id != 'all') {
currentItem[id] = values.power_imported ?? 0
if (!registry.keys().includes(id)) {
registry.duplicateItem(id, shDevices.get(id)!)
const dev =
shDevices.get(id) ??
createPowerItem(id, PowerItemType.device, 'var(--color-device)')
registry.duplicateItem(id, dev)
}
if (shDevices.get(id)?.countAsHouse) {
shEnergyToBeExtractedFromHouse += values.power_imported
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,11 @@ function transformDatatable(
function transformRow(inputRow: RawDayGraphDataItem): GraphDataItem {
const outputRow: GraphDataItem = {}
// date
console.log('date: '+ inputRow.date)
const d = (graphData.graphMode == 'month') ? timeParse('%Y%m%d')(inputRow.date as string)
: timeParse('%Y%m')(inputRow.date as string)
console.log('date: ' + inputRow.date)
const d =
graphData.graphMode == 'month'
? timeParse('%Y%m%d')(inputRow.date as string)
: timeParse('%Y%m')(inputRow.date as string)
if (d) {
outputRow.date =
graphData.graphMode == 'month' ? d.getDate() : d.getMonth() + 1
Expand Down Expand Up @@ -166,7 +168,7 @@ function transformRow(inputRow: RawDayGraphDataItem): GraphDataItem {
Object.entries(inputRow.cp).forEach(([id, values]) => {
if (id != 'all') {
if (!registry.keys().includes(id)) {
const cp: PowerItem =
const cp: PowerItem =
chargePoints[+id.slice(2)] ??
createPowerItem(
id,
Expand All @@ -190,7 +192,9 @@ function transformRow(inputRow: RawDayGraphDataItem): GraphDataItem {
outputRow.devices = Object.entries(inputRow.sh).reduce<number>(
(sum: number, item) => {
if (!registry.keys().includes(item[0])) {
const dev = shDevices.get(item[0]) ?? createPowerItem (item[0], PowerItemType.device, 'var(--color-devices')
const dev =
shDevices.get(item[0]) ??
createPowerItem(item[0], PowerItemType.device, 'var(--color-devices')
registry.duplicateItem(item[0], dev)
}
if (item[1].energy_imported >= 0) {
Expand All @@ -205,13 +209,13 @@ function transformRow(inputRow: RawDayGraphDataItem): GraphDataItem {
0,
)
// Consumers
Object.entries(inputRow.consumer).forEach(([id,values]) => {
Object.entries(inputRow.consumer).forEach(([id, values]) => {
if (id != 'all') {
if (!registry.keys().includes(id)) {
const cns : PowerItem =
const cns: PowerItem =
consumers.get(+id.slice(8)) ??
createPowerItem(id, PowerItemType.consumer,'var(--color-consumer')
registry.duplicateItem (id,cns)
createPowerItem(id, PowerItemType.consumer, 'var(--color-consumer')
registry.duplicateItem(id, cns)
}
outputRow[id] = values.energy_imported
} else {
Expand All @@ -226,7 +230,9 @@ function transformRow(inputRow: RawDayGraphDataItem): GraphDataItem {
outputRow.counters += values.power_imported ?? 0
outputRow[id] = values.power_imported ?? 0
if (!registry.keys().includes(id)) {
const ctr = counters.get(+id.slice(7)) ?? createPowerItem (id, PowerItemType.counter, 'var(--color-counter)')
const ctr =
counters.get(+id.slice(7)) ??
createPowerItem(id, PowerItemType.counter, 'var(--color-counter)')
registry.duplicateItem(id, ctr)
registry.items.get(id)!.showInGraph = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const devicesToShow = computed(() => {
return b.power - a.power
}),
)
: [registry.getItem('consumers')]
: []
})

const consumersToShow = computed(() => {
Expand Down
Loading