don770omr commited on
Commit
4c3237e
·
verified ·
1 Parent(s): 9ec7c02

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +42 -40
app.py CHANGED
@@ -56,70 +56,36 @@ for i in range(num_items):
56
  frac_w = st.selectbox('', lst_frac, key=f"frac_width_{i}")
57
  width += float(Fraction(frac_w))
58
 
59
- col22, col25, col27 = st.columns([2, 2, 2])
60
- reduction_h_glass = object_item_value['glass'][option]['height']
61
- reduction_w_glass = object_item_value['glass'][option]['width']
62
- divider_w_glass = object_item_value['divider'][option]['width']
63
- divider_h_glass = object_item_value['divider'][option]['height']
64
  # Input fields for dimensions (width and height)
65
- with col22:
66
- col221, col222 = st.columns([2, 2])
67
- with col221:
68
- reduction_h_glass_new_num = st.number_input(f'Height Reduction', key=f"reduction_h_g_n_{i}", min_value=0, value=int(reduction_h_glass), step=1)
69
- with col222:
70
- reduction_h_glass_new_frac = st.selectbox(f'Glass (Item {i+1}):', lst_frac, key=f"reduction_h_g_f_{i}")
71
- reduction_h_glass_new = reduction_h_glass_new_num + float(Fraction(reduction_h_glass_new_frac))
72
-
73
- with col25:
74
- col251, col252 = st.columns([2, 2])
75
- with col251:
76
- reduction_w_glass_new_num = st.number_input(f'Width Reduction', key=f"reduction_w_g_n_{i}", min_value=0, value=int(reduction_w_glass), step=1)
77
- with col252:
78
- reduction_w_glass_new_frac = st.selectbox(f'Glass (Item {i+1}):', lst_frac, key=f"reduction_w_g_f_{i}")
79
- reduction_w_glass_new = reduction_w_glass_new_num + float(Fraction(reduction_w_glass_new_frac))
80
-
81
- with col27:
82
- col271, col272 = st.columns([2, 2])
83
- with col271:
84
- divider_w_glass_new_num = st.number_input(f'Divider Reduct ', key=f"divider_w_g_n_{i}", min_value=0, value=int(divider_w_glass), step=1)
85
- with col272:
86
- divider_w_glass_new_frac = st.selectbox(f'Glass (Item {i+1}):', lst_frac, key=f"divider_w_g_f_{i}")
87
- divider_w_glass_new = divider_w_glass_new_num + float(Fraction(divider_w_glass_new_frac))
88
-
89
- object_item_value['glass'][option]['height'] = reduction_h_glass_new
90
- object_item_value['glass'][option]['width'] = reduction_w_glass_new
91
- object_item_value['divider'][option]['width'] = divider_w_glass_new
92
-
93
  col23, col26,col29 = st.columns([2, 2, 2])
94
  reduction_h_shttr = object_item_value['shutter'][option]['height']
95
  reduction_w_shttr = object_item_value['shutter'][option]['width']
96
  divider_h_shttr = object_item_value['divider'][option]['height']
97
  divider_w_shttr = object_item_value['divider'][option]['width']
98
 
99
- # Input fields for dimensions (width and height)
100
  with col23:
101
  col231, col232 = st.columns([2, 2])
102
  with col231:
103
- reduction_h_shttr_new_num = st.number_input(f'Height Reduction', key=f"reduction_h_shttr_n_{i}", min_value=0, value=int(reduction_h_glass), step=1)
104
  with col232:
105
- reduction_h_shttr_new_frac = st.selectbox(f'Shutter (Item {i+1}):', lst_frac, key=f"reduction_h_shttr_f_{i}")
106
  reduction_h_shttr_new = reduction_h_shttr_new_num + float(Fraction(reduction_h_shttr_new_frac))
107
 
108
  with col26:
109
  col261, col262 = st.columns([2, 2])
110
  with col261:
111
- reduction_w_shttr_new_num = st.number_input(f'Width Reduction', key=f"reduction_w_shttr_n_{i}", min_value=0, value=int(reduction_w_glass), step=1)
112
  with col262:
113
- reduction_w_shttr_new_frac = st.selectbox(f'Shutter (Item {i+1}):', lst_frac, key=f"reduction_w_shttr_f_{i}")
114
  reduction_w_shttr_new = reduction_w_shttr_new_num + float(Fraction(reduction_w_shttr_new_frac))
115
 
116
  with col29:
117
  col291, col292 = st.columns([2, 2])
118
  with col291:
119
- divider_w_shttr_new_num = st.number_input(f'Divider Reduct', key=f"divider_w_shttr_n_{i}", min_value=0, value=int(divider_w_glass), step=1)
120
  #divider_h_shttr_new_num = st.number_input(f'Divider Reduction for Shutter (Item {i+1})', key=f"divider_h_shttr_n_{i}", min_value=0, value=int(divider_h_shttr), step=1)
121
  with col292:
122
- divider_w_shttr_new_frac = st.selectbox(f'Shutter (Item {i+1}:)', lst_frac, key=f"divider_w_shttr_f_{i}")
123
  #divider_h_shttr_new_frac = st.selectbox('', lst_frac, key=f"divider_h_shttr_f_{i}")
124
  divider_w_shttr_new = divider_w_shttr_new_num + float(Fraction(divider_w_shttr_new_frac))
125
  #divider_h_shttr_new = divider_h_shttr_new_num + float(Fraction(divider_h_shttr_new_frac))
@@ -132,6 +98,42 @@ for i in range(num_items):
132
  #object_item_value['divider'][option]['height'] = divider_h_shttr_new
133
 
134
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  # Prepare the results table with the new structure
136
  results = {
137
  'Outer Frame': [],
 
56
  frac_w = st.selectbox('', lst_frac, key=f"frac_width_{i}")
57
  width += float(Fraction(frac_w))
58
 
 
 
 
 
 
59
  # Input fields for dimensions (width and height)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  col23, col26,col29 = st.columns([2, 2, 2])
61
  reduction_h_shttr = object_item_value['shutter'][option]['height']
62
  reduction_w_shttr = object_item_value['shutter'][option]['width']
63
  divider_h_shttr = object_item_value['divider'][option]['height']
64
  divider_w_shttr = object_item_value['divider'][option]['width']
65
 
 
66
  with col23:
67
  col231, col232 = st.columns([2, 2])
68
  with col231:
69
+ reduction_h_shttr_new_num = st.number_input(f'H.Reduct Shutter (Item {i+1}):', key=f"reduction_h_shttr_n_{i}", min_value=0, value=int(reduction_h_glass), step=1)
70
  with col232:
71
+ reduction_h_shttr_new_frac = st.selectbox(f'', lst_frac, key=f"reduction_h_shttr_f_{i}")
72
  reduction_h_shttr_new = reduction_h_shttr_new_num + float(Fraction(reduction_h_shttr_new_frac))
73
 
74
  with col26:
75
  col261, col262 = st.columns([2, 2])
76
  with col261:
77
+ reduction_w_shttr_new_num = st.number_input(f'W.Reduct Shutter (Item {i+1}):', key=f"reduction_w_shttr_n_{i}", min_value=0, value=int(reduction_w_glass), step=1)
78
  with col262:
79
+ reduction_w_shttr_new_frac = st.selectbox(f'', lst_frac, key=f"reduction_w_shttr_f_{i}")
80
  reduction_w_shttr_new = reduction_w_shttr_new_num + float(Fraction(reduction_w_shttr_new_frac))
81
 
82
  with col29:
83
  col291, col292 = st.columns([2, 2])
84
  with col291:
85
+ divider_w_shttr_new_num = st.number_input(f'Div.Reduct Shutter (Item {i+1}:)', key=f"divider_w_shttr_n_{i}", min_value=0, value=int(divider_w_glass), step=1)
86
  #divider_h_shttr_new_num = st.number_input(f'Divider Reduction for Shutter (Item {i+1})', key=f"divider_h_shttr_n_{i}", min_value=0, value=int(divider_h_shttr), step=1)
87
  with col292:
88
+ divider_w_shttr_new_frac = st.selectbox(f'', lst_frac, key=f"divider_w_shttr_f_{i}")
89
  #divider_h_shttr_new_frac = st.selectbox('', lst_frac, key=f"divider_h_shttr_f_{i}")
90
  divider_w_shttr_new = divider_w_shttr_new_num + float(Fraction(divider_w_shttr_new_frac))
91
  #divider_h_shttr_new = divider_h_shttr_new_num + float(Fraction(divider_h_shttr_new_frac))
 
98
  #object_item_value['divider'][option]['height'] = divider_h_shttr_new
99
 
100
 
101
+
102
+ col22, col25, col27 = st.columns([2, 2, 2])
103
+ reduction_h_glass = object_item_value['glass'][option]['height']
104
+ reduction_w_glass = object_item_value['glass'][option]['width']
105
+ divider_w_glass = object_item_value['divider'][option]['width']
106
+ divider_h_glass = object_item_value['divider'][option]['height']
107
+ # Input fields for dimensions (width and height)
108
+ with col22:
109
+ col221, col222 = st.columns([2, 2])
110
+ with col221:
111
+ reduction_h_glass_new_num = st.number_input(f'H.Reduct Glass (Item {i+1}):', key=f"reduction_h_g_n_{i}", min_value=0, value=int(reduction_h_glass), step=1)
112
+ with col222:
113
+ reduction_h_glass_new_frac = st.selectbox(f'', lst_frac, key=f"reduction_h_g_f_{i}")
114
+ reduction_h_glass_new = reduction_h_glass_new_num + float(Fraction(reduction_h_glass_new_frac))
115
+
116
+ with col25:
117
+ col251, col252 = st.columns([2, 2])
118
+ with col251:
119
+ reduction_w_glass_new_num = st.number_input(f'W.Reduct Glass (Item {i+1}):', key=f"reduction_w_g_n_{i}", min_value=0, value=int(reduction_w_glass), step=1)
120
+ with col252:
121
+ reduction_w_glass_new_frac = st.selectbox(f'', lst_frac, key=f"reduction_w_g_f_{i}")
122
+ reduction_w_glass_new = reduction_w_glass_new_num + float(Fraction(reduction_w_glass_new_frac))
123
+
124
+ with col27:
125
+ col271, col272 = st.columns([2, 2])
126
+ with col271:
127
+ divider_w_glass_new_num = st.number_input(f'Div.Reduct Glass (Item {i+1}):', key=f"divider_w_g_n_{i}", min_value=0, value=int(divider_w_glass), step=1)
128
+ with col272:
129
+ divider_w_glass_new_frac = st.selectbox(f'', lst_frac, key=f"divider_w_g_f_{i}")
130
+ divider_w_glass_new = divider_w_glass_new_num + float(Fraction(divider_w_glass_new_frac))
131
+
132
+ object_item_value['glass'][option]['height'] = reduction_h_glass_new
133
+ object_item_value['glass'][option]['width'] = reduction_w_glass_new
134
+ object_item_value['divider'][option]['width'] = divider_w_glass_new
135
+
136
+
137
  # Prepare the results table with the new structure
138
  results = {
139
  'Outer Frame': [],