Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HEV - High Energy Ventilator
Manage
Activity
Members
Labels
Plan
Issues
5
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
HEV - High Energy Ventilator
Commits
f8a0e21d
Commit
f8a0e21d
authored
4 years ago
by
adam-abed-abud
Browse files
Options
Downloads
Patches
Plain Diff
Fix for charts xaxis diff time
parent
b17c83ba
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
raspberry-backend/static/js/Chart-display.js
+4
-4
4 additions, 4 deletions
raspberry-backend/static/js/Chart-display.js
with
4 additions
and
4 deletions
raspberry-backend/static/js/Chart-display.js
+
4
−
4
View file @
f8a0e21d
...
...
@@ -51,7 +51,6 @@ function init_results(){
initial_yaxis_volume
[
i
][
0
]
=
initial_yaxis_volume
[
i
][
0
]
-
current_timestamp
;
initial_yaxis_flow
[
i
][
0
]
=
initial_yaxis_flow
[
i
][
0
]
-
current_timestamp
;
}
},
cache
:
false
});
...
...
@@ -99,14 +98,15 @@ function requestChartVar() {
//console.log(fio_reading);
fio_gauge
.
data
.
datasets
[
0
].
gaugeData
[
'
value
'
]
=
fio_reading
;
var
seconds
=
point
[
"
timestamp
"
]
/
1000
;
var
seconds
=
point
[
"
timestamp
"
]
/
1000
;
// get difference between last time stamp and this and apply to existing points
var
diff
=
0
;
if
(
current_timestamp
==
-
1
){
diff
=
seconds
;
}
else
{
diff
=
seconds
-
current_timestamp
;
//diff = seconds - current_timestamp; //FUTURE: restore this line in case not using simulated data
diff
=
0.2
;
}
current_timestamp
=
seconds
;
...
...
@@ -125,7 +125,7 @@ function requestChartVar() {
initial_yaxis_pressure
[
i
][
'
x
'
]
=
initial_yaxis_pressure
[
i
][
'
x
'
]
-
diff
;
initial_yaxis_volume
[
i
][
'
x
'
]
=
initial_yaxis_volume
[
i
][
'
x
'
]
-
diff
;
initial_yaxis_flow
[
i
][
'
x
'
]
=
initial_yaxis_flow
[
i
][
'
x
'
]
-
diff
;
}
}
chart_pressure
.
data
.
datasets
[
0
].
data
.
push
({
x
:
0
,
y
:
point
[
"
pressure_buffer
"
]});
chart_flow
.
data
.
datasets
[
0
].
data
.
push
({
x
:
0
,
y
:
point
[
"
temperature_buffer
"
]});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment