Public Member Functions | List of all members
Circuit Class Reference

Circuit class is used to obtain the information on the entire circuit and operating the component.
This class can be called from Study class.
. More...

Public Member Functions

void AddToLibrary (String &macroName, String &saveName, String &folderName, String &description)
 Adds the macro component of the specified name to the specified folder in the library. More...
 
void Clear ()
 Deletes all components and wires.
 
void ClearBrushGraph ()
 Deletes the contact angle for the brush and commutator that were added to the result table.
 
void ClearTerminalDifferenceLabel ()
 Deletes all electric potential difference or temperature difference between two terminals from the result table.
 
void ClearTerminalLabel ()
 Deletes all electric potentials or temperatures of the terminal from the result table.
 
void ClearVoltageDifferenceLabel ()
 Equivalent of Circuit::ClearTerminalDifferenceLabel . More...
 
void CreateBrushGraph (int x1, int y1, int x2, int y2)
 Adds the contact angle of the brush and commutator in the result table. More...
 
CircuitComponentCreateComponent (String &typeName, String &name="")
 Creates a component. More...
 
CircuitComponentInstanceCreateComponentInstance (CircuitComponent *component, int x, int y)
 Creates an instance from a circuit component. More...
 
DynamicCircuitCreateDynamicCircuit (String &typeName)
 Returns an object of the specified macro component. More...
 
CircuitComponentInstanceCreateInstance (Variant &component, int x, int y)
 Creates an instance from a component. More...
 
MacroCircuitCreateMacro (String &macroName)
 Returns the specified macro component object. More...
 
CircuitComponentInstanceCreateNewComponentInstance (String &typeName, int x, int y)
 Creates a new component by specifying the component type and coordinates, and returns a CircuitComponentInstance object. More...
 
CircuitComponentInstanceCreateNewSubCircuitInstance (String &filename, int x, int y)
 Creates a macro component, and then returns a CircuitComponentInstance object. More...
 
void CreateResponseTable (CircuitComponent *component)
 
CircuitComponentInstanceCreateSubCircuit (String &filename, String &name, int x, int y)
 Creates a macro component. More...
 
void CreateTerminalDifferenceLabel (String &name, int x1, int y1, int x2, int y2)
 Adds the difference in electric potentials or temperatures between two terminals to the result table. More...
 
void CreateTerminalLabel (String &name, int x, int y)
 Adds the electric potential or temperature of the terminal to the result table. More...
 
void CreateVoltageDifferenceLabel (String &name, int x1, int y1, int x2, int y2)
 Equivalent of Circuit::CreateTerminalDifferenceLabel . More...
 
CircuitWireCreateWire (int x1, int y1, int x2, int y2)
 Connects two terminals with a wire. More...
 
void DeleteComponent (Variant &val)
 Specifies a name, and deletes a component. More...
 
void DeleteComponentInstance (Variant &val)
 Deletes the component from the specified name or index. More...
 
void DeleteComponentInstanceByType (String &typeName, int index)
 Deletes the component from the specified component type and index. More...
 
void DeleteInstance (Variant &val, int index)
 Specifies a name or index, and deletes an instance. More...
 
void DeleteTerminalDifferenceLabel (int x1, int y1, int x2, int y2)
 Deletes the electric potential difference or temperature difference between two terminals from the result table. More...
 
void DeleteTerminalLabel (int x, int y)
 Deletes the electric potential or temperature of the terminal from the result table. More...
 
void DeleteVoltageDifferenceLabel (int x1, int y1, int x2, int y2)
 Equivalent of Circuit::DeleteTerminalDifferenceLabel . More...
 
void DeleteWire (CircuitWire *wire)
 Specifies the CircuitWire object, and deletes a wire. More...
 
void DeleteWireByIndex (int index)
 Specifies the index, and deletes a wire. More...
 
CircuitComponentInstanceDuplicateCircuit (String &name, String &newName)
 Duplicates a circuit. More...
 
void ExportImage (String &filename)
 Exports an image file (*.png, *.jpg, *.bmp). More...
 
void ExportImageWithSize (String &filename, int width, int height)
 Exports an image file (*.png, *.jpg, *.bmp) by specifying the size. More...
 
void ExportXML (String &filename)
 Exports thermal circuit from magnetic analysis study to xml file. More...
 
CircuitComponentGetComponent (Variant &val)
 Returns the CircuitComponent object of the specified component name or index. More...
 
CircuitComponentGetComponentByType (String &typeName, int index)
 Returns the CircuitComponent object from the specified component type and index.
. More...
 
CircuitComponentInstanceGetComponentInstance (Variant &val)
 Returns the CircuitComponentInstance object of the specified component name or index.
. More...
 
CircuitComponentInstanceGetComponentInstanceByType (String &typeName, int index)
 Returns the CircuitComponentInstance object from the specified component type and index.
. More...
 
CircuitComponentInstanceGetInstance (Variant &val, int index)
 Returns an instance. More...
 
CircuitGetSubCircuit (Variant &val)
 Returns the Circuit object for the specified macro component name or index. More...
 
CircuitWireGetWire (int index)
 Returns the CircuitWire object of the specified index. More...
 
bool IsValid ()
 Returns True if an object is valid. More...
 
void MakeSubCircuitEditable (Variant &val)
 Makes the subcircuit editable for the macro component of the specified name or index. More...
 
int NumComponents ()
 Returns the total number of components in the circuit as an integer. More...
 
int NumComponentsByType (String &typeName)
 Returns the total number of components in the circuit as an integer. More...
 
int NumInstances ()
 Returns the total number of instances of the component as an integer. More...
 
int NumSubCircuit ()
 Returns the total number of macro components as an integer. More...
 
int NumWires ()
 Returns the number of wires as an integer. More...
 
void Save (String &filename, int version=kProjectFileVersion)
 Saves a file. More...
 
void SaveToolbox (String &title, String &description, String &folder, int version=kProjectFileVersion)
 Saves circuit file and registers it to the tool box. More...
 

Detailed Description

Circuit class is used to obtain the information on the entire circuit and operating the component.
This class can be called from Study class.
.

Example of obtaining the class object:

app.GetModel(0).GetStudy(0).GetCircuit()


For more information on component type names specified by the argument typeName in the circuit settings, see Properties and Flags for the Circuit Settings .

Member Function Documentation

void Circuit::AddToLibrary ( String &  macroName,
String &  saveName,
String &  folderName,
String &  description 
)

Adds the macro component of the specified name to the specified folder in the library.

Parameters
macroNameMacro component name
saveNameSave name in library
folderNameSave folder name
descriptionDescription
void Circuit::ClearVoltageDifferenceLabel ( )

Equivalent of Circuit::ClearTerminalDifferenceLabel .

Deprecated:
Deletes all differences in results between the two terminals added to the result table.
void Circuit::CreateBrushGraph ( int  x1,
int  y1,
int  x2,
int  y2 
)

Adds the contact angle of the brush and commutator in the result table.

Parameters
x1X-coordinate of the terminal 1
y1Y-coordinate of the terminal 1
x2X-coordinate of the terminal 2
y2Y-coordinate of the terminal 2
CircuitComponent * Circuit::CreateComponent ( String &  typeName,
String &  name = "" 
)

Creates a component.

Parameters
typeName
Component type
Resistor
Capacitor
Inductor
Diode
Coil
FEMConductor
Switch
Ground
VoltageSource
TwoTerminalVoltageSource
CurrentSource
TwoTerminalCurrentSource
CurrentProbe
VoltageProbe
3PhaseVoltageSource
3PhaseCurrentSource
MultiPhaseVoltageSource
MultiPhaseCurrentSource
BrushCommutator
MacroComponent
ReferenceCoil
ReferenceConductor
PowerSource
ThreeTerminalResistor
ThreeTerminalCoil
FEAElectricInput
FEAElectricOutput
CouplingControl
UserSubroutine
ThermalResistor
HeatCapacity
HeatGeneration
HeatTransfer
FixedTemperature
ThermalProbe
HeatControl
CoilEndCooling
ConvectionCooling
nameComponent name
Returns
CircuitComponentInstance object

For more information on component type, see Properties and Flags for the Circuit Settings .

CircuitComponentInstance * Circuit::CreateComponentInstance ( CircuitComponent component,
int  x,
int  y 
)

Creates an instance from a circuit component.

Parameters
componentCircuitComponent object
xX-coordinate
yY-coordinate
Returns
CircuitComponentInstance object
DynamicCircuit * Circuit::CreateDynamicCircuit ( String &  typeName)

Returns an object of the specified macro component.

Parameters
typeName
Type of macro component to be created
cage
lap-winding (for brush motors)
wave-winding (for brush motors)
Serial-Conductors
Returns
DynamicCircuit object

For more information on component types, see Properties and Flags for the Circuit Settings .

CircuitComponentInstance * Circuit::CreateInstance ( Variant &  component,
int  x,
int  y 
)

Creates an instance from a component.

Parameters
componentComponent name or index
xX-coordinate
yY-coordinate
Returns
CircuitComponentInstance object

Specify Ground in the component to create an instance of a Ground component.

MacroCircuit * Circuit::CreateMacro ( String &  macroName)

Returns the specified macro component object.

Parameters
macroNameMacro component name
Returns
MacroCircuit object
CircuitComponentInstance * Circuit::CreateNewComponentInstance ( String &  typeName,
int  x,
int  y 
)

Creates a new component by specifying the component type and coordinates, and returns a CircuitComponentInstance object.

Parameters
typeName
Component type
Resistor
Capacitor
Inductor
Diode
Coil
FEMConductor
Switch
Ground
VoltageSource
TwoTerminalVoltageSource
CurrentSource
TwoTerminalCurrentSource
CurrentProbe
VoltageProbe
3PhaseVoltageSource
3PhaseCurrentSource
MultiPhaseVoltageSource
MultiPhaseCurrentSource
BrushCommutator
MacroComponent
ReferenceCoil
ReferenceConductor
PowerSource
ThreeTerminalResistor
ThreeTerminalCoil
FEAElectricInput
FEAElectricOutput
CouplingControl
UserSubroutine
ThermalResistor
HeatCapacity
HeatGeneration
HeatTransfer
FixedTemperature
ThermalProbe
HeatControl
CoilEndCooling
ConvectionCooling
xX-coordinate
yY-coordinate
Returns
CircuitComponentInstance object

For more information on component type, see Properties and Flags for the Circuit Settings .

CircuitComponentInstance * Circuit::CreateNewSubCircuitInstance ( String &  filename,
int  x,
int  y 
)

Creates a macro component, and then returns a CircuitComponentInstance object.

Parameters
typeName
Macro component type
PAM Inverter(Diode)
PAM Inverter
PWM_Inverter
Delta Connection
Star Connection
Three Phase Power Supply(Current)
Three Phase Power Supply(Voltage)
Three Phase Rectifier
PWM_Generator
PWM_Signal_Generator_6phase
RTPMSM_6phase_Mask
Vin_Gain_6phase
dq_PI_controller
phase_current_PI_controller_6phases
Inverter_(Control_Switch)
Rt_Fea_Switch
RT_FEA_Switch_Grand_3phase
JMAG-RT_FEA_Switch_6phase
PWM_Current_Vector_Control
PWM_Current_Vector_Control_with_RT
PWM_Current_Vector_Control_6phases
PWM_Current_Vector_Control_6phases_with_RT
IM_PWM_Current_Vector_Control
IM_PWM_Current_Vector_Control_6phases
xX-coordinate
yY-coordinate
Returns
CircuitComponentInstance object
void Circuit::CreateResponseTable ( CircuitComponent component)
Deprecated:
Creates a response value table from the RT component.
Parameters
componentCircuitComponent object
CircuitComponentInstance * Circuit::CreateSubCircuit ( String &  filename,
String &  name,
int  x,
int  y 
)

Creates a macro component.

Parameters
typeName
Macro component type
PAM Inverter(Diode)
PAM Inverter
PWM_Inverter
Delta Connection
Star Connection
Three Phase Power Supply(Current)
Three Phase Power Supply(Voltage)
Three Phase Rectifier
PWM_Generator
PWM_Signal_Generator_6phase
RTPMSM_6phase_Mask
Vin_Gain_6phase
dq_PI_controller
phase_current_PI_controller_6phases
Inverter_(Control_Switch)
Rt_Fea_Switch
RT_FEA_Switch_Grand_3phase
JMAG-RT_FEA_Switch_6phase
PWM_Current_Vector_Control
PWM_Current_Vector_Control_with_RT
PWM_Current_Vector_Control_6phases
PWM_Current_Vector_Control_6phases_with_RT
IM_PWM_Current_Vector_Control
IM_PWM_Current_Vector_Control_6phases
nameComponent name
xX-coordinate
yY-coordinate
Returns
CircuitComponentInstance object

For more information on component type, see Properties and Flags for the Circuit Settings .

void Circuit::CreateTerminalDifferenceLabel ( String &  name,
int  x1,
int  y1,
int  x2,
int  y2 
)

Adds the difference in electric potentials or temperatures between two terminals to the result table.

Parameters
nameLabel given to a pair of terminals for finding the electric potential difference or temperature difference.
x1X-coordinate of terminal 1
y1Y-coordinate of terminal 1
x2X-coordinate of terminal 2
y2Y-coordinate of terminal 2
void Circuit::CreateTerminalLabel ( String &  name,
int  x,
int  y 
)

Adds the electric potential or temperature of the terminal to the result table.

Parameters
nameTitle of the voltage or temperature
xX-coordinate of the terminal
yY-coordinate of the terminal
void Circuit::CreateVoltageDifferenceLabel ( String &  name,
int  x1,
int  y1,
int  x2,
int  y2 
)

Equivalent of Circuit::CreateTerminalDifferenceLabel .

Deprecated:
Adds the difference in results between two terminals to a result table.
CircuitWire * Circuit::CreateWire ( int  x1,
int  y1,
int  x2,
int  y2 
)

Connects two terminals with a wire.

Parameters
x1X-coordinate of terminal 1
y1Y-coordinate of terminal 1
x2X-coordinate of terminal 2
y2Y-coordinate of terminal 2
Returns
CircuitWire object
void Circuit::DeleteComponent ( Variant &  val)

Specifies a name, and deletes a component.

Parameters
valComponent name
void Circuit::DeleteComponentInstance ( Variant &  val)

Deletes the component from the specified name or index.

Parameters
valName or index of the circuit component
void Circuit::DeleteComponentInstanceByType ( String &  typeName,
int  index 
)

Deletes the component from the specified component type and index.

Parameters
typeNameComponent type
indexIndex of circuit component

For more information on component types, see Properties and Flags for the Circuit Settings .

void Circuit::DeleteInstance ( Variant &  val,
int  index 
)

Specifies a name or index, and deletes an instance.

Parameters
valName or index of the circuit component
indexIndex of an instance
void Circuit::DeleteTerminalDifferenceLabel ( int  x1,
int  y1,
int  x2,
int  y2 
)

Deletes the electric potential difference or temperature difference between two terminals from the result table.

Parameters
x1X-coordinate of the terminal 1
y1Y-coordinate of the terminal 1
x2X-coordinate of the terminal 2
y2Y-coordinate of the terminal 2
void Circuit::DeleteTerminalLabel ( int  x,
int  y 
)

Deletes the electric potential or temperature of the terminal from the result table.

Parameters
xX-coordinate of the terminal
yY-coordinate of the terminal
void Circuit::DeleteVoltageDifferenceLabel ( int  x1,
int  y1,
int  x2,
int  y2 
)

Equivalent of Circuit::DeleteTerminalDifferenceLabel .

Deprecated:
Deletes the difference in results between two terminals from a result table.
void Circuit::DeleteWire ( CircuitWire wire)

Specifies the CircuitWire object, and deletes a wire.

Parameters
wireCircuitWire object
void Circuit::DeleteWireByIndex ( int  index)

Specifies the index, and deletes a wire.

Parameters
indexWire index
CircuitComponentInstance * Circuit::DuplicateCircuit ( String &  name,
String &  newName 
)

Duplicates a circuit.

Parameters
nameCircuit component name
newNameNew circuit component name
void Circuit::ExportImage ( String &  filename)

Exports an image file (*.png, *.jpg, *.bmp).

Parameters
filenameFile path
void Circuit::ExportImageWithSize ( String &  filename,
int  width,
int  height 
)

Exports an image file (*.png, *.jpg, *.bmp) by specifying the size.

Parameters
filenameFile path
widthwidth
heightheight
void Circuit::ExportXML ( String &  filename)

Exports thermal circuit from magnetic analysis study to xml file.

Parameters
filenameFile path
CircuitComponent * Circuit::GetComponent ( Variant &  val)

Returns the CircuitComponent object of the specified component name or index.

This command is used to operate the properties of a component.

Parameters
valComponent name or index
Returns
CircuitComponent object
CircuitComponent * Circuit::GetComponentByType ( String &  typeName,
int  index 
)

Returns the CircuitComponent object from the specified component type and index.
.

This command is used to operate the properties of a component.

Parameters
typeNameComponent type
indexIndex of circuit component
Returns
CircuitComponent object
CircuitComponentInstance * Circuit::GetComponentInstance ( Variant &  val)

Returns the CircuitComponentInstance object of the specified component name or index.
.

This command is used to specify the position and angle of a component.

Parameters
valName or index of the circuit component
Returns
CircuitComponentInstance object
CircuitComponentInstance * Circuit::GetComponentInstanceByType ( String &  typeName,
int  index 
)

Returns the CircuitComponentInstance object from the specified component type and index.
.

This command is used to operate the position and angle of a component.

Parameters
typeNameComponent type
indexComponent index
Returns
CircuitComponentInstance object
CircuitComponentInstance * Circuit::GetInstance ( Variant &  val,
int  index 
)

Returns an instance.

Parameters
valComponent name/Component index
indexInstance index
Returns
CircuitComponentInstance object
Circuit * Circuit::GetSubCircuit ( Variant &  val)

Returns the Circuit object for the specified macro component name or index.

This command is used to operate the contents of a macro component.

Parameters
valName or index of the macro circuit component
Returns
Circuit object
CircuitWire * Circuit::GetWire ( int  index)

Returns the CircuitWire object of the specified index.

Parameters
indexWire index
Returns
CircuitWire object
bool Circuit::IsValid ( )

Returns True if an object is valid.

Returns
Whether or not the Circuit object is valid
void Circuit::MakeSubCircuitEditable ( Variant &  val)

Makes the subcircuit editable for the macro component of the specified name or index.

Parameters
valComponent name / component index
int Circuit::NumComponents ( )

Returns the total number of components in the circuit as an integer.

Returns
Total number of components
int Circuit::NumComponentsByType ( String &  typeName)

Returns the total number of components in the circuit as an integer.

Parameters
typeNameComponent type
Returns
Total number of components
int Circuit::NumInstances ( )

Returns the total number of instances of the component as an integer.

Returns
Total number of instances of the component
int Circuit::NumSubCircuit ( )

Returns the total number of macro components as an integer.

Returns
Total number of macro components
int Circuit::NumWires ( )

Returns the number of wires as an integer.

Returns
Total number of wires
void Circuit::Save ( String &  filename,
int  version = kProjectFileVersion 
)

Saves a file.

Parameters
filenameFile path
versionSave version
void Circuit::SaveToolbox ( String &  title,
String &  description,
String &  folder,
int  version = kProjectFileVersion 
)

Saves circuit file and registers it to the tool box.

Parameters
titleTitle
descriptionDescription
folderFolder of tool box
versionSave version