Add numCoords, Coords, Area, AlarmRGB to Zone object. Also add Points(), AreaCoords, svg_polygon utility functions to it.
This commit is contained in:
parent
27e87fc21f
commit
45559123af
|
@ -13,6 +13,10 @@ class Zone extends ZM_Object {
|
||||||
'Name' => '',
|
'Name' => '',
|
||||||
'Type' => 'Active',
|
'Type' => 'Active',
|
||||||
'Units' => 'Pixels',
|
'Units' => 'Pixels',
|
||||||
|
'NumCoords' => '0',
|
||||||
|
'Coords' => 0,
|
||||||
|
'Area' => '0',
|
||||||
|
'AlarmRGB' => '0',
|
||||||
'CheckMethod' => 'Blobs',
|
'CheckMethod' => 'Blobs',
|
||||||
'MinPixelThreshold' => null,
|
'MinPixelThreshold' => null,
|
||||||
'MaxPixelThreshold' => null,
|
'MaxPixelThreshold' => null,
|
||||||
|
@ -46,5 +50,17 @@ class Zone extends ZM_Object {
|
||||||
return new Monitor();
|
return new Monitor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function Points() {
|
||||||
|
return coordsToPoints($this->Coords());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function AreaCoords() {
|
||||||
|
return preg_replace('/\s+/', ',', $this->Coords());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function svg_polygon() {
|
||||||
|
return '<polygon points="'.$this->AreaCoords().'" class="'.$this->Type().'" />';
|
||||||
|
}
|
||||||
|
|
||||||
} # end class Zone
|
} # end class Zone
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue