Skip to content

Commit

Permalink
Merge pull request #1 from cros0400/PlottingScripts
Browse files Browse the repository at this point in the history
Reorganizing into WagonDB and EngineDB web interfaces
  • Loading branch information
cros0400 authored May 23, 2023
2 parents b9413f6 + 74f4ba3 commit feb49f1
Show file tree
Hide file tree
Showing 210 changed files with 24,960 additions and 0 deletions.
Binary file not shown.
Binary file added cgi-bin/EngineDB/__pycache__/base.cpython-36.pyc
Binary file not shown.
Binary file added cgi-bin/EngineDB/__pycache__/connect.cpython-36.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added cgi-bin/EngineDB/__pycache__/settings.cpython-36.pyc
Binary file not shown.
Binary file not shown.
30 changes: 30 additions & 0 deletions cgi-bin/EngineDB/add_board_info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/python3

import cgi
import base
import home_page_list

#cgi header
print("Content-type: text/html\n")

form = cgi.FieldStorage()
#card_id = form.getvalue('card_id')
serial_num = base.cleanCGInumber(form.getvalue('serial_num'))
board_id = base.cleanCGInumber(form.getvalue('board_id'))

base.header(title='Add extra information about board')
base.top()

home_page_list.add_board_info_form(serial_num, board_id)

print('<div class="row">')
print('<div class="col-md-5 pt-2 ps-5 mx-2 my-2">')
print('<h2>List of All Boards</h2>' )
print('<b><em>(Sorted by Serial Number)</em></b>&emsp;<badge class="badge bg-primary">Successful Tests</badge>')
print('</div>')
print('</div>')

home_page_list.render_list_module()

base.bottom()

32 changes: 32 additions & 0 deletions cgi-bin/EngineDB/add_board_info2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/python3

import cgi
import cgitb
import base
import module_functions
import os
import connect

cgitb.enable()

base_url = connect.get_base_url()

print("Location: %s/summary.py\n\n"%(base_url))
#cgi header
print("Content-type: text/html\n")

form = cgi.FieldStorage()
sn = base.cleanCGInumber(form.getvalue("serial_num"))
board_id = base.cleanCGInumber(form.getvalue("board_id"))
location = form.getvalue("location")
daqid = form.getvalue("daq_chip_id")
trig1id = form.getvalue("trigger_chip_1_id")
trig2id = form.getvalue("trigger_chip_2_id")
comments = cgi.escape(form.getvalue("comments"))

base.header(title='Add Board Info')
base.top()

module_functions.add_board_info(board_id, str(sn), location, daqid, trig1id, trig2id, comments)

base.bottom()
30 changes: 30 additions & 0 deletions cgi-bin/EngineDB/add_init_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/python3

import cgi
import base
import add_test_functions
import os

#cgi header
print("Content-type: text/html\n")

form = cgi.FieldStorage()
label_applied = base.cleanCGInumber(form.getvalue("label_applied"))
database_entry = base.cleanCGInumber(form.getvalue("database_entry"))
label_legibility = base.cleanCGInumber(form.getvalue("label_legibility"))
power_cycle = base.cleanCGInumber(form.getvalue("power_cycle"))
tester = cgi.escape(form.getvalue("tester"))
serial_num = base.cleanCGInumber(form.getvalue("serial_num"))
comments = form.getvalue("comments")

test_results = {"Label Applied": label_applied, "Database Entry": database_entry, "Label Legibility": label_legibility, "Power Cycle": power_cycle}

if comments:
comments = cgi.escape(comments)

base.header(title='Add Test')
base.top()

test_id=add_test_functions.add_init_tests(serial_num, tester, test_results, comments)

base.bottom()
25 changes: 25 additions & 0 deletions cgi-bin/EngineDB/add_module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/python3

import cgi
import base
import home_page_list

#cgi header
print("Content-type: text/html\n")

base.header(title='Add a new module to HGCAL Wagon Test')
base.top()

home_page_list.add_module_form()

print('<div class="row">')
print('<div class="col-md-5 pt-2 ps-5 mx-2 my-2">')
print('<h2>List of All Boards</h2>' )
print('<b><em>(Sorted by Serial Number)</em></b>&emsp;<badge class="badge bg-primary">Successful Tests</badge>')
print('</div>')
print('</div>')

home_page_list.render_list_module()

base.bottom()

71 changes: 71 additions & 0 deletions cgi-bin/EngineDB/add_module2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/usr/bin/python3

import cgi
import base
import home_page_list
import connect
import os

base_url = connect.get_base_url()

print("Location: %s/summary.py\n\n" % base_url)

#cgi header
print("Content-type: text/html\n")

base.header(title='Adding a new module...')
base.top()

form = cgi.FieldStorage()

if form.getvalue('serial_number'):
sn = (form.getvalue('serial_number'))

home_page_list.add_module(sn)

print('<div class="row">')
print('<div class="col-md-3 ps-4 pt-2 mx-2 my-2">')
print('<h2>List of All Boards</h2>' )
print('<b><em>(Sorted by Serial Number)</em></b>')
print('</div>')
print('<div class="col-md-3 ps-5 pt-2 mx-2 my-2">')
print('<a href="add_module.py">')
print('<button type="button">Add a New Board</button>')
print('</a>')
print('</div>')
print('</div>')

print('<br><br>')


home_page_list.render_list_module()

base.bottom()


else:
print('<div class="row">')
print('<div class="col-md-12 ps-4 pt-2 mx-2 my-2">')
print('<h4><b> FAILED. Enter SERIAL NUMBER </b></h4>')
print('</div>')
print('</div>')

home_page_list.add_module_form()


print('<div class="row">')
print('<div class="col-md-3 ps-4 pt-2 mx-2 my-2">')
print('<h2>List of All Boards</h2>' )
print('<b><em>(Sorted by Serial Number)</em></b>')
print('</div>')
print('</div>')

print('<br><br>')

home_page_list.render_list_module()

base.bottom()




17 changes: 17 additions & 0 deletions cgi-bin/EngineDB/add_new_test_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/python3

import cgi
import base
import home_page_list
import add_test_functions


#cgi header
print("Content-type: text/html\n")

base.header(title='Add New Test Template')
base.top()

add_test_functions.add_new_test_template()

base.bottom()
27 changes: 27 additions & 0 deletions cgi-bin/EngineDB/add_new_test_template2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/python3

import cgi
import base
import add_test_functions
import os
import connect

base_url = connect.get_base_url()

print("Location: %s/summary.py\n\n" % base_url)
#cgi header
print("Content-type: text/html\n")

form = cgi.FieldStorage()
test_name = cgi.escape(form.getvalue("test_name"))
required = base.cleanCGInumber(form.getvalue("required"))
test_desc_short = cgi.escape(form.getvalue("test_desc_short"))
test_desc_long = cgi.escape(form.getvalue("test_desc_long"))
password = cgi.escape(form.getvalue("password"))

base.header(title='Add New Test Template')
base.top()

test_id=add_test_functions.add_new_test(test_name, required, test_desc_short, test_desc_long, password)

base.bottom()
16 changes: 16 additions & 0 deletions cgi-bin/EngineDB/add_new_user_ID.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/python3

import cgi
import base
import module_functions
import os

#cgi header
print("Content-type: text/html\n")

base.header(title='Add New User')
base.top()

tests = module_functions.add_new_user_ID()

base.bottom()
22 changes: 22 additions & 0 deletions cgi-bin/EngineDB/add_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/python3

import cgi
import base
import home_page_list
import add_test_functions


#cgi header
print("Content-type: text/html\n")

form = cgi.FieldStorage()
#card_id = form.getvalue('card_id')
serial_num = base.cleanCGInumber(form.getvalue('serial_num'))
suggested_test = base.cleanCGInumber(form.getvalue('suggested'))

base.header(title='Add Test')
base.top()

add_test_functions.add_test_template(serial_num, suggested_test)

base.bottom()
49 changes: 49 additions & 0 deletions cgi-bin/EngineDB/add_test2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/python3

import cgi
import base
import add_test_functions
import os
import connect

base_url = connect.get_base_url()

print("Location: %s/summary.py\n\n" % base_url)
#cgi header
print("Content-type: text/html\n")

form = cgi.FieldStorage()
person_id = base.cleanCGInumber(form.getvalue("person_id"))
test_type = base.cleanCGInumber(form.getvalue("test_type"))
serial_num = base.cleanCGInumber(form.getvalue("serial_number"))
success = base.cleanCGInumber(form.getvalue("success"))
comments = form.getvalue("comments")

if comments:
comments = cgi.escape(comments)

base.header(title='Add Test')
base.top()

test_id=add_test_functions.add_test(person_id, test_type, serial_num, success, comments)

for itest in [1]:
afile = form['attach%d'%(itest)]
if (afile.name):
adesc= form.getvalue("attachdesc%d"%(itest))
if adesc:
adesc = cgi.escape(adesc)
acomment= form.getvalue("attachcomment%d"%(itest))
if acomment:
acomment = cgi.escape(acomment)
add_test_functions.add_test_attachment(test_id,afile,adesc,acomment)
elif (afile.filename):
adesc= form.getvalue("attachdesc%d"%(itest))
if adesc:
adesc = cgi.escape(adesc)
acomment= form.getvalue("attachcomment%d"%(itest))
if acomment:
acomment = cgi.escape(acomment)
add_test_functions.add_test_attachment_gui(test_id,afile,adesc,acomment)

base.bottom()
Loading

0 comments on commit feb49f1

Please sign in to comment.