Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| Rivi 27: | Rivi 27: | ||
for ( var oi in jw.obsList ) { | for ( var oi in jw.obsList ) { | ||
var o = jw.obsList[oi]; | var o = jw.obsList[oi]; | ||
if ( typeof jw.obstype[ jw.obs[o].printouts.ObsCode[0] ] == 'undefined' ) { jw.obstype[ jw.obs[o].printouts.ObsCode[0] ] = { obses: [] }; } | if ( typeof jw.obstype[ jw.obs[o].printouts.ObsCode[0] ] == 'undefined' ) { jw.obstype[ jw.obs[o].printouts.ObsCode[0] ] = { sum: 0, count: 0, mean: 0, obses: [] }; } | ||
jw.obstype[ jw.obs[o].printouts.ObsCode[0] ].obses.push( o ); | jw.obstype[ jw.obs[o].printouts.ObsCode[0] ].obses.push( o ); | ||
} | } | ||
| Rivi 43: | Rivi 43: | ||
if ( data ) { | if ( data ) { | ||
if ( ot == 'temp' ) { | if ( ot == 'temp' ) { | ||
jw.obstype[ ot ]. | jw.obstype[ ot ].sum += data.val; | ||
jw.obstype[ ot ]. | jw.obstype[ ot ].count++; | ||
jw.obstype[ ot ].mean = jw.obstype[ ot ].count++ / jw.obstype[ ot ].count; | |||
} | } | ||
} | } | ||


