class pressure_socket(object): def __init__(self): self.name = 'Sigrun_pressure' self.data_entries = ['pressure'] self.port = 9009 self.socket = DateDataPullSocket(self.name, self.data_entries, port=self.port) self.socket.start() def stop(self): self.socket.stop() def set_point_now(self, data_point): self.socket.set_point('pressure',data_point)
class GC_data_socket(object): def __init__(self): self.name = 'Sigrun_Gas_Chromatograph' self.data_entries = ['ready_voltage','retention_time','FID low V','FID high V','TCD low V','TCD high V'] self.port = 9002 self.socket = DateDataPullSocket(self.name, self.data_entries, port=self.port) self.socket.start() def stop(self): self.socket.stop() def set_point_now(self, entry, data_point): if entry not in self.data_entries: raise KeyError('Key not found in data_entries') return self.socket.set_point(entry, data_point)