Skip to content

Commit 6919249

Browse files
DOCS: Update Emit examples (#411)
Co-authored-by: Sébastien Morais <[email protected]>
1 parent c3c541a commit 6919249

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

examples/high_frequency/antenna/interferences/antenna.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import time
1717

1818
import ansys.aedt.core
19+
from ansys.aedt.core.emit_core.emit_constants import ResultType, TxRxMode
1920
# -
2021

2122
# Define constants.
@@ -80,18 +81,18 @@
8081

8182
# > **Note:** You can uncomment the following code.
8283
#
83-
# if AEDT_VERSION > "2023.1":
84-
# rev = aedtapp.results.analyze()
85-
# rx_bands = rev.get_band_names(rad2.name, TxRxMode.RX)
86-
# tx_bands = rev.get_band_names(rad3.name, TxRxMode.TX)
87-
# domain = aedtapp.results.interaction_domain()
88-
# domain.set_receiver(rad2.name, rx_bands[0], -1)
89-
# domain.set_interferer(rad3.name, tx_bands[0])
90-
# interaction = rev.run(domain)
91-
# worst = interaction.get_worst_instance(ResultType.EMI)
92-
# if worst.has_valid_values():
93-
# emi = worst.get_value(ResultType.EMI)
94-
# print("Worst case interference is: {} dB".format(emi))
84+
if AEDT_VERSION > "2023.1":
85+
rev = aedtapp.results.analyze()
86+
rx_bands = rev.get_band_names(rad2.name, TxRxMode.RX)
87+
tx_bands = rev.get_band_names(rad3.name, TxRxMode.TX)
88+
domain = aedtapp.results.interaction_domain()
89+
domain.set_receiver(rad2.name, rx_bands[0], -1)
90+
domain.set_interferer(rad3.name, tx_bands[0])
91+
interaction = rev.run(domain)
92+
worst = interaction.get_worst_instance(ResultType.EMI)
93+
if worst.has_valid_values():
94+
emi = worst.get_value(ResultType.EMI)
95+
print("Worst case interference is: {} dB".format(emi))
9596

9697
# ## Release AEDT
9798
#

examples/high_frequency/antenna/interferences/protection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@
103103
if "HR-DSSS" in band.node_name:
104104
if "Ch 1-13" in band.node_name:
105105
band.enabled = True
106-
band.set_band_power_level(-20)
106+
band.set_band_power_level(-20, 'dBm')
107107

108108
# Reduce the bluetooth transmit power
109109
bands = bluetooth.bands()
110110
for band in bands:
111-
band.set_band_power_level(-20)
111+
band.set_band_power_level(-20, 'dBm')
112112

113113

114114
def get_radio_node(radio_name):

0 commit comments

Comments
 (0)