Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
wattsworth
/
lumen-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7ac5389a
authored
Apr 27, 2017
by
John Doe
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
bug fix for computing decimation intervals
parent
90950d07
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
app/services/data/load_stream_data.rb
app/services/data/load_stream_data.rb
View file @
7ac5389a
...
...
@@ -202,14 +202,18 @@ class LoadStreamData
# eg: events, compute intervals from the actual decimated data
def
__build_intervals_from_decimated_data
(
elements
,
resp
)
#compute intervals from resp
start_time
=
resp
.
first
[
0
]
end_time
=
resp
.
last
[
0
]
interval_start
=
start_time
interval_end
=
start_time
if
(
resp
.
empty?
)
return
{
id:
e
.
id
,
type:
'interval'
,
values:
[]}
end
intervals
=
[]
interval_start
=
nil
interval_end
=
nil
resp
.
each
do
|
row
|
if
row
.
nil?
if
!
interval_start
.
nil?
&&
!
interval_end
.
nil?
#interval break and we know the start and end times
intervals
+=
[[
interval_start
,
0
],
[
interval_end
,
0
],
nil
]
end
interval_start
=
nil
next
end
...
...
@@ -220,8 +224,8 @@ class LoadStreamData
interval_end
=
row
[
0
]
end
if
interval_start
!=
nil
intervals
+=
[[
interval_start
,
0
],
[
end_time
,
0
]]
if
!
interval_start
.
nil?
&&
!
interval_end
.
nil?
intervals
+=
[[
interval_start
,
0
],
[
interval_end
,
0
]]
end
elements
.
map
do
|
e
|
{
id:
e
.
id
,
...
...
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