Fixed the refresh time of map and networkmap

This commit is contained in:
mdtrooper 2016-04-26 12:23:09 +02:00
parent 1bc205f1f6
commit 67a65d84b1
3 changed files with 9 additions and 5 deletions

View File

@ -30,6 +30,7 @@ abstract class Map {
protected $subtype = null; protected $subtype = null;
protected $id_group = null; protected $id_group = null;
protected $generation_method = null; protected $generation_method = null;
protected $source_period = MAP_REFRESH_TIME;
protected $width = null; protected $width = null;
protected $height = null; protected $height = null;
@ -82,6 +83,8 @@ abstract class Map {
$this->width = (int)$dbValues['width']; $this->width = (int)$dbValues['width'];
$this->height = (int)$dbValues['height']; $this->height = (int)$dbValues['height'];
$this->source_period = (int)$dbValues['source_period'];
} }
private function loadDB() { private function loadDB() {

View File

@ -22,8 +22,9 @@ var CONTROL_KEY = 17;
/*-----------------------------------------------*/ /*-----------------------------------------------*/
/*------------------Constructor------------------*/ /*------------------Constructor------------------*/
/*-----------------------------------------------*/ /*-----------------------------------------------*/
var MapController = function(target) { var MapController = function(target, refresh_time) {
this._target = target; this._target = target;
this._refresh_time = refresh_time * 1000; // 1000 for the javascript
this._id = $(target).data('id'); this._id = $(target).data('id');
} }
@ -2012,7 +2013,7 @@ MapController.prototype.events = function() {
} }
}); });
setTimeout(function() { self.refresh_map();}, MAP_REFRESH_TIME); setTimeout(function() { self.refresh_map();}, self._refresh_time);
} }
/** /**
@ -2026,7 +2027,7 @@ MapController.prototype.refresh_map = function() {
self.refresh_nodes(); self.refresh_nodes();
self.refresh_arrows(); self.refresh_arrows();
setTimeout(function() { self.refresh_map();}, MAP_REFRESH_TIME); setTimeout(function() { self.refresh_map();}, self._refresh_time);
} }
/** /**

View File

@ -15,8 +15,8 @@
/*-----------------------------------------------*/ /*-----------------------------------------------*/
/*------------------Constructor------------------*/ /*------------------Constructor------------------*/
/*-----------------------------------------------*/ /*-----------------------------------------------*/
var NetworkmapController = function(target) { var NetworkmapController = function(target, refresh_time) {
MapController.call(this, target); MapController.call(this, target, refresh_time);
} }
/*-----------------------------------------------*/ /*-----------------------------------------------*/