5252 from ansys .aedt .core .emit_core .emit_constants import TxRxMode
5353 from ansys .aedt .core .emit_core .nodes import generated
5454 from ansys .aedt .core .emit_core .nodes .emit_node import EmitNode
55+ from ansys .aedt .core .emit_core .nodes .emitter_node import EmitterNode
5556 from ansys .aedt .core .emit_core .nodes .generated import Amplifier
57+ from ansys .aedt .core .emit_core .nodes .generated import AntennaNode
5658 from ansys .aedt .core .emit_core .nodes .generated import Band
5759 from ansys .aedt .core .emit_core .nodes .generated import Filter
5860 from ansys .aedt .core .emit_core .nodes .generated import RadioNode
5961 from ansys .aedt .core .emit_core .nodes .generated import SamplingNode
6062 from ansys .aedt .core .emit_core .nodes .generated import TxBbEmissionNode
6163 from ansys .aedt .core .emit_core .nodes .generated import TxSpectralProfNode
64+ from ansys .aedt .core .emit_core .nodes .generated import TxSpectralProfEmitterNode
65+ from ansys .aedt .core .emit_core .nodes .generated import Waveform
6266 from ansys .aedt .core .modeler .circuits .primitives_emit import EmitAntennaComponent
6367 from ansys .aedt .core .modeler .circuits .primitives_emit import EmitComponent
6468 from ansys .aedt .core .modeler .circuits .primitives_emit import EmitComponents
@@ -1807,7 +1811,7 @@ def test_fm_fsk_freq_deviation(self, emit_app):
18071811 band_node .freq_deviation = 1e4
18081812 assert band_node .freq_deviation == 1e4
18091813
1810- @pytest .mark .skipif (config ["desktopVersion" ] <= "2025.2" , reason = "Skipped on versions earlier than 2025 R2." )
1814+ @pytest .mark .skipif (config ["desktopVersion" ] < "2025.2" , reason = "Skipped on versions earlier than 2025 R2." )
18111815 def test_tables (self , emit_app ):
18121816 # Emit has 2 different types of tables: Node Prop Tables and ColumnData Tables
18131817 # this test confirms that the table_data properties work for both
@@ -1844,40 +1848,71 @@ def test_tables(self, emit_app):
18441848 # Get the amplifier table and verify the data was set properly
18451849 assert amp .table_data == amp_data
18461850
1847- # Test BB Emissions Node since it can be either a NodeProp or
1848- # ColumnData Table
1849- radio2 = emit_app .schematic .create_component ("New Radio" )
1850- radio2 = cast (RadioNode , radio2 )
1851+ if config ["desktopVersion" ] < "2026.1" :
1852+ # Test BB Emissions Node since it can be either a NodeProp or
1853+ # ColumnData Table
1854+ radio2 = emit_app .schematic .create_component ("New Radio" )
1855+ radio2 = cast (RadioNode , radio2 )
18511856
1852- children = radio2 .children
1853- tx_spec = None
1854- for child in children :
1855- if child .node_type == "Band" :
1856- band_children = child .children
1857- for band_child in band_children :
1858- if band_child .node_type == "TxSpectralProfNode" :
1859- tx_spec = cast (TxSpectralProfNode , band_child )
1857+ children = radio2 .children
1858+ tx_spec = None
1859+ for child in children :
1860+ if child .node_type == "Band" :
1861+ band_children = child .children
1862+ for band_child in band_children :
1863+ if band_child .node_type == "TxSpectralProfNode" :
1864+ tx_spec = cast (TxSpectralProfNode , band_child )
1865+
1866+ bb_noise = tx_spec .add_tx_broadband_noise_profile ()
1867+ bb_noise = cast (TxBbEmissionNode , bb_noise )
1868+
1869+ # verify the table is empty by default
1870+ assert bb_noise .table_data == []
1871+
1872+ # Set the ColumnData Table
1873+ bb_data = [(100000.0 , - 170.0 ), (100000000.0 , - 160.0 ), (200000000.0 , - 170.0 )]
1874+ bb_noise .table_data = bb_data
1875+
1876+ # Verify the ColumnData Table was set
1877+ assert bb_noise .table_data == bb_data
1878+
1879+ # Change it to a NodeProp Table (Equation based)
1880+ bb_data = [("RF+10" , - 160 ), ("RF+100" , - 166 )]
1881+ bb_noise .noise_behavior = TxBbEmissionNode .NoiseBehaviorOption .EQUATION
1882+ bb_noise .table_data = bb_data
1883+
1884+ # Verify the NodeProp Table was set
1885+ assert bb_noise .table_data == bb_data
18601886
1861- bb_noise = tx_spec .add_tx_broadband_noise_profile ()
1862- bb_noise = cast (TxBbEmissionNode , bb_noise )
1887+ @pytest .mark .skipif (config ["desktopVersion" ] < "2025.2" , reason = "Skipped on versions earlier than 2025 R2." )
1888+ def test_emitters_radios (self , emit_app ):
1889+ emitter_node : EmitterNode = emit_app .schematic .create_component ("New Emitter" , "Emitters" )
1890+
1891+ # Test that you can get the emitter's radio and antenna nodes
1892+ emitter_radio : RadioNode = emitter_node .get_radio ()
1893+ assert isinstance (emitter_radio , RadioNode )
1894+
1895+ emitter_ant : AntennaNode = emitter_node .get_antenna ()
1896+ assert isinstance (emitter_ant , AntennaNode )
1897+
1898+ emitter_band : Waveform = emitter_node .get_waveforms ()[0 ]
1899+ assert emitter_band .warnings == ""
1900+
1901+ assert emitter_node .children () == emitter_node .get_waveforms ()
18631902
1864- # verify the table is empty by default
1865- assert bb_noise . table_data == []
1903+ emitter_band . waveform = Waveform . WaveformOption . PRBS
1904+ assert emitter_band . waveform == Waveform . WaveformOption . PRBS
18661905
1867- # Set the ColumnData Table
1868- bb_data = [(100000.0 , - 170.0 ), (100000000.0 , - 160.0 ), (200000000.0 , - 170.0 )]
1869- bb_noise .table_data = bb_data
1906+ tx_spec : TxSpectralProfEmitterNode = emitter_band .children [0 ]
1907+ assert isinstance (tx_spec , TxSpectralProfEmitterNode )
18701908
1871- # Verify the ColumnData Table was set
1872- assert bb_noise .table_data == bb_data
1909+ radio_node : RadioNode = emit_app .schematic .create_component ("New Radio" , "Radios" )
18731910
1874- # Change it to a NodeProp Table (Equation based)
1875- bb_data = [("RF+10" , - 160 ), ("RF+100" , - 166 )]
1876- bb_noise .noise_behavior = TxBbEmissionNode .NoiseBehaviorOption .EQUATION
1877- bb_noise .table_data = bb_data
1911+ band : Band = radio_node .children [0 ]
1912+ assert isinstance (band , Band )
18781913
1879- # Verify the NodeProp Table was set
1880- assert bb_noise . table_data == bb_data
1914+ radio_tx_spec : TxSpectralProfNode = band . children [ 0 ]
1915+ assert isinstance ( radio_tx_spec , TxSpectralProfNode )
18811916
18821917 @pytest .mark .skipif (config ["desktopVersion" ] <= "2025.1" , reason = "Skipped on versions earlier than 2026 R1." )
18831918 def test_units (self , emit_app ):
@@ -1913,7 +1948,7 @@ def test_units(self, emit_app):
19131948 cable .length = "0.0031 mile"
19141949 assert round (cable .length , 4 ) == 4.9890
19151950
1916- @pytest .mark .skipif (config ["desktopVersion" ] <= "2025.2" , reason = "Skipped on versions earlier than 2026 R1." )
1951+ @pytest .mark .skipif (config ["desktopVersion" ] < "2025.2" , reason = "Skipped on versions earlier than 2026 R1." )
19171952 def test_27_components_catalog (self , emit_app ):
19181953 comp_list = emit_app .modeler .components .components_catalog ["LTE" ]
19191954 assert len (comp_list ) == 14
@@ -1929,28 +1964,28 @@ def test_27_components_catalog(self, emit_app):
19291964 default_antenna = emit_app .schematic .create_component ("Antenna" )
19301965
19311966 for comp in comp_list .components :
1967+ library_name = comp .split (":" )[0 ]
19321968 comp_to_add = comp .split (":" )[1 ]
19331969 # try to add just based on the CompName
1934- comp_added = emit_app .schematic .create_component (comp_to_add )
1935- if not comp_added :
1936- # if CompName has multiple matches, then we need to
1937- # also specify the library
1938- library_name = comp .split (":" )[0 ]
1939- try :
1940- comp_added = emit_app .schematic .create_component (component_type = comp_to_add , library = library_name )
1941- assert comp_added
1942-
1943- # connect the component
1944- if comp_added ._node_type == "AntennaNode" or comp_added ._node_type == "Terminator" :
1945- emit_app .schematic .connect_components (default_radio .name , comp_added .name )
1946- else :
1947- emit_app .schematic .connect_components (comp_added .name , default_antenna .name )
1948-
1949- # Delete the component
1950- emit_app .schematic .delete_component (comp_added .name )
1951-
1952- except Exception as e :
1953- print (f"Failed to create component: { comp_to_add } from library { library_name } . Error: { e } " )
1970+ try :
1971+ comp_added = emit_app .schematic .create_component (component_type = comp_to_add , library = library_name )
1972+ assert comp_added
1973+
1974+ # connect the component
1975+ if comp_added .node_type == "EmitterNode" :
1976+ # can't connect Emitters since they have no ports
1977+ continue
1978+ elif comp_added ._node_type == "AntennaNode" or comp_added ._node_type == "Terminator" :
1979+ emit_app .schematic .connect_components (default_radio .name , comp_added .name )
1980+ else :
1981+ emit_app .schematic .connect_components (comp_added .name , default_antenna .name )
1982+
1983+ # Delete the component
1984+ print (comp_added .name )
1985+ emit_app .schematic .delete_component (comp_added .name )
1986+
1987+ except Exception as e :
1988+ print (f"Failed to create component: { comp_to_add } from library { library_name } . Error: { e } " )
19541989
19551990 rev = emit_app .results .analyze ()
19561991 comps_in_schematic = rev .get_all_component_nodes ()
0 commit comments