コード例 #1
0
def bdrhistory():
    global b
    wday = b.Days.index(request.args.get('wday'))
    P_Ch = int(request.args.get('P_Ch'))
    T_Ch = int(request.args.get('T_Ch'))
    P_Ch2 = int(request.args.get('P_Ch2'))
    T_Ch2 = int(request.args.get('T_Ch2'))
    b = bluefors()
    b.selectday(wday)
    [startimeP, tp, P, P_stat] = b.pressurelog(P_Ch)
    [startimeT, tt, T] = b.temperaturelog(T_Ch)
    if P_Ch2 > 0 and T_Ch2 > 0:
        [startimeP, tp2, P2, P_stat2] = b.pressurelog(P_Ch2)
        [startimeT, tt2, T2] = b.temperaturelog(T_Ch2)
    elif P_Ch2 > 0:
        [startimeP, tp2, P2, P_stat2] = b.pressurelog(P_Ch2)
        [startimeT, tt2, T2] = [startimeT, tt, T]
    elif T_Ch2 > 0:
        [startimeP, tp2, P2, P_stat2] = [startimeP, tp, P, P_stat]
        [startimeT, tt2, T2] = b.temperaturelog(T_Ch2)
    else:
        [startimeP, tp2, P2, P_stat2] = [startimeP, tp, P, P_stat]
        [startimeT, tt2, T2] = [startimeT, tt, T]
    return jsonify(startimeP=startimeP,
                   startimeT=startimeT,
                   tp=tp,
                   P=P,
                   P_stat=P_stat,
                   tt=tt,
                   T=T,
                   tp2=tp2,
                   P2=P2,
                   P_stat2=P_stat2,
                   tt2=tt2,
                   T2=T2)
コード例 #2
0
def bdrhistory():
	global b, bdrlogs
	wday = int(request.args.get('wday'))
	P_Ch = int(request.args.get('P_Ch'))
	T_Ch = int(request.args.get('T_Ch'))
	P_Ch2 = int(request.args.get('P_Ch2'))
	T_Ch2 = int(request.args.get('T_Ch2'))
	OptionS = request.args.get('OptS')
	OptionV = request.args.get('OptV')

	b = bluefors()
	b.selectday(wday)

	tp, P, P_stat = b.pressurelog(P_Ch)
	tt, T = b.temperaturelog(T_Ch)
	tp2, P2, P_stat2 = b.pressurelog(P_Ch2)
	tt2, T2 = b.temperaturelog(T_Ch2)

	if OptionS == 'flow': tos, Opts = b.flowmeterlog()
	else: tos, Opts = b.statuslog(OptionS)
	tov, Optv = b.channellog(OptionV)

	bdrlogs = dict(bdr_P=P,bdr_T=T) # for forecast
	# print("T: %s"%bdrlogs['bdr_%s'%('T')][-15:])

	log = pauselog() #disable logging (NOT applicable on Apache)
	return jsonify(log=str(log), tp=tp, P=P, P_stat=P_stat, tt=tt, T=T, tp2=tp2, P2=P2, P_stat2=P_stat2, tt2=tt2, T2=T2, tos=tos, Opts=Opts, tov=tov, Optv=Optv)
コード例 #3
0
def allstatus():
    dr = bluefors()
    dr.selectday(-1)

    # Logging Latest Key-Readings for ALL
    latestbdr = {}
    for i in range(6):
        latestbdr.update({"P%s" % (i + 1): dr.pressurelog(i + 1)[1][-1]})
    for i in [1, 2, 5, 6, 7]:
        latestbdr.update({"T%s" % (i + 1): dr.temperaturelog(i + 1)[1][-1]})
    set_status("BDR", latestbdr)

    status = {}
    status['PSGV'] = get_status('PSGV')["state"]
    status['AWG'] = get_status('AWG')["state"]

    log = pauselog()  #disable logging (NOT applicable on Apache)
    return jsonify(log=str(log), latestbdr=latestbdr, status=status)
コード例 #4
0
def bdr():
    global b
    b = bluefors()
    return render_template("blog/machn/bdr.html", Days=b.Days)
コード例 #5
0
ファイル: machine.py プロジェクト: Bocheng662533/PYQUM
def bdrinit():
    global b
    b = bluefors()
    return jsonify(Days=b.Days)
コード例 #6
0
ファイル: machine.py プロジェクト: zeyanchen/PYQUM
def bdrtemperature():
    b = bluefors()
    b.selectday(3)
    [startime, t, T] = b.temperature(5)
    return jsonify(startime=startime, t=t, T=T)