Skip to content

Commit 659c061

Browse files
authored
Merge pull request #657 from EOMYS-Public/Branch_Dev_A
[NF] LamSlotMagNS for uneven North/South
2 parents 8013125 + c51b8d9 commit 659c061

File tree

91 files changed

+60634
-73210
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+60634
-73210
lines changed

Tests/GUI/Dialog/DMachineSetup/NewMachine/test_new_machine_Benchmark.py

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
)
1818
from pyleecan.GUI.Dialog.DMachineSetup.SMachineType.SMachineType import SMachineType
1919
from pyleecan.GUI.Dialog.DMachineSetup.SMSlot.SMSlot import SMSlot
20+
from pyleecan.GUI.Dialog.DMachineSetup.SMSlot.WSlotMag.WSlotMag import WSlotMag
2021
from pyleecan.GUI.Dialog.DMachineSetup.SMSlot.PMSlot11.PMSlot11 import PMSlot11
2122
from pyleecan.GUI.Dialog.DMachineSetup.SSimu.SSimu import SSimu
2223
from pyleecan.GUI.Dialog.DMachineSetup.SWindCond.SWindCond import SWindCond
@@ -450,9 +451,6 @@ def test_Benchmark(self):
450451
self.widget.w_step.out_Slot_pitch.text()
451452
== "p = 5 / Slot pitch = 36 [°] (0.6283 [rad])"
452453
)
453-
assert self.widget.w_step.c_slot_type.currentText() == "Rectangular Magnet"
454-
assert self.widget.w_step.c_type_magnetization.currentText() == "Radial"
455-
assert self.widget.w_step.w_mat.c_mat_type.currentText() == "Magnet1"
456454

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

468-
wid_slot = self.widget.w_step.w_slot
466+
wid_slot_mag = self.widget.w_step.tab_slot.currentWidget()
467+
assert isinstance(wid_slot_mag, WSlotMag)
468+
assert wid_slot_mag.c_slot_type.currentText() == "Rectangular Magnet"
469+
index_polar_magnet = wid_slot_mag.c_slot_type.findText("Polar Magnet")
470+
wid_slot_mag.c_slot_type.setCurrentIndex(index_polar_magnet)
471+
472+
wid_slot = wid_slot_mag.w_slot
473+
assert isinstance(wid_slot, PMSlot11)
474+
475+
index_magnet1 = wid_slot.w_mag.w_mat.c_mat_type.findText("Magnet1")
476+
wid_slot.w_mag.w_mat.c_mat_type.setCurrentIndex(index_magnet1)
477+
478+
index_magnetization = wid_slot.w_mag.c_type_magnetization.findText("Radial")
479+
wid_slot.w_mag.c_type_magnetization.setCurrentIndex(index_magnetization)
480+
481+
assert wid_slot.w_mag.c_type_magnetization.currentText() == "Radial"
482+
483+
assert self.widget.machine.rotor.magnet.type_magnetization == 0
484+
485+
assert wid_slot.w_mag.w_mat.c_mat_type.currentText() == "Magnet1"
486+
469487
assert wid_slot.w_out.out_Wlam.text() == "Rotor width: 0.0305 [m]"
470488
assert wid_slot.w_out.out_slot_height.text() == "Slot height: ?"
471489
assert wid_slot.w_out.out_yoke_height.text() == "Yoke height: ?"
472490
assert wid_slot.w_out.out_wind_surface.text() == "Active surface: ?"
473491
assert wid_slot.w_out.out_tot_surface.text() == "Slot surface: ?"
474492
assert wid_slot.w_out.out_op_angle.text() == "Opening angle: ?"
475493

476-
index_polar_magnet = self.widget.w_step.c_slot_type.findText("Polar Magnet")
477-
self.widget.w_step.c_slot_type.setCurrentIndex(index_polar_magnet)
478-
index_magnetPrius = self.widget.w_step.w_mat.c_mat_type.findText("MagnetPrius")
479-
self.widget.w_step.w_mat.c_mat_type.setCurrentIndex(index_magnetPrius)
480-
481-
wid_slot = self.widget.w_step.w_slot
482-
assert isinstance(wid_slot, PMSlot11)
494+
index_magnetPrius = wid_slot.w_mag.w_mat.c_mat_type.findText("MagnetPrius")
495+
wid_slot.w_mag.w_mat.c_mat_type.setCurrentIndex(index_magnetPrius)
496+
assert wid_slot.w_mag.w_mat.c_mat_type.currentText() == "MagnetPrius"
497+
assert wid_slot.w_mag.c_type_magnetization.currentText() == "Radial"
483498

484499
assert wid_slot.lf_W0.value() is None
485500
assert wid_slot.lf_Wmag.value() is None

0 commit comments

Comments
 (0)