17
17
)
18
18
from pyleecan .GUI .Dialog .DMachineSetup .SMachineType .SMachineType import SMachineType
19
19
from pyleecan .GUI .Dialog .DMachineSetup .SMSlot .SMSlot import SMSlot
20
+ from pyleecan .GUI .Dialog .DMachineSetup .SMSlot .WSlotMag .WSlotMag import WSlotMag
20
21
from pyleecan .GUI .Dialog .DMachineSetup .SMSlot .PMSlot11 .PMSlot11 import PMSlot11
21
22
from pyleecan .GUI .Dialog .DMachineSetup .SSimu .SSimu import SSimu
22
23
from pyleecan .GUI .Dialog .DMachineSetup .SWindCond .SWindCond import SWindCond
@@ -450,9 +451,6 @@ def test_Benchmark(self):
450
451
self .widget .w_step .out_Slot_pitch .text ()
451
452
== "p = 5 / Slot pitch = 36 [°] (0.6283 [rad])"
452
453
)
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"
456
454
457
455
assert self .widget .w_step .test_err_msg is None
458
456
with mock .patch (
@@ -465,21 +463,38 @@ def test_Benchmark(self):
465
463
== "Error in Rotor Slot definition:\n You must set W0 !"
466
464
)
467
465
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
+
469
487
assert wid_slot .w_out .out_Wlam .text () == "Rotor width: 0.0305 [m]"
470
488
assert wid_slot .w_out .out_slot_height .text () == "Slot height: ?"
471
489
assert wid_slot .w_out .out_yoke_height .text () == "Yoke height: ?"
472
490
assert wid_slot .w_out .out_wind_surface .text () == "Active surface: ?"
473
491
assert wid_slot .w_out .out_tot_surface .text () == "Slot surface: ?"
474
492
assert wid_slot .w_out .out_op_angle .text () == "Opening angle: ?"
475
493
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"
483
498
484
499
assert wid_slot .lf_W0 .value () is None
485
500
assert wid_slot .lf_Wmag .value () is None
0 commit comments