Skip to content

Commit

Permalink
Merge pull request #13 from virtual-labs/dev
Browse files Browse the repository at this point in the history
updated
  • Loading branch information
coepvlab authored Dec 13, 2023
2 parents 91d9790 + ff3a3e6 commit beda485
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 34 deletions.
59 changes: 31 additions & 28 deletions experiment/simulation/src/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,60 +176,68 @@ function tableReading(masterJson)
var loadCheck=0;
var loadCheck1=0;

$("#text4").change(function(){


var selLoadOut = 0;

$("#text4").change(function(){

loadCheck1 = $("#text4").val();
loadCheck = parseInt(loadCheck1);
loadCheck = parseInt(loadCheck1);

pressureValue =$("#text4").children(":selected").attr("value");
$("#text4").children('option[value="' + pressureValue + '"]').attr('disabled', true);

// loadCheck1 = $("#text4").val();
// loadCheck = parseFloat(loadCheck1);
// console.log(" loadCheck "+loadCheck);
});
});

var selLoadOut = 0;

$("#submit_selLoad").click(function(){

if(loadCheck!=0)

// loadCheck = $("#text4").val();
if(loadCheck1==0)
{
for(i=0 ,flag=0; i<masterJson.demo.length;i++){
$(".modal-header").html("Error Message");
$(".modal-header").css("background","#9c1203b0");
$("#btnModal").removeClass("btn-success").addClass("btn-danger");
$("#MsgModal").html("Select Appropriate Value");
}else{


// for(i=0 ,flag=0; i<masterJson.demo.length;i++){
// var temp=parseInt(masterJson.demo[i].text1);
if(loadCheck ==1){
if(loadCheck1 ==1){
flag = 1;
selLoadOut = firstLoad;
secondVal = masterJson.demo[0].text2;
thirdVal = masterJson.demo[0].text3;
break;
}else if(loadCheck==2)
// break;
}else if(loadCheck1==2)
{
flag = 1;
selLoadOut = secondLoad;
secondVal = masterJson.demo[1].text2;
thirdVal = masterJson.demo[1].text3;
break;
// break;

}else if(loadCheck==3)
}else if(loadCheck1==3)
{
flag = 1;
selLoadOut = thirdLoad;
secondVal = masterJson.demo[2].text2;
thirdVal = masterJson.demo[2].text3;
break;
}else if(loadCheck==4){
// break;
}else if(loadCheck1==4){
flag = 1;
selLoadOut = forthLoad;
secondVal = masterJson.demo[3].text2;
thirdVal = masterJson.demo[3].text3;
break;
}else if(loadCheck==5){
// break;
}else if(loadCheck1==5){
flag = 1;
selLoadOut = fifthLoad;
secondVal = masterJson.demo[4].text2;
thirdVal = masterJson.demo[4].text3;
break;
// break;
}
// if(firstLoad ==temp || secondLoad==temp||thirdLoad==temp||forthLoad==temp||fifthLoad){
// flag = 1;
Expand All @@ -239,7 +247,7 @@ function tableReading(masterJson)
// console.log("thirdVal"+thirdVal);
// break;
// }
}
// }
// if(loadCheck!=0)
// {
flg = 1;
Expand All @@ -254,12 +262,6 @@ function tableReading(masterJson)
// else{
// alert("Select one of the calculated load value");
// }
}else{
$(".modal-header").html("Error Message");
$(".modal-header").css("background","#9c1203b0");
$("#btnModal").removeClass("btn-success").addClass("btn-danger");
$("#MsgModal").html("Select Appropriate Value");
// alert("Select Appropriate Value");
}

});
Expand Down Expand Up @@ -411,6 +413,7 @@ function tableReading(masterJson)
$("#anotherReading").click(function(){
clear();
idCal = 1;
loadCheck1 = 0;
$("#text4").val(0);
$("#text4").prop("disabled",false);
$("#submit_selLoad").prop("disabled",false);
Expand Down
12 changes: 6 additions & 6 deletions experiment/simulation/src/wheatStoneCalculation.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ function bridgeCalculate(){
paper.text(x+508,y+227,"-6").attr({'stroke' : '#084373' , "font-size":"12px","fill":"#0ee8e5"});

paper.text(x+465,y+95,secondVal+" X 10").attr({'stroke' : '#084373' , "font-size":"14px","fill":"#0ee8e5"});
paper.text(x+507,y+90,"-6").attr({'stroke' : '#084373' , "font-size":"12px","fill":"#0ee8e5"});
paper.text(x+510,y+90,"-6").attr({'stroke' : '#084373' , "font-size":"12px","fill":"#0ee8e5"});

paper.text(x+180,y+230,secondVal+" X 10").attr({'stroke' : '#084373' , "font-size":"14px","fill":"#0ee8e5"});
paper.text(x+220,y+225,"-6").attr({'stroke' : '#084373' , "font-size":"12px","fill":"#0ee8e5"});
paper.text(x+224,y+225,"-6").attr({'stroke' : '#084373' , "font-size":"12px","fill":"#0ee8e5"});

// paper.text(x+280,y+100,secondVal).attr({'stroke' : '#000' , "font-size":"20px","font-weight": "bold","fill":"#0ee8e5"});
// paper.text(x+385,y+212,secondVal).attr({'stroke' : '#000' , "font-size":"20px","font-weight": "bold","fill":"#0ee8e5"});
Expand All @@ -45,10 +45,10 @@ function bridgeCalculate(){
paper.text(x+508,y+227,"-6").attr({'stroke' : '#084373' , "font-size":"12px","fill":"#0ee8e5"});

paper.text(x+465,y+95,secondVal+" X 10").attr({'stroke' : '#084373' , "font-size":"14px","fill":"#0ee8e5"});
paper.text(x+507,y+90,"-6").attr({'stroke' : '#084373' , "font-size":"12px","fill":"#0ee8e5"});
paper.text(x+510,y+90,"-6").attr({'stroke' : '#084373' , "font-size":"12px","fill":"#0ee8e5"});

paper.text(x+180,y+230,secondVal+" X 10").attr({'stroke' : '#084373' , "font-size":"14px","fill":"#0ee8e5"});
paper.text(x+220,y+225,"-6").attr({'stroke' : '#084373' , "font-size":"12px","fill":"#0ee8e5"});
paper.text(x+224,y+225,"-6").attr({'stroke' : '#084373' , "font-size":"12px","fill":"#0ee8e5"});

paper.text(x-6,y+159,eb+"v").attr({'stroke' : '#000' , "font-size":"20px","font-weight": "bold","fill":"red"});

Expand All @@ -63,10 +63,10 @@ function bridgeCalculate(){
p22= paper.text(x+508,y+227,"-6").attr({'stroke' : '#084373' , "font-size":"12px","fill":"#0ee8e5"});

p3 = paper.text(x+465,y+95,secondVal+" X 10").attr({'stroke' : '#084373' , "font-size":"14px","fill":"#0ee8e5"});
p33= paper.text(x+507,y+90,"-6").attr({'stroke' : '#084373' , "font-size":"12px","fill":"#0ee8e5"});
p33= paper.text(x+510,y+90,"-6").attr({'stroke' : '#084373' , "font-size":"12px","fill":"#0ee8e5"});

p4= paper.text(x+180,y+230,secondVal+" X 10").attr({'stroke' : '#084373' , "font-size":"14px","fill":"#0ee8e5"});
p44 = paper.text(x+220,y+225,"-6").attr({'stroke' : '#084373' , "font-size":"12px","fill":"#0ee8e5"});
p44 = paper.text(x+224,y+225,"-6").attr({'stroke' : '#084373' , "font-size":"12px","fill":"#0ee8e5"});

p5= paper.text(x-6,y+159,eb+"v").attr({'stroke' : '#000' , "font-size":"20px","font-weight": "bold","fill":"red"});
if (corrOut == outVolt){
Expand Down

0 comments on commit beda485

Please sign in to comment.