修改:1、修改忽略文件 2、修改增加设备节点时没有初始化变量表的bug,会导致错误

This commit is contained in:
pengwang 2020-08-12 13:41:38 +08:00
parent 7009de7d4b
commit 2e1fe355e1
6 changed files with 5 additions and 2 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
goAdapter
plugin/
config/
selfpara/

View File

@ -283,6 +283,8 @@ func (d *CollectInterfaceTemplate) AddDeviceNode(dName string,dType string, dAdd
node.CurCommFailCnt = 0
node.CommStatus = "offLine"
node.VariableMap = make([]api.VariableTemplate, 0)
variables := node.NewVariables()
node.VariableMap = append(node.VariableMap, variables...)
d.DeviceNodeMap = append(d.DeviceNodeMap, node)

BIN
goAdapter

Binary file not shown.

View File

@ -1 +0,0 @@
{"CollectInterfaceParam":[{"CollInterfaceName":"1","CommInterfaceName":"com1","PollPeriod":120,"OfflinePeriod":3,"DeviceNodeCnt":0}],"DeviceNodeNameMap":[],"DeviceNodeAddrMap":[],"DeviceNodeTypeMap":[]}

View File

@ -1 +0,0 @@
[{"Name":"com1","Type":"LocalSerial","Param":{"Name":"/dev/ttyS1","BaudRate":"9600","DataBits":"8","StopBits":"1","Parity":"N","Timeout":"1500","Interval":"300"}}]

View File

@ -9,4 +9,5 @@ var SerialPortNameTemplateMap = [...]SerialPortNameTemplate{
{Name:"/dev/ttyUSB1"},
{Name:"/dev/ttyS0"},
{Name:"/dev/ttyS1"},
{Name:"/dev/tty.SLAB_USBtoUART"},
}