This commit is contained in:
gac-S_Changer
2018-09-21 16:51:33 +02:00
parent 7deba9eee4
commit ea1b2bad2a
8 changed files with 131 additions and 64 deletions

View File

@@ -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)