Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def addADRIB():
|
| 4 |
+
mylist=['1','2','3']
|
| 5 |
+
vals=[]
|
| 6 |
+
with gr.Blocks() as newblocks:
|
| 7 |
+
with gr.Column():
|
| 8 |
+
algorithm = gr.Dropdown(choices=['Ground Beams','Pile Caps'],interactive=True,label='Projects')
|
| 9 |
+
with gr.Row():
|
| 10 |
+
area_pattern= gr.CheckboxGroup(choices=("Area","Pattern","Border","Length","Match"),show_label=False)
|
| 11 |
+
if algorithm=='Pile Caps':
|
| 12 |
+
with gr.Row():
|
| 13 |
+
drpdwnType=gr.Dropdown(choices=['Area','Border','Length','Count'],value='Area',show_label=False,interactive=True)
|
| 14 |
+
drpdwnUnit=gr.Dropdown(choices=['m2','m'],value='m2',show_label=False,interactive=True)
|
| 15 |
+
|
| 16 |
+
with gr.Row():
|
| 17 |
+
drpdwnType=gr.Dropdown(choices=['Area','Border','Length','Count'],value='Length',show_label=False,interactive=True)
|
| 18 |
+
drpdwnUnit=gr.Dropdown(choices=['m2','m'],value='m2',show_label=False,interactive=True)
|
| 19 |
+
elif algorithm=='Ground Beams':
|
| 20 |
+
with gr.Row():
|
| 21 |
+
drpdwnType=gr.Dropdown(choices=['Area','Border','Length','Count'],value='Area',show_label=False,interactive=True)
|
| 22 |
+
drpdwnUnit=gr.Dropdown(choices=['m2','m'],value='m2',show_label=False,interactive=True)
|
| 23 |
+
|
| 24 |
+
with gr.Row():
|
| 25 |
+
drpdwnType=gr.Dropdown(choices=['Area','Border','Length','Count'],value='Length',show_label=False,interactive=True)
|
| 26 |
+
drpdwnUnit=gr.Dropdown(choices=['m2','m'],value='m2',show_label=False,interactive=True)
|
| 27 |
+
|
| 28 |
+
with gr.Row():
|
| 29 |
+
drpdwnType=gr.Dropdown(choices=['Area','Border','Length','Count'],value='Length',show_label=False,interactive=True)
|
| 30 |
+
drpdwnUnit=gr.Dropdown(choices=['m2','m'],value='m2',show_label=False,interactive=True)
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
for i in range(len(mylist)):
|
| 34 |
+
with gr.Accordion(label='item',open=False):
|
| 35 |
+
with gr.Row():
|
| 36 |
+
label1=gr.Textbox(placeholder='Level',show_label=False)
|
| 37 |
+
label2=gr.Textbox(placeholder='Section Specification',show_label=False)
|
| 38 |
+
label3=gr.Textbox(placeholder='Depth',show_label=False)
|
| 39 |
+
|
| 40 |
+
# vals.append(label1.value)
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
return newblocks.launch()
|
| 46 |
+
|
| 47 |
+
with gr.Blocks() as mainBlock:
|
| 48 |
+
|
| 49 |
+
with gr.Column():
|
| 50 |
+
projects=gr.Dropdown(choices=['BMW job1','BMW job2','Project C'],interactive=True,label='Projects')
|
| 51 |
+
projectParts=gr.Dropdown(choices=None,interactive=True,label='Project Parts')
|
| 52 |
+
NRMsection = gr.Dropdown(choices=['foundation','external','interior'], value=None, interactive=True,label='NRM Sections')
|
| 53 |
+
|
| 54 |
+
planMeasure= gr.CheckboxGroup(label='To Measure',choices=("plan1","plan2","plan3"))
|
| 55 |
+
|
| 56 |
+
RelvDocuments= gr.CheckboxGroup(label='Relevant Documents',choices=("plan1","plan2","plan3"))
|
| 57 |
+
with gr.Row():
|
| 58 |
+
saveOutputCheckBox= gr.Checkbox(label='Save Output')
|
| 59 |
+
measureBtn=gr.Button('Measure using ADR')
|
| 60 |
+
|
| 61 |
+
addBtn= gr.Button('Add ADR Identification Box')
|
| 62 |
+
|
| 63 |
+
# with gr.Row():#(visible=False) as output_col:
|
| 64 |
+
# inpu= gr.Dataframe(label='Dictionary',interactive=True ) # row_count = (5, "fixed")
|
| 65 |
+
# btn = gr.Button("Submit Ratio")
|
| 66 |
+
# btn.click(fn=printDictionary, inputs=inpu, outputs=inpu)
|
| 67 |
+
addBtn.click(fn=addADRIB)
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
mainBlock.launch(debug=True,enable_queue=True)# debug=True,enable_queue=True
|