mirror of
https://github.com/nasa/openmct.git
synced 2025-01-01 19:06:40 +00:00
[Mobile] Gestures
Redraw rate adjusted to redraw on mobile every 15ms instead of 1000ms (like on desktop). Also added agentservice to PlotController and MCTChart (bundles and file.
This commit is contained in:
parent
db1b76413c
commit
c394151c46
@ -35,7 +35,7 @@
|
|||||||
{
|
{
|
||||||
"key": "mctChart",
|
"key": "mctChart",
|
||||||
"implementation": "directives/MCTChart.js",
|
"implementation": "directives/MCTChart.js",
|
||||||
"depends": [ "$interval", "$log" ]
|
"depends": [ "$interval", "$log", "agentService" ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "mctPlot",
|
"key": "mctPlot",
|
||||||
@ -58,7 +58,7 @@
|
|||||||
{
|
{
|
||||||
"key": "PlotController",
|
"key": "PlotController",
|
||||||
"implementation": "controllers/PlotController.js",
|
"implementation": "controllers/PlotController.js",
|
||||||
"depends": [ "$scope", "colorService"]
|
"depends": [ "$scope", "colorService", "agentService"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "StackedPlotController",
|
"key": "StackedPlotController",
|
||||||
|
@ -9,7 +9,7 @@ define(
|
|||||||
// domainObject metadata.
|
// domainObject metadata.
|
||||||
var DOMAIN_INTERVAL = 2 * 60 * 1000; // Two minutes.
|
var DOMAIN_INTERVAL = 2 * 60 * 1000; // Two minutes.
|
||||||
|
|
||||||
function PlotController($scope, colorService) {
|
function PlotController($scope, colorService, agentService) {
|
||||||
var plotHistory = [],
|
var plotHistory = [],
|
||||||
isLive = true,
|
isLive = true,
|
||||||
maxDomain = +new Date(),
|
maxDomain = +new Date(),
|
||||||
|
@ -35,7 +35,7 @@ define(
|
|||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function MCTChart($interval) {
|
function MCTChart($interval, $log, agentService) {
|
||||||
|
|
||||||
function linkChart($scope, $element) {
|
function linkChart($scope, $element) {
|
||||||
var canvas = $element.find("canvas")[0],
|
var canvas = $element.find("canvas")[0],
|
||||||
@ -199,8 +199,13 @@ define(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for resize, on a timer
|
// Check for resize, on a timer, the timer is 15
|
||||||
activeInterval = $interval(drawIfResized, 1000);
|
// on mobile (to allow quick refresh of drawing).
|
||||||
|
if(agentService.isMobile(navigator.userAgent)) {
|
||||||
|
activeInterval = $interval(drawIfResized, 15, false);
|
||||||
|
} else {
|
||||||
|
activeInterval = $interval(drawIfResized, 1000, false);
|
||||||
|
}
|
||||||
|
|
||||||
$scope.$on('series:data:add', onSeriesDataAdd);
|
$scope.$on('series:data:add', onSeriesDataAdd);
|
||||||
redraw();
|
redraw();
|
||||||
|
Loading…
Reference in New Issue
Block a user