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
ef3e87dd
Commit
ef3e87dd
authored
Oct 21, 2022
by
Mateus Goto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[new] Charts working with some bugs
parent
b96ab0c6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
11 deletions
+12
-11
test/realtime_graph/NHR9400series/NHR9400.py
test/realtime_graph/NHR9400series/NHR9400.py
+8
-4
test/realtime_graph/NHR9400series/__pycache__/NHR9400.cpython-310.pyc
...e_graph/NHR9400series/__pycache__/NHR9400.cpython-310.pyc
+0
-0
test/realtime_graph/graph/__pycache__/consumers.cpython-310.pyc
...ealtime_graph/graph/__pycache__/consumers.cpython-310.pyc
+0
-0
test/realtime_graph/graph/consumers.py
test/realtime_graph/graph/consumers.py
+4
-7
No files found.
test/realtime_graph/NHR9400series/NHR9400.py
View file @
ef3e87dd
...
@@ -500,18 +500,22 @@ class NHR9400():
...
@@ -500,18 +500,22 @@ class NHR9400():
value
=
self
.
__s
.
recv
(
1024
)
value
=
self
.
__s
.
recv
(
1024
)
return
self
.
receiveFloat
(
value
)
return
self
.
receiveFloat
(
value
)
def
get
VoltageArray
(
self
):
def
get
Points
(
self
):
array
=
[]
self
.
__s
.
send
(
"CLS
\n
"
.
encode
())
self
.
__s
.
send
(
"SENSe:SWEep:POINts?
\n
"
.
encode
())
self
.
__s
.
send
(
"SENSe:SWEep:POINts?
\n
"
.
encode
())
points
=
self
.
__s
.
recv
(
1024
)
points
=
self
.
__s
.
recv
(
1024
)
points
=
self
.
receiveFloat
(
points
)
return
self
.
receiveFloat
(
points
)
for
i
in
range
(
int
(
points
/
130
)):
def
getVoltageArray
(
self
,
points
):
array
=
[]
for
i
in
range
(
int
((
points
/
130
))):
self
.
__s
.
send
((
"FETC:ARR:VOLT? "
+
str
(
i
*
130
)
+
"
\n
"
).
encode
())
self
.
__s
.
send
((
"FETC:ARR:VOLT? "
+
str
(
i
*
130
)
+
"
\n
"
).
encode
())
value
=
self
.
__s
.
recv
(
1024
)
value
=
self
.
__s
.
recv
(
1024
)
value
=
self
.
receiveArray
(
value
)
value
=
self
.
receiveArray
(
value
)
array
=
array
+
value
array
=
array
+
value
return
array
return
array
#Fetch the average power of all channels
#Fetch the average power of all channels
def
getPower
(
self
):
def
getPower
(
self
):
self
.
__s
.
send
(
"FETC:POW?
\n
"
.
encode
())
self
.
__s
.
send
(
"FETC:POW?
\n
"
.
encode
())
...
...
test/realtime_graph/NHR9400series/__pycache__/NHR9400.cpython-310.pyc
View file @
ef3e87dd
No preview for this file type
test/realtime_graph/graph/__pycache__/consumers.cpython-310.pyc
View file @
ef3e87dd
No preview for this file type
test/realtime_graph/graph/consumers.py
View file @
ef3e87dd
import
json
import
json
from
random
import
randint
from
asyncio
import
sleep
from
asyncio
import
sleep
from
channels.generic.websocket
import
AsyncWebsocketConsumer
from
channels.generic.websocket
import
AsyncWebsocketConsumer
from
NHR9400series.NHR9410
import
NHR9410
from
Control_Interface.controlInterface
import
controlInterface
from
Control_Interface.controlInterface
import
controlInterface
...
@@ -10,15 +8,14 @@ interface = controlInterface()
...
@@ -10,15 +8,14 @@ interface = controlInterface()
interface
.
newNhr
(
"9410"
)
interface
.
newNhr
(
"9410"
)
nhr10
=
[]
nhr10
=
[]
nhr10
=
interface
.
getNhr9410
()
nhr10
=
interface
.
getNhr9410
()
points
=
nhr10
[
0
].
getPoints
()
class
GraphConsumer
(
AsyncWebsocketConsumer
):
class
GraphConsumer
(
AsyncWebsocketConsumer
):
async
def
connect
(
self
):
async
def
connect
(
self
):
await
self
.
accept
()
await
self
.
accept
()
for
i
in
range
(
1000
):
for
i
in
range
(
1000
):
array
=
nhr10
[
0
].
getVoltageArray
()
array
=
nhr10
[
0
].
getVoltageArray
(
points
)
print
(
len
(
array
)
/
10
)
for
j
in
range
(
int
(
len
(
array
)
/
30
)):
for
j
in
range
(
int
(
len
(
array
)
/
4
)):
await
self
.
send
(
json
.
dumps
({
'value'
:
array
[
j
*
29
]}))
await
self
.
send
(
json
.
dumps
({
'value'
:
array
[
j
*
4
]}))
await
sleep
(
0.1
)
await
sleep
(
0.1
)
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