-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui.py
41 lines (37 loc) · 1.01 KB
/
gui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import eel
from solver import TISE
eel.init('web')
@eel.expose
def run(params):
try:
x_min = float(params['x_min'])
x_max = float(params['x_max'])
n_point = int(params['n_points'])
n_sol = int(params['n_solutions'])
e_min = float(params['e_min'])
e_max = float(params['e_max'])
de = float(params['e_step'])
const_b = float(params['B'])
potential = int(params['variant'])
tise = TISE(
x_min=x_min,
x_max=x_max,
n_point=n_point,
n_sol=n_sol,
e_min=e_min,
e_max=e_max,
de=de,
const_b=const_b,
potential=potential
)
out_number = tise.solve()
if out_number != 0:
eel.show_message(out_number)
tise.plot_solutions()
else:
eel.show_message(out_number)
except IndexError:
eel.show_message(-1)
except ValueError:
eel.show_message(-2)
eel.start('index.html')