checkin after svn update

--HG--
branch : sandbox
This commit is contained in:
Andreas
2009-10-03 09:51:09 +00:00
parent d4d45b00c7
commit bb3de1e8c3
3 changed files with 655 additions and 9 deletions

View File

@@ -362,12 +362,12 @@ class Main:
# create plot
fig = plt.figure()
self.ax1 = fig.add_subplot(311) # ticks
self.ax2 = fig.add_subplot(312) # slope of line segement
self.ax3 = fig.add_subplot(313) # moving average (10min)
self.ax1 = fig.add_subplot(211) # ticks
# self.ax2 = fig.add_subplot(312) # slope of line segement
self.ax3 = fig.add_subplot(212) # moving average (10min)
self.ax1.set_ylabel("ticks")
self.ax2.set_ylabel("slope")
# self.ax2.set_ylabel("slope")
self.ax3.set_ylabel("gearing")
major_fmt = mdates.DateFormatter('%H:%M:%S')
@@ -378,12 +378,14 @@ class Main:
self.ax1.format_ydata = lambda x: '%1.2f' % x
self.ax1.grid(True)
"""
self.ax2.xaxis.set_major_formatter(major_fmt)
self.ax2.xaxis.set_major_locator(mdates.MinuteLocator(byminute = range(0, 60, 10)))
self.ax2.xaxis.set_minor_locator(mdates.MinuteLocator())
self.ax2.format_xdata = major_fmt
self.ax2.format_ydata = lambda x: '%1.2f' % x
self.ax2.grid(True)
"""
self.ax3.xaxis.set_major_formatter(major_fmt)
self.ax3.xaxis.set_major_locator(mdates.MinuteLocator(byminute = range(0, 60, 10)))
@@ -398,7 +400,7 @@ class Main:
# create artists
LOG.debug("Loading ticks...")
self.xs, self.ys, self.vs = tdl(datetime.datetime(2009, 7, 2))
self.xs, self.ys, self.vs = tdl(datetime.datetime(2009, 7, 1))
LOG.debug("Ticks loaded.")
lows, highs = find_lows_highs(self.xs, self.ys)
self.mas = self.ys[:]
@@ -406,7 +408,7 @@ class Main:
self.gs = [ 0 ] * len(self.xs)
self.mmh = TimedLohi(5)
self.osw = SlidingWindow(5)
self.osw = SlidingWindow(2)
self.w0 = 0
self.wd = 2000
@@ -426,7 +428,7 @@ class Main:
self.dl, = self.ax1.plot_date(xr, vr, 'g-')
# slope subplot
self.sl, = self.ax2.plot_date(xr, sr, '-')
# self.sl, = self.ax2.plot_date(xr, sr, '-')
# gearing subplot
self.gl, = self.ax3.plot_date(xr, gr, '-')
@@ -468,7 +470,7 @@ class Main:
# update tick line
self.tl.set_data(xr, yr)
# update segment slope
self.sl.set_data(xr, sr)
# self.sl.set_data(xr, sr)
# update volume line
self.dl.set_data(xr, vr)
# gearing line
@@ -491,7 +493,7 @@ class Main:
self.yhigh = y
self.ylow = self.yhigh - bias
self.ax1.axis([xr[0], xr[-1], self.ylow, self.yhigh])
self.ax2.axis([xr[0], xr[-1], -5, +5])
# self.ax2.axis([xr[0], xr[-1], -5, +5])
self.ax3.axis([xr[0], xr[-1], -50, +50])
def tick_window(self, w0, wd = 1000):