Minor Update
This commit is contained in:
parent
b15d3c5192
commit
96d6cbd125
13
src/main.py
13
src/main.py
@ -1,15 +1,18 @@
|
|||||||
# main.py
|
# main.py
|
||||||
|
|
||||||
|
import sys
|
||||||
|
sys.path.append("C:\\Users\\promerogomb\\Desktop\\Proyectos UNAV\\LaunchSim\\src")
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
from tkinter import ttk
|
from tkinter import ttk
|
||||||
|
|
||||||
# Importamos las distintas pestañas
|
# Importamos las distintas pestañas
|
||||||
from src.tabs.tab_simulator import TabSimulator
|
from tabs.tab_simulator import TabSimulator
|
||||||
from src.tabs.tab_search import TabSearch
|
from tabs.tab_search import TabSearch
|
||||||
from src.tabs.tab_drag import TabDrag
|
from tabs.tab_drag import TabDrag
|
||||||
from src.tabs.tab_coil import TabCoil
|
from tabs.tab_coil import TabCoil
|
||||||
from src.tabs.tab_electrical import TabElectrical
|
from tabs.tab_electrical import TabElectrical
|
||||||
|
|
||||||
class MainApp:
|
class MainApp:
|
||||||
def __init__(self, master):
|
def __init__(self, master):
|
||||||
|
@ -9,9 +9,11 @@ import matplotlib.pyplot as plt
|
|||||||
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
|
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import math as m
|
||||||
|
import decimal as dec
|
||||||
|
|
||||||
# Importamos la función para dibujar la bobina 2D
|
# Importamos la función para dibujar la bobina 2D
|
||||||
from src.tabs.geometry_viewer import plot_coil_in_frame
|
from tabs.geometry_viewer import plot_coil_in_frame
|
||||||
|
|
||||||
class TabCoil:
|
class TabCoil:
|
||||||
def __init__(self, notebook, tab_simulator):
|
def __init__(self, notebook, tab_simulator):
|
||||||
@ -48,12 +50,18 @@ class TabCoil:
|
|||||||
tk.Label(frame_left, text="Parámetros de la Bobina:").pack(anchor="w")
|
tk.Label(frame_left, text="Parámetros de la Bobina:").pack(anchor="w")
|
||||||
|
|
||||||
# Variables
|
# Variables
|
||||||
self.var_N = tk.IntVar(value=500)
|
self.var_N = tk.DoubleVar(value=500)
|
||||||
self.var_e_pvc = tk.DoubleVar(value=4.04)
|
self.var_e_pvc = tk.DoubleVar(value=4.04)
|
||||||
self.var_r_int = tk.DoubleVar(value=12.07)
|
self.var_r_int = tk.DoubleVar(value=12.07)
|
||||||
self.var_r_ext = tk.DoubleVar(value=21.27)
|
self.var_r_ext = tk.DoubleVar(value=21.27)
|
||||||
self.var_h_c = tk.DoubleVar(value=53.12)
|
self.var_h_c = tk.DoubleVar(value=53.12)
|
||||||
self.var_d_cu = tk.DoubleVar(value=0.8)
|
self.var_d_cu = tk.DoubleVar(value=0.8)
|
||||||
|
|
||||||
|
mu_0 = 4 * m.pi * 1e-7
|
||||||
|
mu_r = 1
|
||||||
|
|
||||||
|
inductance = (self.var_N.get()**2 * mu_0 * mu_r * (2 * m.pi * (self.var_r_ext.get() * 1e-3)**2)) / (self.var_h_c.get() * 1e-3)
|
||||||
|
self.var_L = tk.DoubleVar(value=inductance)
|
||||||
|
|
||||||
# Frame para agrupar los Entries
|
# Frame para agrupar los Entries
|
||||||
self.frame_params = tk.Frame(frame_left, bd=1, relief="sunken")
|
self.frame_params = tk.Frame(frame_left, bd=1, relief="sunken")
|
||||||
@ -74,6 +82,7 @@ class TabCoil:
|
|||||||
add_param_row("r_ext (mm):", self.var_r_ext, rowcount); rowcount += 1
|
add_param_row("r_ext (mm):", self.var_r_ext, rowcount); rowcount += 1
|
||||||
add_param_row("h_c (mm):", self.var_h_c, rowcount); rowcount += 1
|
add_param_row("h_c (mm):", self.var_h_c, rowcount); rowcount += 1
|
||||||
add_param_row("d_cu (mm):", self.var_d_cu, rowcount); rowcount += 1
|
add_param_row("d_cu (mm):", self.var_d_cu, rowcount); rowcount += 1
|
||||||
|
add_param_row("L (H):", self.var_L, rowcount); rowcount += 1
|
||||||
|
|
||||||
# Botón para actualizar la vista 2D
|
# Botón para actualizar la vista 2D
|
||||||
btn_refrescar = tk.Button(
|
btn_refrescar = tk.Button(
|
||||||
|
Loading…
Reference in New Issue
Block a user