{ var $x = ""; var $y = ""; var $noiseavg = 0; // avg var $n = 0; // number of measurements function setData($x, $y) { $this->x = $x; $this->y = $y; return $this; } function addMeasurement($noise) {
} function addMeasurement($noise) { $this->n = $this->n + 1; $this->noiseavg = $this->noiseavg + ($noise - $this->noiseavg) / $this->n; return $this; } } class Areas { var $arrayOfAreas = array(); var $max = -200; // necessary // TODO: remove max from PHP function add($x, $y, $width, $height, $noise) { $found = false; foreach ($this->arrayOfAreas as $area) { if ($area->x == $x && $area->y == $y) {