Skip to content

Commit

Permalink
updating gui
Browse files Browse the repository at this point in the history
  • Loading branch information
seVenVo1d committed Jan 16, 2023
1 parent 9795c84 commit 338d4f8
Show file tree
Hide file tree
Showing 9 changed files with 130 additions and 91 deletions.
33 changes: 22 additions & 11 deletions screen/grtensorsGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@ def grtensors_gui(metric_tensor, coord_sys, tensor_object):
[sg.Frame(layout=[
[sg.Text('Tensor Type (p,q):', font=('Tahoma', 11)),
sg.InputCombo(tensor_type2, size=(10, 1), default_value='(0,2)')],
[sg.Image(r'logs/tensor.png', key='-TENSOR-')]], title = tensor_object, font=('Verdana', 14))],
[sg.Image(r'logs/tensor.png', key='-TENSOR-')]],
title = tensor_object, font=('Verdana', 14), expand_x=True, element_justification='center', title_location='n')],

[sg.Frame(layout=[
[sg.Text('Tensor Component:', font=('Tahoma', 11)),
sg.InputCombo(coord_sys, size = (6,1), default_value=coord_sys[0], font=('Tahoma', 11)),
sg.InputCombo(coord_sys, size = (6,1), default_value=coord_sys[0], font=('Tahoma', 11))],
[sg.Image(r'logs/tensor_component.png', key='-TENSOR-COMP-')]], title=tensor_object + ' Component', font=('Verdana', 14))],
[sg.Image(r'logs/tensor_component.png', key='-TENSOR-COMP-')]],
title=tensor_object + ' Component', font=('Verdana', 14), expand_x=True, element_justification='center', title_location='n')],

[sg.Submit(button_color='blue')]
]
Expand All @@ -80,13 +82,15 @@ def grtensors_gui(metric_tensor, coord_sys, tensor_object):
elif tensor_object == 'Inverse Metric Tensor':
layout_tensor_type = [
[sg.Frame(layout=[
[sg.Image(r'logs/tensor.png')]], title='Inverse Metric Tensor', font=('Verdana', 14))],
[sg.Image(r'logs/tensor.png')]],
title='Inverse Metric Tensor', font=('Verdana', 14), expand_x=True, element_justification='center', title_location='n')],

[sg.Frame(layout=[
[sg.Text('Tensor Component:', font=('Tahoma', 11)),
sg.InputCombo(coord_sys, size = (6,1), default_value=coord_sys[0], font=('Tahoma', 11)),
sg.InputCombo(coord_sys, size = (6,1), default_value=coord_sys[0], font=('Tahoma', 11))],
[sg.Image(r'logs/tensor_component.png', key='-TENSOR-COMP-')]], title='Inverse Metric Tensor Component', font=('Verdana', 14))],
[sg.Image(r'logs/tensor_component.png', key='-TENSOR-COMP-')]],
title='Inverse Metric Tensor Component', font=('Verdana', 14), expand_x=True, element_justification='center', title_location='n')],

[sg.Submit(button_color='blue')]
]
Expand All @@ -108,14 +112,16 @@ def grtensors_gui(metric_tensor, coord_sys, tensor_object):
[sg.Frame(layout=[
[sg.Text('Type (p,q):', font=('Tahoma', 11)),
sg.InputCombo(tensor_type3, size=(10, 1), default_value='(1,2)', font=('Tahoma', 11))],
[sg.Image(r'logs/tensor.png', key='-TENSOR-')]], title='Christoffel Symbol', font=('Verdana', 14))],
[sg.Image(r'logs/tensor.png', key='-TENSOR-')]],
title='Christoffel Symbol', font=('Verdana', 14), expand_x=True, element_justification='center', title_location='n')],

[sg.Frame(layout = [
[sg.Text('Component:', font=('Tahoma', 11)),
sg.InputCombo(coord_sys, size = (6,1), default_value=coord_sys[0], font=('Tahoma', 11)),
sg.InputCombo(coord_sys, size = (6,1), default_value=coord_sys[0], font=('Tahoma', 11)),
sg.InputCombo(coord_sys, size = (6,1), default_value=coord_sys[0], font=('Tahoma', 11))],
[sg.Image(r'logs/tensor_component.png', key='-TENSOR-COMP-')]], title='Christoffel Symbol Component', font=('Verdana', 14))],
[sg.Image(r'logs/tensor_component.png', key='-TENSOR-COMP-')]],
title='Christoffel Symbol Component', font=('Verdana', 14), expand_x=True, element_justification='center', title_location='n')],

[sg.Submit(button_color='blue')]
]
Expand Down Expand Up @@ -143,15 +149,17 @@ def grtensors_gui(metric_tensor, coord_sys, tensor_object):
[sg.Frame(layout=[
[sg.Text('Tensor Type (p,q):', font=('Tahoma', 11)),
sg.InputCombo(tensor_type4, size=(10, 1), default_value='(1,3)', font=('Tahoma', 11))],
[sg.Image(r'logs/tensor.png', key='-TENSOR-')]], title = 'Riemann Tensor', font=('Verdana', 14))],
[sg.Image(r'logs/tensor.png', key='-TENSOR-')]],
title = 'Riemann Tensor', font=('Verdana', 14), expand_x=True, element_justification='center', title_location='n')],

[sg.Frame(layout = [
[sg.Text('Tensor Component:', font=('Tahoma', 11)),
sg.InputCombo(coord_sys, size = (6,1), default_value=coord_sys[0], font=('Tahoma', 11)),
sg.InputCombo(coord_sys, size = (6,1), default_value=coord_sys[0], font=('Tahoma', 11)),
sg.InputCombo(coord_sys, size = (6,1), default_value=coord_sys[0], font=('Tahoma', 11)),
sg.InputCombo(coord_sys, size = (6,1), default_value=coord_sys[0], font=('Tahoma', 11))],
[sg.Image(r'logs/tensor_component.png', key='-TENSOR-COMP-')]], title='Riemann Tensor Component', font=('Verdana', 14))],
[sg.Image(r'logs/tensor_component.png', key='-TENSOR-COMP-')]],
title='Riemann Tensor Component', font=('Verdana', 14), expand_x=True, element_justification='center', title_location='n')],

[sg.Submit(button_color='blue')]
]
Expand Down Expand Up @@ -179,15 +187,17 @@ def grtensors_gui(metric_tensor, coord_sys, tensor_object):
[sg.Frame(layout=[
[sg.Text('Tensor Type (p,q):', font=('Tahoma', 11)),
sg.InputCombo(tensor_type4, size=(10, 1), default_value='(0,4)', font=('Tahoma', 11))],
[sg.Image(r'logs/tensor.png', key='-TENSOR-')]], title='Weyl Tensor', font=('Verdana', 14))],
[sg.Image(r'logs/tensor.png', key='-TENSOR-')]],
title='Weyl Tensor', font=('Verdana', 14), expand_x=True, element_justification='center', title_location='n')],

[sg.Frame(layout=[
[sg.Text('Tensor Component:', font=('Tahoma', 11)),
sg.InputCombo(coord_sys, size = (6,1), default_value=coord_sys[0], font=('Tahoma', 11)),
sg.InputCombo(coord_sys, size = (6,1), default_value=coord_sys[0], font=('Tahoma', 11)),
sg.InputCombo(coord_sys, size = (6,1), default_value=coord_sys[0], font=('Tahoma', 11)),
sg.InputCombo(coord_sys, size = (6,1), default_value=coord_sys[0], font=('Tahoma', 11))],
[sg.Image(r'logs/tensor_component.png', key='-TENSOR-COMP-')]], title='Weyl Tensor Component', font=('Verdana', 14))],
[sg.Image(r'logs/tensor_component.png', key='-TENSOR-COMP-')]],
title='Weyl Tensor Component', font=('Verdana', 14), expand_x=True, element_justification='center', title_location='n')],

[sg.Submit(button_color='blue')]
]
Expand All @@ -212,7 +222,8 @@ def grtensors_gui(metric_tensor, coord_sys, tensor_object):

elif tensor_object in scalar_objects:
layout_tensor_type = [
[sg.Frame(layout=[[sg.Image(r'logs/tensor.png', key='-TENSOR-')]], title=tensor_object, font=('Verdana', 14))]
[sg.Frame(layout=[[sg.Image(r'logs/tensor.png', key='-TENSOR-')]],
title=tensor_object, font=('Verdana', 14), expand_x=True, element_justification='center', title_location='n')]
]
window_tensor_type = sg.Window('GRPy', layout_tensor_type)
while True:
Expand Down
44 changes: 24 additions & 20 deletions screen/screen3D/mainpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,46 +44,46 @@ def grpy_3d(coordinate_type='Spherical Coordinates'):
new_coord_sys = new_coordinate[1] # the new coordinate system that accompanies the metric tensor

GRTensors_col1 = [
[sg.Button('Metric Tensor', button_color='purple'),
[sg.Button('Metric Tensor', button_color='purple', size=(20, 1)),
sg.Image(r'res/images3D/metrictensor.png')],
[sg.Button('Inverse Metric Tensor', button_color='purple'),
[sg.Button('Inverse Metric Tensor', button_color='purple', size=(20, 1)),
sg.Image(r'res/images3D/inversemetrictensor.png')],
[sg.Button('Christoffel Symbol', button_color='purple'),
[sg.Button('Christoffel Symbol', button_color='purple', size=(20, 1)),
sg.Image(r'res/images3D/chrissymbol.png')],
[sg.Button('Riemann Tensor', button_color='purple'),
[sg.Button('Riemann Tensor', button_color='purple', size=(20, 1)),
sg.Image(r'res/images3D/riemanntensor.png')],
[sg.Button('Ricci Tensor', button_color='purple'),
[sg.Button('Ricci Tensor', button_color='purple', size=(20, 1)),
sg.Image(r'res/images3D/riccitensor.png')]
]

GRTensors_col2 = [
[sg.Button('Ricci Scalar', button_color='purple'),
[sg.Button('Ricci Scalar', button_color='purple', size=(20, 1)),
sg.Image(r'res/images3D/ricciscalar.png')],
[sg.Button('Weyl Tensor', button_color='purple'),
[sg.Button('Weyl Tensor', button_color='purple', size=(20, 1)),
sg.Image(r'res/images3D/weyltensor.png')],
[sg.Button('Traceless Ricci Tensor', button_color='purple'),
[sg.Button('Traceless Ricci Tensor', button_color='purple', size=(20, 1)),
sg.Image(r'res/images3D/tracelessriccitensor.png')],
[sg.Button('Einstein Tensor', button_color='purple'),
[sg.Button('Einstein Tensor', button_color='purple', size=(20, 1)),
sg.Image(r'res/images3D/einsteintensor.png')],
[sg.Button('Kretschmann Scalar', button_color='purple'),
[sg.Button('Kretschmann Scalar', button_color='purple', size=(20, 1)),
sg.Image(r'res/images3D/kretschmannscalar.png')]
]

Fields_col1 = [
[sg.Button('Scalar Field', button_color='purple'),
[sg.Button('Scalar Field', button_color='purple', size=(20, 1)),
sg.Image(r'res/images3D/scalarfield.png')],
[sg.Button('Type (1,0) Vector Field', button_color='purple'),
[sg.Button('Type (1,0) Vector Field', button_color='purple', size=(20, 1)),
sg.Image(r'res/images3D/vectorfield_10.png')],
[sg.Button('Type (0,1) Vector Field', button_color='purple'),
[sg.Button('Type (0,1) Vector Field', button_color='purple', size=(20, 1)),
sg.Image(r'res/images3D/vectorfield_01.png')]
]

Fields_col2 = [
[sg.Button('Type (2,0) Tensor Field', button_color='purple'),
[sg.Button('Type (2,0) Tensor Field', button_color='purple', size=(20, 1)),
sg.Image(r'res/images3D/tensorfield_20.png')],
[sg.Button('Type (1,1) Tensor Field', button_color='purple'),
[sg.Button('Type (1,1) Tensor Field', button_color='purple', size=(20, 1)),
sg.Image(r'res/images3D/tensorfield_11.png')],
[sg.Button('Type (0,2) Tensor Field', button_color='purple'),
[sg.Button('Type (0,2) Tensor Field', button_color='purple', size=(20, 1)),
sg.Image(r'res/images3D/tensorfield_02.png')]
]

Expand All @@ -100,15 +100,17 @@ def grpy_3d(coordinate_type='Spherical Coordinates'):
layout_4dim = [
[sg.Frame(layout=[
[sg.InputCombo(available_coord_sys, default_value=coordinate_type, font=('Tahoma', 11)),
sg.Button('Change Coordinate System', button_color='blue')]], title='Predefined Coordinates', font=('Georgia', 14))],
sg.Button('Change Coordinate System', button_color='blue')]],
title='Predefined Coordinates', font=('Georgia', 14), expand_x=True, element_justification='center', title_location='n')],

[sg.Frame(layout=[
[sg.Image(r'res/images3D/x0.png'),
sg.InputCombo(coordinate_symbols, size=(6, 1), default_value=new_coord_sys[0], font=('Tahoma', 11)),
sg.Image(r'res/images3D/x1.png'),
sg.InputCombo(coordinate_symbols, size=(6, 1), default_value=new_coord_sys[1], font=('Tahoma', 11)),
sg.Image(r'res/images3D/x2.png'),
sg.InputCombo(coordinate_symbols, size=(6, 1), default_value=new_coord_sys[2], font=('Tahoma', 11))]], title='Coordinate System', font=('Georgia', 14))],
sg.InputCombo(coordinate_symbols, size=(6, 1), default_value=new_coord_sys[2], font=('Tahoma', 11))]],
title='Coordinate System', font=('Georgia', 14), expand_x=True, element_justification='center', title_location='n')],

[sg.Frame(layout = [
[sg.Image(r'res/images3D/g0b.png'),
Expand All @@ -122,12 +124,14 @@ def grpy_3d(coordinate_type='Spherical Coordinates'):
[sg.Image(r'res/images3D/g2b.png'),
sg.InputText(default_text=new_metric_tensor[2][0], size=(15, 1), font=('Tahoma', 11)),
sg.InputText(default_text=new_metric_tensor[2][1], size=(15, 1), font=('Tahoma', 11)),
sg.InputText(default_text=new_metric_tensor[2][2], size=(15, 1), font=('Tahoma', 11))],], title='Metric Tensor', font=('Georgia', 14))],
sg.InputText(default_text=new_metric_tensor[2][2], size=(15, 1), font=('Tahoma', 11))],],
title='Metric Tensor', font=('Georgia', 14), expand_x=True, element_justification='center', title_location='n')],

[sg.Frame(layout=[
[sg.TabGroup([
[sg.Tab('GR Tensors', GRTensors_tab, font=('Georgia', 12)),
sg.Tab('Fields', Fields_tab, font=('Georgia', 12))]])]], title = 'Operations', font=('Georgia', 14))],
sg.Tab('Fields', Fields_tab, font=('Georgia', 12))]])]],
title = 'Operations', font=('Georgia', 14), expand_x=True, element_justification='center', title_location='n')],
[sg.Exit(button_color='red')]
]
window_3dim = sg.Window('GRPy', layout_4dim)
Expand Down
7 changes: 4 additions & 3 deletions screen/screen3D/scalarfieldGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def scalarfield_gui3d(coord_sys):
sg.Image(r'res/images3D/cov_scalarfield.png'),
sg.Text('for', font=('Verdana', 11)),
sg.Image(r'res/images3D/e.png'),
sg.InputCombo(coord_sys, default_value=coord_sys[0])
]], title='Covariant Derivative', font=('Verdana', 12))],
sg.InputCombo(coord_sys, default_value=coord_sys[0])]],
title='Covariant Derivative', font=('Verdana', 12), expand_x=True, element_justification='center', title_location='n')],

[sg.Frame(layout=[
[sg.Image(r'res/images3D/LX0.png'),
Expand All @@ -33,7 +33,8 @@ def scalarfield_gui3d(coord_sys):
[sg.Image(r'res/images3D/LX2.png'),
sg.InputText(default_text='0', font=('Tahoma', 11))],
[sg.Button('Calculate', button_color='purple'),
sg.Image(r'res/images3D/LX_scalarfield.png')]], title='Lie Derivative', font=('Verdana', 12))]
sg.Image(r'res/images3D/LX_scalarfield.png')]],
title='Lie Derivative', font=('Verdana', 12), expand_x=True, element_justification='center', title_location='n')]
]
windows_scalar_field = sg.Window('Scalar Field', scalar_field_layout)
while True:
Expand Down
Loading

0 comments on commit 338d4f8

Please sign in to comment.