diff --git a/site_ansto/instrument/TEST_SICS/fakeGalil/galilcontroller.py b/site_ansto/instrument/TEST_SICS/fakeGalil/galilcontroller.py index 45cf7612..79c31e5c 100644 --- a/site_ansto/instrument/TEST_SICS/fakeGalil/galilcontroller.py +++ b/site_ansto/instrument/TEST_SICS/fakeGalil/galilcontroller.py @@ -13,6 +13,8 @@ class GalilController(object): print "GalilController ctor: %d" % int(thePort) self.port = thePort self.motors = {} + self.IN = 256*[1] + self.OUT = 256*[1] for letter in "ABCDEFGH": self.motors[letter] = GalilMotor(letter) self.reset_powerup() @@ -76,6 +78,10 @@ class GalilController(object): response.append(" 0000000000") elif item == "_XQ0": response.append(" 0000000123") + elif item[:3] == "@IN": + response.append(' ' + str(self.IN[int(item[3:].strip('[]'))])) + elif item[:4] == "@OUT": + response.append(' ' + str(self.OUT[int(item[4:].strip('[]'))])) elif item[0] == "@": response.append(" 1.0000") elif len(item) == 4 and item[0] == "_": @@ -123,6 +129,13 @@ class GalilController(object): self.doCommandDA(cmd, arg) elif action == "MG": self.doCommandMG(cmd, arg) + elif action == "SB": + self.OUT[int(arg)] = 1 + elif action == "CB": + self.OUT[int(arg)] = 0 + elif action == "IB": + (bit, val) = arg.split() + self.IN[int(bit)] = int(val) def processDataReceived(self, data): #print "PDU: \"" + data + "\""