diff --git a/script/device/Pixel.py b/script/device/Pixel.py index f1e303a..29fe014 100644 --- a/script/device/Pixel.py +++ b/script/device/Pixel.py @@ -37,7 +37,22 @@ class Pixel(DeviceBase, Readable, Readable.IntegerType): self.PIX_EXP_START_TIME = 0 self._update_header_length() self.show() + + if not self.is_connected(): + print "The Pixel detector is not connected to Epics/Spec." + print "Please disconnect in tvx and connect via the CCD/Pixel Epics widget." + else : + if self.get_error_code("X04SA-ES3-CCD:ERRCODE") != 0: + print "The pixel detector returned an error. It may not be properly" + print "connected. Please disconnect in tvx and disconnect and" + print "re-connect with the CCD/Pixel Epics widget." + def is_connected(self): + return caget(self.prefix + ":STAT1", 's') == "Connected" + + def get_error_code(self): + return caget(self.prefix + ":ERRCODE", 'i') + def _update_header_length(self): format = self.get_image_format()