fix updating time-panel; balance boundaries for random position of particles;

This commit is contained in:
Christopher Ronnewinkel (D036654) committed 2014-04-03 20:48:47 +02:00
1 parent 68bca57f60
commit b2218270e0
2 files changed
+8 -3

No files matched your search

@@ -209,6 +209,7 @@ public class SimulatorMap extends AbsolutePanel implements RequiresDataInitializ
if (timePanel != null) {
timePanel.setMinMax(new Date(startTime), new Date(startTime + maxDurationTime), true);
timePanel.resetTimeSlider();
timePanel.timeChanged(windParams.getStartTime(), null);
}
/**
@@ -636,7 +637,7 @@ public class SimulatorMap extends AbsolutePanel implements RequiresDataInitializ
}
timePanel.setMinMax(windParams.getStartTime(), windParams.getEndTime(), true);
timePanel.resetTimeSlider();
//timer.setTime(windParams.getStartTime().getTime());
timePanel.timeChanged(windParams.getStartTime(), null);
busyIndicator.setBusy(false);
}
@@ -147,6 +147,10 @@ var VectorField = function(data) {
this.rcEnd = data.rcEnd;
this.resY = data.resY;
this.resX = data.resX;
this.bdXi = 1.0 / 2.0 / (this.resY - 1);
this.bdPhi = 1.0 + 2*this.bdXi;
this.bdA = { lat:this.rcEnd.lat+(this.rcEnd.lat-this.rcStart.lat)*this.bdXi, lng:this.rcEnd.lng+(this.rcEnd.lng-this.rcStart.lng)*this.bdXi };
this.bdB = { lat:(this.rcStart.lat-this.rcEnd.lat)*this.bdPhi, lng:(this.rcStart.lng-this.rcEnd.lng)*this.bdPhi };
this.xScale = data.xScale;
this.x0 = data.boundsSW.lng;
this.x1 = data.boundsNE.lng;
@@ -177,8 +181,8 @@ var VectorField = function(data) {
VectorField.prototype.getRandomPosition = function() {
var rndY = Math.random();
var rndX = Math.random() - 0.5;
var latP = rndY * this.rcStart.lat + (1.0 - rndY) * this.rcEnd.lat + rndX * this.gvX.lat;
var lngP = rndY * this.rcStart.lng + (1.0 - rndY) * this.rcEnd.lng + rndX * this.gvX.lng;
var latP = this.bdA.lat + rndY * this.bdB.lat + rndX * this.gvX.lat;
var lngP = this.bdA.lng + rndY * this.bdB.lng + rndX * this.gvX.lng;
return {lat:latP, lng:lngP};
};