2022-03-24 19:06:47 -04:00
|
|
|
"""
|
|
|
|
Station
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
2022-04-08 09:35:33 -04:00
|
|
|
Copyright © 2022 Concordia CERC group
|
|
|
|
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
2022-03-24 19:06:47 -04:00
|
|
|
"""
|
|
|
|
import uuid
|
|
|
|
|
2023-01-24 10:51:50 -05:00
|
|
|
from hub.city_model_structure.iot.sensor import Sensor
|
2022-03-24 19:06:47 -04:00
|
|
|
|
|
|
|
|
|
|
|
class Station:
|
|
|
|
def __init__(self, station_id=None, _mobile=False):
|
|
|
|
self._id = station_id
|
|
|
|
self._mobile = _mobile
|
|
|
|
self._sensors = []
|
|
|
|
|
|
|
|
@property
|
|
|
|
def id(self):
|
|
|
|
"""
|
|
|
|
Get the station id a random uuid will be assigned if no ID was provided to the constructor
|
|
|
|
:return: Id
|
|
|
|
"""
|
|
|
|
if self._id is None:
|
|
|
|
self._id = uuid.uuid4()
|
|
|
|
return self._id
|
|
|
|
|
|
|
|
@property
|
|
|
|
def _mobile(self):
|
|
|
|
"""
|
|
|
|
Get if the station is mobile or not
|
|
|
|
:return: bool
|
|
|
|
"""
|
|
|
|
return self._mobile
|
|
|
|
|
|
|
|
@property
|
|
|
|
def sensors(self) -> [Sensor]:
|
|
|
|
"""
|
|
|
|
Get the sensors belonging to the station
|
|
|
|
:return: [Sensor]
|
|
|
|
"""
|
|
|
|
return self._sensors
|