Commit Graph

23 Commits

Author SHA1 Message Date
Peter Keresztes Schmidt 60db1c2eaf Coord: Rename to Vector2
The class is not only used to represent coordinates but also lengths in XY.
Vector2 is a more fitting/general name for this purpose.
2021-05-14 20:14:50 +02:00
Peter Keresztes Schmidt 4180bc99ac Zone: Sprinkle some const-ness
Keep references in for-loops const if no modifications are preformed on the object.
2021-04-25 22:34:33 +02:00
Peter Keresztes Schmidt d4458d1216 Monitor: Store zones as vector instead of list
std::vector suits the usage pattern better with no random inserts/deletions
2021-04-25 22:29:18 +02:00
Peter Keresztes Schmidt eb51408ef9 ZMPacket+Frame: Use vector to store ZoneStats
We don't any of the usage patterns that would warrant a std::list (random insert/deletion). Switch to vector which has much lower overhead for this kind of usage.
2021-04-25 22:29:18 +02:00
Peter Keresztes Schmidt ad32a94931 ZoneStats: Rename members according to Google style guide 2021-04-25 17:18:07 +02:00
Isaac Connor 8671e65517 More work on flushing out ZoneStats. Use references to avoid copying 2021-04-21 21:40:39 -04:00
Isaac Connor be9c5d3f95 Introduce a ZoneStats structure/class and implement a list of them in packet, frame. Store the stats in a list in the packet until it is time to write them to the db in the event. Hence implement batched queuing of stats. 2021-04-21 17:51:43 -04:00
Isaac Connor f5e249a6f2 ifout an unused constructor in zone. Add polygon copy in copy constructor. 2021-04-19 13:19:17 -04:00
Isaac Connor 03767236d9 Clean up constructor/Setup functions. Add copy constructor. Change Load to return a std::list<Zone> 2021-04-17 12:50:26 -04:00
Peter Keresztes Schmidt 76e6c468e8 rgb: Convert some constant defines to constexpr
Using defines interferes with fmt.
Also rename them according to the Google styleguide.
2021-03-01 00:38:21 +01:00
Peter Keresztes Schmidt dd527f0888 Consolidate __STDC_FORMAT_MACROS and __STDC_CONSTANT_MACROS definition
Move the definitions to zm_define.h and include the header at the appropriate locations.
These macros have not been adopted by the C++11 standard.
However glibc 2.17 (CentOS 7) still depends on them to provide the macros which are guarded by these defines.
2021-02-04 19:58:29 +01:00
Peter Keresztes Schmidt 0dbc39ee25 Cleanup and reorganize includes
With this commit a unified structure for includes is introduced.
The general rules:
 * Only include what you need
 * Include wherever possible in the cpp and forward-declare in the header

 The includes are sorted in a local to global fashion. This means for the include order:
  0. If cpp file: The corresponding h file and an empty line
  1. Includes from the project sorted alphabetically
  2. System/library includes sorted alphabetically
  3. Conditional includes
2021-02-04 18:02:01 +01:00
Isaac Connor 37c829f2bf cleanup code a bit. Move BlobStats to the Zone Object so that it isn't constantly being allocated/freed from the heap. Improve ParsePolygon. 2020-04-20 11:19:33 -04:00
Isaac Connor c0d04521d4 cleanup. Google Code Style. Move diag_path from a static to a class member so that multiple zones will create different diag files. 2018-04-23 14:36:54 -04:00
Isaac Connor 781d49dfb1 fix merge 2017-06-09 14:19:31 -04:00
Isaac Connor 90517ed0aa Merge branch 'master' into add_was_alarmed 2017-05-25 14:01:27 -04:00
Andy Bauer 254fcbcef7 update gpl 2 mailing address in source files 2016-12-26 09:23:16 -06:00
Isaac Connor 03b1ced568 tabs to spaces and use 2space indenting 2016-04-04 10:11:48 -04:00
Robin Daermann 5b465194f8 Renamed 'Blacken' zone type to 'Privacy' 2015-08-20 17:37:59 +02:00
Robin Daermann 8f9ed96585 First try to implement blacken areas for monitors 2015-08-20 14:20:41 +02:00
Isaac Connor 2c1a02ade6 Add was_alarmed property and WasAlarmed method to Zone 2015-02-18 16:34:35 -05:00
m-bene 26777487dc add feature to extend preclusive zone alarm state by x frames 2014-03-09 17:05:39 +01:00
nextime 33cbd89212 Migrate svn to git 2013-03-17 00:45:21 +01:00