Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added functionality to export results to txt file #23

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<script type="text/javascript" src="js/comfortmodels.js"></script>
<script type="text/javascript" src="js/erf.js"></script>
<script type="text/javascript" src="js/mrt.js"></script>

<div class="scale-label" id="scale-maximum"></div>
<div id="scale-container">
<div id="scale"></div>
Expand Down
21 changes: 11 additions & 10 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ params = {
'autoscale': true,
'scaleMin': 20.0,
'scaleMax': 40.0,
'setGlobalSurfaceTemp': 21,
'setGlobalSurfaceTemp': 21,
'update': function(){
document.getElementById('calculating').style.display = "";
setTimeout(function() {
Expand Down Expand Up @@ -1088,7 +1088,7 @@ function init() {
.onFinishChange(function(){ do_fast_stuff(); });

gui.add(params, 'setGlobalSurfaceTemp').min(tempMin).max(tempMax).step(1)
.onFinishChange(function(){ link_temps(); });
.onFinishChange(function(){ link_temps(); });

gui.add(params, 'update');

Expand Down Expand Up @@ -1123,7 +1123,7 @@ function init() {
panel_floor_xpos.max(mrt.room.width - 2* panelBorderMin);
panel_floor_ypos.max(mrt.room.depth - 2* panelBorderMin);
};

function link_temps(){
params.wall1.temperature = params.setGlobalSurfaceTemp;
set_surface_property('wall1', 'temperature', params.wall1.temperature, false);
Expand All @@ -1139,15 +1139,15 @@ function init() {
set_surface_property('ceiling', 'temperature', params.ceiling.temperature, false);
params.floor.temperature = params.setGlobalSurfaceTemp;
set_surface_property('floor', 'temperature', params.floor.temperature, false);

//update gui displays to match values stored in fields
_.each([f_wall1, f_wall2, f_wall3, f_wall4, f_floor, f_ceiling], function(g){
g.updateDisplay();
});
do_fast_stuff();

do_fast_stuff();
}

// Lights
var ambientLight = new THREE.AmbientLight( 0x999999 );
scene.add( ambientLight );
Expand Down Expand Up @@ -1304,9 +1304,9 @@ function render() {
display_value = my_pmv.pmv;
}
document.getElementById('occupant-position').innerHTML = "Occupant (x, y): ("
+ intersects[0].point.x.toFixed(1) + ", " + intersects[0].point.z.toFixed(1) + ")";
+ intersects[0].point.x.toFixed(2) + ", " + intersects[0].point.z.toFixed(2) + ")";
document.getElementById('cursor-temperature').innerHTML = params.display + ": "
+ display_value.toFixed(1);
+ display_value.toFixed(2);
} else {
document.getElementById('cursor-temperature').innerHTML = "";
document.getElementById('occupant-position').innerHTML = "";
Expand Down Expand Up @@ -1337,6 +1337,7 @@ function update_view_factors(){
}
return vfs;
});

view_factors_need_updating = false;

}
Expand Down Expand Up @@ -1442,7 +1443,6 @@ function calculate_erf_point(v, skydome_center, window_objects, window_object_vf
}

function update_visualization(){

if (view_factors_need_updating) {
var vertex_colors = _.map(view_factors, function(){
return new THREE.Color(1, 1, 1);
Expand Down Expand Up @@ -1517,5 +1517,6 @@ function update_visualization(){
f.vertexColors.push( vertex_colors[ idx ] );
}
}

plane.geometry.colorsNeedUpdate = true;
}
3 changes: 1 addition & 2 deletions js/mrt.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ mrt.mesh_view_factor = function(mesh, d_perp, area, person_pos, person_az, postu
var dvf = mrt.fanger_view_factor(p, d_perp, area, person_pos, person_az, posture);
view_factor += dvf;
}
}
}
return view_factor;
};

Expand Down Expand Up @@ -335,7 +335,6 @@ mrt.calc = function(surface_vfs){
my_mrt /= vf_emis_total;
my_mrt = Math.pow(my_mrt, 0.25);
my_mrt -= 273.15;

return my_mrt;
};

Expand Down