25 #include <qtabwidget.h>
26 #include <qmessagebox.h>
58 Arcs.setAutoDelete(
true);
59 Lines.setAutoDelete(
true);
60 Rects.setAutoDelete(
true);
61 Ellips.setAutoDelete(
true);
62 Ports.setAutoDelete(
true);
63 Texts.setAutoDelete(
true);
64 Props.setAutoDelete(
true);
90 _dx = metrics.width(
Name);
91 _dy = metrics.height();
97 tmp = metrics.width(pp->Name+
"="+pp->Value);
98 if(tmp > _dx) _dx = tmp;
99 _dy += metrics.height();
120 dy = int(
float(ny) / Corr);
129 if(relative) {
cx +=
x;
cy += y; }
130 else {
cx =
x;
cy = y; }
145 if(x_ <
tx)
return -1;
146 if(y_ <
ty)
return -1;
150 int w, dy = int(
float(y_) * Corr);
153 w = metrics.width(
Name);
162 for(pp =
Props.first(); pp != 0; pp =
Props.next())
164 if((dy--) < 1)
break;
168 w = metrics.width(pp->
Name+
"="+pp->
Value);
169 if(x_ > w)
return -1;
178 if(x_ >=
x1)
if(x_ <=
x2)
if(y_ >=
y1)
if(y_ <=
y2)
188 int x, y, a,
b, xb, yb;
192 if(
Model.at(0) ==
'.') {
193 newFont.setPointSizeFloat(p->
Scale *
Texts.getFirst()->Size);
194 newFont.setWeight(QFont::DemiBold);
198 p->
Painter->setPen(QPen(QPen::darkBlue,2));
201 for(pt =
Texts.first(); pt != 0; pt =
Texts.next()) {
202 t.setRect(x, y+b, 0, 0);
203 p->
Painter->drawText(t, Qt::AlignLeft|Qt::DontClip, pt->
s, -1, &r);
205 if(a < r.width()) a = r.width();
207 xb = a + int(12.0*p->
Scale);
208 yb = b + int(10.0*p->
Scale);
215 p->
Painter->drawRect(a, b, xb, yb);
216 p->
Painter->drawLine(x, y+yb, a, b+yb);
217 p->
Painter->drawLine(x+xb-1, y+yb, x, y+yb);
218 p->
Painter->drawLine(x+xb-1, y+yb, a+xb, b+yb);
219 p->
Painter->drawLine(x+xb-1, y+yb, x+xb-1, y);
220 p->
Painter->drawLine(x+xb-1, y, a+xb, b);
231 for(
Arc *p3 =
Arcs.first(); p3 != 0; p3 =
Arcs.next()) {
233 p->
drawArc(
cx+p3->x,
cy+p3->y, p3->w, p3->h, p3->angle, p3->arclen);
238 for(pa =
Rects.first(); pa != 0; pa =
Rects.next()) {
250 p->
Painter->setBrush(QBrush::NoBrush);
253 QWMatrix wm = p->
Painter->worldMatrix();
255 for(pt =
Texts.first(); pt != 0; pt =
Texts.next()) {
260 newFont.setPointSizeFloat(p->
Scale * pt->
Size);
261 newFont.setOverline(pt->
over);
262 newFont.setUnderline(pt->
under);
266 p->
Painter->drawText(0, 0, 0, 0, Qt::AlignLeft|Qt::DontClip, pt->
s);
272 p->
Painter->setWorldMatrix(wm);
273 p->
Painter->setWorldXForm(
false);
279 p->
Painter->setPen(QPen(QPen::black,1));
282 p->
Painter->drawText(x, y, 0, 0, Qt::DontClip,
Name);
288 p->
Painter->drawText(x, y, 0, 0, Qt::DontClip, p4->Name+
"="+p4->Value);
293 p->
Painter->setPen(QPen(QPen::red,0));
295 p->
Painter->setPen(QPen(QPen::darkGreen,0));
303 p->
Painter->setPen(QPen(QPen::darkGray,3));
312 if(
Model.at(0) ==
'.') {
315 QFont newFont = p->font();
320 newFont.setWeight(QFont::DemiBold);
321 QFontMetrics metrics(newFont);
325 for(pt =
Texts.first(); pt != 0; pt =
Texts.next()) {
326 r = metrics.size(0, pt->
s);
328 if(a < r.width()) a = r.width();
330 xb = a + int(12.0*Scale);
331 yb = b + int(10.0*Scale);
332 x2 =
x1+25 + int(
float(a) / Scale);
333 y2 =
y1+23 + int(
float(b) / Scale);
336 p->drawRect(
cx-6,
cy-5, xb, yb);
337 p->drawLine(
cx-1,
cy+yb,
cx-6,
cy+yb-5);
338 p->drawLine(
cx+xb-2,
cy+yb,
cx-1,
cy+yb);
339 p->drawLine(
cx+xb-2,
cy+yb,
cx+xb-6,
cy+yb-5);
340 p->drawLine(
cx+xb-2,
cy+yb,
cx+xb-2,
cy);
341 p->drawLine(
cx+xb-2,
cy,
cx+xb-6,
cy-5);
347 p->drawLine(
cx+p1->x1,
cy+p1->y1,
cx+p1->x2,
cy+p1->y2);
351 if(p2->avail) p->drawEllipse(
cx+p2->x-4,
cy+p2->y-4, 8, 8);
353 for(
Arc *p3 =
Arcs.first(); p3 != 0; p3 =
Arcs.next())
354 p->drawArc(
cx+p3->x,
cy+p3->y, p3->w, p3->h, p3->angle, p3->arclen);
357 for(pa =
Rects.first(); pa != 0; pa =
Rects.next())
358 p->drawRect(
cx+pa->
x,
cy+pa->
y, pa->
w, pa->
h);
361 p->drawEllipse(
cx+pa->
x,
cy+pa->
y, pa->
w, pa->
h);
369 for(pt =
Texts.first(); pt != 0; pt =
Texts.next())
370 pt->
Size *= FontScale;
374 for(pt =
Texts.first(); pt != 0; pt =
Texts.next())
375 pt->
Size /= FontScale;
382 if(
Ports.count() < 1)
return;
403 for(
Arc *p3 =
Arcs.first(); p3 != 0; p3 =
Arcs.next()) {
411 if(p3->angle >= 16*360) p3->angle -= 16*360;;
416 for(pa =
Rects.first(); pa != 0; pa =
Rects.next()) {
457 dx = metrics.width(
Name);
458 dy = metrics.lineSpacing();
463 tmp = metrics.width(pp->Name+
"="+pp->Value);
464 if(tmp > dx) dx = tmp;
465 dy += metrics.lineSpacing();
468 else if(
ty <
y1)
ty -= dy;
480 if(
Ports.count() < 1)
return;
493 for(
Arc *p3 =
Arcs.first(); p3 != 0; p3 =
Arcs.next()) {
494 p3->y = -p3->y - p3->h;
495 if(p3->angle > 16*180) p3->angle -= 16*360;
496 p3->angle = -p3->angle;
497 p3->angle -= p3->arclen;
498 if(p3->angle < 0) p3->angle += 16*360;
503 for(pa =
Rects.first(); pa != 0; pa =
Rects.next())
504 pa->
y = -pa->
y - pa->
h;
508 pa->
y = -pa->
y - pa->
h;
513 f.setPointSizeFloat(pt->Size);
514 QFontMetrics smallMetrics(f);
515 QSize
s = smallMetrics.size(0, pt->s);
516 pt->y = -pt->y - int(pt->mCos)*s.height() + int(pt->mSin)*s.width();
525 dy = metrics.lineSpacing();
527 if(pp->display) dy += metrics.lineSpacing();
540 if(
Ports.count() < 1)
return;
553 for(
Arc *p3 =
Arcs.first(); p3 != 0; p3 =
Arcs.next()) {
554 p3->x = -p3->x - p3->w;
555 p3->angle = 16*180 - p3->angle - p3->arclen;
556 if(p3->angle < 0) p3->angle += 16*360;
561 for(pa =
Rects.first(); pa != 0; pa =
Rects.next())
562 pa->
x = -pa->
x - pa->
w;
566 pa->
x = -pa->
x - pa->
w;
572 f.setPointSizeFloat(pt->Size);
573 QFontMetrics smallMetrics(f);
574 QSize
s = smallMetrics.size(0, pt->s);
575 pt->x = -pt->x - int(pt->mSin)*s.height() - int(pt->mCos)*s.width();
584 dx = metrics.width(
Name);
588 tmp = metrics.width(pp->Name+
"="+pp->Value);
589 if(tmp > dx) dx = tmp;
607 s +=
" "+p1->Connection->Name;
611 if(p2->Name !=
"Symbol")
612 s +=
" "+p2->Name+
"=\""+p2->Value+
"\"";
630 QString Node1 =
Ports.first()->Connection->Name;
632 s +=
"R:" +
Name +
"." + QString::number(z++) +
" " +
633 Node1 +
" " + pp->Connection->Name +
" R=\"0\"\n";
657 for(p =
Ports.next(); p != 0; p =
Ports.next())
683 QString Node1 =
Ports.first()->Connection->Name;
684 return " " + Node1 +
" <= " +
Ports.next()->Connection->Name +
";\n";
692 QDomElement el = doc.createElement (
Model);
693 doc.appendChild (el);
694 el.setTagName (
Model);
695 el.setAttribute (
"inst",
Name.isEmpty() ?
"*" :
Name);
697 el.setAttribute (
"cx",
cx);
698 el.setAttribute (
"cy",
cy);
699 el.setAttribute (
"tx",
tx);
700 el.setAttribute (
"ty",
ty);
702 el.setAttribute (
"rotate",
rotated);
705 el.setAttribute (pr->Name, (pr->display ?
"1@" :
"0@") + pr->Value);
707 qDebug (doc.toString());
711 if(
Name.isEmpty()) s +=
" * ";
712 else s +=
" "+
Name+
" ";
718 s += QString::number(i);
719 s +=
" "+QString::number(
cx)+
" "+QString::number(
cy);
720 s +=
" "+QString::number(
tx)+
" "+QString::number(
ty);
723 s +=
" "+QString::number(
rotated);
727 if(p1->Description.isEmpty())
728 s +=
" \""+p1->Name+
"="+p1->Value+
"\"";
729 else s +=
" \""+p1->Value+
"\"";
730 if(p1->display) s +=
" 1";
744 if(s.at(0) !=
'<')
return false;
745 if(s.at(s.length()-1) !=
'>')
return false;
746 s = s.mid(1, s.length()-2);
749 Name = s.section(
' ',1,1);
752 n = s.section(
' ',2,2);
754 if(!ok)
return false;
762 n = s.section(
' ',3,3);
764 if(!ok)
return false;
766 n = s.section(
' ',4,4);
768 if(!ok)
return false;
770 n = s.section(
' ',5,5);
772 if(!ok)
return false;
774 n = s.section(
' ',6,6);
776 if(!ok)
return false;
778 if(
Model.at(0) !=
'.') {
780 n = s.section(
' ',7,7);
781 if(n.toInt(&ok) == 1)
mirrorX();
782 if(!ok)
return false;
784 n = s.section(
' ',8,8);
786 if(!ok)
return false;
795 unsigned int z=0, counts = s.contains(
'"');
798 else if(
Model ==
"Lib")
800 else if(
Model ==
"EDD")
802 else if(
Model ==
"RFEDD")
804 else if(
Model ==
"VHDL")
806 else tmp = counts + 1;
808 for(; tmp<=(int)counts/2; tmp++)
813 for(p1 =
Props.first(); p1 != 0; p1 =
Props.next()) {
815 n = s.section(
'"',z,z);
822 if(
Model ==
"Diode") {
825 p1 =
Props.at(counts-1);
826 for(; p1 != 0; p1 =
Props.current()) {
830 n =
Props.prev()->Value;
836 Props.current()->Value =
"0";
843 p1 =
Props.at(counts);
844 for(; p1 != 0; p1 =
Props.current()) {
847 n =
Props.prev()->Value;
850 Props.current()->Value =
"10";
856 p1 =
Props.at(counts);
857 for(; p1 != 0; p1 =
Props.current()) {
860 n =
Props.prev()->Value;
863 Props.current()->Value =
"10";
873 p1->
Name = n.section(
'=',0,0);
874 n = n.section(
'=',1);
876 if(
Props.count() < (counts>>1)) {
881 if(z == 6)
if(counts == 6)
883 Props.getLast()->Value =
n;
888 n = s.section(
'"',z,z);
889 p1->
display = (n.at(1) ==
'1');
905 int i1, i2, i3, i4, i5, i6;
907 s = Row.section(
' ',0,0);
908 if((s ==
"PortSym") || (s ==
".PortSym")) {
911 for(i6 =
Ports.count(); i6<i3; i6++)
914 Ports.at(i3-1)->x = i1;
915 Ports.current()->y = i2;
916 Ports.current()->avail =
true;
924 else if(s ==
"Line") {
925 if(!
getIntegers(Row, &i1, &i2, &i3, &i4))
return -1;
926 if(!
getPen(Row, Pen, 5))
return -1;
929 Lines.append(
new Line(i1, i2, i3, i4, Pen));
941 else if(s ==
"EArc") {
942 if(!
getIntegers(Row, &i1, &i2, &i3, &i4, &i5, &i6))
944 if(!
getPen(Row, Pen, 7))
return -1;
945 Arcs.append(
new struct Arc(i1, i2, i3, i4, i5, i6, Pen));
948 if(i1+i3 >
x2)
x2 = i1+i3;
950 if(i2+i4 >
y2)
y2 = i2+i4;
953 else if(s ==
".ID") {
957 Name = Row.section(
' ',3,3);
963 s = Row.section(
'"', i1,i1);
964 if(s.isEmpty())
break;
971 pp->
display = (s.at(0) ==
'1');
972 pp->
Value = s.section(
'=', 2,2);
975 pp->
Name = s.section(
'=', 1,1);
983 while(pp !=
Props.last())
987 else if(s ==
"Arrow") {
988 if(!
getIntegers(Row, &i1, &i2, &i3, &i4, &i5, &i6))
return -1;
989 if(!
getPen(Row, Pen, 7))
return -1;
991 double beta =
atan2(
double(i6),
double(i5));
992 double phi =
atan2(
double(i4),
double(i3));
993 double Length =
sqrt(
double(i6*i6 + i5*i5));
1000 if(i3 >
x2)
x2 = i3;
1001 if(i2 <
y1)
y1 = i2;
1002 if(i2 >
y2)
y2 = i2;
1003 if(i4 <
y1)
y1 = i4;
1004 if(i4 >
y2)
y2 = i4;
1006 Lines.append(
new Line(i1, i2, i3, i4, Pen));
1008 double w = beta+phi;
1009 i5 = i3-int(Length*
cos(w));
1010 i6 = i4-int(Length*
sin(w));
1011 Lines.append(
new Line(i3, i4, i5, i6, Pen));
1012 if(i5 <
x1)
x1 = i5;
1013 if(i5 >
x2)
x2 = i5;
1014 if(i6 <
y1)
y1 = i6;
1015 if(i6 >
y2)
y2 = i6;
1018 i5 = i3-int(Length*
cos(w));
1019 i6 = i4-int(Length*
sin(w));
1020 Lines.append(
new Line(i3, i4, i5, i6, Pen));
1021 if(i5 <
x1)
x1 = i5;
1022 if(i5 >
x2)
x2 = i5;
1023 if(i6 <
y1)
y1 = i6;
1024 if(i6 >
y2)
y2 = i6;
1028 else if(s ==
"Ellipse") {
1029 if(!
getIntegers(Row, &i1, &i2, &i3, &i4))
return -1;
1030 if(!
getPen(Row, Pen, 5))
return -1;
1031 if(!
getBrush(Row, Brush, 8))
return -1;
1032 Ellips.append(
new Area(i1, i2, i3, i4, Pen, Brush));
1034 if(i1 <
x1)
x1 = i1;
1035 if(i1 >
x2)
x2 = i1;
1036 if(i2 <
y1)
y1 = i2;
1037 if(i2 >
y2)
y2 = i2;
1038 if(i1+i3 <
x1)
x1 = i1+i3;
1039 if(i1+i3 >
x2)
x2 = i1+i3;
1040 if(i2+i4 <
y1)
y1 = i2+i4;
1041 if(i2+i4 >
y2)
y2 = i2+i4;
1044 else if(s ==
"Rectangle") {
1045 if(!
getIntegers(Row, &i1, &i2, &i3, &i4))
return -1;
1046 if(!
getPen(Row, Pen, 5))
return -1;
1047 if(!
getBrush(Row, Brush, 8))
return -1;
1048 Rects.append(
new Area(i1, i2, i3, i4, Pen, Brush));
1050 if(i1 <
x1)
x1 = i1;
1051 if(i1 >
x2)
x2 = i1;
1052 if(i2 <
y1)
y1 = i2;
1053 if(i2 >
y2)
y2 = i2;
1054 if(i1+i3 <
x1)
x1 = i1+i3;
1055 if(i1+i3 >
x2)
x2 = i1+i3;
1056 if(i2+i4 <
y1)
y1 = i2+i4;
1057 if(i2+i4 >
y2)
y2 = i2+i4;
1060 else if(s ==
"Text") {
1061 if(!
getIntegers(Row, &i1, &i2, &i3, 0, &i4))
return -1;
1062 Color.setNamedColor(Row.section(
' ',4,4));
1063 if(!Color.isValid())
return -1;
1065 s = Row.mid(Row.find(
'"')+1);
1066 s = s.left(s.length()-1);
1067 if(s.isEmpty())
return -1;
1070 Texts.append(
new Text(i1, i2, s, Color,
float(i3),
1071 float(
cos(
float(i4)*
M_PI/180.0)),
1072 float(
sin(
float(i4)*
M_PI/180.0))));
1075 Font.setPointSizeFloat(
float(i3));
1076 QFontMetrics metrics(Font);
1077 QSize r = metrics.size(0, s);
1078 i3 = i1 + int(
float(r.width()) *
Texts.current()->mCos)
1079 +
int(
float(r.height()) *
Texts.current()->mSin);
1080 i4 = i2 + int(
float(r.width()) * -
Texts.current()->mSin)
1081 +
int(
float(r.height()) *
Texts.current()->mCos);
1083 if(i1 <
x1)
x1 = i1;
1084 if(i2 <
y1)
y1 = i2;
1085 if(i1 >
x2)
x2 = i1;
1086 if(i2 >
y2)
y2 = i2;
1088 if(i3 <
x1)
x1 = i3;
1089 if(i4 <
y1)
y1 = i4;
1090 if(i3 >
x2)
x2 = i3;
1091 if(i4 >
y2)
y2 = i4;
1100 int *i4,
int *i5,
int *i6)
1105 if(!i1)
return true;
1106 n = s.section(
' ',1,1);
1108 if(!ok)
return false;
1110 if(!i2)
return true;
1111 n = s.section(
' ',2,2);
1113 if(!ok)
return false;
1115 if(!i3)
return true;
1116 n = s.section(
' ',3,3);
1118 if(!ok)
return false;
1121 n = s.section(
' ',4,4);
1123 if(!ok)
return false;
1126 if(!i5)
return true;
1127 n = s.section(
' ',5,5);
1129 if(!ok)
return false;
1131 if(!i6)
return true;
1132 n = s.section(
' ',6,6);
1134 if(!ok)
return false;
1145 n = s.section(
' ',i,i);
1147 co.setNamedColor(n);
1149 if(!Pen.color().isValid())
return false;
1152 n = s.section(
' ',i,i);
1153 Pen.setWidth(n.toInt(&ok));
1154 if(!ok)
return false;
1157 n = s.section(
' ',i,i);
1158 Pen.setStyle((Qt::PenStyle)n.toInt(&ok));
1159 if(!ok)
return false;
1170 n = s.section(
' ',i,i);
1172 co.setNamedColor(n);
1174 if(!Brush.color().isValid())
return false;
1177 n = s.section(
' ',i,i);
1178 Brush.setStyle((Qt::BrushStyle)n.toInt(&ok));
1179 if(!ok)
return false;
1182 n = s.section(
' ',i,i);
1183 if(n.toInt(&ok) == 0) Brush.setStyle(QBrush::NoBrush);
1184 if(!ok)
return false;
1193 if(pp->Name == name) {
1252 for(
int z=0; z<rrot; z++)
rotate();
1276 QObject::tr(
"number of input ports")));
1278 QObject::tr(
"voltage of high level")));
1280 QObject::tr(
"delay time")));
1282 QObject::tr(
"transfer function scaling factor")));
1286 QObject::tr(
"schematic symbol")+
" [old, DIN40900]"));
1296 s +=
" "+pp->Connection->Name;
1300 s +=
" " + p->Name +
"=\"" + p->Value +
"\"";
1302 s +=
" " + p->Name +
"=\"" + p->Value +
"\"";
1304 s +=
" " + p->Name +
"=\"" + p->Value +
"\"\n";
1315 if (
Model ==
"XNOR") {
1316 QString Op =
" xor ";
1323 for (pp =
Ports.next (); pp != 0; pp =
Ports.next ())
1328 QString Op =
' ' +
Model.lower() +
' ';
1329 if(
Model.at(0) ==
'N') {
1331 Op = Op.remove(1, 1);
1338 for(pp =
Ports.next(); pp != 0; pp =
Ports.next())
1340 if(
Model.at(0) ==
'N')
1345 QString td =
Props.at(2)->Value;
1357 bool synthesize =
true;
1362 QString op =
Model.lower();
1363 if(op ==
"and" || op ==
"nand")
1365 else if (op ==
"or" || op ==
"nor")
1367 else if (op ==
"xor")
1369 else if (op ==
"xnor")
1375 QString td =
Props.at(2)->Value;
1380 if(
Model.at(0) ==
'N') s +=
"~(";
1386 for(pp =
Ports.next(); pp != 0; pp =
Ports.next())
1389 if(
Model.at(0) ==
'N') s +=
")";
1393 s =
" " +
Model.lower();
1396 QString td =
Props.at(2)->Value;
1406 for(pp =
Ports.next(); pp != 0; pp =
Ports.next())
1417 int Num =
Props.getFirst()->Value.toInt();
1418 if(Num < 2) Num = 2;
1419 else if(Num > 8) Num = 8;
1420 Props.getFirst()->Value = QString::number(Num);
1422 int xl, xr, y = 10*Num, z;
1423 x1 = -30;
y1 = -y-3;
1430 if(
Model.at(0) ==
'N') z = 1;
1432 if(
Props.getLast()->Value.at(0) ==
'D') {
1435 Lines.append(
new Line( 15,-y, 15, y,QPen(QPen::darkBlue,2)));
1436 Lines.append(
new Line(-15,-y, 15,-y,QPen(QPen::darkBlue,2)));
1437 Lines.append(
new Line(-15, y, 15, y,QPen(QPen::darkBlue,2)));
1438 Lines.append(
new Line(-15,-y,-15, y,QPen(QPen::darkBlue,2)));
1439 Lines.append(
new Line( 15, 0, 30, 0,QPen(QPen::darkBlue,2)));
1441 if(
Model.at(z) ==
'O') {
1442 Lines.append(
new Line(-11, 6-y,-6, 9-y,QPen(QPen::darkBlue,0)));
1443 Lines.append(
new Line(-11,12-y,-6, 9-y,QPen(QPen::darkBlue,0)));
1444 Lines.append(
new Line(-11,14-y,-6,14-y,QPen(QPen::darkBlue,0)));
1445 Lines.append(
new Line(-11,16-y,-6,16-y,QPen(QPen::darkBlue,0)));
1446 Texts.append(
new Text( -4, 3-y,
"1", QPen::darkBlue, 15.0));
1448 else if(
Model.at(z) ==
'A')
1449 Texts.append(
new Text( -10, 3-y,
"&", QPen::darkBlue, 15.0));
1450 else if(
Model.at(0) ==
'X') {
1451 if(
Model.at(1) ==
'N') {
1453 QPen(QPen::darkBlue,0), QBrush(QPen::darkBlue)));
1454 Texts.append(
new Text( -11, 3-y,
"=1", QPen::darkBlue, 15.0));
1457 Texts.append(
new Text( -11, 3-y,
"=1", QPen::darkBlue, 15.0));
1462 if(
Model.at(z) ==
'O') xl = 10;
1465 Lines.append(
new Line(-10,-y,-10, y,QPen(QPen::darkBlue,2)));
1466 Lines.append(
new Line( 10, 0, 30, 0,QPen(QPen::darkBlue,2)));
1467 Arcs.append(
new Arc(-30,-y, 40, 30, 0, 16*90,QPen(QPen::darkBlue,2)));
1468 Arcs.append(
new Arc(-30,y-30, 40, 30, 0,-16*90,QPen(QPen::darkBlue,2)));
1469 Lines.append(
new Line( 10,15-y, 10, y-15,QPen(QPen::darkBlue,2)));
1471 if(
Model.at(0) ==
'X') {
1472 Lines.append(
new Line(-5, 0, 5, 0,QPen(QPen::darkBlue,1)));
1473 if(
Model.at(1) ==
'N') {
1474 Lines.append(
new Line(-5,-3, 5,-3,QPen(QPen::darkBlue,1)));
1475 Lines.append(
new Line(-5, 3, 5, 3,QPen(QPen::darkBlue,1)));
1478 Arcs.append(
new Arc(-5,-5, 10, 10, 0, 16*360,QPen(QPen::darkBlue,1)));
1479 Lines.append(
new Line( 0,-5, 0, 5,QPen(QPen::darkBlue,1)));
1484 if(
Model.at(0) ==
'N')
1486 QPen(QPen::darkBlue,0), QBrush(QPen::darkBlue)));
1490 for(z=0; z<Num; z++) {
1493 if(xl == 10)
if((z == 0) || (z == Num-1)) {
1494 Lines.append(
new Line(-30, y, 9, y,QPen(QPen::darkBlue,2)));
1497 Lines.append(
new Line(-30, y, xl, y,QPen(QPen::darkBlue,2)));
1514 Line = Line.stripWhiteSpace();
1515 if(Line.at(0) !=
'<') {
1516 QMessageBox::critical(0, QObject::tr(
"Error"),
1517 QObject::tr(
"Format Error:\nWrong line start!"));
1521 QString cstr = Line.section (
' ',0,0);
1523 if (cstr ==
"Lib") c =
new LibComp ();
1524 else if (cstr ==
"Eqn") c =
new Equation ();
1525 else if (cstr ==
"Rus") c =
new Resistor (
false);
1526 else if (cstr.left (6) ==
"SPfile" && cstr !=
"SPfile") {
1529 c->
Props.getLast()->Value = cstr.mid (6); }
1534 QMessageBox::critical(0, QObject::tr(
"Error"),
1535 QObject::tr(
"Format Error:\nUnknown component!"));
1539 if(!c->
load(Line)) {
1540 QMessageBox::critical(0, QObject::tr(
"Error"),
1541 QObject::tr(
"Format Error:\nWrong 'component' line format!"));
1547 int x = c->
tx, y = c->
ty;
1550 c->
tx =
x; c->
ty = y;