This commit is contained in:
@@ -6,7 +6,6 @@ class SmartMagnet(DeviceBase):
|
||||
"restingCurrent":0.0,
|
||||
"mountCurrent":0.0,
|
||||
"unmountCurrent":0.0,
|
||||
"remanenceCurrent":0.0,
|
||||
}))
|
||||
|
||||
def doInitialize(self):
|
||||
@@ -98,7 +97,17 @@ class SmartMagnet(DeviceBase):
|
||||
self.set_holding_current()
|
||||
else:
|
||||
self.set_resting_current()
|
||||
|
||||
|
||||
def is_resting_current(self):
|
||||
return self.get_current() != self.config.getFieldValue("restingCurrent")
|
||||
|
||||
|
||||
#Setting resting curren t to better detect sample
|
||||
def enforce_sample_detection(self):
|
||||
if not self.is_resting_current():
|
||||
self.set_resting_current()
|
||||
time.sleep(0.2)
|
||||
|
||||
|
||||
add_device(SmartMagnet("smart_magnet"), force = True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user