mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-09 13:50:57 +00:00
separate simulation colors and macro weather colors; default border size 0 for old wind visualizations;
This commit is contained in:
1 parent
9944448478
commit
4648c87916
2 files changed
+28
-8
No files matched your search
+4
-1
@@ -24,7 +24,7 @@ public class SimulatorEntryPoint extends AbstractEntryPoint {
|
||||
private final SimulatorServiceAsync simulatorService = GWT.create(SimulatorService.class);
|
||||
private int xRes = 40;
|
||||
private int yRes = 20;
|
||||
private int border = 10;
|
||||
private int border = 0;
|
||||
private boolean autoUpdate = false;
|
||||
private char mode = SailingSimulatorConstants.ModeEvent; // default mode: 'e'vent
|
||||
private char event = SailingSimulatorConstants.EventKielerWoche; // default event: 'k'ieler woche
|
||||
@@ -132,6 +132,9 @@ public class SimulatorEntryPoint extends AbstractEntryPoint {
|
||||
showStreamlets2 = true;
|
||||
injectWindDataJS = true;
|
||||
}
|
||||
if ((showStreamlets2)&&(this.border==0)) {
|
||||
this.border = 10;
|
||||
}
|
||||
if (windDisplayStr.contains("b")) {
|
||||
seedLines = 'b';
|
||||
}
|
||||
|
||||
@@ -336,6 +336,17 @@ VectorField.prototype.particleWeight = function(p,v) {
|
||||
return v.length() / this.maxLength + 0.1;
|
||||
}
|
||||
|
||||
VectorField.prototype.getColors = function() {
|
||||
var colors = [];
|
||||
var alpha = 0.7;
|
||||
var greyValue = 255;
|
||||
for (var i = 0; i < 256; i++) {
|
||||
colors[i] = 'rgba(' + (greyValue) + ',' + (greyValue) + ',' + (greyValue) + ',' + (alpha*i/255.0) + ')';
|
||||
//this.colors[i] = 'hsla(' + 360*(0.55+0.9*(0.5-i/255)) + ',' + (100) + '% ,' + (50) + '%,' + (i/255) + ')';
|
||||
}
|
||||
return colors;
|
||||
}
|
||||
|
||||
VectorField.prototype.lineWidth = function(s) {
|
||||
return 1.0;
|
||||
}
|
||||
@@ -449,6 +460,17 @@ RectField.prototype.particleWeight = function(p,v) {
|
||||
return 1.0 - v.length() / this.maxLength;
|
||||
}
|
||||
|
||||
RectField.prototype.getColors = function() {
|
||||
var colors = [];
|
||||
var alpha = 1.0;
|
||||
var greyValue = 255;
|
||||
for (var i = 0; i < 256; i++) {
|
||||
colors[i] = 'rgba(' + (greyValue) + ',' + (greyValue) + ',' + (greyValue) + ',' + (alpha*i/255.0) + ')';
|
||||
//this.colors[i] = 'hsla(' + 360*(0.55+0.9*(0.5-i/255)) + ',' + (100) + '% ,' + (50) + '%,' + (i/255) + ')';
|
||||
}
|
||||
return colors;
|
||||
}
|
||||
|
||||
RectField.prototype.lineWidth = function(s) {
|
||||
return 1.0;
|
||||
}
|
||||
@@ -546,15 +568,10 @@ var Swarm = function(canvas, field, opt_projection) {
|
||||
this.updateBounds(null);
|
||||
|
||||
this.makeNewParticles(null, true);
|
||||
this.colors = [];
|
||||
this.rgb = '40, 40, 40';
|
||||
this.background = 'rgb(' + this.rgb + ')';
|
||||
var greyValue = 255;
|
||||
for (var i = 0; i < 256; i++) {
|
||||
this.colors[i] = 'rgba(' + (greyValue) + ',' + (greyValue) + ',' + (greyValue) + ',' + (0.7*i/255.0) + ')';
|
||||
//this.colors[i] = 'rgba(' + (255) + ',' + (255) + ',' + (255) + ',' + 1.0 + ')';
|
||||
//this.colors[i] = 'hsla(' + 360*(0.55+0.9*(0.5-i/255)) + ',' + (100) + '% ,' + (50) + '%,' + (i/255) + ')';
|
||||
}
|
||||
this.colors = this.field.getColors();
|
||||
|
||||
if (this.projection) {
|
||||
this.startOffsetX = this.projection.offsetX;
|
||||
this.startOffsetY = this.projection.offsetY;
|
||||
|
||||
Reference in new issue
Block a user