Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT: VSin, ISin Sources added to Maxwell Circuit Primitives #5283

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5aac760
VSin, ISin Sources added to Maxwell Circuit Primitives
DaveTwyman Oct 11, 2024
f8699a5
Merge branch 'main' into 5282-Add-Missing-Circuit-Elements
DaveTwyman Oct 11, 2024
8552947
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 11, 2024
93375bd
VSin, ISin Sources added to Maxwell Circuit Primitives
DaveTwyman Oct 11, 2024
955bcf7
Merge remote-tracking branch 'origin/5282-Add-Missing-Circuit-Element…
DaveTwyman Oct 11, 2024
cf6153e
VSin, ISin Sources added to Maxwell Circuit Primitives
DaveTwyman Oct 11, 2024
eb4c79e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 11, 2024
a07645f
vsin, isin Sources added to Maxwell Circuit Primitives
DaveTwyman Oct 14, 2024
84e4f7a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 14, 2024
d7945da
Merge branch 'main' into 5282-Add-Missing-Circuit-Elements
DaveTwyman Oct 14, 2024
a3a2340
Merge branch 'main' into 5282-Add-Missing-Circuit-Elements
DaveTwyman Oct 14, 2024
46152e2
Merge branch 'main' into 5282-Add-Missing-Circuit-Elements
DaveTwyman Oct 15, 2024
bf84832
Merge branch 'main' into 5282-Add-Missing-Circuit-Elements
DaveTwyman Oct 16, 2024
0c4d246
Merge branch 'main' into 5282-Add-Missing-Circuit-Elements
SMoraisAnsys Oct 17, 2024
d180ad8
Unit Tests added for vsin and isin
DaveTwyman Oct 17, 2024
5a95e4e
Replaced id with comp_name
DaveTwyman Oct 18, 2024
4b7d09f
Delete unused function handler from create_page
DaveTwyman Oct 18, 2024
f00f682
Use component instead of comp_name
DaveTwyman Oct 18, 2024
359f752
Added support for Name=None case which previously created error messa…
DaveTwyman Oct 18, 2024
fdf3786
Merge branch 'main' into 5282-Add-Missing-Circuit-Elements
DaveTwyman Oct 18, 2024
4ef9e9f
Added method 'get_num_pages' as well as unit tests 52_create_page and…
DaveTwyman Oct 30, 2024
d44fd5d
Merge branch 'main' into 5282-Add-Missing-Circuit-Elements
DaveTwyman Oct 30, 2024
0a98ed1
Update src/ansys/aedt/core/modeler/circuits/primitives_circuit.py
DaveTwyman Nov 5, 2024
a4dd34f
Update src/ansys/aedt/core/modeler/circuits/primitives_circuit.py
DaveTwyman Nov 5, 2024
7aa718d
Update src/ansys/aedt/core/modeler/circuits/primitives_circuit.py
DaveTwyman Nov 5, 2024
bd322c4
Update src/ansys/aedt/core/modeler/circuits/primitives_circuit.py
DaveTwyman Nov 5, 2024
44827f3
Update src/ansys/aedt/core/modeler/circuits/primitives_circuit.py
DaveTwyman Nov 5, 2024
29eeb97
-Moved create_page and get_num_pages into maxwellcircuit.py, they sho…
DaveTwyman Nov 12, 2024
3f56946
Merge branch 'main' of https://github.com/ansys/pyaedt into 5282-Add-…
DaveTwyman Nov 12, 2024
e053aab
Merge branch 'main' into 5282-Add-Missing-Circuit-Elements
DaveTwyman Nov 12, 2024
8cefb93
CHORE: Auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 12, 2024
44c9258
Merge branch 'main' into 5282-Add-Missing-Circuit-Elements
DaveTwyman Nov 12, 2024
8b94bd1
Merge branch 'main' into 5282-Add-Missing-Circuit-Elements
DaveTwyman Nov 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/ansys/aedt/core/modeler/circuits/primitives_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1261,6 +1261,22 @@
except Exception:
return False

@pyaedt_function_handler()
def create_page(self, name):
"""Add a new page to circuit schematic.

Parameters
"""
self.oeditor.CreatePage(name)

Check warning on line 1270 in src/ansys/aedt/core/modeler/circuits/primitives_circuit.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/modeler/circuits/primitives_circuit.py#L1270

Added line #L1270 was not covered by tests

@pyaedt_function_handler()
def select_page(self, name):
"""Add a new page to circuit schematic.

Parameters
"""
self.oeditor.SelectPage(name)

Check warning on line 1278 in src/ansys/aedt/core/modeler/circuits/primitives_circuit.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/modeler/circuits/primitives_circuit.py#L1278

Added line #L1278 was not covered by tests


class ComponentInfo(object):
"""Manages Circuit Catalog info."""
Expand Down
84 changes: 84 additions & 0 deletions src/ansys/aedt/core/modeler/circuits/primitives_maxwell_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,3 +284,87 @@
)
id.set_property("Name", name)
return id

@pyaedt_function_handler(compname="name")
DaveTwyman marked this conversation as resolved.
Show resolved Hide resolved
def create_ISin(self, name=None, value=1, location=None, angle=0, use_instance_id_netlist=False):
DaveTwyman marked this conversation as resolved.
Show resolved Hide resolved
"""Create a sinusoidal current source.

Parameters
----------
name : str, optional
Name of the current source. The default is ``None``.
DaveTwyman marked this conversation as resolved.
Show resolved Hide resolved
value : float, optional
Value for the amplitude of current. The default is ``1``.
location : list of float, optional
Position on the X axis and Y axis.
angle : float, optional
Angle of rotation in degrees. The default is ``0``.
use_instance_id_netlist : bool, optional
Whether to use the instance ID in the net list or not. The default is ``False``.

Returns
-------
:class:`ansys.aedt.core.modeler.cad.object_3dcircuit.CircuitComponent`
Circuit Component Object.

References
----------

>>> oEditor.CreateComponent
"""
if location is None:
DaveTwyman marked this conversation as resolved.
Show resolved Hide resolved
location = []
id = self.create_component(

Check warning on line 317 in src/ansys/aedt/core/modeler/circuits/primitives_maxwell_circuit.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/modeler/circuits/primitives_maxwell_circuit.py#L315-L317

Added lines #L315 - L317 were not covered by tests
DaveTwyman marked this conversation as resolved.
Show resolved Hide resolved
DaveTwyman marked this conversation as resolved.
Show resolved Hide resolved
name,
component_library="Sources",
component_name="ISin",
location=location,
angle=angle,
use_instance_id_netlist=use_instance_id_netlist,
)

id.set_property("Ia", value)
DaveTwyman marked this conversation as resolved.
Show resolved Hide resolved
id.set_property("Name", name)
return id

Check warning on line 328 in src/ansys/aedt/core/modeler/circuits/primitives_maxwell_circuit.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/modeler/circuits/primitives_maxwell_circuit.py#L326-L328

Added lines #L326 - L328 were not covered by tests

@pyaedt_function_handler(compname="name")
def create_VSin(self, name=None, value=1, location=None, angle=0, use_instance_id_netlist=False):
DaveTwyman marked this conversation as resolved.
Show resolved Hide resolved
"""Create a sinusoidal voltage source.

Parameters
----------
name : str, optional
Name of the voltage source. The default is ``None``.
value : float, optional
Value for the amplitude of voltage. The default is ``1``.
location : list of float, optional
Position on the X axis and Y axis.
angle : float, optional
Angle of rotation in degrees. The default is ``0``.
use_instance_id_netlist : bool, optional
Whether to use the instance ID in the net list or not. The default is ``False``.

Returns
-------
:class:`ansys.aedt.core.modeler.cad.object_3dcircuit.CircuitComponent`
Circuit Component Object.

References
----------

>>> oEditor.CreateComponent
"""
if location is None:
location = []
id = self.create_component(

Check warning on line 359 in src/ansys/aedt/core/modeler/circuits/primitives_maxwell_circuit.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/modeler/circuits/primitives_maxwell_circuit.py#L357-L359

Added lines #L357 - L359 were not covered by tests
DaveTwyman marked this conversation as resolved.
Show resolved Hide resolved
name,
component_library="Sources",
component_name="VSin",
location=location,
angle=angle,
use_instance_id_netlist=use_instance_id_netlist,
)

id.set_property("Va", value)
id.set_property("Name", name)
return id

Check warning on line 370 in src/ansys/aedt/core/modeler/circuits/primitives_maxwell_circuit.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/modeler/circuits/primitives_maxwell_circuit.py#L368-L370

Added lines #L368 - L370 were not covered by tests
Loading