2021-06-01 18:31:50 -04:00
|
|
|
"""
|
|
|
|
Sensor module
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
|
|
|
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
|
|
|
"""
|
|
|
|
|
2021-06-09 14:23:45 -04:00
|
|
|
from helpers.location import Location
|
|
|
|
|
2021-06-01 19:03:55 -04:00
|
|
|
|
2021-06-01 18:31:50 -04:00
|
|
|
class Sensor:
|
2021-06-02 09:30:01 -04:00
|
|
|
"""
|
|
|
|
Sensor abstract class
|
|
|
|
"""
|
2021-06-01 18:31:50 -04:00
|
|
|
def __init__(self):
|
|
|
|
self._name = None
|
|
|
|
self._type = None
|
|
|
|
self._units = None
|
|
|
|
self._location = None
|
|
|
|
|
|
|
|
@property
|
|
|
|
def name(self):
|
|
|
|
"""
|
|
|
|
Get sensor name
|
2021-06-09 14:23:45 -04:00
|
|
|
:return: str
|
2021-06-01 18:31:50 -04:00
|
|
|
"""
|
|
|
|
return self._name
|
|
|
|
|
|
|
|
@name.setter
|
|
|
|
def name(self, value):
|
|
|
|
"""
|
|
|
|
Set sensor name
|
2021-06-09 14:23:45 -04:00
|
|
|
:param value: str
|
2021-06-01 18:31:50 -04:00
|
|
|
"""
|
|
|
|
self._name = value
|
|
|
|
|
|
|
|
@property
|
|
|
|
def type(self):
|
|
|
|
"""
|
|
|
|
Get sensor type
|
2021-06-09 14:23:45 -04:00
|
|
|
:return: str
|
2021-06-01 18:31:50 -04:00
|
|
|
"""
|
|
|
|
return self._type
|
|
|
|
|
|
|
|
@property
|
|
|
|
def units(self):
|
|
|
|
"""
|
|
|
|
Get sensor units
|
2021-06-09 14:23:45 -04:00
|
|
|
:return: str
|
2021-06-01 18:31:50 -04:00
|
|
|
"""
|
|
|
|
return self._units
|
|
|
|
|
|
|
|
@property
|
2021-06-09 14:23:45 -04:00
|
|
|
def location(self) -> Location:
|
2021-06-01 18:31:50 -04:00
|
|
|
"""
|
|
|
|
Get sensor location
|
2021-06-09 14:23:45 -04:00
|
|
|
:return: Location
|
2021-06-01 18:31:50 -04:00
|
|
|
"""
|
|
|
|
return self._location
|
|
|
|
|
|
|
|
@location.setter
|
|
|
|
def location(self, value):
|
|
|
|
"""
|
|
|
|
Set sensor location
|
2021-06-09 14:23:45 -04:00
|
|
|
:param value: Location
|
2021-06-01 18:31:50 -04:00
|
|
|
"""
|
|
|
|
self._location = value
|
|
|
|
|
|
|
|
@property
|
|
|
|
def measures(self):
|
2021-08-26 09:19:38 -04:00
|
|
|
"""
|
2021-09-01 09:39:27 -04:00
|
|
|
Raises not implemented error
|
2021-08-26 09:19:38 -04:00
|
|
|
"""
|
2021-06-01 18:31:50 -04:00
|
|
|
raise NotImplementedError
|