Skip to content

Commit

Permalink
Thursday
Browse files Browse the repository at this point in the history
  • Loading branch information
stephensm authored and stephensm committed Aug 8, 2013
1 parent 1ff78cf commit 03625d1
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 35 deletions.
Binary file modified .DS_Store
Binary file not shown.
6 changes: 3 additions & 3 deletions graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ var rect = layer.selectAll("rect")
.attr("y", height)
.attr("width", x.rangeBand())
.attr("height", 0)
.style("fill", function(d, i) {return meatType=='False'? color[meatType](data[i][d.y0]/tempMax):this.style("fill")})
.style("fill", function(d, i) {return meatType=='False'? color[meatType](data[i][d.y0]/tempMax):""})
.on("mouseover", function() {
if(meatType!='False'){
var rects = d3.select(this);
Expand Down Expand Up @@ -191,8 +191,8 @@ var line=parseInt((event.pageX-parseFloat($("body").css('margin-left'))-margin.l
.style("stroke", "grey");
//console.log(d3.event.pageX-parseFloat($("body").css('margin-left')));
var ttip=d3.select('.tooltip');
// ttip.html(data[line][pos].toFixed(2)+ "\xB0C")
ttip.html(line.toFixed(2)+ "\xB0C")
ttip.html(data[line][pos].toFixed(2)+ "\xB0C")
// ttip.html(line.toFixed(2)+ "\xB0C")
//ttip.html("please work")
.style("opacity", 1)
.style("left", (d3.event.pageX-parseFloat($("body").css('margin-left'))+5) + "px")
Expand Down
53 changes: 27 additions & 26 deletions heat-diffusion.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,30 +206,30 @@ function HeatSolver(startingTemps,timestep,spacestep){
for(var i=0; i<60*step; i+=step){

grapharray.push(tempArray[parseInt(i)].slice(1,len-1));

if(temperatures[parseInt(i)][0] > 25 && temperatures[parseInt(i)][1] > 25){

graphlabels.push([count,0,temperatures[parseInt(i)][0]]);
graphlabels.push([count,1,temperatures[parseInt(i)][1]]);

}
else if(temperatures[parseInt(i)][0] > 25){

graphlabels.push([count,0,temperatures[parseInt(i)][0]]);

}
else if(temperatures[parseInt(i)][1] > 25){

graphlabels.push([count,1,temperatures[parseInt(i)][1]]);

}
else{
// graphlabels.push([count,0,temperatures[parseInt(i/60)][1]]);
}


count++;

}


Expand Down Expand Up @@ -279,48 +279,49 @@ function HeatSolver(startingTemps,timestep,spacestep){
}
var cnVector = make_crank_nicolson_vector();
calculate_next_cn(cnVector);
var newMaxTemp = [];
for(var n=0; n<maxTemps[maxTemps.length-1].length; n++){
if(tempArray[tempArray.length-1][n] > maxTemps[maxTemps.length-1][n]){
newMaxTemp.push(tempArray[tempArray.length-1][n]);
}
else{
newMaxTemp.push(maxTemps[maxTemps.length-1][n])
}
}
maxTemps.push(newMaxTemp);
}
}
var arrays = tempArray.length-1 ;
var len= tempArray[0].length;
var step = arrays/60.0;
for(var i=0; i<60*step; i+=step){

var newMaxTemp = [];
for(var n=0; n<maxTemps[maxTemps.length-1].length; n++){
if(tempArray[parseInt(i)][n] > maxTemps[maxTemps.length-1][n]){
newMaxTemp.push(tempArray[parseInt(i)][n]);
}
else{
newMaxTemp.push(maxTemps[maxTemps.length-1][n])
}
}
maxTemps.push(newMaxTemp);

grapharray.push(tempArray[parseInt(i)].slice(1,len-1));

if(temperatures[parseInt(i)][0] > 25 && temperatures[parseInt(i)][1] > 25){

graphlabels.push([count,0,temperatures[parseInt(i)][0]]);
graphlabels.push([count,1,temperatures[parseInt(i)][1]]);

}
else if(temperatures[parseInt(i)][0] > 25){

graphlabels.push([count,0,temperatures[parseInt(i)][0]]);

}
else if(temperatures[parseInt(i)][1] > 25){

graphlabels.push([count,1,temperatures[parseInt(i)][1]]);

}
else{
// graphlabels.push([count,0,temperatures[parseInt(i/60)][1]]);
}


count++;

}

return {temps: grapharray, points: graphlabels, step: step, maxTemps: maxTemps[maxTemps.length-1], allMaxTemps: maxTemps};
Expand Down
4 changes: 2 additions & 2 deletions home-screen.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
border: 1px solid black;
}

#startModal .modal-footer{
text-align:center;
.modal-footer{
text-align:center !important;
}

/*.dropdown{
Expand Down
6 changes: 5 additions & 1 deletion perfectSteak.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,11 @@ var onoff=function(){
tog.on("click",onoff);
var addTextButton = $("<button class='btn' id='addTextButton'>Input Text</button>");
var saveModal=$('<div id="saveBut" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"><div class="modal-body">Please select a name for your recipe <p> <input type="text" id="recipeName"></input><p><button class="btn" data-dismiss="modal" aria-hidden="true">OK</button></div></div>');
displayDiv.append(saveModal)
var cookDropdown=$("<div class='dropdown'><select class='cookDropdown'></select></div>");

var quickAddModal=$('<div id="quickAdd" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button><h3 id="myModalLabel">Quick Add</h3></div><div class="modal-body"> <p class="cookp">Cook at: </p></div><div class="modal-footer"><button class="btn" data-dismiss="modal" aria-hidden="true">OK</button></div></div>');
$(".cookp").append(cookDropdown);
displayDiv.append(saveModal, quickAddModal)

saveBut.on("click", function(){

Expand Down
10 changes: 7 additions & 3 deletions sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,20 @@ var calculate=function(data,steak,meatType,first,totalTime){
if(timestep > 39){ //39 is basically the maximum timestep for acceptable accuracy (below 1° error)
timestep = 39;
}

var myheatsolver = HeatSolver(steak,timestep,spacestep);
var Thedata=myheatsolver.sixty_graph_arrays_duration(data);
if(meatType=='False'){
var sampledata=Thedata.temps;
}
else{
var sampledata=Thedata.allMaxTemps;
console.log(sampledata.length);
var sampledata=Thedata.allMaxTemps.slice(1,Thedata.allMaxTemps.length);
console.log(sampledata);

for(var i=0;i<sampledata.length;i++)
{
sampledata[i]=sampledata[i].slice(1,sampledata[i].length-1);
}
}
var flame=Thedata.points;
var timestep=1/Thedata.step;
var maxTemps=Thedata.maxTemps;
Expand Down

0 comments on commit 03625d1

Please sign in to comment.