From 45559123afc511218f38736ea8356e67b6d50909 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sun, 5 Dec 2021 17:45:26 -0500 Subject: [PATCH] Add numCoords, Coords, Area, AlarmRGB to Zone object. Also add Points(), AreaCoords, svg_polygon utility functions to it. --- web/includes/Zone.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/web/includes/Zone.php b/web/includes/Zone.php index 9f3850bb1..eb216565a 100644 --- a/web/includes/Zone.php +++ b/web/includes/Zone.php @@ -13,6 +13,10 @@ class Zone extends ZM_Object { 'Name' => '', 'Type' => 'Active', 'Units' => 'Pixels', + 'NumCoords' => '0', + 'Coords' => 0, + 'Area' => '0', + 'AlarmRGB' => '0', 'CheckMethod' => 'Blobs', 'MinPixelThreshold' => null, 'MaxPixelThreshold' => null, @@ -46,5 +50,17 @@ class Zone extends ZM_Object { return new Monitor(); } + public function Points() { + return coordsToPoints($this->Coords()); + } + + public function AreaCoords() { + return preg_replace('/\s+/', ',', $this->Coords()); + } + + public function svg_polygon() { + return ''; + } + } # end class Zone ?>