示例#1
0
 def open(self, **kwargs):
     if hasattr(self, "socket"):
         return
     self.socket = initialize_connection(self.host, self.port, **kwargs)
     self.socket.sendall(b"ARTIQ management\n")
     endian = self._read(1)
     if endian == b"e":
         self.endian = "<"
     elif endian == b"E":
         self.endian = ">"
     else:
         raise IOError("Incorrect reply from device: expected e/E.")
示例#2
0
    def open(self):
        if hasattr(self, "socket"):
            return
        self.socket = initialize_connection(self.host, self.port)
        self.socket.sendall(b"ARTIQ coredev\n")
        endian = self._read(1)
        if endian == b"e":
            self.endian = "<"
        elif endian == b"E":
            self.endian = ">"
        else:
            raise IOError("Incorrect reply from device: expected e/E.")
        self.unpack_int32 = struct.Struct(self.endian + "l").unpack
        self.unpack_int64 = struct.Struct(self.endian + "q").unpack
        self.unpack_float64 = struct.Struct(self.endian + "d").unpack

        self.pack_header = struct.Struct(self.endian + "lB").pack
        self.pack_int32 = struct.Struct(self.endian + "l").pack
        self.pack_int64 = struct.Struct(self.endian + "q").pack
        self.pack_float64 = struct.Struct(self.endian + "d").pack
示例#3
0
 def open(self, **kwargs):
     if hasattr(self, "socket"):
         return
     self.socket = initialize_connection(self.host, self.port, **kwargs)
     self.socket.sendall(b"ARTIQ coredev\n")
示例#4
0
文件: comm_mgmt.py 项目: m-labs/artiq
 def open(self, **kwargs):
     if hasattr(self, "socket"):
         return
     self.socket = initialize_connection(self.host, self.port, **kwargs)
     self.socket.sendall(b"ARTIQ management\n")