27 Description = QObject::tr(
"equation defined device");
34 QObject::tr(
"type of equations")+
" [explicit, implicit]"));
36 QObject::tr(
"number of branches")));
40 QObject::tr(
"current equation") +
" 1"));
42 QObject::tr(
"charge equation") +
" 1"));
60 Name = QObject::tr(
"Equation Defined Device");
61 BitmapFile = (
char *)
"edd";
65 p->
Props.at(0)->Value =
"explicit";
66 p->
Props.at(1)->Value =
"1";
81 s +=
" "+p1->Connection->Name;
86 s +=
" "+p2->Name+
"=\""+Name+
"."+p2->Name+
"\"";
87 e +=
" Eqn:Eqn"+Name+p2->Name+
" "+
88 Name+
"."+p2->Name+
"=\""+p2->Value+
"\" Export=\"no\"\n";
98 int i, PortDistance = 60;
101 int Num =
Props.at(1)->Value.toInt();
107 Props.at(1)->Value = QString::number(Num);
110 int NumProps = (
Props.count() - 2) / 2;
111 if (NumProps < Num) {
112 for(i = NumProps; i < Num; i++) {
113 Props.append(
new Property(
"I"+QString::number(i+1),
"0",
false,
114 QObject::tr(
"current equation") +
" " +QString::number(i+1)));
115 Props.append(
new Property(
"Q"+QString::number(i+1),
"0",
false,
116 QObject::tr(
"charge equation") +
" " +QString::number(i+1)));
119 for(i = Num; i < NumProps; i++) {
127 for(i = 1; i <= Num; i++) {
128 p1->
Name =
"I"+QString::number(i);
130 p1->
Name =
"Q"+QString::number(i);
135 int h = (PortDistance/2)*((Num-1)) + PortDistance/2;
136 Lines.append(
new Line(-15, -h, 15, -h,QPen(Qt::darkBlue,2)));
137 Lines.append(
new Line( 15, -h, 15, h,QPen(Qt::darkBlue,2)));
138 Lines.append(
new Line(-15, h, 15, h,QPen(Qt::darkBlue,2)));
139 Lines.append(
new Line(-15, -h,-15, h,QPen(Qt::darkBlue,2)));
143 int y = PortDistance/2-h, yh;
146 Lines.append(
new Line(-30, y,-15, y,QPen(Qt::darkBlue,2)));
149 Lines.append(
new Line( 7,y-3, 10, y,QPen(Qt::black,1)));
150 Lines.append(
new Line( 7,y+3, 10, y,QPen(Qt::black,1)));
151 Lines.append(
new Line(-10, y, 10, y,QPen(Qt::black,1)));
154 yh = y-PortDistance/2;
155 Lines.append(
new Line(-15, yh, 15, yh, QPen(Qt::darkBlue,2)));
158 Lines.append(
new Line( 15, y, 30, y,QPen(Qt::darkBlue,2)));
160 Texts.append(
new Text( 19,y-14,QString::number(i)));
169 ty =
y1 - 2*metrics.lineSpacing() - 4;
static Element * info(QString &, char *&, bool getNewOne=false)
tQucsSettings QucsSettings
Definitions and declarations for the main application.
Q3PtrList< Property > Props
Superclass of all schematic drawing elements.
void recreate(Schematic *)