Index: dcm_viewer.py
===================================================================
--- dcm_viewer.py	(revision 1620)
+++ dcm_viewer.py	(working copy)
@@ -13,7 +13,8 @@
 from time import time
 import re
 from visual import *
-from matrixpilot_lib import telemetry
+#from matrixpilot_lib import telemetry
+from matrixpilot_lib import ascii_telemetry_file
 from matrixpilot_lib import matrix_multiply_3x3_3x1
 
 def conv_udb_vpython(vector) :
@@ -29,13 +30,14 @@
     return(matrix_multiply_3x3_3x1(vpython_rotate, vector))
     
 # Setup the Serial Port Communications
-ser = serial.Serial(3)  # open COM 4, Change this for your setup.
-print ser.portstr       # check which port was really used
-print ser              
-ser.baudrate = 19200    # UDB prints telemetry at 19200 baud.
-print                   # print out the serial configuration
+##ser = serial.Serial(3)  # open COM 4, Change this for your setup.
+##print ser.portstr       # check which port was really used
+##print ser              
+##ser.baudrate = 19200    # UDB prints telemetry at 19200 baud.
+##print                   # print out the serial configuration
 
-telemetry_line = telemetry() # instantiate the telemetry class
+
+telemetry = ascii_telemetry_file("roll test.txt") # instantiate the telemetry class
 max_tm_actual = 0
 line_no = 0
 
@@ -74,23 +76,24 @@
 rmat = [0,0,0,0,0,0,0,0,0] 
 result = "Not set yet"
 while (True) :
-    try:
+#    try:
         line_no += 1
-        line = ser.readline()
-        
-        result = telemetry_line.parse(line, line_no, max_tm_actual)
+        #line = ser.readline()
+        line = telemetry.next()
         print line
-        
-        if result == "F2" : # If received SERIAL_UDB or SERIAL_UDB_EXTRA format telemetry
-            rmat[0] =   telemetry_line.rmat0 /16384.0
-            rmat[1] =   telemetry_line.rmat1 /16384.0
-            rmat[2] =   telemetry_line.rmat2 /16384.0
-            rmat[3] =   telemetry_line.rmat3 /16384.0
-            rmat[4] =   telemetry_line.rmat4 /16384.0
-            rmat[5] =   telemetry_line.rmat5 /16384.0
-            rmat[6] =   telemetry_line.rmat6 /16384.0
-            rmat[7] =   telemetry_line.rmat7 /16384.0
-            rmat[8] =   telemetry_line.rmat8 /16384.0
+        if line == "" :# End of file
+            break
+        log = telemetry.parse(line, line_no, max_tm_actual)
+        if log.log_format == "F2" : # If received SERIAL_UDB or SERIAL_UDB_EXTRA format telemetry
+            rmat[0] =   log.rmat0 /16384.0
+            rmat[1] =   log.rmat1 /16384.0
+            rmat[2] =   log.rmat2 /16384.0
+            rmat[3] =   log.rmat3 /16384.0
+            rmat[4] =   log.rmat4 /16384.0
+            rmat[5] =   log.rmat5 /16384.0
+            rmat[6] =   log.rmat6 /16384.0
+            rmat[7] =   log.rmat7 /16384.0
+            rmat[8] =   log.rmat8 /16384.0
             fuselage_vector_rotated  = matrix_multiply_3x3_3x1(rmat,fuselage_vector_udb)
             fuselage_plane.axis  = conv_udb_vpython(fuselage_vector_rotated)
             fuselage_plane.length = f_length
@@ -104,17 +107,19 @@
             right_wing.length = w_length
             right_wing.pos = (0,0,0)
             magnetic_scale_factor = 10 # Change this to scale the line appropriately. The vector should be about 1 unit in length.
-            mag_udb_axis = (telemetry_line.earth_mag_vec_E / magnetic_scale_factor, \
-                             telemetry_line.earth_mag_vec_N / magnetic_scale_factor, \
-                             telemetry_line.earth_mag_vec_Z / magnetic_scale_factor)
+            mag_udb_axis = (log.earth_mag_vec_E / magnetic_scale_factor, \
+                             log.earth_mag_vec_N / magnetic_scale_factor, \
+                             log.earth_mag_vec_Z / magnetic_scale_factor)
             mag_vp_axis  = conv_udb_vpython(mag_udb_axis)
             mag_axis.axis = mag_vp_axis
             
+           
+##    except:
+##        print "There has been a program exception."
+##        print "This has been caught by dcm_viewer's own code logic"
+##        print "That logic will now close the program, and close the serial port"
+##        ser.close()
+##        exit()
 
-            
-    except:
-        print "There has been a program exception."
-        print "This has been caught by dcm_viewer's own code logic"
-        print "That logic will now close the program, and close the serial port"
-        ser.close()
-        exit()
+ser.close()
+exit()
