Skip to content

Commit

Permalink
Merge pull request #657 from EOMYS-Public/Branch_Dev_A
Browse files Browse the repository at this point in the history
[NF] LamSlotMagNS for uneven North/South
  • Loading branch information
BonneelP authored Oct 13, 2023
2 parents 8013125 + c51b8d9 commit 659c061
Show file tree
Hide file tree
Showing 91 changed files with 60,634 additions and 73,210 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
)
from pyleecan.GUI.Dialog.DMachineSetup.SMachineType.SMachineType import SMachineType
from pyleecan.GUI.Dialog.DMachineSetup.SMSlot.SMSlot import SMSlot
from pyleecan.GUI.Dialog.DMachineSetup.SMSlot.WSlotMag.WSlotMag import WSlotMag
from pyleecan.GUI.Dialog.DMachineSetup.SMSlot.PMSlot11.PMSlot11 import PMSlot11
from pyleecan.GUI.Dialog.DMachineSetup.SSimu.SSimu import SSimu
from pyleecan.GUI.Dialog.DMachineSetup.SWindCond.SWindCond import SWindCond
Expand Down Expand Up @@ -450,9 +451,6 @@ def test_Benchmark(self):
self.widget.w_step.out_Slot_pitch.text()
== "p = 5 / Slot pitch = 36 [°] (0.6283 [rad])"
)
assert self.widget.w_step.c_slot_type.currentText() == "Rectangular Magnet"
assert self.widget.w_step.c_type_magnetization.currentText() == "Radial"
assert self.widget.w_step.w_mat.c_mat_type.currentText() == "Magnet1"

assert self.widget.w_step.test_err_msg is None
with mock.patch(
Expand All @@ -465,21 +463,38 @@ def test_Benchmark(self):
== "Error in Rotor Slot definition:\nYou must set W0 !"
)

wid_slot = self.widget.w_step.w_slot
wid_slot_mag = self.widget.w_step.tab_slot.currentWidget()
assert isinstance(wid_slot_mag, WSlotMag)
assert wid_slot_mag.c_slot_type.currentText() == "Rectangular Magnet"
index_polar_magnet = wid_slot_mag.c_slot_type.findText("Polar Magnet")
wid_slot_mag.c_slot_type.setCurrentIndex(index_polar_magnet)

wid_slot = wid_slot_mag.w_slot
assert isinstance(wid_slot, PMSlot11)

index_magnet1 = wid_slot.w_mag.w_mat.c_mat_type.findText("Magnet1")
wid_slot.w_mag.w_mat.c_mat_type.setCurrentIndex(index_magnet1)

index_magnetization = wid_slot.w_mag.c_type_magnetization.findText("Radial")
wid_slot.w_mag.c_type_magnetization.setCurrentIndex(index_magnetization)

assert wid_slot.w_mag.c_type_magnetization.currentText() == "Radial"

assert self.widget.machine.rotor.magnet.type_magnetization == 0

assert wid_slot.w_mag.w_mat.c_mat_type.currentText() == "Magnet1"

assert wid_slot.w_out.out_Wlam.text() == "Rotor width: 0.0305 [m]"
assert wid_slot.w_out.out_slot_height.text() == "Slot height: ?"
assert wid_slot.w_out.out_yoke_height.text() == "Yoke height: ?"
assert wid_slot.w_out.out_wind_surface.text() == "Active surface: ?"
assert wid_slot.w_out.out_tot_surface.text() == "Slot surface: ?"
assert wid_slot.w_out.out_op_angle.text() == "Opening angle: ?"

index_polar_magnet = self.widget.w_step.c_slot_type.findText("Polar Magnet")
self.widget.w_step.c_slot_type.setCurrentIndex(index_polar_magnet)
index_magnetPrius = self.widget.w_step.w_mat.c_mat_type.findText("MagnetPrius")
self.widget.w_step.w_mat.c_mat_type.setCurrentIndex(index_magnetPrius)

wid_slot = self.widget.w_step.w_slot
assert isinstance(wid_slot, PMSlot11)
index_magnetPrius = wid_slot.w_mag.w_mat.c_mat_type.findText("MagnetPrius")
wid_slot.w_mag.w_mat.c_mat_type.setCurrentIndex(index_magnetPrius)
assert wid_slot.w_mag.w_mat.c_mat_type.currentText() == "MagnetPrius"
assert wid_slot.w_mag.c_type_magnetization.currentText() == "Radial"

assert wid_slot.lf_W0.value() is None
assert wid_slot.lf_Wmag.value() is None
Expand Down
Loading

0 comments on commit 659c061

Please sign in to comment.