Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
IC-Interface Control
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
Operations
Operations
Metrics
Environments
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
Mateus Goto
IC-Interface Control
Commits
88cea533
Commit
88cea533
authored
Oct 11, 2022
by
goto01
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ADDED] array for the django back end
parent
ee4d43bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
main.py
main.py
+0
-8
test/realtime_graph/graph/consumers.py
test/realtime_graph/graph/consumers.py
+7
-2
No files found.
main.py
View file @
88cea533
...
...
@@ -25,14 +25,6 @@ def main():
print
(
"nhr10 ip: "
,
elem
.
getIp
())
print
(
"nhr 10 array: "
,
elem
.
getVoltageArray
())
for
elem
in
nhr30
:
elem
.
setCurrent
(
10
)
elem
.
start
()
print
(
"nhr30 ip: "
,
elem
.
getIp
())
print
(
"nhr 30 array: "
,
elem
.
getCurrentArray
())
time
.
sleep
(
3
)
...
...
test/realtime_graph/graph/consumers.py
View file @
88cea533
...
...
@@ -2,6 +2,11 @@ import json
from
random
import
randint
from
asyncio
import
sleep
from
channels.generic.websocket
import
AsyncWebsocketConsumer
from
NHR9400series.NHR9400
import
NHR9400
from
NHR9400series.NHR9430
import
NHR9430
class
GraphConsumer
(
AsyncWebsocketConsumer
):
...
...
@@ -9,5 +14,5 @@ class GraphConsumer(AsyncWebsocketConsumer):
await
self
.
accept
()
for
i
in
range
(
1000
):
await
self
.
send
(
json
.
dumps
({
'value'
:
randint
(
0
,
100
)}))
await
sleep
(
1
)
await
self
.
send
(
json
.
dumps
({
'value'
:
NHR9400
.
getVoltageArray
(
)}))
await
sleep
(
0.16
)
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