24
24
"HFSS" : [
25
25
"Modal Solution Data" ,
26
26
"Terminal Solution Data" ,
27
- "EigenMode Parameters" ,
27
+ "Eigenmode Parameters" ,
28
28
"Fields" ,
29
29
"Far Fields" ,
30
30
"Emissions" ,
55
55
"Icepak" : ["Monitor" , "Fields" ],
56
56
"Circuit Design" : ["Standard" , "Eye Diagram" , "Spectrum" ],
57
57
"HFSS 3D Layout" : ["Standard" , "Fields" , "Spectrum" ],
58
+ "HFSS 3D Layout Design" : ["Standard" , "Fields" , "Spectrum" ],
58
59
"Mechanical" : ["Standard" , "Fields" ],
59
60
"Q3D Extractor" : ["Matrix" , "CG Fields" , "DC R/L Fields" , "AC R/L Fields" ],
60
61
"2D Extractor" : ["Matrix" , "CG Fields" , "RL Fields" ],
73
74
"Far Fields" : rt .FarField ,
74
75
"Near Fields" : rt .NearField ,
75
76
"Eye Diagram" : rt .EyeDiagram ,
76
- "EigenMode Parameters" : rt .Standard ,
77
+ "Eigenmode Parameters" : rt .Standard ,
77
78
"Spectrum" : rt .Spectral ,
78
79
}
79
80
@@ -481,8 +482,8 @@ def eigenmode(self, expressions=None, setup_name=None):
481
482
"""
482
483
if not setup_name :
483
484
setup_name = self ._post_app ._app .nominal_sweep
484
- if "EigenMode Parameters" in self ._templates :
485
- rep = rt .Standard (self ._post_app , "EigenMode Parameters" , setup_name )
485
+ if "Eigenmode Parameters" in self ._templates :
486
+ rep = rt .Standard (self ._post_app , "Eigenmode Parameters" , setup_name )
486
487
rep .expressions = expressions
487
488
return rep
488
489
return
@@ -609,6 +610,113 @@ def __init__(self, app):
609
610
self .plots = self ._get_plot_inputs ()
610
611
self .reports_by_category = Reports (self , self ._app .design_type )
611
612
613
+ @property
614
+ def available_report_types (self ):
615
+ """Report types.
616
+
617
+ References
618
+ ----------
619
+
620
+ >>> oModule.GetAvailableReportTypes
621
+ """
622
+ return list (self .oreportsetup .GetAvailableReportTypes ())
623
+
624
+ @pyaedt_function_handler ()
625
+ def available_display_types (self , report_category = None ):
626
+ """Retrieve display types for a report categories.
627
+
628
+ Parameters
629
+ ----------
630
+ report_category : str, optional
631
+ Type of the report. The default value is ``None``.
632
+
633
+ Returns
634
+ -------
635
+ list
636
+ List of available report categories.
637
+
638
+ References
639
+ ----------
640
+ >>> oModule.GetAvailableDisplayTypes
641
+ """
642
+ if not report_category :
643
+ report_category = self .available_report_types [0 ]
644
+ if report_category :
645
+ return list (self .oreportsetup .GetAvailableDisplayTypes (report_category ))
646
+ return []
647
+
648
+ @pyaedt_function_handler ()
649
+ def available_quantities_categories (self , report_category = None , display_type = None , solution = None , context = "" ):
650
+ """Compute the list of all available report categories.
651
+
652
+ Parameters
653
+ ----------
654
+ report_category : str, optional
655
+ Report Category. Default is `None` which will take first default category.
656
+ display_type : str, optional
657
+ Report Display Type.
658
+ Default is `None` which will take first default type which is in most of the case "Rectangular Plot".
659
+ solution : str, optional
660
+ Report Setup. Default is `None` which will take first nominal_adpative solution.
661
+ context : str, optional
662
+ Report Category. Default is `""` which will take first default context.
663
+
664
+ Returns
665
+ -------
666
+ list
667
+ """
668
+ if not report_category :
669
+ report_category = self .available_report_types [0 ]
670
+ if not display_type :
671
+ display_type = self .available_display_types (report_category )[0 ]
672
+ if not solution :
673
+ solution = self ._app .nominal_adaptive
674
+ if solution and report_category and display_type :
675
+ return list (self .oreportsetup .GetAllCategories (report_category , display_type , solution , context ))
676
+ return []
677
+
678
+ @pyaedt_function_handler ()
679
+ def available_report_quantities (
680
+ self , report_category = None , display_type = None , solution = None , quantities_category = None , context = ""
681
+ ):
682
+ """Compute the list of all available report quantities of a given report quantity category.
683
+
684
+ Parameters
685
+ ----------
686
+ report_category : str, optional
687
+ Report Category. Default is `None` which will take first default category.
688
+ display_type : str, optional
689
+ Report Display Type.
690
+ Default is `None` which will take first default type which is in most of the case "Rectangular Plot".
691
+ solution : str, optional
692
+ Report Setup. Default is `None` which will take first nominal_adpative solution.
693
+ quantities_category : str, optional
694
+ The category to which quantities belong. It has to be one of `available_quantities_categories` method.
695
+ Default is `None` which will take first default quantity.".
696
+ context : str, optional
697
+ Report Category. Default is `""` which will take first default context.
698
+
699
+ Returns
700
+ -------
701
+ list
702
+ """
703
+ if not report_category :
704
+ report_category = self .available_report_types [0 ]
705
+ if not display_type :
706
+ display_type = self .available_display_types (report_category )[0 ]
707
+ if not solution :
708
+ solution = self ._app .nominal_adaptive
709
+ if not quantities_category :
710
+ categories = self .available_quantities_categories (report_category , display_type , solution , context )
711
+ quantities_category = categories [0 ] if categories else None
712
+ if quantities_category and display_type and report_category and solution :
713
+ return list (
714
+ self .oreportsetup .GetAllQuantities (
715
+ report_category , display_type , solution , context , quantities_category
716
+ )
717
+ )
718
+ return None
719
+
612
720
@pyaedt_function_handler ()
613
721
def _get_plot_inputs (self ):
614
722
names = self ._app .get_oo_name (self .oreportsetup )
@@ -1013,12 +1121,15 @@ def get_solution_data_per_variation(
1013
1121
if not setup_sweep_name :
1014
1122
setup_sweep_name = self ._app .nominal_adaptive
1015
1123
sweep_list = _convert_dict_to_report_sel (sweeps )
1016
-
1017
- data = list (
1018
- self .oreportsetup .GetSolutionDataPerVariation (soltype , setup_sweep_name , ctxt , sweep_list , expression )
1019
- )
1020
- self .logger .info ("Solution Data Correctly Loaded." )
1021
- return SolutionData (data )
1124
+ try :
1125
+ data = list (
1126
+ self .oreportsetup .GetSolutionDataPerVariation (soltype , setup_sweep_name , ctxt , sweep_list , expression )
1127
+ )
1128
+ self .logger .info ("Solution Data Correctly Loaded." )
1129
+ return SolutionData (data )
1130
+ except :
1131
+ self .logger .warning ("Solution Data failed to load. Check solution, context or expression." )
1132
+ return None
1022
1133
1023
1134
@pyaedt_function_handler ()
1024
1135
def steal_focus_oneditor (self ):
@@ -1762,37 +1873,6 @@ def ofieldsreporter(self):
1762
1873
"""
1763
1874
return self ._app .ofieldsreporter
1764
1875
1765
- @property
1766
- def report_types (self ):
1767
- """Report types.
1768
-
1769
- References
1770
- ----------
1771
-
1772
- >>> oModule.GetAvailableReportTypes
1773
- """
1774
- return list (self .oreportsetup .GetAvailableReportTypes ())
1775
-
1776
- @pyaedt_function_handler ()
1777
- def display_types (self , report_type ):
1778
- """Retrieve display types for a report type.
1779
-
1780
- Parameters
1781
- ----------
1782
- report_type : str
1783
- Type of the report.
1784
-
1785
- Returns
1786
- -------
1787
- :attr:`pyaedt.modules.PostProcessor.PostProcessor.report_types`
1788
-
1789
- References
1790
- ----------
1791
-
1792
- >>> oModule.GetAvailableDisplayTypes
1793
- """
1794
- return self .oreportsetup .GetAvailableDisplayTypes (report_type )
1795
-
1796
1876
@pyaedt_function_handler ()
1797
1877
def _get_base_name (self , setup ):
1798
1878
setups_data = self ._app .design_properties ["FieldsReporter" ]["FieldsPlotManagerID" ]
@@ -1805,7 +1885,11 @@ def _get_base_name(self, setup):
1805
1885
if isinstance (sim_data ["SimSetup" ], list ):
1806
1886
for solution in sim_data ["SimSetup" ]:
1807
1887
base_name = solution ["Name" ]
1808
- for sol in solution ["Solution" ]:
1888
+ if isinstance (solution ["Solution" ], (dict , OrderedDict )):
1889
+ sols = [solution ["Solution" ]]
1890
+ else :
1891
+ sols = solution ["Solution" ]
1892
+ for sol in sols :
1809
1893
if sol ["ID" ] == setups_data [setup ]["SolutionId" ]:
1810
1894
base_name += " : " + sol ["Name" ]
1811
1895
return base_name
0 commit comments