Ejemplo n.º 1
0
    def display(self, delay):
         t = threading.currentThread()
         while getattr(t, "do_run", True):
             #os.system('clear')
             #print "#d"
             # Process return data
        # 0: date
        # 1: time
        # 2: lat
        # 3: lon
        # 4: alt
        # 5: speed
        # 6: temp
        # 7: press
        # 8: heading
        # 9: gyro
        #10: accel
             try:
                self.disp_data[0] = dataFormat.convertDate("mm/dd/yy", "EDT", self.disp_data[0])
             except:
                 print "Failed to convert Date"
                 
             try:
                self.disp_data[1] = dataFormat.convertTime("am/pm", "EDT", self.disp_data[1])
             except:
                 print "Failed to convert Time"
             
             print "Date:  ", self.disp_data[0]
             print "Time:  ", self.disp_data[1]
             print "Lat:   ", self.disp_data[2]
             print "Lon:   ", self.disp_data[3]
             
             try:
                self.disp_data[4] = dataFormat.convertAltitude("meters", self.disp_data[4])
             except:
                 print "Failed to convert Alititude"
                 
             print "Alt:   ", self.disp_data[4]
             
             try:
                self.disp_data[5] = dataFormat.convertSpeed("mph", self.disp_data[5])
             except:
                 print "Failed to convert Speed"
                 
             print "Speed: ", self.disp_data[5]
             
             try:
                self.disp_data[6] = dataFormat.convertTemp("F", self.disp_data[6])
             except:
                 print "Failed to convert Temp"
                 
             print "Temp:  ", self.disp_data[6]
             
             try:
                self.disp_data[7] = dataFormat.convertPressure("kPa", self.disp_data[7])
             except:
                 print "Failed to convert Pressure"
             print "Press: ", self.disp_data[7]
             
            #try:
            #    self.disp_data[8] = dataFormat.convertHeading("16", self.disp_data[8])
            # except:
            #    print "Failed to convert Heading"
             
             print "Head:  ", self.disp_data[8]
             #print "Gyro:  ", self.disp_data[9]
             #print "Accel: ", self.disp_data[10]

             self.edisplay.display_data(self.disp_data, self.saving_text)
             
             time.sleep(delay)
Ejemplo n.º 2
0
while t0 == "":
	print "count: ", count
	print "t0: ", t0
	gps.getNext()
	t0 = gps.getTime()
	time.sleep(.5)
	count = count + 1
	
print "count: ", count
print "t0: ", t0
	
t1 = "00:00:00"
t2 = "10:10:10"
t3 = "22:23:24"
t4 = "01:01:01"
t5 = "08:45:33"

t10 = dataFormat.convertTime("am/pm", "EDT", t0)
t11 = dataFormat.convertTime("am/pm", "EDT", t1)
t12 = dataFormat.convertTime("am/pm", "EDT", t2)
t13 = dataFormat.convertTime("am/pm", "EDT", t3)
t14 = dataFormat.convertTime("am/pm", "EDT", t4)
t15 = dataFormat.convertTime("am/pm", "EDT", t5)

print "t0: ", t10
print "t1: ", t11
print "t2: ", t12
print "t3: ", t13
print "t4: ", t14
print "t5: ", t15