Untitled Document
<?php
// Create a new class sensor
class Sensor{
// add properties
var $name;
var $multiplier;
var $offset;
// create functions for setting the variables
public function setName($data) {
$this->name = $data;
}
public function setMultiplier($data) {
$this->multiplier = $data;
}
public function setoffset($data) {
$this->offset= $data ;
}
// create functions for getting the variables
public function getName() {
return $this->name;
}
public function getMultiplier() {
return $this->multiplier;
}
public function getOffset() {
return $this->offset;
}
}
// create this Vaisala sensor based on the standard Sensor class and extend it
class Vaisala extends Sensor{
// create functions for setting the variables
var $calvalue1;
var $calvalue2;
var $fullrange;
// create functions for setting the variables
public function setCalvalue1($data) {
$this->calvalue1 = $data ;
}
public function setCalvalue2($data) {
$this->calvalue2 = $data;
}
public function setFullrange($data) {
$this->fullrange = $data;
}
// create functions for getting the variables
public function getCalvalue1() {
return $this->calvalue1;
}
public function getCalvalue2() {
return $this->calvalue2;
}
public function getFullrange() {
return $this->fullrange;
}
}
?>