Skip to content

Commit c7b045f

Browse files
hui-zhou-amaxcapodi78MaxJPRey
authored
Create voltage probe (#1289)
* method * unitest * unitest * unitest * unitest * Apply suggestions from code review Co-authored-by: Maxime Rey <[email protected]> Co-authored-by: Massimo Capodiferro <[email protected]> Co-authored-by: Maxime Rey <[email protected]>
1 parent 3a9fe24 commit c7b045f

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

_unittest/test_21_Circuit.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,3 +444,7 @@ def test_35_netlist_data_block(self):
444444
lna = self.aedtapp.create_setup("mylna", self.aedtapp.SETUPS.NexximLNA)
445445
lna.props["SweepDefinition"]["Data"] = "LINC 0Hz 1GHz 101"
446446
assert self.aedtapp.analyze_nominal()
447+
448+
def test_36_create_voltage_probe(self):
449+
myprobe = self.aedtapp.modeler.components.create_voltage_probe(probe_name="test_probe", location=[0.4, 0.2])
450+
assert type(myprobe.id) is int

pyaedt/modeler/PrimitivesNexxim.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,49 @@ def create_voltage_dc(self, compname=None, value=1, location=None, angle=0, use_
712712
cmpid.set_property("DC", value)
713713
return cmpid
714714

715+
@pyaedt_function_handler()
716+
def create_voltage_probe(self, probe_name=None, location=None, angle=0, use_instance_id_netlist=False):
717+
"""Create a voltage probe.
718+
719+
Parameters
720+
----------
721+
probe_name :
722+
Name of the voltage probe. The default is ``None``.
723+
location : list of float, optional
724+
Position on the X axis and Y axis. The default is ``None``.
725+
angle : float, optional
726+
Angle rotation in degrees. The default is ``0``.
727+
use_instance_id_netlist : bool, optional
728+
Whether to use the instance ID in the net list.
729+
The default is ``False``.
730+
731+
Returns
732+
-------
733+
:class:`pyaedt.modeler.Object3d.CircuitComponent`
734+
Circuit Component Object.
735+
736+
References
737+
----------
738+
739+
>>> oEditor.CreateComponent
740+
"""
741+
if location is None:
742+
location = []
743+
else:
744+
location = [location[0] + 0.2 * 24.4 / 1000, location[1] + 0.2 * 24.4 / 1000]
745+
746+
cmpid = self.create_component(
747+
None,
748+
component_library="Probes",
749+
component_name="VPROBE",
750+
location=location,
751+
angle=angle,
752+
use_instance_id_netlist=use_instance_id_netlist,
753+
)
754+
755+
cmpid.set_property("Name", probe_name)
756+
return cmpid
757+
715758
@pyaedt_function_handler()
716759
def create_current_pulse(self, compname=None, value_lists=[], location=[], angle=0, use_instance_id_netlist=False):
717760
"""Create a current pulse.

0 commit comments

Comments
 (0)