Project

General

Profile

Feature #781

支持新通用命令控制的pis脚本控制

Added by xiangyang li almost 4 years ago. Updated almost 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
shixun yan
Target version:
Start date:
09/08/2020
Due date:
09/09/2020
% Done:

100%

Estimated time:
20.00 h
Defect version:

Description

提供新的PIS控制脚本,支持通用命令json格式下发


Files


Related issues

Related to ISCS需求及问题 - Bug #770: 南昌line3# 南昌PIS需要根据fas报警联动下发 既有函数脚本pis命令下发成功 报文不正确 Resolved09/07/2020

Actions

History

#1

Updated by xiangyang li almost 4 years ago

  • Related to Bug #770: 南昌line3# 南昌PIS需要根据fas报警联动下发 既有函数脚本pis命令下发成功 报文不正确 added
#2

Updated by shixun yan almost 4 years ago

  • Status changed from New to In Progress
#3

Updated by shixun yan almost 4 years ago

  • Due date set to 09/09/2020
  • Start date changed from 09/07/2020 to 09/08/2020
  • Estimated time set to 20.00 h

脚本转通用命令接口 1.5个工作日.
测试0.5个工作日

#4

Updated by shixun yan almost 4 years ago

脚本里面新增一个接口generalcmd 通用命令,
void generalcmd(char * pJson, int nAddrNo)
参数说明:
pJson: 要往下控制的JSON包数据.组包方式请参考后面的详细说明.
nAddrNo: 地址偏移量, 1表示PA控制, 2表示PIS控制, 3表示CCTV
返回值: 无
例如: PIS 紧急模式控制 generalcmd( “{"type": 2,"ctype": 1,"opt": 1, "zone":65535, "sta":"1",”text”:”火灾报警,请疏散!”}”, 2 )

#5

Updated by shixun yan almost 4 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

例如: PIS 紧急模式控制 generalcmd( '{"type": 2,"ctype": 1,"opt": 1, "zone":65535, "sta":"1",”text”:”火灾报警,请疏散!”}', 2 )
更新一下,如果在脚本里面编写控制命令 最外层用单引号,里面JSON用双引号,不然会编译错误.
或者里面用转义字符也可以. 比如generalcmd( "{\"type": 2,.......

#6

Updated by lq Du almost 4 years ago

以上脚本中 " 符号复用了 需要转义 \" 或者改 '' 和 ""

if K==1 then
generalcmd('{"ctype":1,"id":1,"opt":1,"sta":"2","text":"火灾疏散","type":2,"zone":7}',2)
else
generalcmd('{"ctype":1,"id":1,"opt":0,"sta":"2","text":"","type":2,"zone":7}',2)
end

Also available in: Atom PDF