Minor tweaks for JSObserver
This commit is contained in:
@@ -114,6 +114,7 @@ overviewer.views.ProgressView = Backbone.View.extend({
|
|||||||
this.el.innerHTML = 'Current Render Progress';
|
this.el.innerHTML = 'Current Render Progress';
|
||||||
overviewer.map.controls[google.maps.ControlPosition.BOTTOM_RIGHT].push(this.el);
|
overviewer.map.controls[google.maps.ControlPosition.BOTTOM_RIGHT].push(this.el);
|
||||||
this.hidden = true;
|
this.hidden = true;
|
||||||
|
$.ajaxSetup({cache: false});
|
||||||
},
|
},
|
||||||
updateProgress: function() {
|
updateProgress: function() {
|
||||||
e = this;
|
e = this;
|
||||||
|
|||||||
@@ -181,10 +181,6 @@ class JSObserver(Observer):
|
|||||||
self.minrefresh = 1000*minrefresh
|
self.minrefresh = 1000*minrefresh
|
||||||
self.logfile = os.path.join(outputdir, "progress.js")
|
self.logfile = os.path.join(outputdir, "progress.js")
|
||||||
|
|
||||||
f = open(self.logfile, "w", 0)
|
|
||||||
f.write('{"message": "Render in progress", "update": %d}' % self.minrefresh)
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
def start(self, max_value):
|
def start(self, max_value):
|
||||||
f = open(self.logfile, "w", 0)
|
f = open(self.logfile, "w", 0)
|
||||||
f.write('{"message": "Rendering %d tiles", "update": %s}' % (max_value, self.minrefresh))
|
f.write('{"message": "Rendering %d tiles", "update": %s}' % (max_value, self.minrefresh))
|
||||||
@@ -251,8 +247,6 @@ class JSObserver(Observer):
|
|||||||
|
|
||||||
def _need_update(self):
|
def _need_update(self):
|
||||||
cur_val = self.get_current_value()
|
cur_val = self.get_current_value()
|
||||||
if (time.time() - self.last_update_time) <= self.minrefresh//1000:
|
|
||||||
return False
|
|
||||||
if cur_val < 100:
|
if cur_val < 100:
|
||||||
return cur_val - self.last_update > 10
|
return cur_val - self.last_update > 10
|
||||||
elif cur_val < 500:
|
elif cur_val < 500:
|
||||||
|
|||||||
Reference in New Issue
Block a user