Marthee commited on
Commit
d41b73b
·
verified ·
1 Parent(s): 6eaaa1c

Update templates/proposed-GUI.html

Browse files
Files changed (1) hide show
  1. templates/proposed-GUI.html +81 -2
templates/proposed-GUI.html CHANGED
@@ -26,6 +26,8 @@
26
 
27
  </head>
28
  <body >
 
 
29
  <div id="all">
30
  <!-- {% include 'loading.html' %} -->
31
  {% include 'loading.html' %}
@@ -295,10 +297,12 @@
295
  <select id="section-select"
296
  onchange="
297
  document.getElementById('description-section-1-0').style.display = this.value === 'section-1-0' ? 'block' : 'none';
298
- document.getElementById('description-section-3-2').style.display = this.value === 'section-3-2' ? 'block' : 'none';">
 
299
  <option value="">--Select Section--</option>
300
  <option value="section-1-0">Section 1.0</option>
301
  <option value="section-3-2">Section 3.2</option>
 
302
  </select>
303
  <div id="description-section-1-0" class="description">
304
  <label style="font-style: italic;">* Notes for section 1.0 measurement:</label>
@@ -341,6 +345,37 @@
341
  </ol>
342
  </div>
343
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
344
  </body>
345
  <br>
346
  <i id="secondpage" class="fa fa-arrow-right" aria-hidden="true"></i>
@@ -473,17 +508,61 @@
473
 
474
  </body>
475
  </html>
476
-
477
  <script >
478
 
479
  ///////////////////////////////////////////////BEGIN JS CODE//////////////////////////////////////////////////
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
480
  PopupElement=document.getElementById('modal-bodyText');
481
 
 
 
 
 
 
 
482
  // add project names to first dropdown from google sheet
483
  firstdropdown=document.getElementsByClassName('selectionsProj')[0];
484
  seconddropdown=document.getElementsByClassName('selectionsProjp')[0];
485
  thirddropdown=document.getElementsByClassName('selectionsProjs')[0];
486
 
 
487
  $(firstdropdown).select2({
488
  placeholder:'Projects',
489
  closeOnSelect: true,
 
26
 
27
  </head>
28
  <body >
29
+ <div id="pdf-container"></div>
30
+
31
  <div id="all">
32
  <!-- {% include 'loading.html' %} -->
33
  {% include 'loading.html' %}
 
297
  <select id="section-select"
298
  onchange="
299
  document.getElementById('description-section-1-0').style.display = this.value === 'section-1-0' ? 'block' : 'none';
300
+ document.getElementById('description-section-3-2').style.display = this.value === 'section-3-2' ? 'block' : 'none';
301
+ document.getElementById('description-section-2-8').style.display = this.value === 'section-2-8' ? 'block' : 'none';">
302
  <option value="">--Select Section--</option>
303
  <option value="section-1-0">Section 1.0</option>
304
  <option value="section-3-2">Section 3.2</option>
305
+ <option value="section-2-8">Section 2.8</option>
306
  </select>
307
  <div id="description-section-1-0" class="description">
308
  <label style="font-style: italic;">* Notes for section 1.0 measurement:</label>
 
345
  </ol>
346
  </div>
347
  </div>
348
+ <div id="description-section-2-8" class="description">
349
+ <label style="font-style: italic;">* Notes for section 2.8 measurement:</label>
350
+ <p style="font-weight: bold;">Door Detection Algorithm - v.1</p>
351
+ <p>The algorithm is designed to detect different symbols of the door and measure its width.</p>
352
+
353
+ <div>
354
+ <p style="font-weight: bold;">Single Door:</p>
355
+ <div style="margin-left: 20px;">
356
+ <p>• Can correctly detect more than 85% of the single doors.</p>
357
+ <p>• Identify the opening of the door properly and draw a line between the two end points.</p>
358
+ <p>• Calculate the width of the opening.</p>
359
+ </div>
360
+ </div>
361
+
362
+ <div>
363
+ <p style="font-weight: bold;">Double Door:</p>
364
+ <div style="margin-left: 20px;">
365
+ <p>• Can correctly detect some double doors.</p>
366
+ <p>• Calculate the width of the opening.</p>
367
+ <p>• Draw a rectangle around the detected door.</p>
368
+ </div>
369
+ </div>
370
+
371
+ <p style="font-weight: bold;">What to Expect in the Next Version?</p>
372
+ <div style="margin-left: 20px;">
373
+ <p>• Identify the opening of the double door properly and draw a line between the two end points.</p>
374
+ <p>• Get the labels beside doors to generate their name.</p>
375
+ <p>• Detect more symbols, e.g., "Leaf door".</p>
376
+ </div>
377
+ </div>
378
+
379
  </body>
380
  <br>
381
  <i id="secondpage" class="fa fa-arrow-right" aria-hidden="true"></i>
 
508
 
509
  </body>
510
  </html>
511
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.14.305/pdf.min.js"></script>
512
  <script >
513
 
514
  ///////////////////////////////////////////////BEGIN JS CODE//////////////////////////////////////////////////
515
+ // Function to send the Dropbox link and keyword to the server
516
+ function processPdf() {
517
+ const pdfLink = 'https://www.dropbox.com/scl/fi/fjykwhhn9gu9t3kqrflxd/LA002-NOR-ZZ-ZZ-T-A-2403_Architectural-Specification-F10-Brick-and-Block-Walling_A4-_C01.pdf?rlkey=ek9i66i79m0hwp8z5yjs6rp5p&e=1&st=mh7rurkc&dl=1'; // Dropbox link
518
+ const keyword = 'Page 1 of 5' ; // Example keyword
519
+
520
+ // Create a new FormData object to send the data as form data
521
+ const formData = new FormData();
522
+ formData.append('pdf_link', pdfLink);
523
+ formData.append('keyword', keyword);
524
+
525
+ // Send the data to the Flask server
526
+ fetch('/api/process-data', {
527
+ method: 'POST',
528
+ body: formData,
529
+ })
530
+ .then(response => response.json())
531
+ .then(data => {
532
+ // Handle the server's response
533
+ if (data.download_link) {
534
+ // Redirect the user to the page where the annotation is located
535
+ // The download_link includes both the page number and the rect (coordinates)
536
+ window.location.href = data.download_link; // This will use the rect info from Flask
537
+ } else {
538
+ alert('Error: ' + data.error);
539
+ }
540
+ })
541
+ .catch(error => {
542
+ console.error('Error:', error);
543
+ });
544
+ }
545
+
546
+ // Call the function to process the PDF
547
+ // processPdf();
548
+
549
+
550
+ ////////////////////////////////////////////////////////////////////
551
+
552
  PopupElement=document.getElementById('modal-bodyText');
553
 
554
+ sectionSelect=document.getElementById('section-select');
555
+ $(sectionSelect).select2({
556
+ closeOnSelect: true,
557
+ width:'20ch'
558
+
559
+ });
560
  // add project names to first dropdown from google sheet
561
  firstdropdown=document.getElementsByClassName('selectionsProj')[0];
562
  seconddropdown=document.getElementsByClassName('selectionsProjp')[0];
563
  thirddropdown=document.getElementsByClassName('selectionsProjs')[0];
564
 
565
+
566
  $(firstdropdown).select2({
567
  placeholder:'Projects',
568
  closeOnSelect: true,