protocolReport_view.py 4.85 KB
Newer Older
李远洪's avatar
李远洪 committed
1 2 3 4 5 6 7
#coding:utf-8

from flask import Blueprint, render_template ,request
import re

protocolReport_view = Blueprint('protocolReport_view', __name__)

8 9 10 11 12 13 14 15 16 17 18 19 20 21
##########################################
#   【视图类型】访问自定义报文发送页面
##########################################
@protocolReport_view.route('/userDefined_protocol_page')
def userDefined_protocol_page():
    #获取请求的路劲
    url = request.url
    reqPath = re.findall("http://(.*)$",url)[0]
    reqPath = re.findall("/(.*)$", reqPath)[0]
    arg = {}
    path = "protocolTools/report/userDefined_protocol_page.html"
    arg["path"] = reqPath.split("/")
    return render_template(path,arg=arg)

李远洪's avatar
李远洪 committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
##########################################
#   【视图类型】访问心跳协议报文发送页面
##########################################
@protocolReport_view.route('/heartBeat_protocol_page')
def heartBeat_protocol_page():
    #获取请求的路劲
    url = request.url
    reqPath = re.findall("http://(.*)$",url)[0]
    reqPath = re.findall("/(.*)$", reqPath)[0]
    arg = {}
    path = "protocolTools/report/heartBeat_protocol_page.html"
    arg["path"] = reqPath.split("/")
    return render_template(path,arg=arg)


##########################################
#   【视图类型】访问终端登录协议报文发送页面
##########################################
@protocolReport_view.route('/login_protocol_page')
def login_protocol_page():
    #获取请求的路劲
    url = request.url
    reqPath = re.findall("http://(.*)$",url)[0]
    reqPath = re.findall("/(.*)$", reqPath)[0]
    arg = {}
    path = "protocolTools/report/login_protocol_page.html"
    arg["path"] = reqPath.split("/")
    return render_template(path,arg=arg)


##########################################
#   【视图类型】访问GPS协议报文发送页面
##########################################
@protocolReport_view.route('/GPS_protocol_page')
def GPS_protocol_page():
    #获取请求的路劲
    url = request.url
    reqPath = re.findall("http://(.*)$",url)[0]
    reqPath = re.findall("/(.*)$", reqPath)[0]
    arg = {}
    path = "protocolTools/report/GPS_protocol_page.html"
    arg["path"] = reqPath.split("/")
    return render_template(path,arg=arg)

##########################################
#   【视图类型】访问OBD_CAN协议报文发送页面
##########################################
@protocolReport_view.route('/OBD_CAN_protocol_page')
def OBD_CAN_protocol_page():
    #获取请求的路劲
    url = request.url
    reqPath = re.findall("http://(.*)$",url)[0]
    reqPath = re.findall("/(.*)$", reqPath)[0]
    arg = {}
    path = "protocolTools/report/OBD_CAN_protocol_page.html"
    arg["path"] = reqPath.split("/")
    return render_template(path,arg=arg)


##########################################
#   【视图类型】访问终端上报安防状态协议报文发送页面
##########################################
@protocolReport_view.route('/securityStatus_protocol_page')
def securityStatus_protocol_page():
    #获取请求的路劲
    url = request.url
    reqPath = re.findall("http://(.*)$",url)[0]
    reqPath = re.findall("/(.*)$", reqPath)[0]
    arg = {}
    path = "protocolTools/report/securityStatus_protocol_page.html"
    arg["path"] = reqPath.split("/")
93 94 95 96
    return render_template(path,arg=arg)


##########################################
97
#   【视图类型】访问终端上报电瓶电压协议报文发送页面
98 99 100 101 102 103 104 105 106 107 108
##########################################
@protocolReport_view.route('/voltageData_protocol_page')
def voltageData_protocol_page():
    #获取请求的路劲
    url = request.url
    reqPath = re.findall("http://(.*)$",url)[0]
    reqPath = re.findall("/(.*)$", reqPath)[0]
    arg = {}
    path = "protocolTools/report/voltageData_protocol_page.html"
    arg["path"] = reqPath.split("/")
    return render_template(path,arg=arg)
109 110 111 112 113 114 115 116 117 118 119 120 121 122


##########################################
#   【视图类型】访问终端上报事件协议报文发送页面
##########################################
@protocolReport_view.route('/event_protocol_page')
def event_protocol_page():
    #获取请求的路劲
    url = request.url
    reqPath = re.findall("http://(.*)$",url)[0]
    reqPath = re.findall("/(.*)$", reqPath)[0]
    arg = {}
    path = "protocolTools/report/event_protocol_page.html"
    arg["path"] = reqPath.split("/")
123 124 125 126 127 128 129 130 131 132 133 134 135 136
    return render_template(path,arg=arg)

##########################################
#   【视图类型】访问终端上报故障码报文发送页面
##########################################
@protocolReport_view.route('/troubleCode_protocol_page')
def troubleCode_protocol_page():
    #获取请求的路劲
    url = request.url
    reqPath = re.findall("http://(.*)$",url)[0]
    reqPath = re.findall("/(.*)$", reqPath)[0]
    arg = {}
    path = "protocolTools/report/troubleCode_protocol_page.html"
    arg["path"] = reqPath.split("/")
137
    return render_template(path,arg=arg)