Coverage for src/shared/constants.py: 100%
55 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-08 09:36 +0000
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-08 09:36 +0000
1from os import cpu_count
3RIFT_LOG_LEVEL = "INFO"
5# [PATHS]
6MEL_LOG_PATH = "logs/melvonaut/"
7MEL_LOG_FORMAT = "log_melvonaut_{time:YYYY-MM-DD_HH}.log"
8MEL_LOG_LOCATION = MEL_LOG_PATH + MEL_LOG_FORMAT
9TELEMETRY_LOCATION_JSON = "logs/melvonaut/telemetry_melvonaut.json"
10TELEMETRY_LOCATION_CSV = "logs/melvonaut/telemetry_melvonaut.csv"
11EVENT_LOCATION_CSV = "logs/melvonaut/event_melvonaut.csv"
12IMAGE_PATH_BASE = "logs/melvonaut/images/"
13IMAGE_PATH = "logs/melvonaut/images/"
14IMAGE_LOCATION = IMAGE_PATH + "image_{melv_id}_{angle}_{time}_x_{cor_x}_y_{cor_y}.png"
15RIFT_LOG_LOCATION = "logs/rift_console/log_rift-console_{time:YYYY-MM-DD_HH}.log"
16PANORAMA_PATH = "media/"
17CONSOLE_LOG_PATH = "logs/rift_console/"
18CONSOLE_FROM_MELVONAUT_PATH = "logs/rift_console/from_melvonaut/"
19CONSOLE_LIVE_PATH = "logs/rift_console/images/live/"
20CONSOLE_DOWNLOAD_PATH = "logs/rift_console/images/download/"
21CONSOLE_STICHED_PATH = "logs/rift_console/images/stitched/"
22CONSOLE_EBT_PATH = "logs/rift_console/images/ebt/"
23MEL_PERSISTENT_SETTINGS = "logs/melvonaut/persistent_settings.json"
25# [URLs]
26BASE_URL = "http://10.100.10.11:33000/" # URL of our instance
27# Given Data Reference System API endpoints
28OBJECTIVE_ENDPOINT = f"{BASE_URL}objective"
29ANNOUNCEMENTS_ENDPOINT = f"{BASE_URL}announcements"
30OBSERVATION_ENDPOINT = f"{BASE_URL}observation"
31CONTROL_ENDPOINT = f"{BASE_URL}control"
32IMAGE_ENDPOINT = f"{BASE_URL}image"
33BEACON_ENDPOINT = f"{BASE_URL}beacon"
34RESET_ENDPOINT = f"{BASE_URL}reset"
35SIMULATION_ENDPOINT = f"{BASE_URL}simulation"
36BACKUP_ENDPOINT = f"{BASE_URL}backup"
37SLOTS_ENDPOINT = f"{BASE_URL}slots"
38ACHIEVEMENTS_ENDPOINT = f"{BASE_URL}achievements"
39DAILYMAP_ENDPOINT = f"{BASE_URL}dailyMap"
41# [From User Manual]
42STATE_TRANSITION_TIME = 3 * 60 # Seconds for regular state transitions
43STATE_TRANSITION_TO_SAFE_TIME = 1 * 60 # Seconds for state transitions to safe
44STATE_TRANSITION_FROM_SAFE_TIME = 20 * 60 # Seconds for state transitions from safe
45WORLD_X = 21600
46WORLD_Y = 10800
47ACCELERATION = 0.02
50# [Console]
51# Since images get very large (>400MB) a smaller 2nd version is displayed
52THUMBNAIL_X = 1000
53THUMBNAIL_Y = 500
54# Calculate trajektorie
55TRAJ_TIME = 3600 * 12 # generate points up to 12 hours
56TRAJ_STEP = 10 # merge 10s into 1 point
57# How many images should be shown at once in the image viewer tabs
58CONSOLE_IMAGE_VIEWER_LIMIT = 1000
60## [Image Processing]
61STITCHING_BORDER = 1000 # While in Stitching add this border in each direction
62NUMBER_OF_WORKER_THREADS = (cpu_count() or 4) - 2 # use 1 for single core
63SAVE_PANORAMA_STEP = 1000 # save the current panorama each X images
64STITCHING_COUNT_LIMIT = 5000 # stitching limit
65# Toogle between sorted/stitching images by position, starting in the top-right corner
66# else sort by timestamp
67SORT_IMAGE_BY_POSITION = True
68# The naming convention for images changed, can be changed for legacy data
69USE_LEGACY_IMAGE_NAMES = False # should be false, only true for older datasets
70IMAGE_NAME_UNDERSCORE_COUNT = 8 # should be 8, only for old datasets can be 9
71IMAGE_ANGLE_POSITION = 2 # hould be 2, only for old datasets can be 3
73## [New stitching algorithm]
74# Activate an improved stitching algorithm, which tries different placements of each image, but
75# takes a very long run time. Works, but needs further refinement
76DO_IMAGE_NUDGING_SEARCH = False # if False ignore SEARCH_GRID_SIDE_LENGTH
77SEARCH_GRID_SIDE_LENGTH = 15 # should be uneven
78# see image_processing:count_matching_pixels. Images are (0-255,0-255,0-255), summed up over RGB how
79# difference two pixels are allowed to be to still count as matching
80IMAGE_NOISE_FORGIVENESS = 20