frappy_psi.cryoltd: add absolute field
This commit is contained in:
+13
-1
@@ -27,7 +27,7 @@ changed from the client is fixed for at least 10 seconds.
|
||||
"""
|
||||
import re
|
||||
import time
|
||||
from math import copysign
|
||||
from math import copysign, sqrt
|
||||
from frappy.core import HasIO, StringIO, Readable, Drivable, Parameter, Command, \
|
||||
Module, Property, Attached, Enum, IDLE, BUSY, ERROR, nopoll, PersistentParam, \
|
||||
PersistentMixin
|
||||
@@ -624,3 +624,15 @@ class Compressor(Channel, Drivable):
|
||||
"""reset error"""
|
||||
self.sendcmd('Set:Compressor:Reset <CH>')
|
||||
self._error_text = ''
|
||||
|
||||
|
||||
'''
|
||||
class Absfield(Readable):
|
||||
main = Attached()
|
||||
bx = Attached()
|
||||
by = Attached()
|
||||
bz = Attached()
|
||||
|
||||
def read_value(self):
|
||||
return sqrt((self.main + self.bz) ** 2 + self.by ** 2 + self.bx ** 2)
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user