LocatorSpec: String representation of location monitoring settings.
More...
|
def | __init__ (self, s) |
| Split string into components defining location warning settings. More...
|
|
def | check (self, s) |
| Check whether locator is within warning threshold or not, based on the data in s More...
|
|
def | __str__ (self) |
|
def | __repr__ (self) |
|
|
def | haversine (lat1, lon1, lat2, lon2) |
| Haversine distance formula, from Wikipedia. More...
|
|
|
| latChan |
| ChannelSpec() identifying source of latitude data.
|
|
| lonChan |
| ChannelSpec() identifying source of longitude data.
|
|
| refLat |
| Reference latitude (decimal degrees)
|
|
| refLon |
| Reference longitude (decimal degrees)
|
|
| threshold |
| Warning Distance (m)
|
|
| name |
| Name for this locator (used in reporting)
|
|
LocatorSpec: String representation of location monitoring settings.
Definition at line 90 of file Specs.py.
◆ __init__()
def SELKIELogger.Specs.LocatorSpec.__init__ |
( |
|
self, |
|
|
|
s |
|
) |
| |
Split string into components defining location warning settings.
Values are validated to the extent possible without device and source specific information String is a set of comma separated values in this order:
- Latitude ChannelSpec()
- Longitude ChannelSpec()
- Reference Latitude
- Reference Longitude
- Warning threshold distance (m)
- [Optional] Name
- Parameters
-
s | String in required format. |
Definition at line 95 of file Specs.py.
◆ __repr__()
def SELKIELogger.Specs.LocatorSpec.__repr__ |
( |
|
self | ) |
|
- Returns
- Parseable representation
Definition at line 187 of file Specs.py.
◆ __str__()
def SELKIELogger.Specs.LocatorSpec.__str__ |
( |
|
self | ) |
|
- Returns
- Correctly formatted string
Definition at line 183 of file Specs.py.
◆ check()
def SELKIELogger.Specs.LocatorSpec.check |
( |
|
self, |
|
|
|
s |
|
) |
| |
Check whether locator is within warning threshold or not, based on the data in s
In returned tuple, alert
is True if position is unknown or further from the reference position than the warning threshold distance. The distance from the reference point in metres is returned along with the current position in decimal degrees.
- Parameters
-
- Returns
- Tuple of form (alert, distance, (lat, lon))
Definition at line 158 of file Specs.py.
◆ haversine()
def SELKIELogger.Specs.LocatorSpec.haversine |
( |
|
lat1, |
|
|
|
lon1, |
|
|
|
lat2, |
|
|
|
lon2 |
|
) |
| |
|
static |
Haversine distance formula, from Wikipedia.
- Parameters
-
lat1 | Latitude 1 (decimal degrees) |
lon1 | Longitude 1 (decimal degrees) |
lat2 | Latitude 2 (decimal degrees) |
lon2 | Latitude 2 (decimal degrees) |
- Returns
- Distance from 1 -> 2 in metres
Definition at line 135 of file Specs.py.
The documentation for this class was generated from the following file:
- /home/runner/work/Logger/Logger/python/SELKIELogger/Specs.py