Skip to content

Commit

Permalink
Merge pull request #3 from chrisgilldc/new_config
Browse files Browse the repository at this point in the history
0.2.0-Alpha
  • Loading branch information
chrisgilldc authored Aug 31, 2023
2 parents ef3f5c2 + ef019c3 commit 6fb4d86
Show file tree
Hide file tree
Showing 14 changed files with 1,705 additions and 1,122 deletions.
252 changes: 117 additions & 135 deletions CobraBay/bay.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions CobraBay/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ def main():

# Create a CobraBay config object.
try:
cbconfig = CobraBay.CBConfig(config_file=arg_config, reset_sensors=True)
cbconfig = CobraBay.CBConfig(config_file=arg_config)
except ValueError as e:
print(e)
sys.exit(1)

# Initialize the object.
# Initialize the system
cb = CobraBay.CBCore(config_obj=cbconfig)

# Start the main operating loop.
Expand Down
902 changes: 511 additions & 391 deletions CobraBay/config.py

Large diffs are not rendered by default.

62 changes: 44 additions & 18 deletions CobraBay/const.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,53 @@
# Various constants

## General constants. Multiple types of objects need these.
GEN_UNKNOWN = 'unknown'
GEN_UNAVAILABLE = 'unavailable'

## Bay states
BAYSTATE_DOCKING = 'docking'
BAYSTATE_UNDOCKING = 'undocking'
BAYSTATE_READY = 'ready'
BAYSTATE_NOTREADY = 'not_ready'

## System States
SYSSTATE_READY = 'ready'
SYSSTATE_DOCKING = 'docking'
SYSSTATE_UNDOCKING = 'undocking'
SYSSTATE_MOTION = (SYSSTATE_DOCKING, SYSSTATE_UNDOCKING)

## Sensor states.
STATE_FAULT = "fault"
STATE_DISABLED = "disabled"
STATE_ENABLED = "enabled"
STATE_RANGING = "ranging"
STATE_NOTRANGING = "not_ranging"
SENSTATE_FAULT = 'fault'
SENSTATE_DISABLED = 'disabled'
SENSTATE_ENABLED = 'enabled'
SENSTATE_RANGING = 'ranging'
SENSTATE_NOTRANGING = 'not_ranging'

# Non-Quantity values the sensor can be in without
SENSOR_VALUE_OK = "ok"
SENSOR_VALUE_WEAK = "weak"
SENSOR_VALUE_STRONG = "strong"
SENSOR_VALUE_FLOOD = "flood"
SENSOR_VALUE_OK = 'ok'
SENSOR_VALUE_WEAK = 'weak'
SENSOR_VALUE_STRONG = 'strong'
SENSOR_VALUE_FLOOD = 'flood'
SENSOR_VALUE_TOOCLOSE = 'tooclose'

# Detector quality values.
DETECTOR_QUALITY_OK = "ok"
DETECTOR_QUALITY_BASE = "base"
DETECTOR_QUALITY_FINAL = "final"
DETECTOR_QUALITY_PARK = "park"
DETECTOR_QUALITY_BACKUP = "backup"
DETECTOR_QUALITY_NOOBJ = "no_object"
DETECTOR_QUALITY_EMERG = "emergency"
DETECTOR_QUALITY_DOOROPEN = "door_open"
DETECTOR_NOREADING = "no_reading"
DETECTOR_QUALITY_OK = 'ok'
DETECTOR_QUALITY_WARN = 'warning'
DETECTOR_QUALITY_CRIT = 'critical'
DETECTOR_QUALITY_BASE = 'base'
DETECTOR_QUALITY_FINAL = 'final'
DETECTOR_QUALITY_PARK = 'park'
DETECTOR_QUALITY_BACKUP = 'backup'
DETECTOR_QUALITY_NOOBJ = 'no_object'
DETECTOR_QUALITY_EMERG = 'emergency'
DETECTOR_QUALITY_DOOROPEN = 'door_open'
DETECTOR_QUALITY_BEYOND = 'beyond_range'
DETECTOR_NOREADING = 'no_reading'
DETECTOR_NOINTERCEPT = 'not_intercepted'

# Directional values
DIR_FWD = 'forward'
DIR_REV = 'reverse'
DIR_STILL = 'still'


200 changes: 110 additions & 90 deletions CobraBay/core.py

Large diffs are not rendered by default.

Loading

0 comments on commit 6fb4d86

Please sign in to comment.