#! /usr/bin/env python ############################################################ # # Modified from Nobuyoshi Kitamura's code "dom_daq_x.py" # # 1.Connect to dom (via terminal server) # 2.Read data, display, save to file # ############################################################ import os from os.path import * from time import * #from Tkinter import * #import ibidaq as daq import icecube.domtest.ibidaq as daq #IP, PORT = "128.104.79.74", 3002 # IP, PORT = "192.168.1.152", 3004 IP, PORT = "localhost", 5000 print " the machine and port are hardcoded..." class domdaq: def __init__(self): self.q = daq.ibx(IP,PORT) def domID(self): return self.q.getId() def sendwords(self,fname): self.q.flasherwords(fname) if __name__ == '__main__': domq = domdaq() print "DOM ID: ", domq.domID() # send command words first # domq.sendwords('Flasher_Forth_Code.txt') filename = 'Flasher_Forth_Code.txt' file = open(filename, 'r') for line in file.readlines(): domq.q.send(line) file.close() print "... Done"