Last active
May 18, 2023 20:01
-
-
Save danielballan/7a30d994d950d527a7c82a41ab735462 to your computer and use it in GitHub Desktop.
Device with custom set
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ophyd.sim import Signal | |
from ophyd import Component, Device | |
class Filters(Device): | |
a = Component(Signal, value=0) | |
b = Component(Signal, value=1) | |
def set(self, a, b): | |
return ( | |
self.a.set(a) & | |
self.b.set(b) | |
) | |
def set_attenuation(self, value): | |
# math.. | |
return self.set(value, -value) | |
f = Filters(name="f") |
Author
danielballan
commented
May 18, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment