forked from mxcube/HardwareObjects
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRobodiffFShut.py
41 lines (33 loc) · 1.26 KB
/
RobodiffFShut.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import logging
from HardwareRepository.BaseHardwareObjects import Equipment
from HardwareRepository.dispatcher import *
import time
class RobodiffFShut(Equipment):
def __init__(self, name):
Equipment.__init__(self, name)
def init(self):
self.robodiff = self.getObjectByRole("robot")
self.connect(self.robodiff.controller.fshut, "status", self.valueChanged)
self.robodiff.controller.fshut.musst.putget("#ABORT")
self.wagoState = "unknown"
def connectNotify(self, signal):
if signal=='wagoStateChanged':
self.getWagoState(read=True)
def valueChanged(self, value):
if value == "CLOSED":
self.wagoState = 'out'
elif value == "OPENED":
self.wagoState = 'in'
else:
self.wagoState = "unknown"
self.emit('wagoStateChanged', (self.wagoState, ))
def getWagoState(self, read=False):
if read:
self.valueChanged(self.robodiff.controller.fshut.state())
return self.wagoState
def wagoIn(self):
self.robodiff.controller.fshut.open()
self.getWagoState(read=True)
def wagoOut(self):
self.robodiff.controller.fshut.close()
self.getWagoState(read=True)