当前位置:网站首页>InTouch advanced alarm (alarm filtering)
InTouch advanced alarm (alarm filtering)
2022-07-25 19:09:00 【Kawaii big meow】
Alarm storage SqlServer
open Alarm DB Logger Manager Software

Click the start button , Give Way intouch Store the alarm record SqlServer Inside

SqlServer Turn on Sql Sign in

SqlServer Create a new user

Turn on all authorizations 
Turn on remote login 
Check the database port number , It's usually 1433 Port number 
If it's remote , The firewall opening port number is required
SqlServer Remote login test
Use software

make new connection sqlserver The server

open sqlserver All alarm data can be seen in the database view

Front end page writing

The backend server is written
import pymssql
import base64
from flask import request, Flask, jsonify
app = Flask(__name__)
## link sqlserver
db = pymssql.connect(host='127.0.0.1',user='TEST',password='[email protected]',database='WWALMDB',charset='utf8')
cursor = db.cursor()
db.autocommit(True)
## Get all alarm information ( Paging query )
@app.route('/police/get/<searchType>/<like>/<pageIndex>/<size>')
def getRoad(searchType,like,pageIndex,size):
like = base64.b64decode(like)
like = str(like, 'utf-8')
print(like)
sql = ""
sqlLike = ""
searchType = int(searchType)
if searchType == 1:
sqlLike = like+"%"
elif searchType == 2:
sqlLike = "% level %"
elif searchType == 3:
sqlLike = "% electric current %"
elif searchType == 4:
sqlLike = "% voltage %"
elif searchType == 5:
sqlLike = "%1# pump %"
elif searchType == 6:
sqlLike = "%2# pump %"
elif searchType == 7:
sqlLike = "% Fan %"
if(searchType == 0):
sql = "SELECT TOP "+ size +" * FROM ( SELECT ROW_NUMBER ( ) OVER ( ORDER BY EventStamp DESC ) AS ROWS,* FROM v_AlarmHistory) A WHERE ROWS >"+pageIndex
else:
sql = "SELECT TOP "+ size +" * FROM ( SELECT ROW_NUMBER ( ) OVER ( ORDER BY EventStamp DESC ) AS ROWS,* FROM v_AlarmHistory WHERE v_AlarmHistory.Description LIKE '"+sqlLike+"') A WHERE ROWS >"+pageIndex
print("-----------")
print(sql)
cursor.execute(sql)
msg = cursor.fetchall()
return {"msg": "error","data":msg}
## The query time ( Paging query )
@app.route('/police/getbyDate/<start>/<end>/<pageIndex>/<size>')
def getbyDate(start,end,pageIndex,size):
start = base64.b64decode(start)
start = str(start, 'utf-8')+" 00:00:00"
end = base64.b64decode(end)
end = str(end, 'utf-8')+" 00:00:00"
sql = "select top "+size+" * from (SELECT ROW_NUMBER() over(order by EventStamp desc) as rows,*FROM v_AlarmHistory WHERE v_AlarmHistory.EventStamp BETWEEN '"+start+"' AND '"+end+"' ) A where rows > "+pageIndex
print(sql)
cursor.execute(sql)
msg = cursor.fetchall()
return {"msg": "error","data":msg}
try:
app.run(port=8066)
except BaseException:
print(" Service startup failed , port :8066")
边栏推荐
- Baklib: make excellent product instruction manual
- The bank's wealth management subsidiary accumulates power to distribute a shares; The rectification of cash management financial products was accelerated
- 小程序毕设作品之微信校园维修报修小程序毕业设计成品(8)毕业设计论文模板
- 乐理基础 调式
- Single arm routing experiment demonstration (Huawei router device configuration)
- Ping 命令详解[通俗易懂]
- How to create an effective help document?
- Basic music theory -- configuring chords
- 有孚原力超算,为客户提供定制化高性能计算服务
- [encryption weekly] has the encryption market recovered? The cold winter has not thawed yet! Check the major events in the encryption market last week!
猜你喜欢

How to design product help center? The following points cannot be ignored

FPGA based 1080p 60Hz bt1120 interface debugging process record

“未来杯”第二届知识图谱锦标赛正式启动

Pymoo learning (6): termination conditions

小程序毕设作品之微信校园维修报修小程序毕业设计成品(8)毕业设计论文模板

【阅读笔记】《深度学习》第一章:引言
![[iniparser] simple use of the project configuration tool iniparser](/img/2b/1d20b4ef44dfe2544891d9c72b676e.png)
[iniparser] simple use of the project configuration tool iniparser

阿里云技术专家郝晨栋:云上可观测能力——问题的发现与定位实践

【DETR用于3D目标检测】3DETR: An End-to-End Transformer Model for 3D Object Detection

Alibaba cloud technology expert haochendong: cloud observability - problem discovery and positioning practice
随机推荐
Everyone can participate in the official launch of open source activities. We sincerely invite you to experience!
Fearless of high temperature and rainstorm, how can Youfu network protect you from worry?
歌曲转调之后和弦如何转换
阿里云免费SSL证书申请详细流程
SQL Server 2019 installation tutorial
[919. Complete binary tree inserter]
【919. 完全二叉树插入器】
[open source project] stm32c8t6 + ADC signal acquisition + OLED waveform display
The difference between QT exec and show
QT compiled successfully, but the program could not run
Interface automation test platform fasterrunner series (IV) - continuous integration and solution of multi domain names
21 days proficient in typescript-4 - type inference and semantic check
Korean AI team plagiarizes shock academia! One tutor with 51 students, or plagiarism recidivist
jmeter性能测试实战视频(常用性能测试工具有哪些)
HTTP cache tongtianpian, there may be something you want
Software testing (mind mapping)
[web technology] 1391 page visualization building tool, previous life and present life
With 8 years of product experience, I have summarized these practical experience of continuous and efficient research and development
乐理基础 调式
怎样设计产品帮助中心?以下几点不可忽视