deleted unneceesary files and references

This commit is contained in:
rxf
2023-04-06 17:25:12 +02:00
parent 5fb78d4eb5
commit 4918e6df47
7 changed files with 0 additions and 610 deletions
-134
View File
@@ -1,134 +0,0 @@
// Sh0w the hour average chart
import {logit, logerror} from './logit.js'
import * as utils from './chart_utilities.js'
import {DateTime, Duration} from "./luxon.min.js"
// ******************************************************************
// PlotDayAVG_Noise
// ******************************************************************
export const showDayavg = async (params) => {
await PlotDayAVG_Noise(params.sid)
}
const PlotDayAVG_Noise = async function (sid) {
let series1 = []
let series2 = []
// read the data from the server
const url = `${utils.url}/getsensordata?sensorid=${sid}&data=davg`
let ret = await fetch(url)
.catch(e => {
logerror(e)
})
let data = await ret.json()
if(!data.err) {
// Put values into the serieses
let cnt = 0
data.values.forEach((x) => {
if(x.n_AVG != -1) {
let dat = new Date(x.datetime).getTime() // retrieve the date
series1.push([dat, x.n_AVG])
series2.push([dat, x.peakcount])
}
})
} else {
utils.showError(data.err)
}
let dlt = DateTime.now() // retrieve the date
dlt = dlt.minus({day:30})
// Plot-Options
let options = utils.createGlobObtions()
options.xAxis.plotBands = utils.calcWeekends(data, true)
options.xAxis.tickInterval = 24 * 3600 * 1000
options.xAxis.title = 'Date'
options.xAxis.labels = {
formatter: function () {
return this.axis.defaultLabelFormatter.call(this);
}
}
options.chart.type = 'column'
options.yAxis = {
title: {
text: 'dbA',
useHTML: true,
},
min: utils.noise_ymin,
tickAmount: 10,
gridLineColor: 'lightgray',
}
options.series = [
{
name: 'Mean value LAeq',
data: series1,
color: utils.colors.eq,
type: 'column',
zIndex: 2,
},
]
options.plotOptions.column = {
pointWidth: 20,
groupPadding: 0.1
}
options.title.text = 'Noise daily mean values'
options.subtitle.text = 'Daily mean values of LAeq for each full day <br />&nbsp'
options.subtitle.useHTML = true
options.chart.zoomType = 'x'
options.chart.resetZoomButton= {
position: {
align: 'left',
// verticalAlign: 'bottom',
x: 20,
y: 300,
},
relativeTo: 'chart'
}
options.tooltip.formatter = function () {
let y = Math.round(this.y * 10) / 10
return '<div style="border: 2px solid ' + this.point.color + '; padding: 3px;">' +
DateTime.fromMillis(this.x, {zone: 'utc'}).toFormat("dd.LL") + '<br />' +
'<span style="color: ' + this.point.color + '">&#9679;&nbsp;</span>' +
this.series.name + ':&nbsp; <b>' + y + '</b></div>'
}
// Do PLOT 1
let ch = Highcharts.chart('dday', options, function (chart) {
utils.addSensorID2chart(chart, {sid: data.sid, indoor: data.indoor}, document.getElementById('dday').offsetWidth)
})
/*
// Do PLOT 2
options.series[0] = {
name: 'Peaks',
data: series2,
color: utils.colors.peaks,
type: 'column'
}
options.title.text = 'Peaks more than ' + data.peak + ' dbA'
options.subtitle.text = 'Number of exceedances per hour <br />&nbsp'
options.yAxis = {
title: {
text: 'Counts',
useHTML: true,
},
tickAmount: 10,
allowDecimals: false,
gridLineColor: 'lightgray',
}
options.tooltip.formatter = function () {
let y = Math.round(this.y)
return '<div style="border: 2px solid ' + this.point.color + '; padding: 3px;">' +
DateTime.fromMillis(this.x, {zone: 'utc'}).toFormat("dd.LL - HH'h'") + '<br />' +
'<span style="color: ' + this.point.color + '">&#9679;&nbsp;</span>' +
this.series.name + ':&nbsp; <b>' + y + '</b></div>'
}
let ch1 = Highcharts.chart('dpeak', options)
*/
}
-160
View File
@@ -1,160 +0,0 @@
// Sh0w the hour average chart
import {logit, logerror} from './logit.js'
import * as utils from './chart_utilities.js'
import {DateTime, Duration} from "./luxon.min.js"
// ******************************************************************
// PlotDayNightAVG_Noise
// ******************************************************************
export const showDaynight = async (params) => {
await PlotDayNight_Noise(params.sid)
}
const PlotDayNight_Noise = async function (sid) {
let series1 = []
let series2 = []
// read the data from the server
const url = `${utils.url}/getsensordata?sensorid=${sid}&data=daynight`
let ret = await fetch(url)
.catch(e => {
logerror(e)
})
let data = await ret.json()
if(!data.err) {
// Put values into the serieses
let cnt = 0
data.values.forEach((x) => {
if(x.n_AVG != -1) {
let dat = new Date(x.datetime).getTime() // retrieve the date
series1.push([dat, x.n_dayAVG])
series2.push([dat, x.n_nightAVG])
}
})
} else {
utils.showError(data.err)
}
let dlt = DateTime.now() // retrieve the date
dlt = dlt.minus({day:30})
// Plot-Options
let options = utils.createGlobObtions()
options.xAxis.plotBands = utils.calcWeekends(data, true)
options.xAxis.tickInterval = 24 * 3600 * 1000
options.xAxis.title = 'Date'
options.xAxis.labels = {
formatter: function () {
return this.axis.defaultLabelFormatter.call(this);
}
}
options.chart.type = 'column'
options.yAxis = {
title: {
text: 'dbA',
useHTML: true,
},
min: utils.noise_ymin,
tickAmount: 10,
gridLineColor: 'lightgray',
}
options.series = [
{
name: 'Day',
data: series1,
color: utils.colors.eq,
type: 'column',
zIndex: 2,
},
{
name: 'Night',
data: series2,
color: utils.colors.max,
type: 'column',
zIndex: 2,
},
]
options.plotOptions.series = {
animation: false
}
options.plotOptions.column = {
pointWidth: 20,
groupPadding: 0.3
}
options.title.text = 'Noise Average values during the day and night hours'
options.subtitle.text = 'Daily mean values of LAeq from 6h00 to 22h00 <br /> Nightly mean values of LAeq from 22h00 to 6h00'
options.subtitle.useHTML = true
options.chart.zoomType = 'x'
options.chart.resetZoomButton= {
position: {
align: 'left',
// verticalAlign: 'bottom',
x: 20,
y: 300,
},
relativeTo: 'chart'
}
options.tooltip.formatter = function () {
let n = this.series.name.startsWith('Night')
let d = DateTime.fromMillis(this.x, {zone: 'utc'})
let d1 = d.plus({days: 1})
let txt = n ? d.toFormat('dd') + '/' + d1.toFormat('dd.LL') :
d.toFormat('dd.LL')
return '<div style="border: 2px solid ' + this.point.color + '; padding: 3px;">' +
'&nbsp;&nbsp;' + txt + '<br />' +
'<span style="color: ' + this.point.color + '">&#9679;&nbsp;</span>' +
this.series.name + ':&nbsp; <b>' +
Highcharts.numberFormat(this.y, 1) +
'</b></div>';
}
/*
formatter = function () {
let y = Math.round(this.y * 10) / 10
return '<div style="border: 2px solid ' + this.point.color + '; padding: 3px;">' +
DateTime.fromMillis(this.x, {zone: 'utc'}).toFormat("dd.LL") + '<br />' +
'<span style="color: ' + this.point.color + '">&#9679;&nbsp;</span>' +
this.series.name + ':&nbsp; <b>' + y + '</b></div>'
}
*/
// Do PLOT 1
let ch = Highcharts.chart('ddaynight', options, function (chart) {
utils.addSensorID2chart(chart, {sid: data.sid, indoor: data.indoor}, document.getElementById('ddaynight').offsetWidth)
})
/*
// Do PLOT 2
options.series[0] = {
name: 'Peaks',
data: series2,
color: utils.colors.peaks,
type: 'column'
}
options.title.text = 'Peaks more than ' + data.peak + ' dbA'
options.subtitle.text = 'Number of exceedances per hour <br />&nbsp'
options.yAxis = {
title: {
text: 'Counts',
useHTML: true,
},
tickAmount: 10,
allowDecimals: false,
gridLineColor: 'lightgray',
}
options.tooltip.formatter = function () {
let y = Math.round(this.y)
return '<div style="border: 2px solid ' + this.point.color + '; padding: 3px;">' +
DateTime.fromMillis(this.x, {zone: 'utc'}).toFormat("dd.LL - HH'h'") + '<br />' +
'<span style="color: ' + this.point.color + '">&#9679;&nbsp;</span>' +
this.series.name + ':&nbsp; <b>' + y + '</b></div>'
}
let ch1 = Highcharts.chart('dpeak', options)
*/
}
-129
View File
@@ -1,129 +0,0 @@
// Sh0w the hour average chart
import {logit, logerror} from './logit.js'
import * as utils from './chart_utilities.js'
import {DateTime, Duration} from "./luxon.min.js"
// ******************************************************************
// PlotHourAVG_Noise
// ******************************************************************
export const showHouravg = async (params) => {
await PlotHourAVG_Noise(params.sid)
}
const PlotHourAVG_Noise = async function (sid) {
let series1 = []
let series2 = []
// read the data from the server
const url = `${utils.url}/getsensordata?sensorid=${sid}&data=havg`
let ret = await fetch(url)
.catch(e => {
logerror(e)
})
let data = await ret.json()
if(!data.err) {
// Put values into the serieses
let cnt = 0
data.values.forEach((x) => {
if (x.n_AVG != -1) {
let dat = new Date(x.datetime).getTime() // retrieve the date
series1.push([dat, x.n_AVG])
series2.push([dat, x.peakcount])
}
})
} else {
utils.showError(data.err)
}
let dlt = DateTime.now() // retrieve the date
dlt = dlt.minus({day:1})
// Plot-Options
let options = utils.createGlobObtions()
options.xAxis.tickInterval = 6 * 3600 * 1000
options.xAxis.plotBands = utils.calcWeekends(data, true)
options.xAxis.minTickInterval = 3600 * 1000
options.yAxis = {
title: {
text: 'dbA',
useHTML: true,
},
min: utils.noise_ymin,
tickAmount: 10,
gridLineColor: 'lightgray',
}
options.series = [
{
name: 'Mean value LAeq',
data: series1,
color: utils.colors.eq,
type: 'column',
zIndex: 2,
},
]
options.plotOptions.column = {
pointWidth: 8,
groupPadding: 0.5
}
options.title.text = 'Noise hourly mean values'
options.subtitle.text = 'Hourly mean values of LAeq for each full hour <br />&nbsp'
options.subtitle.useHTML = true
options.chart.zoomType = 'x'
options.chart.height = 350
options.chart.resetZoomButton= {
position: {
align: 'left',
// verticalAlign: 'bottom',
x: 20,
y: 300,
},
relativeTo: 'chart'
}
options.tooltip.formatter = function () {
let y = Math.round(this.y * 10) / 10
return '<div style="border: 2px solid ' + this.point.color + '; padding: 3px;">' +
DateTime.fromMillis(this.x, {zone: 'utc'}).toFormat("dd.LL - HH'h'") + '<br />' +
'<span style="color: ' + this.point.color + '">&#9679;&nbsp;</span>' +
this.series.name + ':&nbsp; <b>' + y + '</b></div>'
}
// Do PLOT 1
let ch = Highcharts.chart('dhour', options, function (chart) {
utils.addSensorID2chart(chart, {sid: data.sid, indoor: data.indoor}, document.getElementById('dhour').offsetWidth)
})
// Do PLOT 2
options.series[0] = {
name: 'Peaks',
data: series2,
color: utils.colors.peaks,
type: 'column'
}
options.title.text = 'Peaks more than ' + data.peak + ' dbA'
options.subtitle.text = 'Number of exceedances per hour <br />&nbsp'
options.yAxis = {
title: {
text: 'Counts',
useHTML: true,
},
tickAmount: 10,
allowDecimals: false,
gridLineColor: 'lightgray',
}
options.tooltip.formatter = function () {
let y = Math.round(this.y)
return '<div style="border: 2px solid ' + this.point.color + '; padding: 3px;">' +
DateTime.fromMillis(this.x, {zone: 'utc'}).toFormat("dd.LL - HH'h'") + '<br />' +
'<span style="color: ' + this.point.color + '">&#9679;&nbsp;</span>' +
this.series.name + ':&nbsp; <b>' + y + '</b></div>'
}
let ch1 = Highcharts.chart('dpeak', options)
}
-112
View File
@@ -1,112 +0,0 @@
// Sh0w the hour average chart
import {logit, logerror} from './logit.js'
import * as utils from './chart_utilities.js'
import {DateTime, Duration} from "./luxon.min.js"
// ******************************************************************
// PlotLDEN_Noise
// ******************************************************************
export const showLden = async (params) => {
await PlotLDEN_Noise(params.sid)
}
const PlotLDEN_Noise = async function (sid) {
let series1 = []
// read the data from the server
const url = `${utils.url}/getsensordata?sensorid=${sid}&data=lden`
let ret = await fetch(url)
.catch(e => {
logerror(e)
})
let data = await ret.json()
if (!data.err) {
// Put values into the serieses
let cnt = 0
data.values.forEach((x) => {
if(x.n_AVG != -1) {
let dat = new Date(x.datetime).getTime() // retrieve the date
series1.push([dat, x.lden])
}
})
} else {
utils.showError(data.err)
}
let dlt = DateTime.now() // retrieve the date
dlt = dlt.minus({day:30})
// Plot-Options
let options = utils.createGlobObtions()
options.xAxis.plotBands = utils.calcWeekends(data, true)
options.xAxis.tickInterval = 24 * 3600 * 1000
options.xAxis.title = 'Date'
options.xAxis.labels = {
formatter: function () {
let lbl = this.axis.defaultLabelFormatter.call(this);
this.value += 86400000;
let lbl1 = this.axis.defaultLabelFormatter.call(this);
return parseInt(lbl) + '/' + lbl1;
}
}
options.chart.type = 'column'
options.yAxis = {
title: {
text: 'dbA',
useHTML: true,
},
min: utils.noise_ymin,
tickAmount: 10,
gridLineColor: 'lightgray',
}
options.series = [
{
name: 'lden',
data: series1,
color: utils.colors.eq,
type: 'column',
zIndex: 2,
}
]
options.plotOptions.series = {
animation: false
}
options.plotOptions.column = {
pointWidth: 20,
groupPadding: 0.1
}
options.title.text = 'Noise L<sub>DEN</sub>-Index'
options.subtitle.text = 'Daily mean values of L<sub>DEN</sub>\-Index'
options.subtitle.useHTML = true
options.chart.zoomType = 'x'
options.chart.resetZoomButton= {
position: {
align: 'left',
// verticalAlign: 'bottom',
x: 20,
y: 300,
},
relativeTo: 'chart'
}
options.tooltip.formatter = function () {
let d = DateTime.fromMillis(this.x, {zone: 'utc'})
let d1 = d.plus({days: 1})
let txt = d.toFormat('dd') + '/' + d1.toFormat('dd.LL')
return '<div style="border: 2px solid ' + this.point.color + '; padding: 3px;">' +
'&nbsp;&nbsp;' + txt + '<br />' +
'<span style="color: ' + this.point.color + '">&#9679;&nbsp;</span>' +
this.series.name + ':&nbsp; <b>' +
Highcharts.numberFormat(this.y, 1) +
'</b></div>';
}
let ch = Highcharts.chart('dlden', options, function (chart) {
utils.addSensorID2chart(chart, {sid: data.sid, indoor: data.indoor}, document.getElementById('dlden').offsetWidth)
})
}
-68
View File
@@ -1,68 +0,0 @@
// Show the live data chart
import {logit, logerror} from './logit.js'
import * as utils from './chart_utilities.js'
import {DateTime} from "./luxon.min.js";
// ******************************************************************
// PlotDayLive_Noise
// ******************************************************************
export const showLive = async (params) => {
const url = `/chart/getsensordata?&sensorid=${params.sid}`
let ret = await fetch(url)
.catch(e => {
logerror(e)
});
let erg = await ret.json()
let chr = Highcharts.chart('dlive', erg.options, function (chart) {
utils.addSensorID2chart(chart, {sid: erg.params.sensorid, indoor: erg.params.indoor}, document.getElementById('dlive').offsetWidth)
})
}
/*
let butOpts = [
{fill: 'lightblue', r: 2},
{fill: 'blue', r: 2, style: {color: 'white'}},
{fill: 'lightblue', r: 2},
{fill: 'lightblue', r: 2}
]
function renderPfeil(n, chart, x, y, txt, time) {
chart.renderer.button(txt, x, y, null, butOpts[0], butOpts[1], butOpts[2], butOpts[3])
.attr({
id: 'button' + n,
zIndex: 3,
width: 30,
})
.on('click', function () {
prevHour(time)
})
.add()
}
function prevHour(hours) {
console.log("Zurück um ", hours, "Stunden")
let start
if (startDay == "") {
start = moment()
start.subtract(24, 'h')
} else {
start = moment(startDay)
}
let mrk = moment()
mrk.subtract(24, 'h')
let startDay = ""
if (hours < 0) {
start.subtract(Math.abs(hours), 'h')
startDay = start.format("YYYY-MM-DDTHH:mm:ssZ")
} else if (hours > 0) {
start.add(hours, 'h')
if (!start.isAfter(mrk)) {
startDay = start.format("YYYY-MM-DDTHH:mm:ssZ")
}
}
doPlot('live', startDay)
}
*/
-6
View File
@@ -4,12 +4,6 @@
import * as map from './map.js' import * as map from './map.js'
import * as dt from './datetime.js' import * as dt from './datetime.js'
import {logerror, logit} from './logit.js' import {logerror, logit} from './logit.js'
import * as chart_live from './chart_live.js'
import * as chart_houravg from './chart_houravg.js'
import * as chart_dayavg from './chart_dayavg.js'
import * as chart_daynight from './chart_daynight.js'
import * as chart_lden from './chart_lden.js'
import * as utils from "./chart_utilities.js";
import {tabtable, loadAll, showChart} from './showcharts.js' import {tabtable, loadAll, showChart} from './showcharts.js'
import { DateTime } from './luxon.min.js' import { DateTime } from './luxon.min.js'
-1
View File
@@ -1,7 +1,6 @@
// all function related to the map // all function related to the map
import * as dt from './datetime.js' import * as dt from './datetime.js'
import * as chart_live from "./chart_live.js"
import * as utils from "./chart_utilities.js" import * as utils from "./chart_utilities.js"
import { showChart, loadAll } from './showcharts.js' import { showChart, loadAll } from './showcharts.js'