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
7deb0b50
Commit
7deb0b50
authored
Aug 14, 2019
by
Milosz Malczak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: made respective methods private
parent
90b0598f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
user_app.py
software/DistributedOscilloscope/server/user_app.py
+8
-8
No files found.
software/DistributedOscilloscope/server/user_app.py
View file @
7deb0b50
...
...
@@ -179,21 +179,21 @@ class UserApplication():
def
__all_data_aligned
(
self
,
max_timestamp
):
for
channel_idx
,
channel
in
self
.
__channels
.
items
():
timestamp
=
channel
.
timestamp_pre_post_data
[
0
][
'timestamp'
]
if
(
not
self
.
check_if_equal
(
max_timestamp
,
timestamp
,
1
)):
if
(
not
self
.
__
check_if_equal
(
max_timestamp
,
timestamp
,
1
)):
return
False
return
True
def
__remove_old_data
(
self
,
max_timestamp
):
for
channel_idx
,
channel
in
self
.
__channels
.
items
():
timestamp
=
channel
.
timestamp_pre_post_data
[
0
][
'timestamp'
]
if
(
not
self
.
check_if_equal
(
max_timestamp
,
timestamp
,
1
)):
if
(
not
self
.
__
check_if_equal
(
max_timestamp
,
timestamp
,
1
)):
channel
.
timestamp_pre_post_data
.
pop
(
0
)
def
__find_max
(
self
):
max_timestamp
=
[
0
,
0
]
for
channel_idx
,
channel
in
self
.
__channels
.
items
():
timestamp
=
channel
.
timestamp_pre_post_data
[
0
][
'timestamp'
]
if
self
.
check_if_greater
(
timestamp
,
max_timestamp
):
if
self
.
__
check_if_greater
(
timestamp
,
max_timestamp
):
max_timestamp
=
timestamp
return
max_timestamp
...
...
@@ -229,7 +229,7 @@ class UserApplication():
data
[
channel_idx
]
=
timestamp_pre_post_data
[
'data_channel'
]
timestamps
.
append
(
timestamp_pre_post_data
[
'timestamp'
])
tic_diff
=
self
.
tic_difference
(
timestamp_pre_post_data
[
'timestamp'
],
tic_diff
=
self
.
__
tic_difference
(
timestamp_pre_post_data
[
'timestamp'
],
timestamps
[
0
])
offsets
[
channel_idx
]
=
int
(
tic_diff
)
pre_post
=
timestamp_pre_post_data
[
'pre_post'
]
...
...
@@ -305,7 +305,7 @@ class UserApplication():
'horizontal_settings'
:
self
.
get_horiz_settings_copy
()}
return
user_app_settings
def
tic_difference
(
self
,
timestamp_1
,
timestamp_2
):
def
__
tic_difference
(
self
,
timestamp_1
,
timestamp_2
):
[
sec_1
,
tic_1
]
=
timestamp_1
[
sec_2
,
tic_2
]
=
timestamp_2
...
...
@@ -315,14 +315,14 @@ class UserApplication():
return
tic_diff
def
check_if_equal
(
self
,
timestamp_1
,
timestamp_2
,
available_offset_tics
):
tic_diff
=
self
.
tic_difference
(
timestamp_1
,
timestamp_2
)
def
__
check_if_equal
(
self
,
timestamp_1
,
timestamp_2
,
available_offset_tics
):
tic_diff
=
self
.
__
tic_difference
(
timestamp_1
,
timestamp_2
)
if
(
tic_diff
<=
available_offset_tics
and
tic_diff
>=
-
available_offset_tics
):
return
True
return
False
def
check_if_greater
(
self
,
timestamp_1
,
timestamp_2
):
def
__
check_if_greater
(
self
,
timestamp_1
,
timestamp_2
):
[
sec_1
,
tic_1
]
=
timestamp_1
[
sec_2
,
tic_2
]
=
timestamp_2
...
...
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