xp3857 commited on
Commit
c9678ad
1 Parent(s): e925386

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -3
app.py CHANGED
@@ -57,6 +57,19 @@ t_out = ("""
57
 
58
  }
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  .popup{
61
  background-color: #ffffff;
62
  width: 420px;
@@ -143,7 +156,9 @@ def ac():
143
  ti = time.time()
144
  if ti > ts and stamp != 0:
145
  print("Cancelling")
146
- return gr.update(value=1),gr.HTML.update(f"{t_out}", visible=True)
 
 
147
  else:
148
  print("Passing")
149
  return gr.update(value=0),None
@@ -175,12 +190,20 @@ def ac():
175
  h=gr.Textbox(value="V")
176
  t_state=gr.Number()
177
  t_switch=gr.Textbox(value=0)
178
-
 
 
 
 
 
 
 
 
179
  fac_b = gr.Textbox(value="",visible=False)
180
  btn1.click(cl_fac,None,fac_b)
181
 
182
  b1=btn1.click(start,None,[t_state,t_switch])
183
- sta = t_state.change(end,t_state,[t_switch,message],every=1)
184
 
185
  b2=btn1.click(im_fn,[put,fac_b,h],[out1,fac_b])
186
  b3=out1.change(im_fn,[put,fac_b,h],[out2,fac_b])
 
57
 
58
  }
59
 
60
+ #restart_btn{
61
+ position: fixed;
62
+ width: 100%;
63
+ height: 100%;
64
+ top: 0px;
65
+ left: 0px;
66
+ z-index:19999;
67
+ background: #ff000059;
68
+ }
69
+
70
+
71
+
72
+
73
  .popup{
74
  background-color: #ffffff;
75
  width: 420px;
 
156
  ti = time.time()
157
  if ti > ts and stamp != 0:
158
  print("Cancelling")
159
+ #return gr.update(value=1),gr.HTML.update(f"{t_out}", visible=True)
160
+ return gr.update(value=1),gr.Button.update(elem_id="restart_btn", visible=True)
161
+
162
  else:
163
  print("Passing")
164
  return gr.update(value=0),None
 
190
  h=gr.Textbox(value="V")
191
  t_state=gr.Number()
192
  t_switch=gr.Textbox(value=0)
193
+ restart = gr.Button(visible=False)
194
+
195
+ def un_btn():
196
+ return gr.Button.update(elem_id="blank", visible=False)
197
+
198
+
199
+ restart.click(un_btn, None, restart)
200
+
201
+
202
  fac_b = gr.Textbox(value="",visible=False)
203
  btn1.click(cl_fac,None,fac_b)
204
 
205
  b1=btn1.click(start,None,[t_state,t_switch])
206
+ sta = t_state.change(end,t_state,[t_switch,restart],every=1)
207
 
208
  b2=btn1.click(im_fn,[put,fac_b,h],[out1,fac_b])
209
  b3=out1.change(im_fn,[put,fac_b,h],[out2,fac_b])