Closedown
This commit is contained in:
@@ -9,19 +9,28 @@ class Detector(DeviceBase):
|
||||
|
||||
def doInitialize(self):
|
||||
pass
|
||||
|
||||
def send_cmd(self, cmd):
|
||||
print "Send detector command: ", cmd
|
||||
if not self.simulated:
|
||||
data = {"det_name":"eiger","cmd":cmd}
|
||||
headers = {'Content-type': 'application/json'}
|
||||
r = requests.post(url = self.url + "/detector/eiger", json=data, headers=headers)
|
||||
|
||||
def start(self):
|
||||
self.state.assertIs(State.Ready)
|
||||
if not self.simulated:
|
||||
pass
|
||||
self.send_cmd("START")
|
||||
self.setState(State.Busy)
|
||||
|
||||
def stop(self):
|
||||
self.state.assertIs(State.Busy)
|
||||
if not self.simulated:
|
||||
pass
|
||||
self.send_cmd("STOP")
|
||||
self.setState(State.Ready)
|
||||
|
||||
def apply_config(self):
|
||||
self.state.assertIs(State.Ready)
|
||||
self.send_cmd("SET_CONFIG")
|
||||
|
||||
def get_pars(self):
|
||||
if self.simulated:
|
||||
return self.simulated_pars
|
||||
@@ -40,12 +49,13 @@ class Detector(DeviceBase):
|
||||
|
||||
def set_config(self, config):
|
||||
if type(config) == dict or isinstance(config, java.util.Map) :
|
||||
print "Send detector config: ", config
|
||||
if self.simulated:
|
||||
self.simulated_config=config
|
||||
else:
|
||||
data = {"det_name":"eiger","config":config}
|
||||
headers = {'Content-type': 'application/json'}
|
||||
r = requests.post(url = self.url + "/detector", json=data, headers=headers)
|
||||
r = requests.post(url = self.url + "/detector/eiger", json=data, headers=headers)
|
||||
|
||||
|
||||
def doClose(self):
|
||||
|
||||
Reference in New Issue
Block a user