Changeset - edf46615712a
[Not reviewed]
default
0 1 0
Drew Perttula - 11 years ago 2014-05-29 07:12:31
drewp@bigasterisk.com
don't write extra precision in curve data. keep curvecalc rows sorted
Ignore-this: 71794339abfd347ccd3c0d99be635457
1 file changed with 7 insertions and 2 deletions:
0 comments (0 inline, 0 general)
light9/curvecalc/curve.py
Show inline comments
 
@@ -56,7 +56,12 @@ class Curve(object):
 
        dispatcher.send("points changed",sender=self)
 

	
 
    def points_as_string(self):
 
        return ' '.join("%s %r" % p for p in self.points)
 
        def outVal(x):
 
            if isinstance(x, basestring): # markers
 
                return x
 
            return "%.4g" % x
 
        return ' '.join("%s %s" % (outVal(p[0]), outVal(p[1]))
 
                        for p in self.points)
 
        
 
    def save(self,filename):
 
        # this is just around for markers, now
 
@@ -204,7 +209,7 @@ class Curveset(object):
 
        if self.currentSong is None:
 
            return
 

	
 
        for uri in self.graph.objects(self.currentSong, L9['curve']):
 
        for uri in sorted(self.graph.objects(self.currentSong, L9['curve'])):
 
            pts = self.graph.value(uri, L9['points'])
 
            c = Curve(uri, pointsStorage='file' if pts is None else 'graph')
 
            if pts is not None:
0 comments (0 inline, 0 general)