Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
distributed oscilloscope
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Projects
distributed oscilloscope
Commits
b49888a6
Commit
b49888a6
authored
Jul 03, 2019
by
Milosz Malczak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed serialization to protobuf
parent
023116a1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
644 additions
and
8 deletions
+644
-8
TCP_protobuf.txt
documentation/transport_measurements/TCP/TCP_protobuf.txt
+33
-0
rpc.proto
software/general/rpc.proto
+34
-0
rpc_pb2.py
software/general/rpc_pb2.py
+499
-0
serialization.py
software/general/serialization.py
+74
-5
GUI.py
software/pyqt_app/GUI.py
+2
-1
server_expose_test.py
software/tests/server_expose_test.py
+2
-2
No files found.
documentation/transport_measurements/TCP/TCP_protobuf.txt
0 → 100644
View file @
b49888a6
Internal trigger on channel 3
Sampled signal: 100kHz sine wave Channel 3(0-3)
number of presamples = 0
number of acquisitions = 5
Number of channels: 1
Postsamples: 2 ,Best: 0.000633979914710, medium: 0.000946075376123, variance: 0.000000099162026,
Postsamples: 10 ,Best: 0.000647802837193, medium: 0.000802765646949, variance: 0.000000014182586,
Postsamples: 100 ,Best: 0.000787900062278, medium: 0.000889389775693, variance: 0.000000007365546,
Postsamples: 1000 ,Best: 0.002015376929194, medium: 0.002181492559612, variance: 0.000000035955072,
Postsamples: 10000 ,Best: 0.033366520889103, medium: 0.040128952031955, variance: 0.000014324808231,
Postsamples: 100000 ,Best: 0.080741015961394, medium: 0.083138469560072, variance: 0.000002990065997,
Number of channels: 2
Postsamples: 2 ,Best: 0.000883448868990, medium: 0.001638204185292, variance: 0.000002200146951,
Postsamples: 10 ,Best: 0.000889107817784, medium: 0.000962491706014, variance: 0.000000003973907,
Postsamples: 100 ,Best: 0.000799940899014, medium: 0.001060889009386, variance: 0.000000038004029,
Postsamples: 1000 ,Best: 0.002509825164452, medium: 0.002917002607137, variance: 0.000000130021590,
Postsamples: 10000 ,Best: 0.013368732063100, medium: 0.015742917545140, variance: 0.000002447554075,
Postsamples: 100000 ,Best: 0.128769239876419, medium: 0.135830613318831, variance: 0.000029718604762,
Number of channels: 3
Postsamples: 2 ,Best: 0.000949680106714, medium: 0.002025722060353, variance: 0.000004125948884,
Postsamples: 10 ,Best: 0.000970019958913, medium: 0.001045269798487, variance: 0.000000004030532,
Postsamples: 100 ,Best: 0.001095050014555, medium: 0.001585418684408, variance: 0.000001055187211,
Postsamples: 1000 ,Best: 0.003045155201107, medium: 0.003095481451601, variance: 0.000000003370611,
Postsamples: 10000 ,Best: 0.020646672928706, medium: 0.022097548376769, variance: 0.000001166180156,
Postsamples: 100000 ,Best: 0.160935340914875, medium: 0.178656966146082, variance: 0.000101599869790,
Number of channels: 4
Postsamples: 2 ,Best: 0.001027268124744, medium: 0.002212337823585, variance: 0.000005412744433,
Postsamples: 10 ,Best: 0.001010478008538, medium: 0.001169224316254, variance: 0.000000014455955,
Postsamples: 100 ,Best: 0.001282616052777, medium: 0.001551904063672, variance: 0.000000026084856,
Postsamples: 1000 ,Best: 0.004007722018287, medium: 0.004587752837688, variance: 0.000000714493835,
Postsamples: 10000 ,Best: 0.023665977874771, medium: 0.025389265781268, variance: 0.000002734158424,
Postsamples: 100000 ,Best: 0.201076155062765, medium: 0.223100848589092, variance: 0.000154993651400,
software/general/rpc.proto
0 → 100644
View file @
b49888a6
syntax
=
"proto3"
;
message
RPC
{
string
function_name
=
1
;
Args
args
=
2
;
}
message
channel_data
{
repeated
int32
values
=
1
;
}
message
channel_data2
{
repeated
float
values
=
1
;
}
message
prepost
{
repeated
int32
value
=
1
;
}
message
Args
{
string
unique_ADC_name
=
11
;
string
addr
=
10
;
int32
port
=
9
;
int32
number_of_channels
=
8
;
repeated
int64
timestamps
=
7
;
int32
presamples
=
6
;
int32
postsamples
=
5
;
map
<
string
,
channel_data
>
data
=
4
;
map
<
int32
,
channel_data2
>
data2
=
3
;
map
<
int32
,
prepost
>
pre_post
=
2
;
map
<
int32
,
string
>
offsets
=
1
;
}
software/general/rpc_pb2.py
0 → 100644
View file @
b49888a6
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: rpc.proto
import
sys
_b
=
sys
.
version_info
[
0
]
<
3
and
(
lambda
x
:
x
)
or
(
lambda
x
:
x
.
encode
(
'latin1'
))
from
google.protobuf
import
descriptor
as
_descriptor
from
google.protobuf
import
message
as
_message
from
google.protobuf
import
reflection
as
_reflection
from
google.protobuf
import
symbol_database
as
_symbol_database
# @@protoc_insertion_point(imports)
_sym_db
=
_symbol_database
.
Default
()
DESCRIPTOR
=
_descriptor
.
FileDescriptor
(
name
=
'rpc.proto'
,
package
=
''
,
syntax
=
'proto3'
,
serialized_options
=
None
,
serialized_pb
=
_b
(
'
\n\t
rpc.proto
\"
1
\n\x03
RPC
\x12\x15\n\r
function_name
\x18\x01
\x01
(
\t\x12\x13\n\x04\x61
rgs
\x18\x02
\x01
(
\x0b\x32\x05
.Args
\"\x1e\n\x0c\x63
hannel_data
\x12\x0e\n\x06
values
\x18\x01
\x03
(
\x05\"\x1f\n\r
channel_data2
\x12\x0e\n\x06
values
\x18\x01
\x03
(
\x02\"\x18\n\x07
prepost
\x12\r\n\x05
value
\x18\x01
\x03
(
\x05\"\x83\x04\n\x04\x41
rgs
\x12\x17\n\x0f
unique_ADC_name
\x18\x0b
\x01
(
\t\x12\x0c\n\x04\x61\x64\x64
r
\x18\n
\x01
(
\t\x12\x0c\n\x04
port
\x18\t
\x01
(
\x05\x12\x1a\n\x12
number_of_channels
\x18\x08
\x01
(
\x05\x12\x12\n\n
timestamps
\x18\x07
\x03
(
\x03\x12\x12\n\n
presamples
\x18\x06
\x01
(
\x05\x12\x13\n\x0b
postsamples
\x18\x05
\x01
(
\x05\x12\x1d\n\x04\x64\x61
ta
\x18\x04
\x03
(
\x0b\x32\x0f
.Args.DataEntry
\x12\x1f\n\x05\x64\x61
ta2
\x18\x03
\x03
(
\x0b\x32\x10
.Args.Data2Entry
\x12
$
\n\x08
pre_post
\x18\x02
\x03
(
\x0b\x32\x12
.Args.PrePostEntry
\x12
#
\n\x07
offsets
\x18\x01
\x03
(
\x0b\x32\x12
.Args.OffsetsEntry
\x1a
:
\n\t
DataEntry
\x12\x0b\n\x03
key
\x18\x01
\x01
(
\t\x12\x1c\n\x05
value
\x18\x02
\x01
(
\x0b\x32\r
.channel_data:
\x02\x38\x01\x1a
<
\n\n
Data2Entry
\x12\x0b\n\x03
key
\x18\x01
\x01
(
\x05\x12\x1d\n\x05
value
\x18\x02
\x01
(
\x0b\x32\x0e
.channel_data2:
\x02\x38\x01\x1a\x38\n\x0c
PrePostEntry
\x12\x0b\n\x03
key
\x18\x01
\x01
(
\x05\x12\x17\n\x05
value
\x18\x02
\x01
(
\x0b\x32\x08
.prepost:
\x02\x38\x01\x1a
.
\n\x0c
OffsetsEntry
\x12\x0b\n\x03
key
\x18\x01
\x01
(
\x05\x12\r\n\x05
value
\x18\x02
\x01
(
\t
:
\x02\x38\x01\x62\x06
proto3'
)
)
_RPC
=
_descriptor
.
Descriptor
(
name
=
'RPC'
,
full_name
=
'RPC'
,
filename
=
None
,
file
=
DESCRIPTOR
,
containing_type
=
None
,
fields
=
[
_descriptor
.
FieldDescriptor
(
name
=
'function_name'
,
full_name
=
'RPC.function_name'
,
index
=
0
,
number
=
1
,
type
=
9
,
cpp_type
=
9
,
label
=
1
,
has_default_value
=
False
,
default_value
=
_b
(
""
)
.
decode
(
'utf-8'
),
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
_descriptor
.
FieldDescriptor
(
name
=
'args'
,
full_name
=
'RPC.args'
,
index
=
1
,
number
=
2
,
type
=
11
,
cpp_type
=
10
,
label
=
1
,
has_default_value
=
False
,
default_value
=
None
,
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
],
extensions
=
[
],
nested_types
=
[],
enum_types
=
[
],
serialized_options
=
None
,
is_extendable
=
False
,
syntax
=
'proto3'
,
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
13
,
serialized_end
=
62
,
)
_CHANNEL_DATA
=
_descriptor
.
Descriptor
(
name
=
'channel_data'
,
full_name
=
'channel_data'
,
filename
=
None
,
file
=
DESCRIPTOR
,
containing_type
=
None
,
fields
=
[
_descriptor
.
FieldDescriptor
(
name
=
'values'
,
full_name
=
'channel_data.values'
,
index
=
0
,
number
=
1
,
type
=
5
,
cpp_type
=
1
,
label
=
3
,
has_default_value
=
False
,
default_value
=
[],
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
],
extensions
=
[
],
nested_types
=
[],
enum_types
=
[
],
serialized_options
=
None
,
is_extendable
=
False
,
syntax
=
'proto3'
,
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
64
,
serialized_end
=
94
,
)
_CHANNEL_DATA2
=
_descriptor
.
Descriptor
(
name
=
'channel_data2'
,
full_name
=
'channel_data2'
,
filename
=
None
,
file
=
DESCRIPTOR
,
containing_type
=
None
,
fields
=
[
_descriptor
.
FieldDescriptor
(
name
=
'values'
,
full_name
=
'channel_data2.values'
,
index
=
0
,
number
=
1
,
type
=
2
,
cpp_type
=
6
,
label
=
3
,
has_default_value
=
False
,
default_value
=
[],
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
],
extensions
=
[
],
nested_types
=
[],
enum_types
=
[
],
serialized_options
=
None
,
is_extendable
=
False
,
syntax
=
'proto3'
,
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
96
,
serialized_end
=
127
,
)
_PREPOST
=
_descriptor
.
Descriptor
(
name
=
'prepost'
,
full_name
=
'prepost'
,
filename
=
None
,
file
=
DESCRIPTOR
,
containing_type
=
None
,
fields
=
[
_descriptor
.
FieldDescriptor
(
name
=
'value'
,
full_name
=
'prepost.value'
,
index
=
0
,
number
=
1
,
type
=
5
,
cpp_type
=
1
,
label
=
3
,
has_default_value
=
False
,
default_value
=
[],
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
],
extensions
=
[
],
nested_types
=
[],
enum_types
=
[
],
serialized_options
=
None
,
is_extendable
=
False
,
syntax
=
'proto3'
,
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
129
,
serialized_end
=
153
,
)
_ARGS_DATAENTRY
=
_descriptor
.
Descriptor
(
name
=
'DataEntry'
,
full_name
=
'Args.DataEntry'
,
filename
=
None
,
file
=
DESCRIPTOR
,
containing_type
=
None
,
fields
=
[
_descriptor
.
FieldDescriptor
(
name
=
'key'
,
full_name
=
'Args.DataEntry.key'
,
index
=
0
,
number
=
1
,
type
=
9
,
cpp_type
=
9
,
label
=
1
,
has_default_value
=
False
,
default_value
=
_b
(
""
)
.
decode
(
'utf-8'
),
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
_descriptor
.
FieldDescriptor
(
name
=
'value'
,
full_name
=
'Args.DataEntry.value'
,
index
=
1
,
number
=
2
,
type
=
11
,
cpp_type
=
10
,
label
=
1
,
has_default_value
=
False
,
default_value
=
None
,
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
],
extensions
=
[
],
nested_types
=
[],
enum_types
=
[
],
serialized_options
=
_b
(
'8
\001
'
),
is_extendable
=
False
,
syntax
=
'proto3'
,
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
445
,
serialized_end
=
503
,
)
_ARGS_DATA2ENTRY
=
_descriptor
.
Descriptor
(
name
=
'Data2Entry'
,
full_name
=
'Args.Data2Entry'
,
filename
=
None
,
file
=
DESCRIPTOR
,
containing_type
=
None
,
fields
=
[
_descriptor
.
FieldDescriptor
(
name
=
'key'
,
full_name
=
'Args.Data2Entry.key'
,
index
=
0
,
number
=
1
,
type
=
5
,
cpp_type
=
1
,
label
=
1
,
has_default_value
=
False
,
default_value
=
0
,
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
_descriptor
.
FieldDescriptor
(
name
=
'value'
,
full_name
=
'Args.Data2Entry.value'
,
index
=
1
,
number
=
2
,
type
=
11
,
cpp_type
=
10
,
label
=
1
,
has_default_value
=
False
,
default_value
=
None
,
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
],
extensions
=
[
],
nested_types
=
[],
enum_types
=
[
],
serialized_options
=
_b
(
'8
\001
'
),
is_extendable
=
False
,
syntax
=
'proto3'
,
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
505
,
serialized_end
=
565
,
)
_ARGS_PREPOSTENTRY
=
_descriptor
.
Descriptor
(
name
=
'PrePostEntry'
,
full_name
=
'Args.PrePostEntry'
,
filename
=
None
,
file
=
DESCRIPTOR
,
containing_type
=
None
,
fields
=
[
_descriptor
.
FieldDescriptor
(
name
=
'key'
,
full_name
=
'Args.PrePostEntry.key'
,
index
=
0
,
number
=
1
,
type
=
5
,
cpp_type
=
1
,
label
=
1
,
has_default_value
=
False
,
default_value
=
0
,
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
_descriptor
.
FieldDescriptor
(
name
=
'value'
,
full_name
=
'Args.PrePostEntry.value'
,
index
=
1
,
number
=
2
,
type
=
11
,
cpp_type
=
10
,
label
=
1
,
has_default_value
=
False
,
default_value
=
None
,
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
],
extensions
=
[
],
nested_types
=
[],
enum_types
=
[
],
serialized_options
=
_b
(
'8
\001
'
),
is_extendable
=
False
,
syntax
=
'proto3'
,
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
567
,
serialized_end
=
623
,
)
_ARGS_OFFSETSENTRY
=
_descriptor
.
Descriptor
(
name
=
'OffsetsEntry'
,
full_name
=
'Args.OffsetsEntry'
,
filename
=
None
,
file
=
DESCRIPTOR
,
containing_type
=
None
,
fields
=
[
_descriptor
.
FieldDescriptor
(
name
=
'key'
,
full_name
=
'Args.OffsetsEntry.key'
,
index
=
0
,
number
=
1
,
type
=
5
,
cpp_type
=
1
,
label
=
1
,
has_default_value
=
False
,
default_value
=
0
,
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
_descriptor
.
FieldDescriptor
(
name
=
'value'
,
full_name
=
'Args.OffsetsEntry.value'
,
index
=
1
,
number
=
2
,
type
=
9
,
cpp_type
=
9
,
label
=
1
,
has_default_value
=
False
,
default_value
=
_b
(
""
)
.
decode
(
'utf-8'
),
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
],
extensions
=
[
],
nested_types
=
[],
enum_types
=
[
],
serialized_options
=
_b
(
'8
\001
'
),
is_extendable
=
False
,
syntax
=
'proto3'
,
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
625
,
serialized_end
=
671
,
)
_ARGS
=
_descriptor
.
Descriptor
(
name
=
'Args'
,
full_name
=
'Args'
,
filename
=
None
,
file
=
DESCRIPTOR
,
containing_type
=
None
,
fields
=
[
_descriptor
.
FieldDescriptor
(
name
=
'unique_ADC_name'
,
full_name
=
'Args.unique_ADC_name'
,
index
=
0
,
number
=
11
,
type
=
9
,
cpp_type
=
9
,
label
=
1
,
has_default_value
=
False
,
default_value
=
_b
(
""
)
.
decode
(
'utf-8'
),
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
_descriptor
.
FieldDescriptor
(
name
=
'addr'
,
full_name
=
'Args.addr'
,
index
=
1
,
number
=
10
,
type
=
9
,
cpp_type
=
9
,
label
=
1
,
has_default_value
=
False
,
default_value
=
_b
(
""
)
.
decode
(
'utf-8'
),
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
_descriptor
.
FieldDescriptor
(
name
=
'port'
,
full_name
=
'Args.port'
,
index
=
2
,
number
=
9
,
type
=
5
,
cpp_type
=
1
,
label
=
1
,
has_default_value
=
False
,
default_value
=
0
,
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
_descriptor
.
FieldDescriptor
(
name
=
'number_of_channels'
,
full_name
=
'Args.number_of_channels'
,
index
=
3
,
number
=
8
,
type
=
5
,
cpp_type
=
1
,
label
=
1
,
has_default_value
=
False
,
default_value
=
0
,
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
_descriptor
.
FieldDescriptor
(
name
=
'timestamps'
,
full_name
=
'Args.timestamps'
,
index
=
4
,
number
=
7
,
type
=
3
,
cpp_type
=
2
,
label
=
3
,
has_default_value
=
False
,
default_value
=
[],
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
_descriptor
.
FieldDescriptor
(
name
=
'presamples'
,
full_name
=
'Args.presamples'
,
index
=
5
,
number
=
6
,
type
=
5
,
cpp_type
=
1
,
label
=
1
,
has_default_value
=
False
,
default_value
=
0
,
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
_descriptor
.
FieldDescriptor
(
name
=
'postsamples'
,
full_name
=
'Args.postsamples'
,
index
=
6
,
number
=
5
,
type
=
5
,
cpp_type
=
1
,
label
=
1
,
has_default_value
=
False
,
default_value
=
0
,
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
_descriptor
.
FieldDescriptor
(
name
=
'data'
,
full_name
=
'Args.data'
,
index
=
7
,
number
=
4
,
type
=
11
,
cpp_type
=
10
,
label
=
3
,
has_default_value
=
False
,
default_value
=
[],
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
_descriptor
.
FieldDescriptor
(
name
=
'data2'
,
full_name
=
'Args.data2'
,
index
=
8
,
number
=
3
,
type
=
11
,
cpp_type
=
10
,
label
=
3
,
has_default_value
=
False
,
default_value
=
[],
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
_descriptor
.
FieldDescriptor
(
name
=
'pre_post'
,
full_name
=
'Args.pre_post'
,
index
=
9
,
number
=
2
,
type
=
11
,
cpp_type
=
10
,
label
=
3
,
has_default_value
=
False
,
default_value
=
[],
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
_descriptor
.
FieldDescriptor
(
name
=
'offsets'
,
full_name
=
'Args.offsets'
,
index
=
10
,
number
=
1
,
type
=
11
,
cpp_type
=
10
,
label
=
3
,
has_default_value
=
False
,
default_value
=
[],
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
serialized_options
=
None
,
file
=
DESCRIPTOR
),
],
extensions
=
[
],
nested_types
=
[
_ARGS_DATAENTRY
,
_ARGS_DATA2ENTRY
,
_ARGS_PREPOSTENTRY
,
_ARGS_OFFSETSENTRY
,
],
enum_types
=
[
],
serialized_options
=
None
,
is_extendable
=
False
,
syntax
=
'proto3'
,
extension_ranges
=
[],
oneofs
=
[
],
serialized_start
=
156
,
serialized_end
=
671
,
)
_RPC
.
fields_by_name
[
'args'
]
.
message_type
=
_ARGS
_ARGS_DATAENTRY
.
fields_by_name
[
'value'
]
.
message_type
=
_CHANNEL_DATA
_ARGS_DATAENTRY
.
containing_type
=
_ARGS
_ARGS_DATA2ENTRY
.
fields_by_name
[
'value'
]
.
message_type
=
_CHANNEL_DATA2
_ARGS_DATA2ENTRY
.
containing_type
=
_ARGS
_ARGS_PREPOSTENTRY
.
fields_by_name
[
'value'
]
.
message_type
=
_PREPOST
_ARGS_PREPOSTENTRY
.
containing_type
=
_ARGS
_ARGS_OFFSETSENTRY
.
containing_type
=
_ARGS
_ARGS
.
fields_by_name
[
'data'
]
.
message_type
=
_ARGS_DATAENTRY
_ARGS
.
fields_by_name
[
'data2'
]
.
message_type
=
_ARGS_DATA2ENTRY
_ARGS
.
fields_by_name
[
'pre_post'
]
.
message_type
=
_ARGS_PREPOSTENTRY
_ARGS
.
fields_by_name
[
'offsets'
]
.
message_type
=
_ARGS_OFFSETSENTRY
DESCRIPTOR
.
message_types_by_name
[
'RPC'
]
=
_RPC
DESCRIPTOR
.
message_types_by_name
[
'channel_data'
]
=
_CHANNEL_DATA
DESCRIPTOR
.
message_types_by_name
[
'channel_data2'
]
=
_CHANNEL_DATA2
DESCRIPTOR
.
message_types_by_name
[
'prepost'
]
=
_PREPOST
DESCRIPTOR
.
message_types_by_name
[
'Args'
]
=
_ARGS
_sym_db
.
RegisterFileDescriptor
(
DESCRIPTOR
)
RPC
=
_reflection
.
GeneratedProtocolMessageType
(
'RPC'
,
(
_message
.
Message
,),
{
'DESCRIPTOR'
:
_RPC
,
'__module__'
:
'rpc_pb2'
# @@protoc_insertion_point(class_scope:RPC)
})
_sym_db
.
RegisterMessage
(
RPC
)
channel_data
=
_reflection
.
GeneratedProtocolMessageType
(
'channel_data'
,
(
_message
.
Message
,),
{
'DESCRIPTOR'
:
_CHANNEL_DATA
,
'__module__'
:
'rpc_pb2'
# @@protoc_insertion_point(class_scope:channel_data)
})
_sym_db
.
RegisterMessage
(
channel_data
)
channel_data2
=
_reflection
.
GeneratedProtocolMessageType
(
'channel_data2'
,
(
_message
.
Message
,),
{
'DESCRIPTOR'
:
_CHANNEL_DATA2
,
'__module__'
:
'rpc_pb2'
# @@protoc_insertion_point(class_scope:channel_data2)
})
_sym_db
.
RegisterMessage
(
channel_data2
)
prepost
=
_reflection
.
GeneratedProtocolMessageType
(
'prepost'
,
(
_message
.
Message
,),
{
'DESCRIPTOR'
:
_PREPOST
,
'__module__'
:
'rpc_pb2'
# @@protoc_insertion_point(class_scope:prepost)
})
_sym_db
.
RegisterMessage
(
prepost
)
Args
=
_reflection
.
GeneratedProtocolMessageType
(
'Args'
,
(
_message
.
Message
,),
{
'DataEntry'
:
_reflection
.
GeneratedProtocolMessageType
(
'DataEntry'
,
(
_message
.
Message
,),
{
'DESCRIPTOR'
:
_ARGS_DATAENTRY
,
'__module__'
:
'rpc_pb2'
# @@protoc_insertion_point(class_scope:Args.DataEntry)
})
,
'Data2Entry'
:
_reflection
.
GeneratedProtocolMessageType
(
'Data2Entry'
,
(
_message
.
Message
,),
{
'DESCRIPTOR'
:
_ARGS_DATA2ENTRY
,
'__module__'
:
'rpc_pb2'
# @@protoc_insertion_point(class_scope:Args.Data2Entry)
})
,
'PrePostEntry'
:
_reflection
.
GeneratedProtocolMessageType
(
'PrePostEntry'
,
(
_message
.
Message
,),
{
'DESCRIPTOR'
:
_ARGS_PREPOSTENTRY
,
'__module__'
:
'rpc_pb2'
# @@protoc_insertion_point(class_scope:Args.PrePostEntry)
})
,
'OffsetsEntry'
:
_reflection
.
GeneratedProtocolMessageType
(
'OffsetsEntry'
,
(
_message
.
Message
,),
{
'DESCRIPTOR'
:
_ARGS_OFFSETSENTRY
,
'__module__'
:
'rpc_pb2'
# @@protoc_insertion_point(class_scope:Args.OffsetsEntry)
})
,
'DESCRIPTOR'
:
_ARGS
,
'__module__'
:
'rpc_pb2'
# @@protoc_insertion_point(class_scope:Args)
})
_sym_db
.
RegisterMessage
(
Args
)
_sym_db
.
RegisterMessage
(
Args
.
DataEntry
)
_sym_db
.
RegisterMessage
(
Args
.
Data2Entry
)
_sym_db
.
RegisterMessage
(
Args
.
PrePostEntry
)
_sym_db
.
RegisterMessage
(
Args
.
OffsetsEntry
)
_ARGS_DATAENTRY
.
_options
=
None
_ARGS_DATA2ENTRY
.
_options
=
None
_ARGS_PREPOSTENTRY
.
_options
=
None
_ARGS_OFFSETSENTRY
.
_options
=
None
# @@protoc_insertion_point(module_scope)
software/general/serialization.py
View file @
b49888a6
import
json
from
general.rpc_pb2
import
RPC
def
serialize
(
data
):
data
=
json
.
dumps
(
data
)
return
data
.
encode
(
'utf-8'
)
rpc
=
RPC
()
rpc
.
function_name
=
data
[
'function_name'
]
if
data
[
'function_name'
]
==
'update_data'
:
if
(
len
(
data
[
'args'
])
==
4
):
rpc
.
args
.
timestamps
.
extend
(
data
[
'args'
][
0
])
rpc
.
args
.
presamples
=
(
data
[
'args'
][
1
][
'presamples'
])
rpc
.
args
.
postsamples
=
(
data
[
'args'
][
1
][
'postsamples'
])
for
channel_idx
,
channel_data
in
data
[
'args'
][
2
]
.
items
():
rpc
.
args
.
data
[
channel_idx
]
.
values
.
extend
(
channel_data
)
rpc
.
args
.
unique_ADC_name
=
data
[
'args'
][
3
]
else
:
for
channel_idx
,
channel_data
in
data
[
'args'
][
0
]
.
items
():
rpc
.
args
.
data2
[
channel_idx
]
.
values
.
extend
(
channel_data
)
for
idx
,
prepost
in
data
[
'args'
][
1
]
.
items
():
rpc
.
args
.
pre_post
[
idx
]
.
value
.
extend
(
prepost
)
for
idx
,
offsets
in
data
[
'args'
][
2
]
.
items
():
rpc
.
args
.
offsets
[
idx
]
=
offsets
elif
data
[
'function_name'
]
==
'register_ADC'
:
if
(
len
(
data
[
'args'
])
==
3
):
rpc
.
args
.
unique_ADC_name
=
data
[
'args'
][
0
]
rpc
.
args
.
addr
=
data
[
'args'
][
1
]
rpc
.
args
.
port
=
data
[
'args'
][
2
]
else
:
rpc
.
args
.
unique_ADC_name
=
data
[
'args'
][
0
]
rpc
.
args
.
number_of_channels
=
data
[
'args'
][
1
]
elif
data
[
'function_name'
]
==
'unregister_ADC'
:
rpc
.
args
.
unique_ADC_name
=
data
[
'args'
][
0
]
data
=
rpc
.
SerializeToString
()
return
data
def
deserialize
(
data
):
data
=
data
.
decode
(
'utf-8'
)
return
json
.
loads
(
data
)
rpc
=
RPC
()
rpc
.
ParseFromString
(
data
)
args
=
rpc
.
args
function_name
=
rpc
.
function_name
if
function_name
==
'update_data'
:
if
args
.
unique_ADC_name
:
timestamps
=
args
.
timestamps
pre_post
=
{
'presamples'
:
args
.
presamples
,
'postsamples'
:
args
.
postsamples
}
data_arg
=
{}
for
key
in
args
.
data
:
data_arg
[
key
]
=
args
.
data
[
key
]
.
values
unique_ADC_name
=
args
.
unique_ADC_name
args_dict
=
[
timestamps
,
pre_post
,
data_arg
,
unique_ADC_name
]
else
:
data_arg
=
{}
pre_post_samples
=
{}
offsets
=
{}
for
key
in
args
.
data2
:
data_arg
[
key
]
=
args
.
data2
[
key
]
.
values
for
key
in
args
.
pre_post
:
pre_post_samples
[
key
]
=
args
.
pre_post
[
key
]
.
value
for
key
in
args
.
offsets
:
offsets
[
key
]
=
args
.
offsets
[
key
]
args_dict
=
[
data_arg
,
pre_post_samples
,
offsets
]
elif
function_name
==
'register_ADC'
:
if
args
.
addr
:
args_dict
=
[
args
.
unique_ADC_name
,
args
.
addr
,
args
.
port
]
else
:
args_dict
=
[
args
.
unique_ADC_name
,
args
.
number_of_channels
]
elif
function_name
==
'unregister_ADC'
:
args_dict
=
[
args
.
unique_ADC_name
]
message
=
{
'function_name'
:
function_name
,
'args'
:
args_dict
}
return
message
software/pyqt_app/GUI.py
View file @
b49888a6
...
...
@@ -96,7 +96,8 @@ class GUI_Class:
print
(
'offsets: '
+
str
(
offsets
))
axis
=
np
.
array
(
range
(
-
presamples
,
postsamples
))
/
SAMP_FREQ
"""to be removed with xmlrpc"""
self
.
plot
.
curves
[
int
(
channel_idx
)]
.
setData
(
axis
,
channel_data
)
self
.
plot
.
curves
[
int
(
channel_idx
)]
.
setData
(
axis
,
np
.
array
(
channel_data
))
def
set_channel_params
(
self
,
channel_params
):
for
GUI_channel_idx
,
channel_params
in
channel_params
.
items
():
...
...
software/tests/server_expose_test.py
View file @
b49888a6
...
...
@@ -30,8 +30,8 @@ class ServerExposeTest():
def
update_data
(
self
,
*
args
,
**
kwargs
):
if
plot_data
:
data
=
args
[
0
]
chan0
=
data
[
'0'
]
chan1
=
data
[
'1'
]
chan0
=
data
[
0
]
chan1
=
data
[
1
]
plt
.
plot
(
chan0
,
linewidth
=
0.5
)
plt
.
plot
(
chan1
,
linewidth
=
0.5
)
plt
.
show
()
...
...
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