Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
openXG-WIC-Opencpc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alex037yang
openXG-WIC-Opencpc
Commits
ec15202c
Commit
ec15202c
authored
Apr 16, 2018
by
joliu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新版的控制器测试脚本
parent
efa386eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
tests/controler.py
tests/controler.py
+36
-0
No files found.
tests/controler.py
0 → 100644
View file @
ec15202c
import
socket
import
sys
import
numpy
as
np
import
json
port
=
3000
inputTask
=
np
.
array
([[
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
],
\
[
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
],
\
[
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
],
\
[
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
],
\
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
\
[
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
\
[
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
\
[
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
]])
inputTypeList
=
np
.
array
([
1
,
3
,
2
,
5
,
0
,
4
,
4
,
4
])
deviceList
=
[
-
1
,
-
1
,
-
1
,
"delay1"
,
"switch103"
,
"dht102"
,
"dht103"
,
"dht104"
]
jsnInputTask
=
json
.
dumps
(
inputTask
.
tolist
())
jsnInputTypeList
=
json
.
dumps
(
inputTypeList
.
tolist
())
jsnDeviceList
=
json
.
dumps
(
deviceList
)
# message = 'controller&addOutput&%s&%s&%s&0&2' % (jsnInputTask, jsnInputTypeList, jsnDeviceList)
# 执行逻辑矩阵数据库
# message = 'controller&show&resulovetable'
# 数据缓存数据库
# message = 'controller&show&datacach'
# 数据采集控制数据库
# message = 'controller&show&decidedestination'
message
=
'controller&clear'
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
s
.
connect
((
"192.168.12.19"
,
port
))
s
.
sendall
(
message
.
encode
())
response
=
s
.
recv
(
1024
).
decode
()
print
(
response
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment