示例#1
0
import sys
sys.path.insert(0, '/Users/yuchangzhang/git/OSIMS/backend')
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib import style
from streaming.plotlib import hcPlot
from tools.time import Time

style.use('fivethirtyeight')

fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
fig.suptitle('Hot Corner Plot', fontsize=16)
ax.set_xlabel('Time (s)')
ax.set_ylabel('Temperature (C)')

t = Time()

filename = t.filenamegen()
path = '/Users/yuchangzhang/git/OSIMS/data'

ani = animation.FuncAnimation(fig,
                              hcPlot,
                              fargs=(filename, path, ax),
                              interval=1000)
plt.show()
示例#2
0
import numpy as np
import matplotlib.pyplot as plt

# initialize
palette, palbar = palette()
logo = cv2.imread(
    '/Users/yuchangzhang/git/OSIMS/frontend/images/OSIMS_icon.png')
a = Brd()
a.setup(ip='192.168.1.66', port=333)
a.connect()
frame = a.recvImage(9600)
timer = Time()
presec = timer.time()
video = cv2.VideoWriter('video.avi', -1, 9, (800, 600))
datapath = '/Users/yuchangzhang/git/OSIMS/data'
filename = timer.filenamegen()
hc_buffer = []

# select palette range:
args = sys.argv
mode = args[1]  #'Default'    (20,60)
minval = int(args[2])
maxval = int(args[3])

if mode == 'Default':
    floor = 20
    ceiling = 60
    floor = 27315 + floor * 100
    ceiling = 27315 + ceiling * 100
elif mode == 'Auto':
    frame = a.recvImage(9600)