def initialize(self): #initialize by preparing file names ddname_obj = tfn.dateS('des. depth on ') #objects for the imported user modules are created and initialized dtname_obj = tfn.dateS('curr depth on ') pwmname_obj = tfn.dateS('PWM on ') figname_obj = tfn.dateS('Plot on ') ddname_obj.forText() dtname_obj.forText() pwmname_obj.forText() figname_obj.forFig() self.ddname = ddname_obj.dateStamp() self.dtname = dtname_obj.dateStamp() self.pwmname = pwmname_obj.dateStamp() self.figname = figname_obj.dateStamp() self.plt_obj = lmp.plotLive(self.ddname,self.dtname,self.pwmname,self.figname, self.Kp, self.Kd, self.Ki, 500)
def initialize(self): #initialize by preparing file names ddname_obj = tfn.dateS('des. depth on ') dtname_obj = tfn.dateS('curr depth on ') pwmname_obj = tfn.dateS('PWM on ') figname_obj = tfn.dateS('Plot on ') ddname_obj.forText() dtname_obj.forText() pwmname_obj.forText() figname_obj.forFig() self.ddname = ddname_obj.dateStamp() self.dtname = dtname_obj.dateStamp() self.pwmname = pwmname_obj.dateStamp() self.figname = figname_obj.dateStamp() self.plt_obj = lmp.plotLive(self.ddname, self.dtname, self.pwmname, self.figname, self.Kp, self.Kd, self.Ki)
def __init__(self): self.sensor_obj = rs.sensorRead( ) #can pass filter window size as an argument self.sensor_obj.initialization() print('Sensor initalized and calibrated') file_name_object = tfn.dateS( sys.argv[1] + ' hovering data_log on ' ) #to sync the name of the video and the experiment file_name_object.forText() file_name = file_name_object.dateStamp() self.workbook = xlsxwriter.Workbook(file_name) self.worksheet = self.workbook.add_worksheet() self.worksheet.write(0, 0, 'Time(s)') self.worksheet.write(0, 1, 'Voltage(V)') self.worksheet.write(0, 2, 'Depth(cm)') self.worksheet.write(0, 3, 'Current(A)') self.current_depth = 0 self.line = 0 self.obj_act = act.actuator() self.obj_act.CDC(100) self.ser = serial.Serial( '/dev/ttyUSB0', 9600 ) #ACM0 for UNo #object for getting handle of serial communication
class datalog: def __init__(self): self.ser = serial.Serial('/dev/ttyACM0', 9600) #object for getting handle of serial communication #self.sensor_obj = rs.sensorRead() #can pass filter window size as an argument #self.sensor_obj.initialization() print('Sensor initalized and calibrated') file_name_object = tfn.dateS('hovering data_log on ') file_name_object.forText() file_name = file_name_object.dateStamp() self.workbook = xlsxwriter.Workbook(file_name) self.worksheet = self.workbook.add_worksheet() self.worksheet.write(0,0,'Current(A)') self.worksheet.write(0,1,'Voltage(V)') self.worksheet.write(0,2,'Depth(cm)') self.worksheet.write(0,3,'Time(s)') self.current_depth = 0 self.line = 0
def __init__(self): self.sensor_obj = rs.sensorRead( ) #can pass filter window size as an argument self.sensor_obj.initialization() print('Sensor initalized and calibrated') file_name_object = tfn.dateS( sys.argv[1] + ' hovering data_log on ' ) #to sync the name of the video and the experiment file_name_object.forText() file_name = file_name_object.dateStamp() self.workbook = xlsxwriter.Workbook(file_name) self.worksheet = self.workbook.add_worksheet() self.worksheet.write(0, 0, 'Time(s)') self.worksheet.write(0, 1, 'Voltage(V)') self.worksheet.write(0, 2, 'Depth(cm)') self.worksheet.write(0, 3, 'Current(A)') self.current_depth = 0 self.line = 0