如何写一个完整的django网站:配置环境啥的不讲(python+mysql+html相关) 伍

既然说了要放详细代码,就在这里把视图中的代码放一下把,不过前半部分都是内容的代码,可以忽略
很长很长,不建议一点一点研究,可以参考一二三四中的内容来了解。
效果图放在陆吧。

from django.shortcuts import render

# Create your views here.

from django.shortcuts import render
from .models import People,faultmessage,quejlzk,yczb


# Create your views here.
from django.http import HttpResponse


import datetime

#以下是内置的计算函数,很多很多


import random
import time
import _thread
global ym
ym=1       #定义页码,一开始位于第一页

global tm   #代表时间


def Reverse(lst):
    return [ele for ele in reversed(lst)]

def swhs(a):   #小数点后保留三位
    a=int(1000*a)
    c=float(a)
    a=a/1000
    return a


def lwhs(a):   #小数点后保留两位
    a=int(100*a)
    c=float(a)
    a=a/100
    return a

def ywhs(a):   #小数点后保留一位
    a=int(10*a)
    c=float(a)
    a=a/10
    return a

def zshs(a):   #整数
    a=int(a)
    return a


def zrqyl(a):   #再热前压力,如果无值即随机出一个
    if(a==0):#未设置前为0
        a=9.5
    return a

def zrhyl(a):  #再热后压力,4个档位
    if(a==0):
        a=9.5
    elif(a<=10):
        b=random.random()
        a=a+b/2
    elif(a>10 and a<=12):
        b=random.random()
        a=a+b/3
    elif(a<=13 and a>12):
        b=random.random()
        a=a+b/4
    else:
        b=random.random()
        if(b>0.6):
            b=random.random()
            a=a+b/4
        else:
            b=random.random()
            a=a-b/4
    return a

def zrzqfmy(a):  #再热主汽阀门外界,低温
    if(a==0):
        b=random.random()
        a=34.5+b
    if(a<50):
        b=random.random()
        a=a+b*10
    elif(a>=50 and a<75):
        b=random.random()
        a=a+b*10
    elif(a>=75 and a<85):
        b=random.random()
        a=a+b*5
    else:
        b=random.random()
        if(b>0.6):
            b=random.random()
            a=a+b
        else:
            b=random.random()
            a=a-b
    return a

def zrzqfmh(a):    #再热主汽阀门里
    if(a==0):
        b=random.random()
        a=34.5+b
    if(a<50):
        b=random.random()
        a=a+b*15
    elif(a>=50 and a<75):
        b=random.random()
        a=a+b*15
    elif(a>=75 and a<85):
        b=random.random()
        a=a+b*10
    else:
        b=random.random()
        if(b>0.6):
            b=random.random()
            a=a+b
        else:
            b=random.random()
            a=a
    return a

def gyzqfmy(a):  #高压主汽阀门外界,低温
    a=zrzqfmy(a)
    return a

def gyzqfmh(a):  #高压主汽阀门内,高温
    a=zrzqfmh(a)
    return a

def zypqyl(a):  #中压排气压力
    if(a==0):
        a=random.random()
        a=0.5+a
    else:
        if(a<=1):
            b=random.random()
            a=a+b/2
        elif(1<a<1.3):
            b=random.random()
            a=a+b/3
        else:
            b=random.random()
            if(b<=0.6):
                b=random.random()
                a=a+b/3
            else:
                b=random.random()
                a=a-b/3
    return a

def gypqyl(a):   #高压排气压力
    a=zypqyl(a)
    return a

def qfmgzqyl(a):    #气封母管蒸汽压力
    b=random.random()
    if(a==0):
        a=b/5
    else:
        if(a<=0.1):
            a=a+b/8
        else:
            if(b<0.5):
                a=a+b/8
            else:
                a=a-b/8
    return a

def qfzqyl(a):   #气封蒸汽压力
    b = qfmgzqyl(a)
    return b

def ddl(a):  #电导率
    if(a==0):
        a=0.01
    else:
        if(a<=0.02):
            b=random.random()
            a=a+b/50
        else:
            b=random.random()
            if(b<0.55):
                b=random.random()
                a=a+b/80
            else:
                b=random.random()
                a=a-b/80
    return a

def yjbhwd(a):   #预计饱和温度
    if(a==0):
        b=random.random()
        a = 80+b*50
        a = int(a)
    return a

def sjbhwd(a,a2):   #实际饱和温度,a为上一次的实际饱和温度,a2为预计饱和温度
    if(a==0):
        return a2
    if(a<=a2):
        b=random.random()
        a = int(a+b*10)
    else:
        c=a-a2
        b=random.random()
        if(c>=5):
            a=a-b
        elif(c>=3 and c<=1):
            a=a+b
        else:
            a = a+2*b
    return a

def qgsbgwd(a):    #气缸上半缸温度
    if(a==0):
        return 60
    b=random.random()
    if(a>150):
        a =a
    elif(a<100):
        a = a+b*10
    elif(a<=90 and a>=80):
        a = a + b*10
    elif(a<=80 and a>=70):
        a = a+20*b
    else:
        a = a+30*b
    return a

def qgxbgwd(a):   #气缸下班杠温度
    if(a==0):
        return 60
    b=random.random()
    if(a>160):
        a = a
    elif(a<100):
        a = a+20*b
    elif(a<=90 and a>=80):
        a = a + b*30
    elif(a<=80 and a>=70):
        a = a+b*30
    else:
        a = a+40*b
    return a

def zcbshjwd(a):   #轴承甲氏合金温度,models中错了
    if(a==0):
        return 70
    b=random.random()
    if(a<=60):
        a=a+b
    elif(a>60 and a<120):
        if(b<0.7):
            b=random.random()
            a=a+b*20
        elif(b>0.7):
            b=random.random()
            a=a-b*10
    return a

def zcswbwd(a):  #蒸气室外壁温度
    if(a==0):
        a=55
    if(a>=60 and a<=100):
        b=random.random()
        a=a+b*10
    else:
        b=random.random()
        if(b<0.2):
            a=a+b
    return a


def zcsnbwd(a):   #蒸气室内壁温度
    if(a==0):
        a=55
    if(a>=60 and a<=180):
        b=random.random()
        a=a+b*20
    else:
        b=random.random()
        if(b<0.2):
            a=a+b*10
    return a

def cskwd(a):     #出水口温度
    if(a==0):
        a=55
    if(a>=60 and a<=100):
        b=random.random()
        a=a+b*10
    else:
        b=random.random()
        if(b<0.2):
            a=a+b*10
    return a

def jskwd(a):   #进水口温度
    if(a==0):
        a=48
    if(a>=60 and a<=100):
        b=random.random()
        a=a+b*5
    else:
        b=random.random()
        if(b<0.2):
            a=a+b*10
    return a

def jskyc(a):  #进水口压差
    if(a==0):
        a=10
        return a
    b=random.random()
    if(a>=10):
        a=a-b/10
    else:
        a=a+b/10
    return a

def cskyc(a):    #出水口压差
    if(a==0):
        a=10
        return a
    b=random.random()
    if(a>=10):
        a=a-b/10
    else:
        a=a+b/10
    return a

def gzyw(a):  #工作油温
    if(a==0):
        return 35
    if(a<=64 and a>=45):
        b=random.random()
        a=a+b*10
    elif(a<45):
        b=random.random()
        a=a+20*b
    else:
        b=random.random()
        if(b>=0.30):
            b=random.random()
            a=a+b*2
        else:
            b=random.random()
            a=a-b*2
    return a

def jldzybgzyy(a):  #交流顶轴油泵工作油压
    if(a==0):
        a = 10
        return a
    elif(a>=20):
        a=a-1;
        return a
    b=random.random()
    if(b>0.4):
        a = a+b
    else:
        a = a-b
    return a

def dygzfgqwd(a):   #低压杠轴封供汽温度
    if(a==0):
        a = 150
        return a
    b=random.random()
    if(b>0.5):
        b=random.random()
        a = a+b*10
    else:
        b=random.random()
        a = a-b*10
    return a

def zzqyl(a):
    if(a==0):
        a=15
    else:
        b=random.random()
        if(b>0.3):
            b=random.random()
            a=a+b
        else:
            b=random.random()
            a=a-b

    return a





#以上是已经定型得内容


def dy3(a,a1,a2,a3,a4,a5,a51,a6,a7,a8,a9,b1,b2,b3,b4,b5,b6,b7,b8,b9,c1,c2,c3,c4,c5,c6,c7,i):      #控制几个属性并行存进去
    a1=zrqyl(a1)
    a1=swhs(a1)
    a2=zrhyl(a2)
    a2=swhs(a2)
    a3=zrzqfmy(a3)
    a3=lwhs(a3)
    a4=zrzqfmh(a4)
    a4=lwhs(a4)
    a5=gyzqfmy(a5)
    a5=lwhs(a5)
    a51=gyzqfmh(a51)
    a51=lwhs(a51)
    a6=zypqyl(a6)
    a6=zypqyl(a6)
    a7=gypqyl(a7)
    a7=gypqyl(a7)
    a8=qfmgzqyl(a8)
    a8=swhs(a8)
    a9=qfzqyl(a9)
    a9=swhs(a9)
    b1=ddl(b1)
    b1=swhs(b1)
    b2=yjbhwd(b2)
    b2=lwhs(b2)
    b3=sjbhwd(b3,b2)
    b3=lwhs(b3)
    b4=qgsbgwd(b4)
    b4=lwhs(b4)
    b5=qgxbgwd(b5)
    b5=lwhs(b5)
    b6=zcbshjwd(b6)
    b6=lwhs(b6)
    b7=zcswbwd(b7)
    b7=lwhs(b7)
    b8=zcsnbwd(b8)
    b8=lwhs(b8)
    b9=jskwd(b9)
    b9=lwhs(b9)
    c1=cskwd(c1)
    c1=lwhs(c1)
    c2=jskyc(c2)
    c2=swhs(c2)
    c3=cskyc(c3)
    c3=swhs(c3)
    c4=gzyw(c4)
    c4=lwhs(c4)
    c5=jldzybgzyy(c5)
    c5=swhs(c5)
    c6=dygzfgqwd(c6)
    c6=lwhs(c6)
    c7=zzqyl(c7)
    c7=swhs(c7)
    sj=quejlzk(jlsj=time.strftime('%Y-%m-%d %H:%M:%S',a),zrqyl=a1,zrhyl=a2,zrzqfmy=a3,zrzqfmh=a4,gyzqfmy=a5,gyzqfmh=a51,zypqyl=a6,gypqyl=a7,qfmgzqyl=a8,qfzqyl=a9,ddl=b1,yjbhwd=b2,sjbhwd=b3,qgsbgwd=b4,qgxbgwd=b5,zcbshjwd=b6,zcswbwd=b7,zcsnbwd=b8,jskwd=b9,cskwd=c1,jskyc=c2,cskyc=c3,gzyw=c4,jldzybgzyy=c5,dygzfgqwd=c6,zzqyl=c7,quid=i)
    sj.save()
    d=a2-a1      #再热压力比值  1
    if(d>1.25): 
        sj2=yczb(jlsj=time.strftime('%Y-%m-%d %H:%M:%S',a),quenum=1,ycz=d,quid=i)
        sj2.save()
    d=a4-a3    #  再热主汽阀门进口温差  2
    if(d>14):  
        sj2=yczb(jlsj=time.strftime('%Y-%m-%d %H:%M:%S',a),quenum=2,ycz=d,quid=i)
        sj2.save()
    d=a51-a5    #  高压主汽阀门进口温差  3
    if(d>14):  
        sj2=yczb(jlsj=time.strftime('%Y-%m-%d %H:%M:%S',a),quenum=3,ycz=d,quid=i)
        sj2.save()
    d=a6    #  中压排气压力
    if(d>1.47):  
        sj2=yczb(jlsj=time.strftime('%Y-%m-%d %H:%M:%S',a),quenum=4,ycz=d,quid=i)
        sj2.save()
    d=a7    #  高压排气压力
    if(d>1.47):  
        sj2=yczb(jlsj=time.strftime('%Y-%m-%d %H:%M:%S',a),quenum=5,ycz=d,quid=i)
        sj2.save()
    d=a8    #  气封母管蒸汽压力
    if(d>0.2):  
        sj2=yczb(jlsj=time.strftime('%Y-%m-%d %H:%M:%S',a),quenum=6,ycz=d,quid=i)
        sj2.save()
    d=a9    #  气封蒸汽压力
    if(d>0.2):  
        sj2=yczb(jlsj=time.strftime('%Y-%m-%d %H:%M:%S',a),quenum=7,ycz=d,quid=i)
        sj2.save()
    d=b1    #  电导率
    if(d>0.03):  
        sj2=yczb(jlsj=time.strftime('%Y-%m-%d %H:%M:%S',a),quenum=8,ycz=d,quid=i)
        sj2.save()
    d=b3-b2  #饱和温度偏差
    if(d>5):
        sj2=yczb(jlsj=time.strftime('%Y-%m-%d %H:%M:%S',a),quenum=9,ycz=d,quid=i)
        sj2.save()
    d=b5-b4 #气缸上下半钢温差
    if(d>42):   
        sj2=yczb(jlsj=time.strftime('%Y-%m-%d %H:%M:%S',a),quenum=10,ycz=d,quid=i)
        sj2.save()
    d=b6    #轴承巴氏合金温度
    if(d>107):  
        sj2=yczb(jlsj=time.strftime('%Y-%m-%d %H:%M:%S',a),quenum=11,ycz=d,quid=i)
        sj2.save()
    if(d<66):
        sj2=yczb(jlsj=time.strftime('%Y-%m-%d %H:%M:%S',a),quenum=11,ycz=d,quid=i)
        sj2.save()
    d=b8-b7    #蒸气室内外壁温差
    if(d>83):  
        sj2=yczb(jlsj=time.strftime('%Y-%m-%d %H:%M:%S',a),quenum=12,ycz=d,quid=i)
        sj2.save()
    d=c1-b9   #进出水口温差
    if(d>10):  
        sj2=yczb(jlsj=time.strftime('%Y-%m-%d %H:%M:%S',a),quenum=13,ycz=d,quid=i)
        sj2.save()
    d=c3-c2   #进出水口压差
    if(d>0.1):  
        sj2=yczb(jlsj=time.strftime('%Y-%m-%d %H:%M:%S',a),quenum=14,ycz=d,quid=i)
        sj2.save()
    d=c4     #工作油温
    if(d>65):
        sj2=yczb(jlsj=time.strftime('%Y-%m-%d %H:%M:%S',a),quenum=15,ycz=d,quid=i)
        sj2.save()
    d=c5     #交流顶轴油泵工作油压
    if(d>15 or d<5):
        sj2=yczb(jlsj=time.strftime('%Y-%m-%d %H:%M:%S',a),quenum=16,ycz=d,quid=i)
        sj2.save()
    d=c6     #低压缸轴封供汽温度
    if(d<121 or d>177):
        sj2=yczb(jlsj=time.strftime('%Y-%m-%d %H:%M:%S',a),quenum=17,ycz=d,quid=i)
        sj2.save()
    d=c7     #主蒸汽压力
    if(d>19.6):
        sj2=yczb(jlsj=time.strftime('%Y-%m-%d %H:%M:%S',a),quenum=18,ycz=d,quid=i)
        sj2.save()








def dy():   #把id移放到下层
    i=0
    a1=0
    a2=0
    a3=0
    a4=0
    a5=0
    a6=0
    a7=0
    a8=0
    a9=0
    b1=0
    b2=0
    b3=0
    b4=0
    b5=0
    b6=0
    b7=0
    b8=0
    b9=0
    c1=0
    c2=0
    c3=0
    c4=0
    c5=0
    c6=0
    c7=0
    a51=0
    while(i<10000):
            #10秒
        time.sleep(10)   #睡眠10秒钟
        a=time.localtime(time.time())
        #所以亟待解决的问题是获取数据.
        id=0
        while(id<5):
            id=id+1
            #我们应该在这个位置获取最新的数据
            hq=quejlzk.objects.all()    #获取总表
            for h in hq:
                if(h.quid==id):
                    a1=h.zrqyl
                    a2=h.zrhyl
                    a3=h.zrzqfmy
                    a4=h.zrzqfmh
                    a5=h.gyzqfmy
                    a51=h.gyzqfmh
                    a6=h.zypqyl
                    a7=h.gypqyl
                    a8=h.qfmgzqyl
                    a9=h.qfzqyl
                    b1=h.ddl
                    b2=h.yjbhwd
                    b3=h.sjbhwd
                    b4=h.qgsbgwd
                    b5=h.qgxbgwd
                    b6=h.zcbshjwd
                    b7=h.zcswbwd
                    b8=h.zcsnbwd
                    b9=h.jskwd
                    c1=h.cskwd
                    c2=h.jskyc
                    c3=h.cskyc
                    c4=h.gzyw
                    c5=h.jldzybgzyy
                    c6=h.dygzfgqwd
                    c7=h.zzqyl
                    break
            dy3(a,a1,a2,a3,a4,a5,a51,a6,a7,a8,a9,b1,b2,b3,b4,b5,b6,b7,b8,b9,c1,c2,c3,c4,c5,c6,c7,id)





#隔行,以下用来连接html

#在此插入一个用来每五秒钟更新数据库的线程
i=0  #如果是



def cccx(threadName, delay):#存储程序
    ti=0
    while(ti<1000):
        dy()
        

def denglu(request):    #登陆初始界面
    global i
    if(i==0):
        try:
            i=i+1
            _thread.start_new_thread( cccx, ("Thread-1", 20, ) )
        except:
            print ("Error: 无法启动线程")
    peoplelist = People.objects.all()
    
    return render(request,'myApp/denglu.html',{"peop":peoplelist,'a':0})   #最初的登陆界面

def zhuce(request):      #注册板块,引导进入
    peoplelist = People.objects.all()
    a=0     #告诉注册界面此时是正常启动
    return render(request,'myApp/zhuce.html',{"peop":peoplelist,'a':0})    #注册界面
    
def zhuce2(request):    #运行注册程序
    if request.method=='POST':
        username = request.POST.get('username','')#获取用户名
        count = request.POST.get('count','')#获取账户
        mima = request.POST.get('mima','')#获取密码
        mima2 =request.POST.get('mima2','')#获取确认密码
        #确认密码相同
        if(mima != mima2):
            return render(request,'myApp/zhuce.html',{'a':1})
        #判断是否用户重复
        p = People.objects.all()
        for pe in p:
            if(pe.Pid == count):
                peoplelist = People.objects.all()
                return render(request,'myApp/zhuce.html',{"peop":peoplelist,'a':2})  #注册失败
        a = People(Peo=1,Pname=str(username),Psecret=str(mima),Pid=str(count))
        a.save()  #存放一下
        peoplelist = People.objects.all()
        return render(request,'myApp/denglu.html',{"peop":peoplelist,'a':2})

#有效代码 
    #a = People(Peo=1,Pname='2',Psecret='3',Pid='4')
    #a.save()
    #return HttpResponse("sunck is a goodman")


def getuser3(request):       #从登陆中获取信息
    if request.method == 'POST':
        print(request.POST)
        count = request.POST.get('username','')#获取账户
        mima = request.POST.get('password','')#获取密码
        print(request.POST.get('username'))
        sz=0
        pe=People.objects.all()
        for p in pe:
            print(p.Pid)
            print(p.Psecret)
            if(count==p.Pid and mima==p.Psecret):
                sz=sz+1
        #如果登陆失败
        if(sz==0):
            return render(request,'myApp/denglu.html',{'a':1})
    global ym
    ym=1
    yc=yczb.objects.all()
    #统计五个机组,suma到sume
    suma,sumb,sumc,sumd,sume=0,0,0,0,0
    suma2,sumb2,sumc2,sumd2,sume2=0,0,0,0,0
    suma3,sumb3,sumc3,sumd3,sume3=0,0,0,0,0
    suma4,sumb4,sumc4,sumd4,sume4=0,0,0,0,0
    #需要转置
    
    yc=Reverse(yc)    #转置
    y1=yc[0]
    tim=y1.jlsj
    tim2,tim3,tim4=0,0,0
    for y in yc:
        if(y.jlsj==tim):
            if(y.quid==1):
                suma=suma+1
            elif(y.quid==2):
                sumb=sumb+1
            elif(y.quid==3):
                sumc=sumc+1
            elif(y.quid==4):
                sumd=sumd+1
            elif(y.quid==5):
                sume=sume+1
    #在这一时刻出现的错误
        if(tim2==0 and y.jlsj!=tim):
            tim2=y.jlsj
        if(y.jlsj==tim2):
            if(y.quid==1):
                suma2=suma2+1
            elif(y.quid==2):
                sumb2=sumb2+1
            elif(y.quid==3):
                sumc2=sumc2+1
            elif(y.quid==4):
                sumd2=sumd2+1
            elif(y.quid==5):
                sume2=sume2+1
        if(tim3==0 and y.jlsj!=tim and y.jlsj!=tim2):
            tim3=y.jlsj
        if(y.jlsj==tim3):
            if(y.quid==1):
                suma3=suma3+1
            elif(y.quid==2):
                sumb3=sumb3+1
            elif(y.quid==3):
                sumc3=sumc3+1
            elif(y.quid==4):
                sumd3=sumd3+1
            elif(y.quid==5):
                sume3=sume3+1
        if(tim4==0 and y.jlsj!=tim and y.jlsj!=tim2 and y.jlsj!=tim3):
            tim4=y.jlsj
        if(y.jlsj==tim4):
            if(y.quid==1):
                suma4=suma4+1
            elif(y.quid==2):
                sumb4=sumb4+1
            elif(y.quid==3):
                sumc4=sumc4+1
            elif(y.quid==4):
                sumd4=sumd4+1
            elif(y.quid==5):
                sume4=sume4+1
    #下一时刻的
    a1 = yc[0]
    a2 = yc[1]
    a3 = yc[2]
    a4 = yc[3]
    a5 = yc[4]
    a6 = yc[5]
    a7 = yc[6]




    return render(request,'myApp/yuan.html',{'t1':tim,'t2':tim2,'t3':tim3,'t4':tim4,'a1':a1,'a2':a2,'a3':a3,'a4':a4,'a5':a5,'a6':a6,'a7':a7,
                                             'sa1':suma,'sb1':sumb,'sc1':sumc,'sd1':sumd,'se1':sume,
                                             'sa2':suma2,'sb2':sumb2,'sc2':sumc2,'sd2':sumd2,'se2':sume2,
                                             'sa3':suma3,'sb3':sumb3,'sc3':sumc3,'sd3':sumd3,'se3':sume3,
                                             'sa4':suma4,'sb4':sumb4,'sc4':sumc4,'sd4':sumd4,'se4':sume4})

    









#现在的下一页



#接下来写历史的下一页
def xiaye(request):
    global ym
    ym=ym+1
    yc=yczb.objects.all()
    #统计五个机组,suma到sume
    suma,sumb,sumc,sumd,sume=0,0,0,0,0
    suma2,sumb2,sumc2,sumd2,sume2=0,0,0,0,0
    suma3,sumb3,sumc3,sumd3,sume3=0,0,0,0,0
    suma4,sumb4,sumc4,sumd4,sume4=0,0,0,0,0
    #需要转置
    
    yc=Reverse(yc)    #转置
    y1=yc[0]
    tim=y1.jlsj
    tim2,tim3,tim4=0,0,0
    for y in yc:
        if(y.jlsj==tim):
            if(y.quid==1):
                suma=suma+1
            elif(y.quid==2):
                sumb=sumb+1
            elif(y.quid==3):
                sumc=sumc+1
            elif(y.quid==4):
                sumd=sumd+1
            elif(y.quid==5):
                sume=sume+1
    #在这一时刻出现的错误
        if(tim2==0 and y.jlsj!=tim):
            tim2=y.jlsj
        if(y.jlsj==tim2):
            if(y.quid==1):
                suma2=suma2+1
            elif(y.quid==2):
                sumb2=sumb2+1
            elif(y.quid==3):
                sumc2=sumc2+1
            elif(y.quid==4):
                sumd2=sumd2+1
            elif(y.quid==5):
                sume2=sume2+1
        if(tim3==0 and y.jlsj!=tim and y.jlsj!=tim2):
            tim3=y.jlsj
        if(y.jlsj==tim3):
            if(y.quid==1):
                suma3=suma3+1
            elif(y.quid==2):
                sumb3=sumb3+1
            elif(y.quid==3):
                sumc3=sumc3+1
            elif(y.quid==4):
                sumd3=sumd3+1
            elif(y.quid==5):
                sume3=sume3+1
        if(tim4==0 and y.jlsj!=tim and y.jlsj!=tim2 and y.jlsj!=tim3):
            tim4=y.jlsj
        if(y.jlsj==tim4):
            if(y.quid==1):
                suma4=suma4+1
            elif(y.quid==2):
                sumb4=sumb4+1
            elif(y.quid==3):
                sumc4=sumc4+1
            elif(y.quid==4):
                sumd4=sumd4+1
            elif(y.quid==5):
                sume4=sume4+1
    #下一时刻的
    if(len(yc)==ym*7-7):
        ym=ym-1
    if(len(yc)==ym*7-6):
        a1=yc[ym*7-7]
        return render(request,'myApp/cklsxx.html',{'t1':tim,'t2':tim2,'t3':tim3,'t4':tim4,'a1':a1,
                                             'sa1':suma,'sb1':sumb,'sc1':sumc,'sd1':sumd,'se1':sume,
                                             'sa2':suma2,'sb2':sumb2,'sc2':sumc2,'sd2':sumd2,'se2':sume2,
                                             'sa3':suma3,'sb3':sumb3,'sc3':sumc3,'sd3':sumd3,'se3':sume3,
                                             'sa4':suma4,'sb4':sumb4,'sc4':sumc4,'sd4':sumd4,'se4':sume4})
    if(len(yc)==ym*7-5):
        a1=yc[ym*7-7]
        a2=yc[ym*7-6]
        return render(request,'myApp/cklsxx.html',{'t1':tim,'t2':tim2,'t3':tim3,'t4':tim4,'a1':a1,'a2':a2,
                                             'sa1':suma,'sb1':sumb,'sc1':sumc,'sd1':sumd,'se1':sume,
                                             'sa2':suma2,'sb2':sumb2,'sc2':sumc2,'sd2':sumd2,'se2':sume2,
                                             'sa3':suma3,'sb3':sumb3,'sc3':sumc3,'sd3':sumd3,'se3':sume3,
                                             'sa4':suma4,'sb4':sumb4,'sc4':sumc4,'sd4':sumd4,'se4':sume4})
    if(len(yc)==ym*7-4):
        a1=yc[ym*7-7]
        a2=yc[ym*7-6]
        a3=yc[ym*7-5]
        return render(request,'myApp/cklsxx.html',{'t1':tim,'t2':tim2,'t3':tim3,'t4':tim4,'a1':a1,'a2':a2,'a3':a3,
                                             'sa1':suma,'sb1':sumb,'sc1':sumc,'sd1':sumd,'se1':sume,
                                             'sa2':suma2,'sb2':sumb2,'sc2':sumc2,'sd2':sumd2,'se2':sume2,
                                             'sa3':suma3,'sb3':sumb3,'sc3':sumc3,'sd3':sumd3,'se3':sume3,
                                             'sa4':suma4,'sb4':sumb4,'sc4':sumc4,'sd4':sumd4,'se4':sume4})
    if(len(yc)==ym*7-3):
        a1=yc[ym*7-7]
        a2=yc[ym*7-6]
        a3=yc[ym*7-5]
        a4=yc[ym*7-4]
        return render(request,'myApp/cklsxx.html',{'t1':tim,'t2':tim2,'t3':tim3,'t4':tim4,'a1':a1,'a2':a2,'a3':a3,'a4':a4,
                                             'sa1':suma,'sb1':sumb,'sc1':sumc,'sd1':sumd,'se1':sume,
                                             'sa2':suma2,'sb2':sumb2,'sc2':sumc2,'sd2':sumd2,'se2':sume2,
                                             'sa3':suma3,'sb3':sumb3,'sc3':sumc3,'sd3':sumd3,'se3':sume3,
                                             'sa4':suma4,'sb4':sumb4,'sc4':sumc4,'sd4':sumd4,'se4':sume4})
    if(len(yc)==ym*7-2):
        a1=yc[ym*7-7]
        a2=yc[ym*7-6]
        a3=yc[ym*7-5]
        a4=yc[ym*7-4]
        a5=yc[ym*7-3]
        return render(request,'myApp/cklsxx.html',{'t1':tim,'t2':tim2,'t3':tim3,'t4':tim4,'a1':a1,'a2':a2,'a3':a3,'a4':a4,'a5':a5,
                                             'sa1':suma,'sb1':sumb,'sc1':sumc,'sd1':sumd,'se1':sume,
                                             'sa2':suma2,'sb2':sumb2,'sc2':sumc2,'sd2':sumd2,'se2':sume2,
                                             'sa3':suma3,'sb3':sumb3,'sc3':sumc3,'sd3':sumd3,'se3':sume3,
                                             'sa4':suma4,'sb4':sumb4,'sc4':sumc4,'sd4':sumd4,'se4':sume4})
    if(len(yc)==ym*7-1):
        a1=yc[ym*7-7]
        a2=yc[ym*7-6]
        a3=yc[ym*7-5]
        a4=yc[ym*7-4]
        a5=yc[ym*7-3]
        a6=yc[ym*7-2]
        return render(request,'myApp/cklsxx.html',{'t1':tim,'t2':tim2,'t3':tim3,'t4':tim4,'a1':a1,'a2':a2,'a3':a3,'a4':a4,'a5':a5,'a6':a6,
                                             'sa1':suma,'sb1':sumb,'sc1':sumc,'sd1':sumd,'se1':sume,
                                             'sa2':suma2,'sb2':sumb2,'sc2':sumc2,'sd2':sumd2,'se2':sume2,
                                             'sa3':suma3,'sb3':sumb3,'sc3':sumc3,'sd3':sumd3,'se3':sume3,
                                             'sa4':suma4,'sb4':sumb4,'sc4':sumc4,'sd4':sumd4,'se4':sume4})
    a1 = yc[ym*7-7]
    a2 = yc[ym*7-6]
    a3 = yc[ym*7-5]
    a4 = yc[ym*7-4]
    a5 = yc[ym*7-3]
    a6 = yc[ym*7-2]
    a7 = yc[ym*7-1]
    return render(request,'myApp/cklsxx.html',{'t1':tim,'t2':tim2,'t3':tim3,'t4':tim4,'a1':a1,'a2':a2,'a3':a3,'a4':a4,'a5':a5,'a6':a6,'a7':a7,
                                             'sa1':suma,'sb1':sumb,'sc1':sumc,'sd1':sumd,'se1':sume,
                                             'sa2':suma2,'sb2':sumb2,'sc2':sumc2,'sd2':sumd2,'se2':sume2,
                                             'sa3':suma3,'sb3':sumb3,'sc3':sumc3,'sd3':sumd3,'se3':sume3,
                                             'sa4':suma4,'sb4':sumb4,'sc4':sumc4,'sd4':sumd4,'se4':sume4})


#接下来写历史的上一页
def shangye(request):
    global ym
    ym=ym-1
    if(ym==0):
        ym=1
    yc=yczb.objects.all()
    #统计五个机组,suma到sume
    suma,sumb,sumc,sumd,sume=0,0,0,0,0
    suma2,sumb2,sumc2,sumd2,sume2=0,0,0,0,0
    suma3,sumb3,sumc3,sumd3,sume3=0,0,0,0,0
    suma4,sumb4,sumc4,sumd4,sume4=0,0,0,0,0
    #需要转置
    
    yc=Reverse(yc)    #转置
    y1=yc[0]
    tim=y1.jlsj
    tim2,tim3,tim4=0,0,0
    for y in yc:
        if(y.jlsj==tim):
            if(y.quid==1):
                suma=suma+1
            elif(y.quid==2):
                sumb=sumb+1
            elif(y.quid==3):
                sumc=sumc+1
            elif(y.quid==4):
                sumd=sumd+1
            elif(y.quid==5):
                sume=sume+1
    #在这一时刻出现的错误
        if(tim2==0 and y.jlsj!=tim):
            tim2=y.jlsj
        if(y.jlsj==tim2):
            if(y.quid==1):
                suma2=suma2+1
            elif(y.quid==2):
                sumb2=sumb2+1
            elif(y.quid==3):
                sumc2=sumc2+1
            elif(y.quid==4):
                sumd2=sumd2+1
            elif(y.quid==5):
                sume2=sume2+1
        if(tim3==0 and y.jlsj!=tim and y.jlsj!=tim2):
            tim3=y.jlsj
        if(y.jlsj==tim3):
            if(y.quid==1):
                suma3=suma3+1
            elif(y.quid==2):
                sumb3=sumb3+1
            elif(y.quid==3):
                sumc3=sumc3+1
            elif(y.quid==4):
                sumd3=sumd3+1
            elif(y.quid==5):
                sume3=sume3+1
        if(tim4==0 and y.jlsj!=tim and y.jlsj!=tim2 and y.jlsj!=tim3):
            tim4=y.jlsj
        if(y.jlsj==tim4):
            if(y.quid==1):
                suma4=suma4+1
            elif(y.quid==2):
                sumb4=sumb4+1
            elif(y.quid==3):
                sumc4=sumc4+1
            elif(y.quid==4):
                sumd4=sumd4+1
            elif(y.quid==5):
                sume4=sume4+1
    #下一时刻的
    a1 = yc[ym*7-7]
    a2 = yc[ym*7-6]
    a3 = yc[ym*7-5]
    a4 = yc[ym*7-4]
    a5 = yc[ym*7-3]
    a6 = yc[ym*7-2]
    a7 = yc[ym*7-1]

    


    return render(request,'myApp/cklsxx.html',{'t1':tim,'t2':tim2,'t3':tim3,'t4':tim4,'a1':a1,'a2':a2,'a3':a3,'a4':a4,'a5':a5,'a6':a6,'a7':a7,
                                             'sa1':suma,'sb1':sumb,'sc1':sumc,'sd1':sumd,'se1':sume,
                                             'sa2':suma2,'sb2':sumb2,'sc2':sumc2,'sd2':sumd2,'se2':sume2,
                                             'sa3':suma3,'sb3':sumb3,'sc3':sumc3,'sd3':sumd3,'se3':sume3,
                                             'sa4':suma4,'sb4':sumb4,'sc4':sumc4,'sd4':sumd4,'se4':sume4})

def cklsxx(request):   #查看历史信息
    global ym
    ym=1
    yc=yczb.objects.all()
    #统计五个机组,suma到sume
    suma,sumb,sumc,sumd,sume=0,0,0,0,0
    suma2,sumb2,sumc2,sumd2,sume2=0,0,0,0,0
    suma3,sumb3,sumc3,sumd3,sume3=0,0,0,0,0
    suma4,sumb4,sumc4,sumd4,sume4=0,0,0,0,0
    #需要转置
    
    yc=Reverse(yc)    #转置
    y1=yc[0]
    tim=y1.jlsj
    tim2,tim3,tim4=0,0,0
    for y in yc:
        if(y.jlsj==tim):
            if(y.quid==1):
                suma=suma+1
            elif(y.quid==2):
                sumb=sumb+1
            elif(y.quid==3):
                sumc=sumc+1
            elif(y.quid==4):
                sumd=sumd+1
            elif(y.quid==5):
                sume=sume+1
    #在这一时刻出现的错误
        if(tim2==0 and y.jlsj!=tim):
            tim2=y.jlsj
        if(tim2==y.jlsj):
            if(y.quid==1):
                suma2=suma2+1
            elif(y.quid==2):
                sumb2=sumb2+1
            elif(y.quid==3):
                sumc2=sumc2+1
            elif(y.quid==4):
                sumd2=sumd2+1
            elif(y.quid==5):
                sume2=sume2+1
        if(tim3==0 and y.jlsj!=tim and y.jlsj!=tim2):
            tim3=y.jlsj
        if(tim3==y.jlsj):
            if(y.quid==1):
                suma3=suma3+1
            elif(y.quid==2):
                sumb3=sumb3+1
            elif(y.quid==3):
                sumc3=sumc3+1
            elif(y.quid==4):
                sumd3=sumd3+1
            elif(y.quid==5):
                sume3=sume3+1
        if(tim4==0 and y.jlsj!=tim and y.jlsj!=tim2 and y.jlsj!=tim3):
            tim4=y.jlsj
        if(tim4==y.jlsj):
            if(y.quid==1):
                suma4=suma4+1
            elif(y.quid==2):
                sumb4=sumb4+1
            elif(y.quid==3):
                sumc4=sumc4+1
            elif(y.quid==4):
                sumd4=sumd4+1
            elif(y.quid==5):
                sume4=sume4+1
    #下一时刻的
    a1 = yc[0]
    a2 = yc[1]
    a3 = yc[2]
    a4 = yc[3]
    a5 = yc[4]
    a6 = yc[5]
    a7 = yc[6]

    


    return render(request,'myApp/cklsxx.html',{'t1':tim,'t2':tim2,'t3':tim3,'t4':tim4,'a1':a1,'a2':a2,'a3':a3,'a4':a4,'a5':a5,'a6':a6,'a7':a7,
                                             'sa1':suma,'sb1':sumb,'sc1':sumc,'sd1':sumd,'se1':sume,
                                             'sa2':suma2,'sb2':sumb2,'sc2':sumc2,'sd2':sumd2,'se2':sume2,
                                             'sa3':suma3,'sb3':sumb3,'sc3':sumc3,'sd3':sumd3,'se3':sume3,
                                             'sa4':suma4,'sb4':sumb4,'sc4':sumc4,'sd4':sumd4,'se4':sume4})



#定义返回


#图表显示
def tbxs(request):
    yc=yczb.objects.all()
    #统计五个机组,suma到sume
    suma,sumb,sumc,sumd,sume=0,0,0,0,0
    suma2,sumb2,sumc2,sumd2,sume2=0,0,0,0,0
    suma3,sumb3,sumc3,sumd3,sume3=0,0,0,0,0
    suma4,sumb4,sumc4,sumd4,sume4=0,0,0,0,0
    #需要转置
    
    yc=Reverse(yc)    #转置
    y1=yc[0]
    tim=y1.jlsj
    tim2,tim3,tim4=0,0,0
    for y in yc:
        if(y.jlsj==tim):
            if(y.quid==1):
                suma=suma+1
            elif(y.quid==2):
                sumb=sumb+1
            elif(y.quid==3):
                sumc=sumc+1
            elif(y.quid==4):
                sumd=sumd+1
            elif(y.quid==5):
                sume=sume+1
    #在这一时刻出现的错误
        if(tim2==0 and y.jlsj!=tim):
            tim2=y.jlsj
            if(y.quid==1):
                suma2=suma2+1
            elif(y.quid==2):
                sumb2=sumb2+1
            elif(y.quid==3):
                sumc2=sumc2+1
            elif(y.quid==4):
                sumd2=sumd2+1
            elif(y.quid==5):
                sume2=sume2+1
        if(tim3==0 and y.jlsj!=tim and y.jlsj!=tim2):
            tim3=y.jlsj
            if(y.quid==1):
                suma3=suma3+1
            elif(y.quid==2):
                sumb3=sumb3+1
            elif(y.quid==3):
                sumc3=sumc3+1
            elif(y.quid==4):
                sumd3=sumd3+1
            elif(y.quid==5):
                sume3=sume3+1
        if(tim4==0 and y.jlsj!=tim and y.jlsj!=tim2 and y.jlsj!=tim3):
            tim4=y.jlsj
            if(y.quid==1):
                suma4=suma4+1
            elif(y.quid==2):
                sumb4=sumb4+1
            elif(y.quid==3):
                sumc4=sumc4+1
            elif(y.quid==4):
                sumd4=sumd4+1
            elif(y.quid==5):
                sume4=sume4+1
    #下一时刻的
    a1 = yc[0]
    a2 = yc[1]
    a3 = yc[2]
    a4 = yc[3]
    a5 = yc[4]
    a6 = yc[5]
    a7 = yc[6]

    


    return render(request,'myApp/xzb.html',{'t1':tim,'t2':tim2,'t3':tim3,'t4':tim4,'a1':a1,'a2':a2,'a3':a3,'a4':a4,'a5':a5,'a6':a6,'a7':a7,})



#  图表显示
def tbxs2(request):
    jz = request.POST.get('jizu','')#获取机组号
    zc = request.POST.get('zhoucheng','')#获取机组号
    que = quejlzk.objects.all()
    cw3=[]
    if(zc=='one'):
        if(jz=='one'):
            for qu in que:
                if(qu.quid==1):
                    a=qu.zrhyl/qu.zrqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='two'):
            for qu in que:
                if(qu.quid==2):
                    a=qu.zrhyl/qu.zrqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='three'):
            for qu in que:
                if(qu.quid==3):
                    a=qu.zrhyl/qu.zrqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='four'):
            for qu in que:
                if(qu.quid==4):
                    a=qu.zrhyl/qu.zrqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='five'):
            for qu in que:
                if(qu.quid==5):
                    a=qu.zrhyl/qu.zrqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='six'):
            for qu in que:
                if(qu.quid==6):
                    a=qu.zrhyl/qu.zrqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
    if(zc=='two'):
        if(jz=='one'):
            for qu in que:
                if(qu.quid==1):
                    a=qu.zrzqfmh-qu.zrzqfmy
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='two'):
            for qu in que:
                if(qu.quid==2):
                    a=qu.zrzqfmh-qu.zrzqfmy
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='three'):
            for qu in que:
                if(qu.quid==3):
                    a=qu.zrzqfmh-qu.zrzqfmy
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='four'):
            for qu in que:
                if(qu.quid==4):
                    a=qu.zrzqfmh-qu.zrzqfmy
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='five'):
            for qu in que:
                if(qu.quid==5):
                    a=qu.zrzqfmh-qu.zrzqfmy
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='six'):
            for qu in que:
                if(qu.quid==6):
                    a=qu.zrzqfmh-qu.zrzqfmy
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
    if(zc=='three'):
        if(jz=='one'):
            for qu in que:
                if(qu.quid==1):
                    a=qu.gyzqfmh-qu.gyzqfmy
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='two'):
            for qu in que:
                if(qu.quid==2):
                    a=qu.gyzqfmh-qu.gyzqfmy
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='three'):
            for qu in que:
                if(qu.quid==3):
                    a=qu.gyzqfmh-qu.gyzqfmy
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='four'):
            for qu in que:
                if(qu.quid==4):
                    a=qu.gyzqfmh-qu.gyzqfmy
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='five'):
            for qu in que:
                if(qu.quid==5):
                    a=qu.gyzqfmh-qu.gyzqfmy
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='six'):
            for qu in que:
                if(qu.quid==6):
                    a=qu.gyzqfmh-qu.gyzqfmy
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
    if(zc=='four'):
        if(jz=='one'):
            for qu in que:
                if(qu.quid==1):
                    a=qu.zypqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='two'):
            for qu in que:
                if(qu.quid==2):
                    a=qu.zypqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='three'):
            for qu in que:
                if(qu.quid==3):
                    a=qu.zypqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='four'):
            for qu in que:
                if(qu.quid==4):
                    a=qu.zypqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='five'):
            for qu in que:
                if(qu.quid==5):
                    a=qu.zypqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='six'):
            for qu in que:
                if(qu.quid==6):
                    a=qu.zypqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
    if(zc=='five'):
        if(jz=='one'):
            for qu in que:
                if(qu.quid==1):
                    a=qu.gypqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='two'):
            for qu in que:
                if(qu.quid==2):
                    a=qu.gypqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='three'):
            for qu in que:
                if(qu.quid==3):
                    a=qu.gypqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='four'):
            for qu in que:
                if(qu.quid==4):
                    a=qu.gypqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='five'):
            for qu in que:
                if(qu.quid==5):
                    a=qu.gypqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='six'):
            for qu in que:
                if(qu.quid==6):
                    a=qu.gypqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
    if(zc=='six'):
        if(jz=='one'):
            for qu in que:
                if(qu.quid==1):
                    a=qu.qfmgzqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='two'):
            for qu in que:
                if(qu.quid==2):
                    a=qu.qfmgzqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='three'):
            for qu in que:
                if(qu.quid==3):
                    a=qu.qfmgzqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='four'):
            for qu in que:
                if(qu.quid==4):
                    a=qu.qfmgzqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='five'):
            for qu in que:
                if(qu.quid==5):
                    a=qu.qfmgzqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='six'):
            for qu in que:
                if(qu.quid==6):
                    a=qu.qfmgzqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
    if(zc=='seven'):
        if(jz=='one'):
            for qu in que:
                if(qu.quid==1):
                    a=qu.qfzqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='two'):
            for qu in que:
                if(qu.quid==2):
                    a=qu.qfzqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='three'):
            for qu in que:
                if(qu.quid==3):
                    a=qu.qfzqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='four'):
            for qu in que:
                if(qu.quid==4):
                    a=qu.qfzqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='five'):
            for qu in que:
                if(qu.quid==5):
                    a=qu.qfzqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='six'):
            for qu in que:
                if(qu.quid==6):
                    a=qu.qfzqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
    if(zc=='eight'):
        if(jz=='one'):
            for qu in que:
                if(qu.quid==1):
                    a=qu.ddl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='two'):
            for qu in que:
                if(qu.quid==2):
                    a=qu.ddl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='three'):
            for qu in que:
                if(qu.quid==3):
                    a=qu.ddl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='four'):
            for qu in que:
                if(qu.quid==4):
                    a=qu.ddl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='five'):
            for qu in que:
                if(qu.quid==5):
                    a=qu.ddl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='six'):
            for qu in que:
                if(qu.quid==6):
                    a=qu.ddl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
    if(zc=='nine'):
        if(jz=='one'):
            for qu in que:
                if(qu.quid==1):
                    a=qu.sjbhwd-qu.yjbhwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='two'):
            for qu in que:
                if(qu.quid==2):
                    a=qu.sjbhwd-qu.yjbhwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='three'):
            for qu in que:
                if(qu.quid==3):
                    a=qu.sjbhwd-qu.yjbhwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='four'):
            for qu in que:
                if(qu.quid==4):
                    a=qu.sjbhwd-qu.yjbhwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='five'):
            for qu in que:
                if(qu.quid==5):
                    a=qu.sjbhwd-qu.yjbhwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='six'):
            for qu in que:
                if(qu.quid==6):
                    a=qu.sjbhwd-qu.yjbhwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
    if(zc=='ten'):
        if(jz=='one'):
            for qu in que:
                if(qu.quid==1):
                    a=qu.qgxbgwd-qu.qgsbgwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='two'):
            for qu in que:
                if(qu.quid==2):
                    a=qu.qgxbgwd-qu.qgsbgwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='three'):
            for qu in que:
                if(qu.quid==3):
                    a=qu.qgxbgwd-qu.qgsbgwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='four'):
            for qu in que:
                if(qu.quid==4):
                    a=qu.qgxbgwd-qu.qgsbgwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='five'):
            for qu in que:
                if(qu.quid==5):
                    a=qu.qgxbgwd-qu.qgsbgwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='six'):
            for qu in que:
                if(qu.quid==6):
                    a=qu.qgxbgwd-qu.qgsbgwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
    if(zc=='ele'):
        if(jz=='one'):
            for qu in que:
                if(qu.quid==1):
                    a=qu.zcbshjwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='two'):
            for qu in que:
                if(qu.quid==2):
                    a=qu.zcbshjwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='three'):
            for qu in que:
                if(qu.quid==3):
                    a=qu.zcbshjwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='four'):
            for qu in que:
                if(qu.quid==4):
                    a=qu.zcbshjwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='five'):
            for qu in que:
                if(qu.quid==5):
                    a=qu.zcbshjwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='six'):
            for qu in que:
                if(qu.quid==6):
                    a=qu.zcbshjwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
    if(zc=='twe'):
        if(jz=='one'):
            for qu in que:
                if(qu.quid==1):
                    a=qu.zcsnbwd-qu.zcswbwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='two'):
            for qu in que:
                if(qu.quid==2):
                    a=qu.zcsnbwd-qu.zcswbwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='three'):
            for qu in que:
                if(qu.quid==3):
                    a=qu.zcsnbwd-qu.zcswbwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='four'):
            for qu in que:
                if(qu.quid==4):
                    a=qu.zcsnbwd-qu.zcswbwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='five'):
            for qu in que:
                if(qu.quid==5):
                    a=qu.zcsnbwd-qu.zcswbwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='six'):
            for qu in que:
                if(qu.quid==6):
                    a=qu.zcsnbwd-qu.zcswbwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
    if(zc=='thi'):
        if(jz=='one'):
            for qu in que:
                if(qu.quid==1):
                    a=qu.cskwd-qu.jskwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='two'):
            for qu in que:
                if(qu.quid==2):
                    a=qu.cskwd-qu.jskwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='three'):
            for qu in que:
                if(qu.quid==3):
                    a=qu.cskwd-qu.jskwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='four'):
            for qu in que:
                if(qu.quid==4):
                    a=qu.cskwd-qu.jskwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='five'):
            for qu in que:
                if(qu.quid==5):
                    a=qu.cskwd-qu.jskwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='six'):
            for qu in que:
                if(qu.quid==6):
                    a=qu.cskwd-qu.jskwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
    if(zc=='for'):
        if(jz=='one'):
            for qu in que:
                if(qu.quid==1):
                    a=qu.cskyc-qu.jskyc
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='two'):
            for qu in que:
                if(qu.quid==2):
                    a=qu.cskyc-qu.jskyc
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='three'):
            for qu in que:
                if(qu.quid==3):
                    a=qu.cskyc-qu.jskyc
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='four'):
            for qu in que:
                if(qu.quid==4):
                    a=qu.cskyc-qu.jskyc
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='five'):
            for qu in que:
                if(qu.quid==5):
                    a=qu.cskyc-qu.jskyc
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='six'):
            for qu in que:
                if(qu.quid==6):
                    a=qu.cskyc-qu.jskyc
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
    if(zc=='fiv'):
        if(jz=='one'):
            for qu in que:
                if(qu.quid==1):
                    a=qu.gzyw
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='two'):
            for qu in que:
                if(qu.quid==2):
                    a=qu.gzyw
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='three'):
            for qu in que:
                if(qu.quid==3):
                    a=qu.gzyw
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='four'):
            for qu in que:
                if(qu.quid==4):
                    a=qu.gzyw
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='five'):
            for qu in que:
                if(qu.quid==5):
                    a=qu.gzyw
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='six'):
            for qu in que:
                if(qu.quid==6):
                    a=qu.gzyw
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
    if(zc=='sixt'):
        if(jz=='one'):
            for qu in que:
                if(qu.quid==1):
                    a=qu.jldzybgzyy
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='two'):
            for qu in que:
                if(qu.quid==2):
                    a=qu.jldzybgzyy
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='three'):
            for qu in que:
                if(qu.quid==3):
                    a=qu.jldzybgzyy
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='four'):
            for qu in que:
                if(qu.quid==4):
                    a=qu.jldzybgzyy
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='five'):
            for qu in que:
                if(qu.quid==5):
                    a=qu.jldzybgzyy
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='six'):
            for qu in que:
                if(qu.quid==6):
                    a=qu.jldzybgzyy
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
    if(zc=='sev'):
        if(jz=='one'):
            for qu in que:
                if(qu.quid==1):
                    a=qu.dygzfgqwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='two'):
            for qu in que:
                if(qu.quid==2):
                    a=qu.dygzfgqwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='three'):
            for qu in que:
                if(qu.quid==3):
                    a=qu.dygzfgqwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='four'):
            for qu in que:
                if(qu.quid==4):
                    a=qu.dygzfgqwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='five'):
            for qu in que:
                if(qu.quid==5):
                    a=qu.dygzfgqwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='six'):
            for qu in que:
                if(qu.quid==6):
                    a=qu.dygzfgqwd
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
    if(zc=='eig'):
        if(jz=='one'):
            for qu in que:
                if(qu.quid==1):
                    a=qu.zzqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='two'):
            for qu in que:
                if(qu.quid==2):
                    a=qu.zzqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='three'):
            for qu in que:
                if(qu.quid==3):
                    a=qu.zzqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='four'):
            for qu in que:
                if(qu.quid==4):
                    a=qu.zzqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='five'):
            for qu in que:
                if(qu.quid==5):
                    a=qu.zzqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
        if(jz=='six'):
            for qu in que:
                if(qu.quid==6):
                    a=qu.zzqyl
                    sj=qu.jlsj
                    id=qu.quid
                    cw3.append([a,sj,id])
    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:6]
    jlnum11=hh2[0][0]
    jlnum21=hh2[1][0]
    jlnum31=hh2[2][0]
    jlnum41=hh2[3][0]
    jlnum51=hh2[4][0]
    jlnum61=hh2[5][0]

    t11=hh2[0][1]
    t21=hh2[1][1]
    t31=hh2[2][1]
    t41=hh2[3][1]
    t51=hh2[4][1]
    t61=hh2[5][1]
    fau =faultmessage.objects.all()

    cw=0 #判断是否发生故障
    if(zc=='one'):
        if(jlnum11>1.25):
            for f in fau:
                if(f.quenum==1):
                    nm=f.quename
                    jj=f.quesolution  #解决
                    yy=f.quereason   #原因
            mc = '再热压力比值>1.25'
            cw=1  #错了
            return render(request,'myApp/jtxx.html',{'mc':mc,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息

        else:
            for f in fau:
                if(f.quenum==1):
                    nm=f.quename
                    jj=f.quesolution  #解决
                    yy=f.quereason   #原因
            mc= '再热压力比值>1.25'
            cw=0   #对了
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息
    if(zc=='two'):
        if(jlnum11>14):
            for f in fau:
                if(f.quenum==2):
                    nm=f.quename
                    jj=f.quesolution  #解决
                    yy=f.quereason   #原因
            mc = '再热主汽阀门进口温差>14'
            cw=1  #错了
            return render(request,'myApp/jtxx2.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息

        else:
            for f in fau:
                if(f.quenum==2):
                    nm=f.quename
                    jj=f.quesolution  #解决
                    yy=f.quereason   #原因
            mc = '再热主汽阀门进口温差>14'
            cw=0
            return render(request,'myApp/jtxx2.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息
    if(zc=='three'):
        if(jlnum11>14):
            for f in fau:
                if(f.quenum==3):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '高压主汽阀门进口温差>14'
            cw=1  #错了
            return render(request,'myApp/jtxx2.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息

        else:
            for f in fau:
                if(f.quenum==3):
                    nm=f.quename
                    jj=f.quesolution  #解决
                    yy=f.quereason   #原因
            mc = '高压主汽阀门进口温差>14'
            cw=0
            return render(request,'myApp/jtxx2.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息
    if(zc=='four'):
        if(jlnum11>1.47):
            for f in fau:
                if(f.quenum==4):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '中压排气压力>1.47'
            cw=1  #错了
            return render(request,'myApp/jtxx2.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息

        else:
            for f in fau:
                if(f.quenum==4):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '中压排气压力>1.47'
            cw=0
            return render(request,'myApp/jtxx2.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息
    if(zc=='five'):
        if(jlnum11>1.47):
            for f in fau:
                if(f.quenum==5):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '高压排气压力>1.47'
            cw=1  #错了
            return render(request,'myApp/jtxx2.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息

        else:
            for f in fau:
                if(f.quenum==5):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '高压排气压力>1.47'
            cw=0
            return render(request,'myApp/jtxx2.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息
    if(zc=='six'):
        if(jlnum11>0.2):
            for f in fau:
                if(f.quenum==6):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '气封母管蒸汽压力>0.2'
            cw=1  #错了
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息

        else:
            for f in fau:
                if(f.quenum==6):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '气封母管蒸汽压力>0.2'
            cw=0
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息
    if(zc=='seven'):
        if(jlnum11>0.2):
            for f in fau:
                if(f.quenum==7):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '气封蒸汽压力>0.2'
            cw=1  #错了
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息

        else:
            for f in fau:
                if(f.quenum==7):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '气封蒸汽压力>0.2'
            cw=0
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息
    if(zc=='eight'):
        if(jlnum11>0.03):
            for f in fau:
                if(f.quenum==8):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '电导率>0.03'
            cw=1  #错了
            return render(request,'myApp/jtxx2.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息

        else:
            for f in fau:
                if(f.quenum==8):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '电导率>0.03'
            cw=0
            return render(request,'myApp/jtxx2.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息
    if(zc=='nine'):
        if(jlnum11>5):
            for f in fau:
                if(f.quenum==9):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '饱和温度偏差>5'
            cw=1  #错了
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息

        else:
            for f in fau:
                if(f.quenum==9):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '饱和温度偏差>5'
            cw=0
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息
    if(zc=='ten'):
        if(jlnum11>42):
            for f in fau:
                if(f.quenum==10):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '气缸上下半缸温差>42'
            cw=1  #错了
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息

        else:
            for f in fau:
                if(f.quenum==10):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '气缸上下半缸温差>42'
            cw=0
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息
    if(zc=='ele'):
        if(jlnum11>107 or jlnum11<66):
            for f in fau:
                if(f.quenum==11):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '轴承巴氏合金温度>107 or <66'
            cw=1  #错了
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息

        else:
            for f in fau:
                if(f.quenum==11):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '轴承巴氏合金温度>107 or <66'
            cw=0
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息
    if(zc=='twe'):
        if(jlnum11>83):
            for f in fau:
                if(f.quenum==12):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '蒸气室内外壁温差>83'
            cw=1  #错了
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息

        else:
            for f in fau:
                if(f.quenum==12):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '蒸气室内外壁温差>83'
            cw=0
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息
    if(zc=='thi'):
        if(jlnum11>10):
            for f in fau:
                if(f.quenum==13):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '进出水口温度>10'
            cw=1  #错了
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息

        else:
            for f in fau:
                if(f.quenum==13):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '进出水口温度>10'
            cw=0
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息
    if(zc=='for'):
        if(jlnum11>0.1):
            for f in fau:
                if(f.quenum==14):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '进出水口压差>0.1'
            cw=1  #错了
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息

        else:
            for f in fau:
                if(f.quenum==14):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '进出水口压差>0.1'
            cw=0
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息
    if(zc=='fiv'):
        if(jlnum11>65):
            for f in fau:
                if(f.quenum==15):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '工作油温>65'
            cw=0
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息

        else:
            for f in fau:
                if(f.quenum==15):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '工作油温>65'
            cw=0
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息
    if(zc=='sixt'):
        if(jlnum11<5 or jlnum11>15):
            for f in fau:
                if(f.quenum==16):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '交流顶轴油泵工作油压<5 or >15'
            cw=0
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息

        else:
            for f in fau:
                if(f.quenum==16):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '交流顶轴油泵工作油压<5 or >15'
            cw=0
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息
    if(zc=='sev'):
        if(jlnum11<177 or jlnum11>121):
            for f in fau:
                if(f.quenum==17):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '低压缸轴封供汽温度<177 or >121'
            cw=0
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息

        else:
            for f in fau:
                if(f.quenum==17):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '低压缸轴封供汽温度<177 or >121'
            cw=0
            return render(request,'myApp/jtxx.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息
    if(zc=='eig'):
        if(jlnum11>19.6):
            for f in fau:
                if(f.quenum==18):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '主蒸汽压力>19.6'
            cw=0
            return render(request,'myApp/jtxx3.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息

        else:
            for f in fau:
                if(f.quenum==18):
                        nm=f.quename
                        jj=f.quesolution  #解决
                        yy=f.quereason   #原因
            mc = '主蒸汽压力>19.6'
            cw=0
            return render(request,'myApp/jtxx3.html',{'mc':mc,'nm':nm,'jj':jj,'yy':yy,'id':id,'c':cw,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j11':jlnum11,'j21':jlnum21,'j31':jlnum31,'j41':jlnum41,'j51':jlnum51,'j61':jlnum61,})  #选择一下查看那个机组得那条信息





def tb181(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zzqyl #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[4][0]
    jlnum2=ll[9][0]
    jlnum3=ll[14][0]
    jlnum4=ll[19][0]
    jlnum5=ll[24][0]
    jlnum6=ll[29][0]
    fa=faultmessage.objects.all()
    gz=fa[17]
    tsy='主蒸汽压力>19.6'#提示语
    n=1
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb182(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zzqyl #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[3][0]
    jlnum2=ll[8][0]
    jlnum3=ll[13][0]
    jlnum4=ll[18][0]
    jlnum5=ll[23][0]
    jlnum6=ll[28][0]
    fa=faultmessage.objects.all()
    gz=fa[17]
    tsy='主蒸汽压力>19.6'#提示语
    n=2
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb183(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zzqyl #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[2][0]
    jlnum2=ll[7][0]
    jlnum3=ll[12][0]
    jlnum4=ll[17][0]
    jlnum5=ll[22][0]
    jlnum6=ll[27][0]
    fa=faultmessage.objects.all()
    gz=fa[17]
    tsy='主蒸汽压力>19.6'#提示语
    n=3
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb184(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zzqyl #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[1][0]
    jlnum2=ll[6][0]
    jlnum3=ll[11][0]
    jlnum4=ll[16][0]
    jlnum5=ll[21][0]
    jlnum6=ll[26][0]
    fa=faultmessage.objects.all()
    gz=fa[17]
    tsy='主蒸汽压力>19.6'#提示语
    n=4
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb185(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zzqyl #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[0][0]
    jlnum2=ll[5][0]
    jlnum3=ll[10][0]
    jlnum4=ll[15][0]
    jlnum5=ll[20][0]
    jlnum6=ll[25][0]
    fa=faultmessage.objects.all()
    gz=fa[17]
    tsy='主蒸汽压力>19.6'#提示语
    n=5
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功

def tb171(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.dygzfgqwd #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[4][0]
    jlnum2=ll[9][0]
    jlnum3=ll[14][0]
    jlnum4=ll[19][0]
    jlnum5=ll[24][0]
    jlnum6=ll[29][0]
    fa=faultmessage.objects.all()
    gz=fa[16]
    tsy='低压缸轴封供汽温度<121or>177'#提示语
    n=1
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb172(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.dygzfgqwd #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[3][0]
    jlnum2=ll[8][0]
    jlnum3=ll[13][0]
    jlnum4=ll[18][0]
    jlnum5=ll[23][0]
    jlnum6=ll[28][0]
    fa=faultmessage.objects.all()
    gz=fa[16]
    tsy='低压缸轴封供汽温度<121or>177'#提示语
    n=2
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb173(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.dygzfgqwd #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[2][0]
    jlnum2=ll[7][0]
    jlnum3=ll[12][0]
    jlnum4=ll[17][0]
    jlnum5=ll[22][0]
    jlnum6=ll[27][0]
    fa=faultmessage.objects.all()
    gz=fa[16]
    tsy='低压缸轴封供汽温度<121or>177'#提示语
    n=3
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb174(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.dygzfgqwd #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[1][0]
    jlnum2=ll[6][0]
    jlnum3=ll[11][0]
    jlnum4=ll[16][0]
    jlnum5=ll[21][0]
    jlnum6=ll[26][0]
    fa=faultmessage.objects.all()
    gz=fa[16]
    tsy='低压缸轴封供汽温度<121or>177'#提示语
    n=4
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb175(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.dygzfgqwd #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[0][0]
    jlnum2=ll[5][0]
    jlnum3=ll[10][0]
    jlnum4=ll[15][0]
    jlnum5=ll[20][0]
    jlnum6=ll[25][0]
    fa=faultmessage.objects.all()
    gz=fa[16]
    tsy='低压缸轴封供汽温度<121or>177'#提示语
    n=5
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功

def tb161(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.jldzybgzyy #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[4][0]
    jlnum2=ll[9][0]
    jlnum3=ll[14][0]
    jlnum4=ll[19][0]
    jlnum5=ll[24][0]
    jlnum6=ll[29][0]
    fa=faultmessage.objects.all()
    gz=fa[15]
    tsy='交流顶轴油泵工作油压<5or>15'#提示语
    n=1
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb162(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.jldzybgzyy #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[3][0]
    jlnum2=ll[8][0]
    jlnum3=ll[13][0]
    jlnum4=ll[18][0]
    jlnum5=ll[23][0]
    jlnum6=ll[28][0]
    fa=faultmessage.objects.all()
    gz=fa[15]
    tsy='交流顶轴油泵工作油压<5or>15'#提示语
    n=2
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb163(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.jldzybgzyy #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[2][0]
    jlnum2=ll[7][0]
    jlnum3=ll[12][0]
    jlnum4=ll[17][0]
    jlnum5=ll[22][0]
    jlnum6=ll[27][0]
    fa=faultmessage.objects.all()
    gz=fa[15]
    tsy='交流顶轴油泵工作油压<5or>15'#提示语
    n=3
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb164(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.jldzybgzyy #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[1][0]
    jlnum2=ll[6][0]
    jlnum3=ll[11][0]
    jlnum4=ll[16][0]
    jlnum5=ll[21][0]
    jlnum6=ll[26][0]
    fa=faultmessage.objects.all()
    gz=fa[15]
    tsy='交流顶轴油泵工作油压<5or>15'#提示语
    n=4
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb165(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.jldzybgzyy #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[0][0]
    jlnum2=ll[5][0]
    jlnum3=ll[10][0]
    jlnum4=ll[15][0]
    jlnum5=ll[20][0]
    jlnum6=ll[25][0]
    fa=faultmessage.objects.all()
    gz=fa[15]
    tsy='交流顶轴油泵工作油压<5or>15'#提示语
    n=5
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功

def tb151(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.gzyw #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[4][0]
    jlnum2=ll[9][0]
    jlnum3=ll[14][0]
    jlnum4=ll[19][0]
    jlnum5=ll[24][0]
    jlnum6=ll[29][0]
    fa=faultmessage.objects.all()
    gz=fa[14]
    tsy='工作油温>65'#提示语
    n=1
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb152(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.gzyw #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[3][0]
    jlnum2=ll[8][0]
    jlnum3=ll[13][0]
    jlnum4=ll[18][0]
    jlnum5=ll[23][0]
    jlnum6=ll[28][0]
    fa=faultmessage.objects.all()
    gz=fa[14]
    tsy='工作油温>65'#提示语
    n=2
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb153(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.gzyw #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[2][0]
    jlnum2=ll[7][0]
    jlnum3=ll[12][0]
    jlnum4=ll[17][0]
    jlnum5=ll[22][0]
    jlnum6=ll[27][0]
    fa=faultmessage.objects.all()
    gz=fa[14]
    tsy='工作油温>65'#提示语
    n=3
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb154(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.gzyw #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[1][0]
    jlnum2=ll[6][0]
    jlnum3=ll[11][0]
    jlnum4=ll[16][0]
    jlnum5=ll[21][0]
    jlnum6=ll[26][0]
    fa=faultmessage.objects.all()
    gz=fa[14]
    tsy='工作油温>65'#提示语
    n=4
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb155(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.gzyw #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[0][0]
    jlnum2=ll[5][0]
    jlnum3=ll[10][0]
    jlnum4=ll[15][0]
    jlnum5=ll[20][0]
    jlnum6=ll[25][0]
    fa=faultmessage.objects.all()
    gz=fa[14]
    tsy='工作油温>65'#提示语
    n=5
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功

def tb141(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.cskyc - qu.jskyc #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[4][0]
    jlnum2=ll[9][0]
    jlnum3=ll[14][0]
    jlnum4=ll[19][0]
    jlnum5=ll[24][0]
    jlnum6=ll[29][0]
    fa=faultmessage.objects.all()
    gz=fa[13]
    tsy='进出水口压差>0.1'#提示语
    n=1
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb142(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.cskyc - qu.jskyc #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[3][0]
    jlnum2=ll[8][0]
    jlnum3=ll[13][0]
    jlnum4=ll[18][0]
    jlnum5=ll[23][0]
    jlnum6=ll[28][0]
    fa=faultmessage.objects.all()
    gz=fa[13]
    tsy='进出水口压差>0.1'#提示语
    n=2
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb143(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.cskyc - qu.jskyc #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[2][0]
    jlnum2=ll[7][0]
    jlnum3=ll[12][0]
    jlnum4=ll[17][0]
    jlnum5=ll[22][0]
    jlnum6=ll[27][0]
    fa=faultmessage.objects.all()
    gz=fa[13]
    tsy='进出水口压差>0.1'#提示语
    n=3
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb144(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.cskyc - qu.jskyc #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[1][0]
    jlnum2=ll[6][0]
    jlnum3=ll[11][0]
    jlnum4=ll[16][0]
    jlnum5=ll[21][0]
    jlnum6=ll[26][0]
    fa=faultmessage.objects.all()
    gz=fa[13]
    tsy='进出水口压差>0.1'#提示语
    n=4
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb145(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.cskyc - qu.jskyc #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[0][0]
    jlnum2=ll[5][0]
    jlnum3=ll[10][0]
    jlnum4=ll[15][0]
    jlnum5=ll[20][0]
    jlnum6=ll[25][0]
    fa=faultmessage.objects.all()
    gz=fa[13]
    tsy='进出水口压差>0.1'#提示语
    n=5
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功

def tb131(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.cskwd - qu.jskwd #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[4][0]
    jlnum2=ll[9][0]
    jlnum3=ll[14][0]
    jlnum4=ll[19][0]
    jlnum5=ll[24][0]
    jlnum6=ll[29][0]
    fa=faultmessage.objects.all()
    gz=fa[12]
    tsy='出水口与进水口温差>10'#提示语
    n=1
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb132(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.cskwd - qu.jskwd #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[3][0]
    jlnum2=ll[8][0]
    jlnum3=ll[13][0]
    jlnum4=ll[18][0]
    jlnum5=ll[23][0]
    jlnum6=ll[28][0]
    fa=faultmessage.objects.all()
    gz=fa[12]
    tsy='出水口与进水口温差>10'#提示语
    n=2
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb133(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.cskwd - qu.jskwd #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[2][0]
    jlnum2=ll[7][0]
    jlnum3=ll[12][0]
    jlnum4=ll[17][0]
    jlnum5=ll[22][0]
    jlnum6=ll[27][0]
    fa=faultmessage.objects.all()
    gz=fa[12]
    tsy='出水口与进水口温差>10'#提示语
    n=3
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb134(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.cskwd - qu.jskwd #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[1][0]
    jlnum2=ll[6][0]
    jlnum3=ll[11][0]
    jlnum4=ll[16][0]
    jlnum5=ll[21][0]
    jlnum6=ll[26][0]
    fa=faultmessage.objects.all()
    gz=fa[12]
    tsy='出水口与进水口温差>10'#提示语
    n=4
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb135(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.cskwd - qu.jskwd #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[0][0]
    jlnum2=ll[5][0]
    jlnum3=ll[10][0]
    jlnum4=ll[15][0]
    jlnum5=ll[20][0]
    jlnum6=ll[25][0]
    fa=faultmessage.objects.all()
    gz=fa[12]
    tsy='出水口与进水口温差>10'#提示语
    n=5
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功

def tb121(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zcsnbwd - qu.zcswbwd  #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[4][0]
    jlnum2=ll[9][0]
    jlnum3=ll[14][0]
    jlnum4=ll[19][0]
    jlnum5=ll[24][0]
    jlnum6=ll[29][0]
    fa=faultmessage.objects.all()
    gz=fa[11]
    tsy='蒸气室内壁和外壁温差>83'#提示语
    n=1
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb122(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zcsnbwd - qu.zcswbwd  #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[3][0]
    jlnum2=ll[8][0]
    jlnum3=ll[13][0]
    jlnum4=ll[18][0]
    jlnum5=ll[23][0]
    jlnum6=ll[28][0]
    fa=faultmessage.objects.all()
    gz=fa[11]
    tsy='蒸气室内壁和外壁温差>83'#提示语
    n=2
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb123(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zcsnbwd - qu.zcswbwd  #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[2][0]
    jlnum2=ll[7][0]
    jlnum3=ll[12][0]
    jlnum4=ll[17][0]
    jlnum5=ll[22][0]
    jlnum6=ll[27][0]
    fa=faultmessage.objects.all()
    gz=fa[11]
    tsy='蒸气室内壁和外壁温差>83'#提示语
    n=3
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb124(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zcsnbwd - qu.zcswbwd  #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[1][0]
    jlnum2=ll[6][0]
    jlnum3=ll[11][0]
    jlnum4=ll[16][0]
    jlnum5=ll[21][0]
    jlnum6=ll[26][0]
    fa=faultmessage.objects.all()
    gz=fa[11]
    tsy='蒸气室内壁和外壁温差>83'#提示语
    n=4
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb125(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zcsnbwd - qu.zcswbwd  #数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[0][0]
    jlnum2=ll[5][0]
    jlnum3=ll[10][0]
    jlnum4=ll[15][0]
    jlnum5=ll[20][0]
    jlnum6=ll[25][0]
    fa=faultmessage.objects.all()
    gz=fa[11]
    tsy='蒸气室内壁和外壁温差>83'#提示语
    n=5
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功

def tb111(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zcbshjwd  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[4][0]
    jlnum2=ll[9][0]
    jlnum3=ll[14][0]
    jlnum4=ll[19][0]
    jlnum5=ll[24][0]
    jlnum6=ll[29][0]
    fa=faultmessage.objects.all()
    gz=fa[11]
    tsy='轴承巴氏合金温度<66 or>107'#提示语
    n=1
    return render(request,'myApp/tsb2.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb112(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zcbshjwd  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[3][0]
    jlnum2=ll[8][0]
    jlnum3=ll[13][0]
    jlnum4=ll[18][0]
    jlnum5=ll[23][0]
    jlnum6=ll[28][0]
    fa=faultmessage.objects.all()
    gz=fa[11]
    tsy='轴承巴氏合金温度<66 or>107'#提示语
    n=2
    return render(request,'myApp/tsb2.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb113(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zcbshjwd  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[2][0]
    jlnum2=ll[7][0]
    jlnum3=ll[12][0]
    jlnum4=ll[17][0]
    jlnum5=ll[22][0]
    jlnum6=ll[27][0]
    fa=faultmessage.objects.all()
    gz=fa[11]
    tsy='轴承巴氏合金温度<66 or>107'#提示语
    n=3
    return render(request,'myApp/tsb2.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb114(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zcbshjwd  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[1][0]
    jlnum2=ll[6][0]
    jlnum3=ll[11][0]
    jlnum4=ll[16][0]
    jlnum5=ll[21][0]
    jlnum6=ll[26][0]
    fa=faultmessage.objects.all()
    gz=fa[11]
    tsy='轴承巴氏合金温度<66 or>107'#提示语
    n=4
    return render(request,'myApp/tsb2.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb115(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zcbshjwd  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[0][0]
    jlnum2=ll[5][0]
    jlnum3=ll[10][0]
    jlnum4=ll[15][0]
    jlnum5=ll[20][0]
    jlnum6=ll[25][0]
    fa=faultmessage.objects.all()
    gz=fa[11]
    tsy='轴承巴氏合金温度<66 or>107'#提示语
    n=5
    return render(request,'myApp/tsb2.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功

def tb101(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.qgxbgwd-qu.qgsbgwd  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[4][0]
    jlnum2=ll[9][0]
    jlnum3=ll[14][0]
    jlnum4=ll[19][0]
    jlnum5=ll[24][0]
    jlnum6=ll[29][0]
    fa=faultmessage.objects.all()
    gz=fa[9]
    tsy='气缸上下半缸温差>42'#提示语
    n=1
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb102(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.qgxbgwd-qu.qgsbgwd  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[3][0]
    jlnum2=ll[8][0]
    jlnum3=ll[13][0]
    jlnum4=ll[18][0]
    jlnum5=ll[23][0]
    jlnum6=ll[28][0]
    fa=faultmessage.objects.all()
    gz=fa[9]
    tsy='气缸上下半缸温差>42'#提示语
    n=2
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb103(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.qgxbgwd-qu.qgsbgwd  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[2][0]
    jlnum2=ll[7][0]
    jlnum3=ll[12][0]
    jlnum4=ll[17][0]
    jlnum5=ll[22][0]
    jlnum6=ll[27][0]
    fa=faultmessage.objects.all()
    gz=fa[9]
    tsy='气缸上下半缸温差>42'#提示语
    n=3
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb104(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.qgxbgwd-qu.qgsbgwd  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[1][0]
    jlnum2=ll[6][0]
    jlnum3=ll[11][0]
    jlnum4=ll[16][0]
    jlnum5=ll[21][0]
    jlnum6=ll[26][0]
    fa=faultmessage.objects.all()
    gz=fa[9]
    tsy='气缸上下半缸温差>42'#提示语
    n=4
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb105(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.qgxbgwd-qu.qgsbgwd  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[0][0]
    jlnum2=ll[5][0]
    jlnum3=ll[10][0]
    jlnum4=ll[15][0]
    jlnum5=ll[20][0]
    jlnum6=ll[25][0]
    fa=faultmessage.objects.all()
    gz=fa[9]
    tsy='气缸上下半缸温差>42'#提示语
    n=5
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功

def tb91(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.sjbhwd-qu.yjbhwd  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[4][0]
    jlnum2=ll[9][0]
    jlnum3=ll[14][0]
    jlnum4=ll[19][0]
    jlnum5=ll[24][0]
    jlnum6=ll[29][0]
    fa=faultmessage.objects.all()
    gz=fa[8]
    tsy='饱和温度偏差>5'#提示语
    n=1
    return render(request,'myApp/tsb4.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb92(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.sjbhwd-qu.yjbhwd  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[3][0]
    jlnum2=ll[8][0]
    jlnum3=ll[13][0]
    jlnum4=ll[18][0]
    jlnum5=ll[23][0]
    jlnum6=ll[28][0]
    fa=faultmessage.objects.all()
    gz=fa[8]
    tsy='饱和温度偏差>5'#提示语
    n=2
    return render(request,'myApp/tsb4.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb93(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.sjbhwd-qu.yjbhwd  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[2][0]
    jlnum2=ll[7][0]
    jlnum3=ll[12][0]
    jlnum4=ll[17][0]
    jlnum5=ll[22][0]
    jlnum6=ll[27][0]
    fa=faultmessage.objects.all()
    gz=fa[8]
    tsy='饱和温度偏差>5'#提示语
    n=3
    return render(request,'myApp/tsb4.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb94(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.sjbhwd-qu.yjbhwd  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[1][0]
    jlnum2=ll[6][0]
    jlnum3=ll[11][0]
    jlnum4=ll[16][0]
    jlnum5=ll[21][0]
    jlnum6=ll[26][0]
    fa=faultmessage.objects.all()
    gz=fa[8]
    tsy='饱和温度偏差>5'#提示语
    n=4
    return render(request,'myApp/tsb4.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb95(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.sjbhwd-qu.yjbhwd  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[0][0]
    jlnum2=ll[5][0]
    jlnum3=ll[10][0]
    jlnum4=ll[15][0]
    jlnum5=ll[20][0]
    jlnum6=ll[25][0]
    fa=faultmessage.objects.all()
    gz=fa[8]
    tsy='饱和温度偏差>5'#提示语
    n=5
    return render(request,'myApp/tsb4.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功

def tb81(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.ddl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[4][0]
    jlnum2=ll[9][0]
    jlnum3=ll[14][0]
    jlnum4=ll[19][0]
    jlnum5=ll[24][0]
    jlnum6=ll[29][0]
    fa=faultmessage.objects.all()
    gz=fa[7]
    tsy='电导率>0.03'#提示语
    n=1
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb82(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.ddl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[3][0]
    jlnum2=ll[8][0]
    jlnum3=ll[13][0]
    jlnum4=ll[18][0]
    jlnum5=ll[23][0]
    jlnum6=ll[28][0]
    fa=faultmessage.objects.all()
    gz=fa[7]
    tsy='电导率>0.03'#提示语
    n=2
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb83(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.ddl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[2][0]
    jlnum2=ll[7][0]
    jlnum3=ll[12][0]
    jlnum4=ll[17][0]
    jlnum5=ll[22][0]
    jlnum6=ll[27][0]
    fa=faultmessage.objects.all()
    gz=fa[7]
    tsy='电导率>0.03'#提示语
    n=3
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb84(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.ddl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[1][0]
    jlnum2=ll[6][0]
    jlnum3=ll[11][0]
    jlnum4=ll[16][0]
    jlnum5=ll[21][0]
    jlnum6=ll[26][0]
    fa=faultmessage.objects.all()
    gz=fa[7]
    tsy='电导率>0.03'#提示语
    n=4
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb85(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.ddl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[0][0]
    jlnum2=ll[5][0]
    jlnum3=ll[10][0]
    jlnum4=ll[15][0]
    jlnum5=ll[20][0]
    jlnum6=ll[25][0]
    fa=faultmessage.objects.all()
    gz=fa[7]
    tsy='电导率>0.03'#提示语
    n=5
    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功

def tb71(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.qfzqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[4][0]
    jlnum2=ll[9][0]
    jlnum3=ll[14][0]
    jlnum4=ll[19][0]
    jlnum5=ll[24][0]
    jlnum6=ll[29][0]
    fa=faultmessage.objects.all()
    gz=fa[6]
    tsy='气封蒸汽压力>0.2'#提示语
    n=1
    return render(request,'myApp/tsb2.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb72(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.qfzqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[3][0]
    jlnum2=ll[8][0]
    jlnum3=ll[13][0]
    jlnum4=ll[18][0]
    jlnum5=ll[23][0]
    jlnum6=ll[28][0]
    fa=faultmessage.objects.all()
    gz=fa[6]
    tsy='气封蒸汽压力>0.2'#提示语
    n=2
    return render(request,'myApp/tsb2.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb73(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.qfzqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[2][0]
    jlnum2=ll[7][0]
    jlnum3=ll[12][0]
    jlnum4=ll[17][0]
    jlnum5=ll[22][0]
    jlnum6=ll[27][0]
    fa=faultmessage.objects.all()
    gz=fa[6]
    tsy='气封蒸汽压力>0.2'#提示语
    n=3
    return render(request,'myApp/tsb2.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb74(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.qfzqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[1][0]
    jlnum2=ll[6][0]
    jlnum3=ll[11][0]
    jlnum4=ll[16][0]
    jlnum5=ll[21][0]
    jlnum6=ll[26][0]
    fa=faultmessage.objects.all()
    gz=fa[6]
    tsy='气封蒸汽压力>0.2'#提示语
    n=4
    return render(request,'myApp/tsb2.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb75(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.qfzqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[0][0]
    jlnum2=ll[5][0]
    jlnum3=ll[10][0]
    jlnum4=ll[15][0]
    jlnum5=ll[20][0]
    jlnum6=ll[25][0]
    fa=faultmessage.objects.all()
    gz=fa[6]
    tsy='气封蒸汽压力>0.2'#提示语
    n=5
    return render(request,'myApp/tsb2.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功

def tb61(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.qfmgzqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[4][0]
    jlnum2=ll[9][0]
    jlnum3=ll[14][0]
    jlnum4=ll[19][0]
    jlnum5=ll[24][0]
    jlnum6=ll[29][0]
    fa=faultmessage.objects.all()
    gz=fa[5]
    tsy='气封母管蒸汽压力>0.2'#提示语
    n=1
    return render(request,'myApp/tsb2.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb62(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.qfmgzqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[3][0]
    jlnum2=ll[8][0]
    jlnum3=ll[13][0]
    jlnum4=ll[18][0]
    jlnum5=ll[23][0]
    jlnum6=ll[28][0]
    fa=faultmessage.objects.all()
    gz=fa[5]
    tsy='气封母管蒸汽压力>0.2'#提示语
    n=2
    return render(request,'myApp/tsb2.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb63(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.qfmgzqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[2][0]
    jlnum2=ll[7][0]
    jlnum3=ll[12][0]
    jlnum4=ll[17][0]
    jlnum5=ll[22][0]
    jlnum6=ll[27][0]
    fa=faultmessage.objects.all()
    gz=fa[5]
    tsy='气封母管蒸汽压力>0.2'#提示语
    n=3
    return render(request,'myApp/tsb2.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb64(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.qfmgzqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[1][0]
    jlnum2=ll[6][0]
    jlnum3=ll[11][0]
    jlnum4=ll[16][0]
    jlnum5=ll[21][0]
    jlnum6=ll[26][0]
    fa=faultmessage.objects.all()
    gz=fa[5]
    tsy='气封母管蒸汽压力>0.2'#提示语
    n=4
    return render(request,'myApp/tsb2.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb65(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.qfmgzqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[0][0]
    jlnum2=ll[5][0]
    jlnum3=ll[10][0]
    jlnum4=ll[15][0]
    jlnum5=ll[20][0]
    jlnum6=ll[25][0]
    fa=faultmessage.objects.all()
    gz=fa[5]
    tsy='气封母管蒸汽压力>0.2'#提示语
    n=5
    return render(request,'myApp/tsb2.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功

def tb51(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.gypqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[4][0]
    jlnum2=ll[9][0]
    jlnum3=ll[14][0]
    jlnum4=ll[19][0]
    jlnum5=ll[24][0]
    jlnum6=ll[29][0]
    fa=faultmessage.objects.all()
    gz=fa[4]
    tsy='高压排气压力>1.47'#提示语
    n=1
    return render(request,'myApp/tsb3.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb52(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.gypqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[3][0]
    jlnum2=ll[8][0]
    jlnum3=ll[13][0]
    jlnum4=ll[18][0]
    jlnum5=ll[23][0]
    jlnum6=ll[28][0]
    fa=faultmessage.objects.all()
    gz=fa[4]
    tsy='高压排气压力>1.47'#提示语
    n=2
    return render(request,'myApp/tsb3.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb53(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.gypqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[2][0]
    jlnum2=ll[7][0]
    jlnum3=ll[12][0]
    jlnum4=ll[17][0]
    jlnum5=ll[22][0]
    jlnum6=ll[27][0]
    fa=faultmessage.objects.all()
    gz=fa[4]
    tsy='高压排气压力>1.47'#提示语
    n=3
    return render(request,'myApp/tsb3.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb54(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.gypqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[1][0]
    jlnum2=ll[6][0]
    jlnum3=ll[11][0]
    jlnum4=ll[16][0]
    jlnum5=ll[21][0]
    jlnum6=ll[26][0]
    fa=faultmessage.objects.all()
    gz=fa[4]
    tsy='高压排气压力>1.47'#提示语
    n=4
    return render(request,'myApp/tsb3.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb55(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.gypqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[0][0]
    jlnum2=ll[5][0]
    jlnum3=ll[10][0]
    jlnum4=ll[15][0]
    jlnum5=ll[20][0]
    jlnum6=ll[25][0]
    fa=faultmessage.objects.all()
    gz=fa[4]
    tsy='高压排气压力>1.47'#提示语
    n=5
    return render(request,'myApp/tsb3.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功


def tb41(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zypqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[4][0]
    jlnum2=ll[9][0]
    jlnum3=ll[14][0]
    jlnum4=ll[19][0]
    jlnum5=ll[24][0]
    jlnum6=ll[29][0]
    fa=faultmessage.objects.all()
    gz=fa[3]
    tsy='中压排气压力>1.47'#提示语
    n=1 #3号机组
    return render(request,'myApp/tsb3.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb42(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zypqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[3][0]
    jlnum2=ll[8][0]
    jlnum3=ll[13][0]
    jlnum4=ll[18][0]
    jlnum5=ll[23][0]
    jlnum6=ll[28][0]
    fa=faultmessage.objects.all()
    gz=fa[3]
    tsy='中压排气压力>1.47'#提示语
    n=2 #3号机组
    return render(request,'myApp/tsb3.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb43(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zypqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[2][0]
    jlnum2=ll[7][0]
    jlnum3=ll[12][0]
    jlnum4=ll[17][0]
    jlnum5=ll[22][0]
    jlnum6=ll[27][0]
    fa=faultmessage.objects.all()
    gz=fa[3]
    tsy='中压排气压力>1.47'#提示语
    n=3 #3号机组
    return render(request,'myApp/tsb3.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb44(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zypqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[1][0]
    jlnum2=ll[6][0]
    jlnum3=ll[11][0]
    jlnum4=ll[16][0]
    jlnum5=ll[21][0]
    jlnum6=ll[26][0]
    fa=faultmessage.objects.all()
    gz=fa[3]
    tsy='中压排气压力>1.47'#提示语
    n=4 #3号机组
    return render(request,'myApp/tsb3.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功
def tb45(request):
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zypqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[0][0]
    jlnum2=ll[5][0]
    jlnum3=ll[10][0]
    jlnum4=ll[15][0]
    jlnum5=ll[20][0]
    jlnum6=ll[25][0]
    fa=faultmessage.objects.all()
    gz=fa[3]
    tsy='中压排气压力>1.47'#提示语
    n=5 #5号机组
    return render(request,'myApp/tsb3.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb4登陆成功


def tb31(request):    #tb3登陆成功
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.gyzqfmh-qu.gyzqfmy  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]


    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    
    jlnum1=ll[4][0]
    jlnum2=ll[9][0]
    jlnum3=ll[14][0]
    jlnum4=ll[19][0]
    jlnum5=ll[24][0]
    jlnum6=ll[29][0]


    


    fa=faultmessage.objects.all()
    gz=fa[2]


    tsy='高压主汽阀门进口温差>14'#提示语
    n=1
    
    return render(request,'myApp/tsb3.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb3登陆成功
def tb32(request):    #tb3登陆成功
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.gyzqfmh-qu.gyzqfmy  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]


    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    
    jlnum1=ll[3][0]
    jlnum2=ll[8][0]
    jlnum3=ll[13][0]
    jlnum4=ll[18][0]
    jlnum5=ll[23][0]
    jlnum6=ll[28][0]


    


    fa=faultmessage.objects.all()
    gz=fa[2]


    tsy='高压主汽阀门进口温差>14'#提示语
    n=2
    
    return render(request,'myApp/tsb3.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb3登陆成功
def tb33(request):    #tb3登陆成功
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.gyzqfmh-qu.gyzqfmy  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]


    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    
    jlnum1=ll[2][0]
    jlnum2=ll[7][0]
    jlnum3=ll[12][0]
    jlnum4=ll[17][0]
    jlnum5=ll[22][0]
    jlnum6=ll[27][0]


    


    fa=faultmessage.objects.all()
    gz=fa[2]


    tsy='高压主汽阀门进口温差>14'#提示语
    n=3
    
    return render(request,'myApp/tsb3.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb3登陆成功
def tb34(request):    #tb3登陆成功
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.gyzqfmh-qu.gyzqfmy  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]


    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    
    jlnum1=ll[1][0]
    jlnum2=ll[6][0]
    jlnum3=ll[11][0]
    jlnum4=ll[16][0]
    jlnum5=ll[21][0]
    jlnum6=ll[26][0]


    


    fa=faultmessage.objects.all()
    gz=fa[2]


    tsy='高压主汽阀门进口温差>14'#提示语
    n=4
    
    return render(request,'myApp/tsb3.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb3登陆成功
def tb35(request):    #tb3登陆成功
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.gyzqfmh-qu.gyzqfmy  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]


    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    
    jlnum1=ll[0][0]
    jlnum2=ll[5][0]
    jlnum3=ll[10][0]
    jlnum4=ll[15][0]
    jlnum5=ll[20][0]
    jlnum6=ll[25][0]


    


    fa=faultmessage.objects.all()
    gz=fa[2]


    tsy='高压主汽阀门进口温差>14'#提示语
    n=5
    
    return render(request,'myApp/tsb3.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb3登陆成功

def tb21(request):    #tb3登陆成功
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zrzqfmh-qu.zrzqfmy  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[4][0]
    jlnum2=ll[9][0]
    jlnum3=ll[14][0]
    jlnum4=ll[19][0]
    jlnum5=ll[24][0]
    jlnum6=ll[29][0]
    fa=faultmessage.objects.all()
    gz=fa[1]
    tsy='再热主汽阀门进口温差>14'#提示语
    n=1
    return render(request,'myApp/tsb3.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb3登陆成功
def tb22(request):    #tb3登陆成功
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zrzqfmh-qu.zrzqfmy  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[3][0]
    jlnum2=ll[8][0]
    jlnum3=ll[13][0]
    jlnum4=ll[18][0]
    jlnum5=ll[23][0]
    jlnum6=ll[28][0]
    fa=faultmessage.objects.all()
    gz=fa[1]
    tsy='再热主汽阀门进口温差>14'#提示语
    n=2
    return render(request,'myApp/tsb3.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb3登陆成功
def tb23(request):    #tb3登陆成功
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zrzqfmh-qu.zrzqfmy  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[2][0]
    jlnum2=ll[7][0]
    jlnum3=ll[12][0]
    jlnum4=ll[17][0]
    jlnum5=ll[22][0]
    jlnum6=ll[27][0]
    fa=faultmessage.objects.all()
    gz=fa[1]
    tsy='再热主汽阀门进口温差>14'#提示语
    n=3
    return render(request,'myApp/tsb3.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb3登陆成功
def tb24(request):    #tb3登陆成功
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zrzqfmh-qu.zrzqfmy  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[1][0]
    jlnum2=ll[6][0]
    jlnum3=ll[11][0]
    jlnum4=ll[16][0]
    jlnum5=ll[21][0]
    jlnum6=ll[26][0]
    fa=faultmessage.objects.all()
    gz=fa[1]
    tsy='再热主汽阀门进口温差>14'#提示语
    n=4
    return render(request,'myApp/tsb3.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb3登陆成功
def tb25(request):    #tb3登陆成功
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zrzqfmh-qu.zrzqfmy  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]
    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]
    jlnum1=ll[0][0]
    jlnum2=ll[5][0]
    jlnum3=ll[10][0]
    jlnum4=ll[15][0]
    jlnum5=ll[20][0]
    jlnum6=ll[25][0]
    fa=faultmessage.objects.all()
    gz=fa[1]
    tsy='再热主汽阀门进口温差>14'#提示语
    n=1
    return render(request,'myApp/tsb3.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})  #如果tb3登陆成功


def tb11(request):    #tb3登陆成功
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zrhyl-qu.zrqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]


    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]

    
    jlnum1=ll[4][0]
    jlnum2=ll[9][0]
    jlnum3=ll[14][0]
    jlnum4=ll[19][0]
    jlnum5=ll[24][0]
    jlnum6=ll[29][0]
    


    fa=faultmessage.objects.all()
    gz=fa[0]


    tsy='再热压力比值>1.25'#提示语
    n=1


    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})
def tb12(request):    #tb3登陆成功
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zrhyl-qu.zrqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]


    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]

    
    jlnum1=ll[3][0]
    jlnum2=ll[8][0]
    jlnum3=ll[13][0]
    jlnum4=ll[18][0]
    jlnum5=ll[23][0]
    jlnum6=ll[28][0]
    


    fa=faultmessage.objects.all()
    gz=fa[0]


    tsy='再热压力比值>1.25'#提示语
    n=2


    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})
def tb13(request):    #tb3登陆成功
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zrhyl-qu.zrqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]


    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]

    
    jlnum1=ll[2][0]
    jlnum2=ll[7][0]
    jlnum3=ll[12][0]
    jlnum4=ll[17][0]
    jlnum5=ll[22][0]
    jlnum6=ll[27][0]
    


    fa=faultmessage.objects.all()
    gz=fa[0]


    tsy='再热压力比值>1.25'#提示语
    n=3


    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})
def tb14(request):    #tb3登陆成功
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zrhyl-qu.zrqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]


    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]

    
    jlnum1=ll[1][0]
    jlnum2=ll[6][0]
    jlnum3=ll[11][0]
    jlnum4=ll[16][0]
    jlnum5=ll[21][0]
    jlnum6=ll[26][0]
    


    fa=faultmessage.objects.all()
    gz=fa[0]


    tsy='再热压力比值>1.25'#提示语
    n=4


    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})
def tb15(request):    #tb3登陆成功
    que = quejlzk.objects.all()
    cw3=[]
    for qu in que:
        zypqyl=qu.zrhyl-qu.zrqyl  #0数据
        sj=qu.jlsj  #1时间
        id=qu.quid    #2机号
        cw3.append([zypqyl,sj,id])

    hh=1        #转置
    hh2=[]
    while(hh<=len(cw3)):
        l=len(cw3)-hh
        hh2.append(cw3[l])
        hh=hh+1
    #显示图表
    ll = hh2[0:30]


    t11=ll[0][1]
    t21=ll[5][1]
    t31=ll[10][1]
    t41=ll[15][1]
    t51=ll[20][1]
    t61=ll[25][1]

    
    jlnum1=ll[0][0]
    jlnum2=ll[5][0]
    jlnum3=ll[10][0]
    jlnum4=ll[15][0]
    jlnum5=ll[20][0]
    jlnum6=ll[25][0]
    


    fa=faultmessage.objects.all()
    gz=fa[0]


    tsy='再热压力比值>1.25'#提示语
    n=5


    return render(request,'myApp/tsb.html',{'n':n,'t':tsy,'f':gz,'t1':t11,'t2':t21,'t3':t31,'t4':t41,'t5':t51,'t6':t61,'j1':jlnum1,'j2':jlnum2,'j3':jlnum3,'j4':jlnum4,'j5':jlnum5,'j6':jlnum6,})








def yuan(request):
    global ym
    ym=1
    yc=yczb.objects.all()
    #统计五个机组,suma到sume
    suma,sumb,sumc,sumd,sume=0,0,0,0,0
    suma2,sumb2,sumc2,sumd2,sume2=0,0,0,0,0
    suma3,sumb3,sumc3,sumd3,sume3=0,0,0,0,0
    suma4,sumb4,sumc4,sumd4,sume4=0,0,0,0,0
    #需要转置
    
    yc=Reverse(yc)    #转置
    y1=yc[0]
    tim=y1.jlsj
    tim2,tim3,tim4=0,0,0

    

    for y in yc:
        if(y.jlsj==tim):
            if(y.quid==1):
                suma=suma+1
            elif(y.quid==2):
                sumb=sumb+1
            elif(y.quid==3):
                sumc=sumc+1
            elif(y.quid==4):
                sumd=sumd+1
            elif(y.quid==5):
                sume=sume+1
    #在这一时刻出现的错误
        if(tim2==0 and y.jlsj!=tim):
            tim2=y.jlsj
        if(y.jlsj==tim2):
            if(y.quid==1):
                suma2=suma2+1
            elif(y.quid==2):
                sumb2=sumb2+1
            elif(y.quid==3):
                sumc2=sumc2+1
            elif(y.quid==4):
                sumd2=sumd2+1
            elif(y.quid==5):
                sume2=sume2+1
        if(tim3==0 and y.jlsj!=tim and y.jlsj!=tim2):
            tim3=y.jlsj
        if(y.jlsj==tim3):
            if(y.quid==1):
                suma3=suma3+1
            elif(y.quid==2):
                sumb3=sumb3+1
            elif(y.quid==3):
                sumc3=sumc3+1
            elif(y.quid==4):
                sumd3=sumd3+1
            elif(y.quid==5):
                sume3=sume3+1
        if(tim4==0 and y.jlsj!=tim and y.jlsj!=tim2 and y.jlsj!=tim3):
            tim4=y.jlsj
        if(y.jlsj==tim4):
            if(y.quid==1):
                suma4=suma4+1
            elif(y.quid==2):
                sumb4=sumb4+1
            elif(y.quid==3):
                sumc4=sumc4+1
            elif(y.quid==4):
                sumd4=sumd4+1
            elif(y.quid==5):
                sume4=sume4+1
    #下一时刻的
    a1 = yc[0]
    a2 = yc[1]
    a3 = yc[2]
    a4 = yc[3]
    a5 = yc[4]
    a6 = yc[5]
    a7 = yc[6]

    


    return render(request,'myApp/yuan.html',{'t1':tim,'t2':tim2,'t3':tim3,'t4':tim4,'a1':a1,'a2':a2,'a3':a3,'a4':a4,'a5':a5,'a6':a6,'a7':a7,
                                             'sa1':suma,'sb1':sumb,'sc1':sumc,'sd1':sumd,'se1':sume,
                                             'sa2':suma2,'sb2':sumb2,'sc2':sumc2,'sd2':sumd2,'se2':sume2,
                                             'sa3':suma3,'sb3':sumb3,'sc3':sumc3,'sd3':sumd3,'se3':sume3,
                                             'sa4':suma4,'sb4':sumb4,'sc4':sumc4,'sd4':sumd4,'se4':sume4})




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值