Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Commit

Permalink
Make it easier to see the CoPs
Browse files Browse the repository at this point in the history
  • Loading branch information
MyForest committed Mar 1, 2020
1 parent 2e5911a commit 1f51fee
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Lib/charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ function createCoPFeed(inputFeedHistory, outputFeedHistory) {
})
}

function createClientSideCoPFeed(inputConfigKey, outputConfigKey, configKey) {
function createClientSideCoPFeed(inputConfigKey, outputConfigKey, configKey, color) {

if (chartSeriesByConfigKey[inputConfigKey] == null || chartSeriesByConfigKey[outputConfigKey] == null) return

const copFeedHistory = createCoPFeed(chartSeriesByConfigKey[inputConfigKey].data, chartSeriesByConfigKey[outputConfigKey].data)

chartSeriesByConfigKey[configKey] = {
color,
lines: { fill: true },
data: copFeedHistory,
"label": configKey,
"scale": 100,
Expand Down Expand Up @@ -96,7 +98,7 @@ function createClientSideNominalEfficiencyFeeds(outsideTemperatureConfigKey, flo

chartSeriesByConfigKey["Nominal CoP@Flow"] = {
data: copAtFlowFeed,
color: "purple",
color: "gold",
"label": "Nominal CoP@Flow",
"scale": 100,
"scaledUnit": "%",
Expand All @@ -105,7 +107,7 @@ function createClientSideNominalEfficiencyFeeds(outsideTemperatureConfigKey, flo

chartSeriesByConfigKey["Nominal CoP@Design"] = {
data: copAtDesign,
color: "green",
color: "silver",
"label": "Nominal CoP@" + designTemperature,
"scale": 100,
"scaledUnit": "%",
Expand Down Expand Up @@ -162,8 +164,8 @@ async function loadDataAndRenderCharts() {
}
}))

createClientSideCoPFeed("HeatingEnergyConsumedRate1", "HeatingEnergyProducedRate1", "Space Heating CoP")
createClientSideCoPFeed("HotWaterEnergyConsumedRate1", "HotWaterEnergyProducedRate1", "Hot Water CoP")
createClientSideCoPFeed("HeatingEnergyConsumedRate1", "HeatingEnergyProducedRate1", "Space Heating CoP", "darkgreen")
createClientSideCoPFeed("HotWaterEnergyConsumedRate1", "HotWaterEnergyProducedRate1", "Hot Water CoP", "blue")
createClientSideCoPFeed("TotalEnergyConsumedRate1", "TotalEnergyProducedRate1", "Total CoP")

if (config.app.IncludeNominalEfficiences.value) {
Expand Down

0 comments on commit 1f51fee

Please sign in to comment.