Ejemplo n.º 1
0
Diode::Diode(Circuit& cir, Node* n1, Node* n2, string name)
: TwoEndedDevice(n1, n2, name)
{
	cir.addDevice(this);
	n1->base.push_back(this);
	n2->head.push_back(this);
}
Ejemplo n.º 2
0
Resistor::Resistor(Circuit& cir, double R, Node* n1, Node* n2, string name)
: TwoEndedDevice(n1, n2, name), R(R)
{
	cir.addDevice(this);
	n1->base.push_back(this);
	n2->head.push_back(this);
}
Ejemplo n.º 3
0
Inductor::Inductor(Circuit& cir, double H, Node* n1, Node* n2, string name)
: TwoEndedDevice(n1, n2, name), H(H)
{
	cir.addDevice(this);
	n1->base.push_back(this);
	n2->head.push_back(this);
}
Ejemplo n.º 4
0
Capacitor::Capacitor(Circuit& cir, double C, Node* n1, Node* n2, string name)
: TwoEndedDevice(n1, n2, name), C(C)
{
	cir.addDevice(this);
	n1->base.push_back(this);
	n2->head.push_back(this);
}
Ejemplo n.º 5
0
ExternalVoltage::ExternalVoltage(Circuit& cir, funct f, Node* n, string name)
: OneEndedDevice(n, name), f(f)
{
	cir.addDevice(this);
	n->base.push_back(this);
}