Compare commits

..

No commits in common. '6e39ba2bf9ffeede13df46a3a927062a901c3aa0' and '4e281de747620dd251bf256020428d710283a971' have entirely different histories.

@ -66,11 +66,11 @@ function follow(e) {
<div id="popup"> <div id="popup">
<div id="close" onclick="hide();"></div> <div id="close" onclick="hide();"></div>
<div id="text"> <div id="text">
<center><img src="assets/logooscuro.png" style="width: 25vh;" /></center> <center><img src="assets/logooscuro.png" style="width: 30vh;" /></center>
<h3>Simulador de Aerogeneradores y Parques Eólicos (SAPE)</h3> <h3>Simulador de Aerogeneradores y Parques Eólicos (SAPE)</h3>
<h4>Centro de Simulación Computacional para Aplicaciones Tecnológicas (CSC) - CONICET</h4> <h4>Centro de Simulación Computacional para Aplicaciones Tecnológicas (CSC) - CONICET</h4>
<p>¡Bienvenido al SAPE! Acá vas a poder experimentar de forma simplificada el diseño de un parque eólico.</p> <p>¡Bienvenido al SAPE! Acá vas a poder experimentar de forma simplificada el diseño de un parque eólico.</p>
<p><b>¿Cómo se juega con el simulador?</b></p> <p>¿Cómo se juega con el simulador?</p>
<ul> <ul>
<li>Clickeá sobre los aerogeneradores para ubicarlos donde creas que van a funcionar mejor.</li> <li>Clickeá sobre los aerogeneradores para ubicarlos donde creas que van a funcionar mejor.</li>
<li>Intentá que todos los aerogeneradores reciban un viento con energía evitando posicionarlos atrás de otros aerogeneradores.</li> <li>Intentá que todos los aerogeneradores reciban un viento con energía evitando posicionarlos atrás de otros aerogeneradores.</li>
@ -97,8 +97,7 @@ function follow(e) {
</div> </div>
<div id="copyright">&copy;2024 Centro de Simulación Computacional para Aplicaciones Tecnológicas (CSC) - CONICET</div> <div id="copyright">&copy;2024 Centro de Simulación Computacional para Aplicaciones Tecnológicas (CSC) - CONICET</div>
<div id="rotate"><img src="assets/rotar_telefono.png" /><p>Rotá tu<br />dispositivo</p></div> <div id="rotate"><img src="assets/rotar_telefono.png" /><p>Rotá tu<br />dispositivo</p></div>
<div id="logo"><a href="http://www.csc.gob.ar" target="_blank"><img src="assets/logooscuro.png" /></a></div> <div id="logo"><a href="http://www.csc.gob.ar"><img src="assets/logooscuro.png" /></a></div>
</div> </div>
<div id="numbers"></div>
</body> </body>
</html> </html>

@ -138,8 +138,7 @@ class WindSimulation {
if(this.simulation) { if(this.simulation) {
var i = this.wms.indexOf(wm); var i = this.wms.indexOf(wm);
var follower = document.getElementById("follower"); var follower = document.getElementById("follower");
var perc = Math.round(this.simulationPot[i] * 100 / 14.95); follower.innerHTML = "Aerogenerador Nº" + (i + 1) + "<br />" + (Math.round(this.simulationPot[i] * 100) / 100) + " GWh (" + Math.round(this.simulationPot[i] * 100 / 14.95) + "%)";
follower.innerHTML = "<h3>Aerogenerador Nº" + (i + 1) + "</h4>" + (Math.round(this.simulationPot[i] * 100) / 100) + ' GWh<br /><div class="bar" style="background: linear-gradient(to right, ' + (perc >= 80 ? '#fff' : '#f00') + ' ' + perc + '%, #000 ' + perc + '%);"></div><br />' + perc + '% ' + (perc < 50 ? '⚠️' : '');
follower.style.display = "block"; follower.style.display = "block";
} }
} }
@ -179,7 +178,6 @@ class WindSimulation {
this.wms[i].lowPower(false); this.wms[i].lowPower(false);
document.getElementById("follower").style.display = "none"; document.getElementById("follower").style.display = "none";
document.getElementById("results").style.display = "none"; document.getElementById("results").style.display = "none";
document.getElementById("numbers").innerHTML = "";
} }
setRotation(dir) { setRotation(dir) {
@ -232,6 +230,7 @@ class WindSimulation {
if(this.xhr != xhr) return; if(this.xhr != xhr) return;
if (xhr.readyState === 4 && xhr.status === 200) { if (xhr.readyState === 4 && xhr.status === 200) {
var json = JSON.parse(xhr.responseText); var json = JSON.parse(xhr.responseText);
console.log(json.pot)
this.add_simulation(json.ws, json.pot); this.add_simulation(json.ws, json.pot);
this.xhr = null; this.xhr = null;
} }
@ -266,18 +265,6 @@ class WindSimulation {
results.innerHTML = innerHTML; results.innerHTML = innerHTML;
results.style.display = "block"; results.style.display = "block";
if(Screen.isMobile) {
var numbers = "";
for(let i = 0; i < pot.length; i++) {
var p = new THREE.Vector3(this.wms[i].position.x, this.wms[i].position.y, 1);
p.project(screen.camera);
p.x = (p.x + 1) / 2 * window.innerWidth;
p.y = -(p.y - 1) / 2 * window.innerHeight;
numbers += '<div style="left: ' + p.x + 'px; top: ' + p.y + 'px;">' + (i + 1) + '</div>';
}
document.getElementById("numbers").innerHTML = numbers;
}
var geometry = new THREE.PlaneGeometry(this.width, this.height, 10 * this.width, 10 * this.height); var geometry = new THREE.PlaneGeometry(this.width, this.height, 10 * this.width, 10 * this.height);
var colors = new three.BufferAttribute(new Float32Array(geometry.attributes.position.count * 4), 4); var colors = new three.BufferAttribute(new Float32Array(geometry.attributes.position.count * 4), 4);
geometry.setAttribute('color', colors); geometry.setAttribute('color', colors);

@ -3,7 +3,7 @@ import json
app = Flask(__name__) app = Flask(__name__)
import simulation import xxx
@app.route("/", methods=['GET', 'POST']) @app.route("/", methods=['GET', 'POST'])
def index(): def index():
@ -17,7 +17,7 @@ def index():
if len(pos) > 10 or direction not in (0, 225, 270, 315): if len(pos) > 10 or direction not in (0, 225, 270, 315):
return abort(400); return abort(400);
ws, pot = simulation.run(direction, pos); ws, pot = xxx.run(direction, pos);
return { return {
'pos': pos, 'pos': pos,
'ws': ws, 'ws': ws,

@ -1,6 +0,0 @@
[uwsgi]
module = wsgi:app
http = 127.0.0.1:1234
master = true
processes = 1

@ -1,4 +0,0 @@
from server import app
if __name__ == '__main__':
app.run(host='127.0.0.1', port=1234)

@ -37,20 +37,14 @@ h3, h4 {
max-width: 70vw; max-width: 70vw;
max-height: 70vh; max-height: 70vh;
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: scroll;
width: auto; width: auto;
border: solid #fff .5vh; border: solid #fff .5vh;
height: auto; height: auto;
background: #00000088; background: #00000088;
/* padding: 4vh;*/ padding: 4vh;
text-align: left; text-align: left;
font-size: .7em; font-size: .7em;
scrollbar-color: #fff #555;
scrollbar-width: thin;
}
#text {
padding: 2vh;
} }
#popup p + p { #popup p + p {
@ -68,25 +62,19 @@ h3, h4 {
#popup .b { #popup .b {
display: inline-block; display: inline-block;
font-weight: 800; font-weight: 800;
font-size: .8em;
border: solid white .4vh; border: solid white .4vh;
border-radius: 1vh; border-radius: 1vh;
width: 1.2em; width: 1em;
height: 1.2em;
text-align: center; text-align: center;
margin: 0 .2vh; margin: 0 .2vh;
} }
#close { #close {
text-align: right;
font-weight: 900; font-weight: 900;
float: right; float: right;
font-size: 1.5em; font-size: 1.5em;
position: sticky; margin-top: -5vh;
top: 0; margin-right: -3.5vh;
right: 1vh;
height: calc(100% - 1px);
cursor: pointer;
} }
#close:hover { #close:hover {
@ -145,10 +133,6 @@ h3, h4 {
left: 1vh; left: 1vh;
} }
#follower {
text-align: center;
}
.bar { .bar {
border: solid white 1px; border: solid white 1px;
display: inline-block; display: inline-block;
@ -202,16 +186,3 @@ tr.last {
#logo img:hover { #logo img:hover {
opacity: 100%; opacity: 100%;
} }
#numbers {
position: absolute;
}
#numbers div {
position: absolute;
text-shadow: 0 0 1px #000;
-webkit-text-stroke: 0.5px black;
font-size: .7em;
font-weight: 600;
}

Loading…
Cancel
Save