This commit is contained in:
gac-S_Changer
2018-11-07 11:36:38 +01:00
parent bc78e8fd40
commit 92574c1341
23 changed files with 749 additions and 63 deletions

View File

@@ -6,6 +6,8 @@ class SmartMagnet(DeviceBase):
"restingCurrent":0.0,
"mountCurrent":0.0,
"unmountCurrent":0.0,
"reverseCurrent":0.0,
"reverseTime":0.0,
}))
def doInitialize(self):
@@ -89,8 +91,8 @@ class SmartMagnet(DeviceBase):
def set_unmount_current(self):
self.set_current(self.config.getFieldValue("unmountCurrent"))
def set_remanence_current(self):
self.set_current(self.config.getFieldValue("remanenceCurrent"))
def set_reverse_current(self):
self.set_current(self.config.getFieldValue("reverseCurrent"))
def set_default_current(self):
if self.is_mounted():
@@ -104,6 +106,10 @@ class SmartMagnet(DeviceBase):
#Setting resting current to better detect sample
def enforce_sample_detection(self):
reverse_wait = float(self.config.getFieldValue("reverseTime"))
if reverse_wait >0:
self.set_reverse_current()
time.sleep(reverse_wait)
if not self.is_resting_current():
self.set_resting_current()
time.sleep(0.2)