Compare commits

...

2 Commits

2 changed files with 3 additions and 20 deletions

View File

@@ -234,12 +234,13 @@ export const fetchActData = async (opts) => {
// Transform data to add E10tel_eq field for compatibility with Flux version // Transform data to add E10tel_eq field for compatibility with Flux version
// E10tel_eq = 10^(LA_max/10) // E10tel_eq = 10^(LA_max/10)
if (opts.data !== 'live') {
result.values = result.values.map(record => ({ result.values = result.values.map(record => ({
...record, ...record,
E10tel_eq: record.LA_max !== null && record.LA_max !== undefined E10tel_eq: record.LA_max !== null && record.LA_max !== undefined
? Math.pow(10, record.LA_max / 10) ? Math.pow(10, record.LA_max / 10)
: null : null
})) }))}
return result return result
} }

View File

@@ -186,7 +186,7 @@ export const fetchActData = async (opts) => {
LA_minx: '$values.noise_LA_min', LA_minx: '$values.noise_LA_min',
LA_max: '$values.LA_max', LA_max: '$values.LA_max',
LAeq: '$values.LAeq', LAeq: '$values.LAeq',
E10tel_eq: '$values.E10tel_eq' } }
}, },
// {$project: { // {$project: {
// datetime: {$dateToString: {format: '%Y-%m-%dT%H:%M:%SZ', date: '$datetime'}}, // datetime: {$dateToString: {format: '%Y-%m-%dT%H:%M:%SZ', date: '$datetime'}},
@@ -202,24 +202,6 @@ export const fetchActData = async (opts) => {
} }
return ret return ret
} }
/*
Try to connect to mongodb://rexfue:s25BMmW2gg@192.168.51.22:27017
Try to connect to mongodb://rexfue:s25BMmW2gg@192.168.51.22:27017
*/
/*
let docs = await collection.find(
{ datetime:
{ $gte: start.toDate(), $lt: end.toDate() }
},
{ projection:
{_id:0, E_eq:0, E_mx:0, E_mi:0, E10tel_mx:0, E10tel_mi:0}, sort: {datetime: sort}
},
).toArray();
*/
export const fetchgeigerAVGData = async (opts) => { export const fetchgeigerAVGData = async (opts) => {
let docs = [] let docs = []