Skip to content

Commit

Permalink
Merge pull request #308 from g7gpr/feature/specify_public_coordinates
Browse files Browse the repository at this point in the history
Feature/specify public coordinates
  • Loading branch information
dvida authored Jul 15, 2024
2 parents 809a9ed + ac41561 commit a4b1cbe
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
13 changes: 12 additions & 1 deletion .config
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; IMPORTANT: There always must be at least one space after the argument value, before the semicolon in front of the comment.
; IMPORTANT: There always must be at least one space after the argument value and before the semicolon in front of the comment.
; For example, "parameter: value ; comment" is correct, while "parameter: value; comment" is incorrect.

[System]

Expand All @@ -12,15 +13,25 @@ cams_code: 0

; Show this camera on the GMN weblog
weblog_enable: true

; The description that will be shown on the weblog (e.g. location, pointing direction)
weblog_description: none


; Server will generate obfuscated coordinates for public datasets.
; Uncomment and populate the three parameters below to use a specific public location.
; public_latitude: 0.0 ; WGS84 +N (degrees)
; public_longitude: 0.0 ; WGS84 +E (degrees)
; public_elevation: 0.0

; Camera network (e.g. national networks, used for grouping on the weblog).
; Separate by comma for multiple networks
network_name: none
; Camera group (e.g. a camera cluster or a location with multiple cameras)
camera_group_name: none



; External script
; An external script will be run after RMS finishes the processing for the night, it will be passed
; three arguments:
Expand Down
19 changes: 17 additions & 2 deletions RMS/ConfigReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,17 @@ def __init__(self):

##### System
self.stationID = "XX0001"

# Accurate coordinates of the camera (private)
self.latitude = 0
self.longitude = 0
self.elevation = 0
self.cams_code = 0


# Public low-accuracy coordinates (shown on the GMN website)
self.pub_latitude = None
self.pub_longitude = None
self.pub_elevation = None

# Show this camera on the GMN weblog
self.weblog_enable = True
Expand Down Expand Up @@ -308,7 +313,7 @@ def __init__(self):
# days of logfiles to keep
self.logdays_to_keep = 30

# ArchDirs and bzs to keep
# ArchDirs and bzs to keep
# keep this many ArchDirs. Zero means keep them all
self.arch_dirs_to_keep = 20
# keep this many compressed ArchDirs. Zero means keep them all
Expand Down Expand Up @@ -810,6 +815,16 @@ def parseSystem(config, parser):
config.event_monitor_db_name = parser.get(section, "event_monitor_db_name")


if parser.has_option(section, "public_latitude"):
config.pub_latitude = parser.getfloat(section, "public_latitude")

if parser.has_option(section, "public_longitude"):
config.pub_longitude = parser.getfloat(section, "public_longitude")

if parser.has_option(section, "public_elevation"):
config.pub_elevation = parser.getfloat(section, "public_elevation")


def parseCapture(config, parser):
section = "Capture"

Expand Down

0 comments on commit a4b1cbe

Please sign in to comment.