Marthee commited on
Commit
1179f4b
·
verified ·
1 Parent(s): 2dc288d

Update templates/proposed-GUI.html

Browse files
Files changed (1) hide show
  1. templates/proposed-GUI.html +37 -44
templates/proposed-GUI.html CHANGED
@@ -764,23 +764,9 @@ document.getElementById('measureADRbutton').addEventListener('click',function(){
764
  document.getElementsByClassName('selectionsProjs')[0].style.boxShadow='0 0 8px 2px rgb(255, 0, 0)';
765
  //___________________________________________________________________________________________________________
766
  //___________________________________________________________________________________________________________
767
-
768
- /*Clear output everytime the user clicks on measureADR button*/
769
- var rightside=document.getElementById('rightside');
770
-
771
- document.getElementById("imgs").innerHTML='';
772
- document.getElementById("underimgbuttons").innerHTML='';
773
- var rightchidren= rightside.children;
774
- // for (let ch=0;ch<rightchidren.length; ch++)
775
- // {
776
- // if (rightchidren[ch].id == 'imgcanvas')
777
- // {
778
- // rightside.removeChild(rightchidren[ch])
779
- // // document.getElementById('imgcanvas').innerHTML=''
780
- // clearInterval()
781
- // clearTimeout()
782
- // }
783
- // }
784
  });
785
 
786
  //___________________________________________________________________________________________________________
@@ -1152,8 +1138,8 @@ function getSelectValues(select) {
1152
 
1153
  measids.forEach(function(elem) {
1154
  elem.addEventListener("change", function() {
1155
- if (!(projsec.value.startsWith('2.8')))
1156
- {
1157
  canvasimg='';
1158
  ry=[[]];
1159
  levelcheckbox.checked=false;
@@ -1179,7 +1165,7 @@ function getSelectValues(select) {
1179
  document.getElementById('measureADRbutton').onclick= function()
1180
  {
1181
  if (!areaRatio.value){
1182
- if (!(projsec.value.startsWith('3.2')))
1183
  areaRatio.style.boxShadow='0 0 8px 2px rgb(255, 0, 0)';
1184
  }
1185
  if (!prmRatio.value)
@@ -1206,7 +1192,7 @@ function getSelectValues(select) {
1206
  areaRatio.style.textAlign='right';
1207
  areaRatio.step=".0000001";
1208
 
1209
- if( projsec.value.startsWith('3.2')){
1210
  areaRatio.setAttribute('disabled',true)
1211
  document.getElementById('selectunitA').setAttribute('disabled',true)
1212
  }
@@ -1282,10 +1268,11 @@ function getSelectValues(select) {
1282
  ratioPunit=1;
1283
 
1284
  })
1285
- }
1286
- else{
1287
- pdfnames=getSelectValues(elem)
1288
- }
 
1289
  });
1290
 
1291
  });
@@ -1422,7 +1409,7 @@ function ImgSide(imgdata, spreadsheetLink, pdfLink) {
1422
  }
1423
 
1424
  function getData(form) {
1425
-
1426
  document.getElementById("loading").hidden = false;
1427
 
1428
  document.getElementById('measureADRbutton').setAttribute('disabled',true);
@@ -1431,6 +1418,7 @@ function getData(form) {
1431
  document.getElementById('measureADRbutton').style.color = 'white';
1432
  document.getElementById('measureADRbutton').style.backgroundColor="rgb(154,152,152)";
1433
 
 
1434
  var formData = new FormData(form);
1435
 
1436
  clearInterval(interval)
@@ -1454,9 +1442,15 @@ function getData(form) {
1454
  console.log(ratio2, prminpixels,formvalues['prmRatio'],ratioPunit)
1455
 
1456
  }
1457
- else if (formvalues['selectprojs'].startsWith('1.0')){
1458
  ratio1=(formvalues['areaRatio']/ratioAunit)/areainpixels;
1459
  ratio2=(formvalues['prmRatio']/ratioPunit)/prminpixels;
 
 
 
 
 
 
1460
  }
1461
  pdfpath.push(formvalues['selectproj'],formvalues['selectprojp'] ,formvalues['selectprojs']) //project name - part - section
1462
 
@@ -1484,7 +1478,7 @@ function getData(form) {
1484
  }
1485
  else if (formvalues['selectprojs'].startsWith('2.8'))
1486
  {
1487
- answers.push(pdfnames, 0,[] , ratio1, ratio2 ,pdfpath);
1488
  formData.append('answers',JSON.stringify(answers))
1489
  }
1490
 
@@ -1567,11 +1561,10 @@ function getData(form) {
1567
  { //
1568
  // /* data[0]--> img , data[1]-->dataframe (goes to legend lsa ) , data [2] -->pdf dropbox shareable link ,data[3]-> spreadsheetId, data[4],spreadsheeturl */
1569
  // SimilarAreaDictionary=data[1];
1570
- listofimages=data[0];
1571
- dropboxLinks=data[1];
1572
- // spreadsheetId=data[2];
1573
- spreadsheetURLs=data[2];
1574
- // list1= data[5]
1575
 
1576
 
1577
  }
@@ -1607,18 +1600,18 @@ function getData(form) {
1607
  namepathArr=data[8];
1608
  }
1609
 
1610
- if (!(formvalues['selectprojs'].startsWith('2.8')))
1611
- {
1612
  ImgSide(data[0],spreadsheetURL,dropboxLink)
1613
- }
1614
 
1615
- else{
1616
- console.log(listofimages.length)
1617
- for(var p=0;p<listofimages.length;p++)
1618
- {
1619
- ImgSide(listofimages[p],spreadsheetURLs[p],dropboxLinks[p])
1620
- }
1621
- }
1622
  getlegendstoDirectory()
1623
  //////////////////////////////////////////////////////////////////////////////////////////
1624
  let delrows2 = {
@@ -1633,7 +1626,7 @@ function getData(form) {
1633
  pdfpath.push(formvalues['selectproj'],formvalues['selectprojp'] ,formvalues['selectprojs'])
1634
  var rightsideids=[];
1635
 
1636
- if (formvalues['selectprojs'].startsWith('1.0') || formvalues['selectprojs'].startsWith('3.2') )
1637
  {// Set the interval in milliseconds
1638
  const interval = 20000;
1639
  const initialDelay = 0;
 
764
  document.getElementsByClassName('selectionsProjs')[0].style.boxShadow='0 0 8px 2px rgb(255, 0, 0)';
765
  //___________________________________________________________________________________________________________
766
  //___________________________________________________________________________________________________________
767
+ if (document.getElementById('imgContainer')) {
768
+ document.getElementById('imgContainer').innerHTML = '';
769
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
770
  });
771
 
772
  //___________________________________________________________________________________________________________
 
1138
 
1139
  measids.forEach(function(elem) {
1140
  elem.addEventListener("change", function() {
1141
+ // if (!(projsec.value.startsWith('2.8')))
1142
+ // {
1143
  canvasimg='';
1144
  ry=[[]];
1145
  levelcheckbox.checked=false;
 
1165
  document.getElementById('measureADRbutton').onclick= function()
1166
  {
1167
  if (!areaRatio.value){
1168
+ if (!(projsec.value.startsWith('3.2')) & !(projsec.value.startsWith('2.8')))
1169
  areaRatio.style.boxShadow='0 0 8px 2px rgb(255, 0, 0)';
1170
  }
1171
  if (!prmRatio.value)
 
1192
  areaRatio.style.textAlign='right';
1193
  areaRatio.step=".0000001";
1194
 
1195
+ if( projsec.value.startsWith('3.2') || projsec.value.startsWith('2.8') ){
1196
  areaRatio.setAttribute('disabled',true)
1197
  document.getElementById('selectunitA').setAttribute('disabled',true)
1198
  }
 
1268
  ratioPunit=1;
1269
 
1270
  })
1271
+ // }
1272
+ // for 2.8 multiple pdfs
1273
+ // else{
1274
+ // pdfnames=getSelectValues(elem)
1275
+ // }
1276
  });
1277
 
1278
  });
 
1409
  }
1410
 
1411
  function getData(form) {
1412
+
1413
  document.getElementById("loading").hidden = false;
1414
 
1415
  document.getElementById('measureADRbutton').setAttribute('disabled',true);
 
1418
  document.getElementById('measureADRbutton').style.color = 'white';
1419
  document.getElementById('measureADRbutton').style.backgroundColor="rgb(154,152,152)";
1420
 
1421
+
1422
  var formData = new FormData(form);
1423
 
1424
  clearInterval(interval)
 
1442
  console.log(ratio2, prminpixels,formvalues['prmRatio'],ratioPunit)
1443
 
1444
  }
1445
+ else if (formvalues['selectprojs'].startsWith('1.0') ){
1446
  ratio1=(formvalues['areaRatio']/ratioAunit)/areainpixels;
1447
  ratio2=(formvalues['prmRatio']/ratioPunit)/prminpixels;
1448
+ console.log('ratioss',ratio1,ratio2)
1449
+ }
1450
+ else if (formvalues['selectprojs'].startsWith('2.8') ){
1451
+ ratio1=1;
1452
+ ratio2=(formvalues['prmRatio']/ratioPunit)/prminpixels;
1453
+ console.log('ratioss',ratio1,ratio2)
1454
  }
1455
  pdfpath.push(formvalues['selectproj'],formvalues['selectprojp'] ,formvalues['selectprojs']) //project name - part - section
1456
 
 
1478
  }
1479
  else if (formvalues['selectprojs'].startsWith('2.8'))
1480
  {
1481
+ answers.push(tomeasureproj, 0,[] , ratio1, ratio2 ,pdfpath);
1482
  formData.append('answers',JSON.stringify(answers))
1483
  }
1484
 
 
1561
  { //
1562
  // /* data[0]--> img , data[1]-->dataframe (goes to legend lsa ) , data [2] -->pdf dropbox shareable link ,data[3]-> spreadsheetId, data[4],spreadsheeturl */
1563
  // SimilarAreaDictionary=data[1];
1564
+ // listofimages=data[0];
1565
+ dropboxLink=data[1];
1566
+ spreadsheetURL=data[2];
1567
+ list1= data[3] // list of pdf markups
 
1568
 
1569
 
1570
  }
 
1600
  namepathArr=data[8];
1601
  }
1602
 
1603
+ // if (!(formvalues['selectprojs'].startsWith('2.8')))
1604
+ // {
1605
  ImgSide(data[0],spreadsheetURL,dropboxLink)
1606
+ // }
1607
 
1608
+ // else{
1609
+ // console.log(listofimages.length)
1610
+ // for(var p=0;p<listofimages.length;p++)
1611
+ // {
1612
+ // ImgSide(listofimages[p],spreadsheetURLs[p],dropboxLinks[p])
1613
+ // }
1614
+ // }
1615
  getlegendstoDirectory()
1616
  //////////////////////////////////////////////////////////////////////////////////////////
1617
  let delrows2 = {
 
1626
  pdfpath.push(formvalues['selectproj'],formvalues['selectprojp'] ,formvalues['selectprojs'])
1627
  var rightsideids=[];
1628
 
1629
+ if (formvalues['selectprojs'].startsWith('1.0') || formvalues['selectprojs'].startsWith('3.2') || formvalues['selectprojs'].startsWith('2.8') )
1630
  {// Set the interval in milliseconds
1631
  const interval = 20000;
1632
  const initialDelay = 0;