Skip to content

Commit

Permalink
enforce read-only for RODOF
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaswmorris committed Aug 10, 2023
1 parent 5ea4c35 commit 7463bc1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bloptools/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
DEFAULT_BOUNDS = (-5.0, +5.0)


class ReadOnlyError(Exception):
...


class DOF(Signal):
"""
Degree of freedom
Expand All @@ -20,7 +24,11 @@ class RODOF(DOF):
Read-only degree of freedom
"""

...
def put(self, value, *, timestamp=None, force=False):
raise ReadOnlyError(f'Cannot put, DOF "{self.name}" is read-only!')

def set(self, value, *, timestamp=None, force=False):
raise ReadOnlyError(f'Cannot set, DOF "{self.name}" is read-only!')


class BrownianMotion(RODOF):
Expand Down

0 comments on commit 7463bc1

Please sign in to comment.