Really hideous merge of Rolf Schmidt's code.
[hooke.git] / hooke / driver / picoforce.py
index c60e57cb3a03c1b62a4cd5cd06d75ba0441fc27f..51e9d21a9b1d37d47ef27909d9201375cdd421ef 100644 (file)
@@ -8,12 +8,15 @@ Copyright (C) 2006 Massimo Sandal (University of Bologna, Italy).
 This program is released under the GNU General Public License version 2.
 '''
 
-import re, struct
+import re
+import struct
 from scipy import arange
 
+#from .. import libhooke as lh
 from .. import libhookecurve as lhc
 
-__version__='0.0.0.20080404'
+
+__version__='0.0.0.20090923'
 
 
 class DataChunk(list):
@@ -35,7 +38,7 @@ class picoforceDriver(lhc.Driver):
         '''
         constructor method
         '''
-
+        filename = lh.get_file_path(filename)
         self.textfile=file(filename)
         self.binfile=file(filename,'rb')
 
@@ -533,11 +536,13 @@ class picoforceDriver(lhc.Driver):
 
         main_plot=lhc.PlotObject()
 
-        main_plot.vectors=[[zdomain.ext()[0:samples], force.ext()[0:samples]],[zdomain.ret()[0:samples], force.ret()[0:samples]]]
+        main_plot.vectors = [[zdomain.ext()[0:samples], force.ext()[0:samples]],[zdomain.ret()[0:samples], force.ret()[0:samples]]]
         main_plot.normalize_vectors()
-        main_plot.units=['meters','newton']
-        main_plot.destination=0
-        main_plot.title=self.filepath
-
+        main_plot.units = ['meters','newton']
+        main_plot.destination = 0
+        main_plit.filename = self.filepath
+        main_plot.title = self.filepath
+        main_plot.colors = ['red', 'blue']
+        main_plit.styles = ['plot', 'plot']
 
         return [main_plot]