Skip to content

Commit

Permalink
Merge pull request #9 from virtual-labs/dev
Browse files Browse the repository at this point in the history
UPDATED
  • Loading branch information
coepvlab authored Dec 12, 2023
2 parents dbc5006 + 756299e commit a673625
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 26 deletions.
4 changes: 3 additions & 1 deletion experiment/procedure.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@
- Repeat the same process for different loads and calculate axial and tranverse strain. Calculate the load for 5 readings and click on next level.
- Select one of the load to calculate output voltage and click on submit.
- Select supply voltage Eb and click on submit.
- Calculate the output voltage and enter it's value if the value is correct further calculations will be enabled and if the value is Incorrect then formula followed by correct answer will be displayed after 3 attempts.
- Calculate the output voltage and enter it's value if the value is correct further calculations will be enabled and if the value is Incorrect then formula followed by correct answer will be displayed after 3 attempts.
- At this stage either complete the experiment by 'COMPLETED' button click or 'SELECT ANOTHER LOAD' click and calculate the output voltage for other loads.
- After calculating all the readings experiment is completed.
16 changes: 8 additions & 8 deletions experiment/simulation/src/calculation.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ var num;
function columnType(){

var area = parseInt(areaSelect);
console.log("areaSelect"+areaSelect);
// console.log("areaSelect"+areaSelect);
var mod = parseInt(modSelelect);
console.log("modSelelect"+modSelelect);
// console.log("modSelelect"+modSelelect);
var pos = parseInt(poisonSelect);
console.log("poisonSelect"+poisonSelect);
// console.log("poisonSelect"+poisonSelect);


$("#main-div-conf").html('');
Expand Down Expand Up @@ -191,7 +191,7 @@ function columnType(){
axialCal = (ax)*Math.pow(10,-6);
// var axialCalConvert = ax+" &times; 10<sup>-6</sup>";
// axialCal = axialCal123.toFixed(3);
console.log("ax"+ax);
// console.log("ax"+ax);
$("#nextLevel").prop('hidden',true);

if (id1 <= 3) {
Expand Down Expand Up @@ -283,7 +283,7 @@ function columnType(){
}else{
text3 = parseFloat($("#text3").val());

console.log("Value of axial cal"+axialCal);
// console.log("Value of axial cal"+axialCal);
trans1 = parseFloat(trans);

mulT = trans1*pos;
Expand All @@ -293,7 +293,7 @@ function columnType(){
transCal12 = transCal1*Math.pow(10,6);
// var transCal123 = transCal12*Math.pow(10,6);
transCal = -transCal12.toFixed(3);
console.log("transCal"+transCal);
// console.log("transCal"+transCal);

if (id2 <= 3) {

Expand Down Expand Up @@ -415,11 +415,11 @@ function columnType(){
tempJson.text2 = ax;
tempJson.text3 = transCal;
arrayJson.push(tempJson);
console.log(arrayJson);
// console.log(arrayJson);
masterJson.demo=arrayJson;

tableReadingAdded();
console.log(masterJson);
// console.log(masterJson);


}
Expand Down
18 changes: 9 additions & 9 deletions experiment/simulation/src/configLoadCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ function columnTypeConfig(){
$("#main-div-conf").html(loadVal);
$("#diaSel").change(function(){
areaSelect = $("#diaSel").val();
console.log(" area "+diaSel);
// console.log(" area "+diaSel);
});
$("#modSel").change(function(){
modSelelect = $("#modSel").val();
console.log(" modulus "+modSelelect);
// console.log(" modulus "+modSelelect);
});
$("#poisonSel").change(function(){
poisonSelect = $("#poisonSel").val();
console.log("poisonSel"+poisonSelect);
// console.log("poisonSel"+poisonSelect);
});


Expand Down Expand Up @@ -185,7 +185,7 @@ function columnTypeConfig(){
$("body").css("padding","0px 0px 0px 0px");
}else{
radius = diam/2;
console.log("radius"+radius);
// console.log("radius"+radius);
// mathFun = Math.pow(10,-3);
// mulPow = mathFun*radius;
mulPow = radius;
Expand All @@ -195,7 +195,7 @@ function columnTypeConfig(){
areaRound = areaRound1;
// areaRound = (3.14*radius*radius).toFixed(2);
areaVal = parseFloat(areaRound);
console.log("areaVal"+areaVal);
// console.log("areaVal"+areaVal);
var areaSelValue = $("#areaSel").val();
if(areaSelValue==""){
$(".modal-header").html("Error Message");
Expand Down Expand Up @@ -496,22 +496,22 @@ function cantileverConfig(){

$("#lengthSel").change(function(){
lengthVal = $("#lengthSel").val();
console.log(" length "+lengthVal);
// console.log(" length "+lengthVal);
});

$("#widthSel").change(function(){
widthVal = $("#widthSel").val();
console.log(" width "+widthVal);
// console.log(" width "+widthVal);
});

$("#heightSel").change(function(){
heightVal = $("#heightSel").val();
console.log(" width "+heightVal);
// console.log(" width "+heightVal);
});

$("#modSelcanti").change(function(){
modSelcantiVal = $("#modSelcanti").val();
console.log(" width "+modSelcantiVal);
// console.log(" width "+modSelcantiVal);
});

$("#checkConfgCanti").click(function() {
Expand Down
2 changes: 1 addition & 1 deletion experiment/simulation/src/questions.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ $( "#typeCell" ).on( "change", function() {
}
dataQues.corrAns = ansCount;
data.corrAns = dataQues;
console.log(data);
// console.log(data);

$("#btnModal").removeClass("btn-danger").addClass("btn-success");
$(".modal-header").html("Success Message");
Expand Down
10 changes: 5 additions & 5 deletions experiment/simulation/src/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ function tableReading(masterJson)
$("#centerText1").html('WHEATSTONE BRIDGE');

let iterator = masterJson.demo.values();
console.log(iterator.next().value);
// console.log(iterator.next().value);
var htm = '<img src="images/wheatStoneBridgeE.png " class="img-fluid" width = 90% height = 90%>'
$("#main-div-conf").html(htm);
console.log("Value of ax1 : "+ax1);
// console.log("Value of ax1 : "+ax1);

var firstLoad = 0, secondLoad = 0, thirdLoad = 0, forthLoad = 0, fifthLoad = 0 ;

Expand Down Expand Up @@ -169,7 +169,7 @@ function tableReading(masterJson)
// +' <td>'+masterJson.weight[i].totalWeight+'</td>'
+' </tr>'
}
console.log(masterJson.demo[0].text1);
// console.log(masterJson.demo[0].text1);

$("#canvas-div").html(tableMainDiv);
$("#canvas-div").append(calculatePanel);
Expand Down Expand Up @@ -249,7 +249,7 @@ function tableReading(masterJson)
$("#submit_selLoad").prop("disabled",true);
$("#guageFact").prop("hidden",false);
selLoad = parseInt($("#text4").val());
console.log("selLoad"+selLoad);
// console.log("selLoad"+selLoad);
// }
// else{
// alert("Select one of the calculated load value");
Expand Down Expand Up @@ -447,7 +447,7 @@ function tableReading(masterJson)
tempJson.outputVoltage = outVolt;
arrayJson.push(tempJson);
masterJson.demo=arrayJson;
console.log(masterJson);
// console.log(masterJson);
}

}
Expand Down
4 changes: 2 additions & 2 deletions experiment/simulation/src/wheatStoneCalculation.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ function bridgeCalculate(){
p5 = paper.text(x-6,y+159,"");

// var p1,p2,p3,p4,p5;
console.log("secondVal"+secondVal);
console.log("thirdVal"+thirdVal);
// console.log("secondVal"+secondVal);
// console.log("thirdVal"+thirdVal);

wheatStone = paper.image("images/wheatStoneBridgeE.png",(x-50), (y-100),700, 600);
r1 = paper.circle(x+327,y+160,35).attr({'stroke' : '#000' , 'stroke-width' : 3,"fill":"#fff" });
Expand Down

0 comments on commit a673625

Please sign in to comment.