26 #include <QMessageBox>
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);
92 _dx = metrics.width(
Name);
93 _dy = metrics.height();
99 tmp = metrics.width(pp->Name+
"="+pp->Value);
100 if(tmp > _dx) _dx = tmp;
101 _dy += metrics.height();
122 dy = int(
float(ny) / Corr);
131 if(relative) {
cx += x;
cy += y; }
132 else {
cx = x;
cy = y; }
147 if(x_ <
tx)
return -1;
148 if(y_ <
ty)
return -1;
152 int w, dy = int(
float(y_) * Corr);
155 w = metrics.width(
Name);
164 for(pp =
Props.first(); pp != 0; pp =
Props.next())
166 if((dy--) < 1)
break;
170 w = metrics.width(pp->
Name+
"="+pp->
Value);
171 if(x_ > w)
return -1;
180 if(x_ >=
x1)
if(x_ <=
x2)
if(y_ >=
y1)
if(y_ <=
y2)
190 int x, y, a, b, xb, yb;
193 if(
Model.at(0) ==
'.') {
194 newFont.setPointSizeFloat(p->
Scale *
Texts.getFirst()->Size);
195 newFont.setWeight(QFont::DemiBold);
199 p->
Painter->setPen(QPen(Qt::darkBlue,2));
202 for(pt =
Texts.first(); pt != 0; pt =
Texts.next()) {
203 t.setRect(x, y+b, 0, 0);
204 p->
Painter->drawText(t, Qt::AlignLeft|Qt::TextDontClip, pt->
s, -1, &r);
206 if(a < r.width()) a = r.width();
208 xb = a + int(12.0*p->
Scale);
209 yb = b + int(10.0*p->
Scale);
216 p->
Painter->drawRect(a, b, xb, yb);
217 p->
Painter->drawLine(x, y+yb, a, b+yb);
218 p->
Painter->drawLine(x+xb-1, y+yb, x, y+yb);
219 p->
Painter->drawLine(x+xb-1, y+yb, a+xb, b+yb);
220 p->
Painter->drawLine(x+xb-1, y+yb, x+xb-1, y);
221 p->
Painter->drawLine(x+xb-1, y, a+xb, b);
232 for(
Arc *p3 =
Arcs.first(); p3 != 0; p3 =
Arcs.next()) {
234 p->
drawArc(
cx+p3->x,
cy+p3->y, p3->w, p3->h, p3->angle, p3->arclen);
239 for(pa =
Rects.first(); pa != 0; pa =
Rects.next()) {
251 p->
Painter->setBrush(Qt::NoBrush);
253 newFont.setWeight(QFont::Light);
258 QMatrix wm = p->
Painter->worldMatrix();
260 for(pt =
Texts.first(); pt != 0; pt =
Texts.next()) {
265 newFont.setPointSizeFloat(p->
Scale * pt->
Size);
266 newFont.setOverline(pt->
over);
267 newFont.setUnderline(pt->
under);
271 p->
Painter->drawText(0, 0, 0, 0, Qt::AlignLeft|Qt::TextDontClip, pt->
s);
277 p->
Painter->setWorldMatrix(wm);
278 p->
Painter->setWorldXForm(
false);
287 p->
Painter->setPen(QPen(Qt::black,1));
290 p->
Painter->drawText(x, y, 0, 0, Qt::TextDontClip,
Name);
296 p->
Painter->drawText(x, y, 0, 0, Qt::TextDontClip, p4->Name+
"="+p4->Value);
301 p->
Painter->setPen(QPen(Qt::red,0));
303 p->
Painter->setPen(QPen(Qt::darkGreen,0));
312 p->
Painter->setPen(QPen(Qt::darkGray,3));
322 if(
Model.at(0) ==
'.') {
325 QFont newFont = p->font();
330 newFont.setWeight(QFont::DemiBold);
331 QFontMetrics metrics(newFont);
335 for(pt =
Texts.first(); pt != 0; pt =
Texts.next()) {
336 r = metrics.size(0, pt->
s);
338 if(a < r.width()) a = r.width();
340 xb = a + int(12.0*Scale);
341 yb = b + int(10.0*Scale);
342 x2 =
x1+25 + int(
float(a) / Scale);
343 y2 =
y1+23 + int(
float(b) / Scale);
363 for(
Arc *p3 =
Arcs.first(); p3 != 0; p3 =
Arcs.next())
367 for(pa =
Rects.first(); pa != 0; pa =
Rects.next())
379 for(pt =
Texts.first(); pt != 0; pt =
Texts.next())
380 pt->
Size *= FontScale;
384 for(pt =
Texts.first(); pt != 0; pt =
Texts.next())
385 pt->
Size /= FontScale;
394 if(
Ports.count() < 1)
return;
415 for(
Arc *p3 =
Arcs.first(); p3 != 0; p3 =
Arcs.next()) {
423 if(p3->angle >= 16*360) p3->angle -= 16*360;;
428 for(pa =
Rects.first(); pa != 0; pa =
Rects.next()) {
469 dx = metrics.width(
Name);
470 dy = metrics.lineSpacing();
475 tmp = metrics.width(pp->Name+
"="+pp->Value);
476 if(tmp > dx) dx = tmp;
477 dy += metrics.lineSpacing();
480 else if(
ty <
y1)
ty -= dy;
494 if(
Ports.count() < 1)
return;
507 for(
Arc *p3 =
Arcs.first(); p3 != 0; p3 =
Arcs.next()) {
508 p3->y = -p3->y - p3->h;
509 if(p3->angle > 16*180) p3->angle -= 16*360;
510 p3->angle = -p3->angle;
511 p3->angle -= p3->arclen;
512 if(p3->angle < 0) p3->angle += 16*360;
517 for(pa =
Rects.first(); pa != 0; pa =
Rects.next())
518 pa->
y = -pa->
y - pa->
h;
522 pa->
y = -pa->
y - pa->
h;
527 f.setPointSizeFloat(pt->Size);
528 QFontMetrics smallMetrics(f);
529 QSize s = smallMetrics.size(0, pt->s);
530 pt->y = -pt->y - int(pt->mCos)*s.height() + int(pt->mSin)*s.width();
539 dy = metrics.lineSpacing();
541 if(pp->display) dy += metrics.lineSpacing();
556 if(
Ports.count() < 1)
return;
569 for(
Arc *p3 =
Arcs.first(); p3 != 0; p3 =
Arcs.next()) {
570 p3->x = -p3->x - p3->w;
571 p3->angle = 16*180 - p3->angle - p3->arclen;
572 if(p3->angle < 0) p3->angle += 16*360;
577 for(pa =
Rects.first(); pa != 0; pa =
Rects.next())
578 pa->
x = -pa->
x - pa->
w;
582 pa->
x = -pa->
x - pa->
w;
588 f.setPointSizeFloat(pt->Size);
589 QFontMetrics smallMetrics(f);
590 QSize s = smallMetrics.size(0, pt->s);
591 pt->x = -pt->x - int(pt->mSin)*s.height() - int(pt->mCos)*s.width();
600 dx = metrics.width(
Name);
604 tmp = metrics.width(pp->Name+
"="+pp->Value);
605 if(tmp > dx) dx = tmp;
623 s +=
" "+p1->Connection->Name;
627 if(p2->Name !=
"Symbol")
628 s +=
" "+p2->Name+
"=\""+p2->Value+
"\"";
646 QString Node1 =
Ports.first()->Connection->Name;
648 s +=
"R:" +
Name +
"." + QString::number(z++) +
" " +
649 Node1 +
" " + pp->Connection->Name +
" R=\"0\"\n";
673 for(p =
Ports.next(); p != 0; p =
Ports.next())
699 QString Node1 =
Ports.first()->Connection->Name;
700 return " " + Node1 +
" <= " +
Ports.next()->Connection->Name +
";\n";
708 QDomElement el = doc.createElement (
Model);
709 doc.appendChild (el);
710 el.setTagName (
Model);
711 el.setAttribute (
"inst",
Name.isEmpty() ?
"*" :
Name);
713 el.setAttribute (
"cx",
cx);
714 el.setAttribute (
"cy",
cy);
715 el.setAttribute (
"tx",
tx);
716 el.setAttribute (
"ty",
ty);
718 el.setAttribute (
"rotate",
rotated);
721 el.setAttribute (pr->Name, (pr->display ?
"1@" :
"0@") + pr->Value);
723 qDebug (doc.toString());
725 QString s =
"<" +
Model;
727 if(
Name.isEmpty()) s +=
" * ";
728 else s +=
" "+
Name+
" ";
734 s += QString::number(i);
735 s +=
" "+QString::number(
cx)+
" "+QString::number(
cy);
736 s +=
" "+QString::number(
tx)+
" "+QString::number(
ty);
739 s +=
" "+QString::number(
rotated);
743 if(p1->Description.isEmpty())
744 s +=
" \""+p1->Name+
"="+p1->Value+
"\"";
745 else s +=
" \""+p1->Value+
"\"";
746 if(p1->display) s +=
" 1";
760 if(s.at(0) !=
'<')
return false;
761 if(s.at(s.length()-1) !=
'>')
return false;
762 s = s.mid(1, s.length()-2);
765 Name = s.section(
' ',1,1);
768 n = s.section(
' ',2,2);
770 if(!ok)
return false;
778 n = s.section(
' ',3,3);
780 if(!ok)
return false;
782 n = s.section(
' ',4,4);
784 if(!ok)
return false;
786 n = s.section(
' ',5,5);
788 if(!ok)
return false;
790 n = s.section(
' ',6,6);
792 if(!ok)
return false;
794 if(
Model.at(0) !=
'.') {
796 n = s.section(
' ',7,7);
797 if(n.toInt(&ok) == 1)
mirrorX();
798 if(!ok)
return false;
800 n = s.section(
' ',8,8);
802 if(!ok)
return false;
811 unsigned int z=0, counts = s.count(
'"');
814 else if(
Model ==
"Lib")
816 else if(
Model ==
"EDD")
818 else if(
Model ==
"RFEDD")
820 else if(
Model ==
"VHDL")
822 else tmp = counts + 1;
824 for(; tmp<=(int)counts/2; tmp++)
829 for(p1 =
Props.first(); p1 != 0; p1 =
Props.next()) {
831 n = s.section(
'"',z,z);
838 if(
Model ==
"Diode") {
841 p1 =
Props.at(counts-1);
842 for(; p1 != 0; p1 =
Props.current()) {
846 n =
Props.prev()->Value;
852 Props.current()->Value =
"0";
859 p1 =
Props.at(counts);
860 for(; p1 != 0; p1 =
Props.current()) {
863 n =
Props.prev()->Value;
866 Props.current()->Value =
"10";
872 p1 =
Props.at(counts);
873 for(; p1 != 0; p1 =
Props.current()) {
876 n =
Props.prev()->Value;
879 Props.current()->Value =
"10";
889 p1->
Name = n.section(
'=',0,0);
890 n = n.section(
'=',1);
892 if(
Props.count() < (counts>>1)) {
897 if(z == 6)
if(counts == 6)
899 Props.getLast()->Value = n;
904 n = s.section(
'"',z,z);
905 p1->
display = (n.at(1) ==
'1');
921 int i1, i2, i3, i4, i5, i6;
923 s = Row.section(
' ',0,0);
924 if((s ==
"PortSym") || (s ==
".PortSym")) {
927 for(i6 =
Ports.count(); i6<i3; i6++)
930 Ports.at(i3-1)->x = i1;
931 Ports.current()->y = i2;
932 Ports.current()->avail =
true;
940 else if(s ==
"Line") {
941 if(!
getIntegers(Row, &i1, &i2, &i3, &i4))
return -1;
942 if(!
getPen(Row, Pen, 5))
return -1;
945 Lines.append(
new Line(i1, i2, i3, i4, Pen));
957 else if(s ==
"EArc") {
958 if(!
getIntegers(Row, &i1, &i2, &i3, &i4, &i5, &i6))
960 if(!
getPen(Row, Pen, 7))
return -1;
961 Arcs.append(
new struct Arc(i1, i2, i3, i4, i5, i6, Pen));
964 if(i1+i3 >
x2)
x2 = i1+i3;
966 if(i2+i4 >
y2)
y2 = i2+i4;
969 else if(s ==
".ID") {
973 Name = Row.section(
' ',3,3);
979 s = Row.section(
'"', i1,i1);
980 if(s.isEmpty())
break;
987 pp->
display = (s.at(0) ==
'1');
988 pp->
Value = s.section(
'=', 2,2);
991 pp->
Name = s.section(
'=', 1,1);
999 while(pp !=
Props.last())
1003 else if(s ==
"Arrow") {
1004 if(!
getIntegers(Row, &i1, &i2, &i3, &i4, &i5, &i6))
return -1;
1005 if(!
getPen(Row, Pen, 7))
return -1;
1007 double beta = atan2(
double(i6),
double(i5));
1008 double phi = atan2(
double(i4),
double(i3));
1009 double Length = sqrt(
double(i6*i6 + i5*i5));
1013 if(i1 <
x1)
x1 = i1;
1014 if(i1 >
x2)
x2 = i1;
1015 if(i3 <
x1)
x1 = i3;
1016 if(i3 >
x2)
x2 = i3;
1017 if(i2 <
y1)
y1 = i2;
1018 if(i2 >
y2)
y2 = i2;
1019 if(i4 <
y1)
y1 = i4;
1020 if(i4 >
y2)
y2 = i4;
1022 Lines.append(
new Line(i1, i2, i3, i4, Pen));
1024 double w = beta+phi;
1025 i5 = i3-int(Length*cos(w));
1026 i6 = i4-int(Length*sin(w));
1027 Lines.append(
new Line(i3, i4, i5, i6, Pen));
1028 if(i5 <
x1)
x1 = i5;
1029 if(i5 >
x2)
x2 = i5;
1030 if(i6 <
y1)
y1 = i6;
1031 if(i6 >
y2)
y2 = i6;
1034 i5 = i3-int(Length*cos(w));
1035 i6 = i4-int(Length*sin(w));
1036 Lines.append(
new Line(i3, i4, i5, i6, Pen));
1037 if(i5 <
x1)
x1 = i5;
1038 if(i5 >
x2)
x2 = i5;
1039 if(i6 <
y1)
y1 = i6;
1040 if(i6 >
y2)
y2 = i6;
1044 else if(s ==
"Ellipse") {
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 Ellips.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 ==
"Rectangle") {
1061 if(!
getIntegers(Row, &i1, &i2, &i3, &i4))
return -1;
1062 if(!
getPen(Row, Pen, 5))
return -1;
1063 if(!
getBrush(Row, Brush, 8))
return -1;
1064 Rects.append(
new Area(i1, i2, i3, i4, Pen, Brush));
1066 if(i1 <
x1)
x1 = i1;
1067 if(i1 >
x2)
x2 = i1;
1068 if(i2 <
y1)
y1 = i2;
1069 if(i2 >
y2)
y2 = i2;
1070 if(i1+i3 <
x1)
x1 = i1+i3;
1071 if(i1+i3 >
x2)
x2 = i1+i3;
1072 if(i2+i4 <
y1)
y1 = i2+i4;
1073 if(i2+i4 >
y2)
y2 = i2+i4;
1076 else if(s ==
"Text") {
1077 if(!
getIntegers(Row, &i1, &i2, &i3, 0, &i4))
return -1;
1078 Color.setNamedColor(Row.section(
' ',4,4));
1079 if(!Color.isValid())
return -1;
1081 s = Row.mid(Row.find(
'"')+1);
1082 s = s.left(s.length()-1);
1083 if(s.isEmpty())
return -1;
1086 Texts.append(
new Text(i1, i2, s, Color,
float(i3),
1087 float(cos(
float(i4)*
M_PI/180.0)),
1088 float(sin(
float(i4)*
M_PI/180.0))));
1091 Font.setPointSizeFloat(
float(i3));
1092 QFontMetrics metrics(Font);
1093 QSize r = metrics.size(0, s);
1094 i3 = i1 + int(
float(r.width()) *
Texts.current()->mCos)
1095 +
int(
float(r.height()) *
Texts.current()->mSin);
1096 i4 = i2 + int(
float(r.width()) * -
Texts.current()->mSin)
1097 +
int(
float(r.height()) *
Texts.current()->mCos);
1099 if(i1 <
x1)
x1 = i1;
1100 if(i2 <
y1)
y1 = i2;
1101 if(i1 >
x2)
x2 = i1;
1102 if(i2 >
y2)
y2 = i2;
1104 if(i3 <
x1)
x1 = i3;
1105 if(i4 <
y1)
y1 = i4;
1106 if(i3 >
x2)
x2 = i3;
1107 if(i4 >
y2)
y2 = i4;
1116 int *i4,
int *i5,
int *i6)
1121 if(!i1)
return true;
1122 n = s.section(
' ',1,1);
1124 if(!ok)
return false;
1126 if(!i2)
return true;
1127 n = s.section(
' ',2,2);
1129 if(!ok)
return false;
1131 if(!i3)
return true;
1132 n = s.section(
' ',3,3);
1134 if(!ok)
return false;
1137 n = s.section(
' ',4,4);
1139 if(!ok)
return false;
1142 if(!i5)
return true;
1143 n = s.section(
' ',5,5);
1145 if(!ok)
return false;
1147 if(!i6)
return true;
1148 n = s.section(
' ',6,6);
1150 if(!ok)
return false;
1161 n = s.section(
' ',i,i);
1163 co.setNamedColor(n);
1165 if(!Pen.color().isValid())
return false;
1168 n = s.section(
' ',i,i);
1169 Pen.setWidth(n.toInt(&ok));
1170 if(!ok)
return false;
1173 n = s.section(
' ',i,i);
1174 Pen.setStyle((Qt::PenStyle)n.toInt(&ok));
1175 if(!ok)
return false;
1186 n = s.section(
' ',i,i);
1188 co.setNamedColor(n);
1190 if(!Brush.color().isValid())
return false;
1193 n = s.section(
' ',i,i);
1194 Brush.setStyle((Qt::BrushStyle)n.toInt(&ok));
1195 if(!ok)
return false;
1198 n = s.section(
' ',i,i);
1199 if(n.toInt(&ok) == 0) Brush.setStyle(Qt::NoBrush);
1200 if(!ok)
return false;
1209 if(pp->Name == name) {
1267 if (mmir && rrot==2)
1273 for(
int z=0; z<rrot; z++)
rotate();
1298 QObject::tr(
"number of input ports")));
1300 QObject::tr(
"voltage of high level")));
1302 QObject::tr(
"delay time")));
1304 QObject::tr(
"transfer function scaling factor")));
1308 QObject::tr(
"schematic symbol")+
" [old, DIN40900]"));
1318 s +=
" "+pp->Connection->Name;
1322 s +=
" " + p->Name +
"=\"" + p->Value +
"\"";
1324 s +=
" " + p->Name +
"=\"" + p->Value +
"\"";
1326 s +=
" " + p->Name +
"=\"" + p->Value +
"\"\n";
1337 if (
Model ==
"XNOR") {
1338 QString Op =
" xor ";
1345 for (pp =
Ports.next (); pp != 0; pp =
Ports.next ())
1350 QString Op =
' ' +
Model.lower() +
' ';
1351 if(
Model.at(0) ==
'N') {
1353 Op = Op.remove(1, 1);
1360 for(pp =
Ports.next(); pp != 0; pp =
Ports.next())
1362 if(
Model.at(0) ==
'N')
1367 QString td =
Props.at(2)->Value;
1379 bool synthesize =
true;
1384 QString op =
Model.lower();
1385 if(op ==
"and" || op ==
"nand")
1387 else if (op ==
"or" || op ==
"nor")
1389 else if (op ==
"xor")
1391 else if (op ==
"xnor")
1397 QString td =
Props.at(2)->Value;
1402 if(
Model.at(0) ==
'N') s +=
"~(";
1408 for(pp =
Ports.next(); pp != 0; pp =
Ports.next())
1411 if(
Model.at(0) ==
'N') s +=
")";
1415 s =
" " +
Model.lower();
1418 QString td =
Props.at(2)->Value;
1428 for(pp =
Ports.next(); pp != 0; pp =
Ports.next())
1439 int Num =
Props.getFirst()->Value.toInt();
1440 if(Num < 2) Num = 2;
1441 else if(Num > 8) Num = 8;
1442 Props.getFirst()->Value = QString::number(Num);
1444 int xl, xr, y = 10*Num, z;
1445 x1 = -30;
y1 = -y-3;
1452 if(
Model.at(0) ==
'N') z = 1;
1454 if(
Props.getLast()->Value.at(0) ==
'D') {
1457 Lines.append(
new Line( 15,-y, 15, y,QPen(Qt::darkBlue,2)));
1458 Lines.append(
new Line(-15,-y, 15,-y,QPen(Qt::darkBlue,2)));
1459 Lines.append(
new Line(-15, y, 15, y,QPen(Qt::darkBlue,2)));
1460 Lines.append(
new Line(-15,-y,-15, y,QPen(Qt::darkBlue,2)));
1461 Lines.append(
new Line( 15, 0, 30, 0,QPen(Qt::darkBlue,2)));
1463 if(
Model.at(z) ==
'O') {
1464 Lines.append(
new Line(-11, 6-y,-6, 9-y,QPen(Qt::darkBlue,0)));
1465 Lines.append(
new Line(-11,12-y,-6, 9-y,QPen(Qt::darkBlue,0)));
1466 Lines.append(
new Line(-11,14-y,-6,14-y,QPen(Qt::darkBlue,0)));
1467 Lines.append(
new Line(-11,16-y,-6,16-y,QPen(Qt::darkBlue,0)));
1468 Texts.append(
new Text( -4, 3-y,
"1", Qt::darkBlue, 15.0));
1470 else if(
Model.at(z) ==
'A')
1471 Texts.append(
new Text( -10, 3-y,
"&", Qt::darkBlue, 15.0));
1472 else if(
Model.at(0) ==
'X') {
1473 if(
Model.at(1) ==
'N') {
1475 QPen(Qt::darkBlue,0), QBrush(Qt::darkBlue)));
1476 Texts.append(
new Text( -11, 3-y,
"=1", Qt::darkBlue, 15.0));
1479 Texts.append(
new Text( -11, 3-y,
"=1", Qt::darkBlue, 15.0));
1484 if(
Model.at(z) ==
'O') xl = 10;
1487 Lines.append(
new Line(-10,-y,-10, y,QPen(Qt::darkBlue,2)));
1488 Lines.append(
new Line( 10, 0, 30, 0,QPen(Qt::darkBlue,2)));
1489 Arcs.append(
new Arc(-30,-y, 40, 30, 0, 16*90,QPen(Qt::darkBlue,2)));
1490 Arcs.append(
new Arc(-30,y-30, 40, 30, 0,-16*90,QPen(Qt::darkBlue,2)));
1491 Lines.append(
new Line( 10,15-y, 10, y-15,QPen(Qt::darkBlue,2)));
1493 if(
Model.at(0) ==
'X') {
1494 Lines.append(
new Line(-5, 0, 5, 0,QPen(Qt::darkBlue,1)));
1495 if(
Model.at(1) ==
'N') {
1496 Lines.append(
new Line(-5,-3, 5,-3,QPen(Qt::darkBlue,1)));
1497 Lines.append(
new Line(-5, 3, 5, 3,QPen(Qt::darkBlue,1)));
1500 Arcs.append(
new Arc(-5,-5, 10, 10, 0, 16*360,QPen(Qt::darkBlue,1)));
1501 Lines.append(
new Line( 0,-5, 0, 5,QPen(Qt::darkBlue,1)));
1506 if(
Model.at(0) ==
'N')
1508 QPen(Qt::darkBlue,0), QBrush(Qt::darkBlue)));
1512 for(z=0; z<Num; z++) {
1515 if(xl == 10)
if((z == 0) || (z == Num-1)) {
1516 Lines.append(
new Line(-30, y, 9, y,QPen(Qt::darkBlue,2)));
1519 Lines.append(
new Line(-30, y, xl, y,QPen(Qt::darkBlue,2)));
1536 Line = Line.stripWhiteSpace();
1537 if(Line.at(0) !=
'<') {
1538 QMessageBox::critical(0, QObject::tr(
"Error"),
1539 QObject::tr(
"Format Error:\nWrong line start!"));
1543 QString cstr = Line.section (
' ',0,0);
1545 if (cstr ==
"Lib") c =
new LibComp ();
1546 else if (cstr ==
"Eqn") c =
new Equation ();
1547 else if (cstr ==
"SPICE") c =
new SpiceFile();
1548 else if (cstr ==
"Rus") c =
new Resistor (
false);
1549 else if (cstr.left (6) ==
"SPfile" && cstr !=
"SPfile") {
1552 c->
Props.getLast()->Value = cstr.mid (6); }
1558 QMessageBox::critical(0, QObject::tr(
"Error"),
1559 QObject::tr(
"Format Error:\nUnknown component!\n"
1561 "Do you make use of loadable components?").arg(cstr));
1565 if(!c->
load(Line)) {
1566 QMessageBox::critical(0, QObject::tr(
"Error"),
1567 QObject::tr(
"Format Error:\nWrong 'component' line format!"));
1573 int x = c->
tx, y = c->
ty;
1577 c->
tx = x; c->
ty = y;
virtual Component * newOne()
void deleteComp(Component *)
bool getBrush(const QString &, QBrush &, int)
void copyComponent(Component *)
bool VHDL_Delay(QString &td, const QString &Name)
void PostPaintEvent(PE pe, int x1=0, int y1=0, int x2=0, int y2=0, int a=0, int b=0, bool PaintOnViewport=false)
QString get_Verilog_Code(int)
Q3PtrList< struct Arc > Arcs
bool getSelected(int, int)
void map(int, int, int &, int &)
tQucsSettings QucsSettings
Component * getComponentFromName(QString &Line, Schematic *p)
static Component * getComponent(QString)
int analyseLine(const QString &, int)
void drawLine(int, int, int, int)
void convert2Unicode(QString &Text)
int textSize(int &, int &)
void insertRawComponent(Component *, bool noOptimize=true)
virtual QString vhdlCode(int)
bool Verilog_Delay(QString &td, const QString &Name)
Definitions and declarations for the main application.
void entireBounds(int &, int &, int &, int &, float)
Q3PtrList< Component > * Components
Q3PtrList< Property > Props
virtual QString verilogCode(int)
virtual QString netlist()
virtual void setSchematic(Schematic *p)
void drawRoundRect(int, int, int, int)
void drawArc(int, int, int, int, int, int)
int drawTextMapped(const QString &, int, int, int *Height=0)
bool getPen(const QString &, QPen &, int)
#define isAnalogComponent
void drawRect(int, int, int, int)
void recreate(Schematic *)
void Bounding(int &, int &, int &, int &)
bool load(const QString &)
void print(ViewPainter *, float)
int getTextSelected(int, int, float)
Schematic * containingSchematic
void getCenter(int &, int &)
void setCenter(int, int, bool relative=false)
void paintScheme(Schematic *)
virtual void createSymbol()
Property * getProperty(const QString &)
QString get_VHDL_Code(int)
virtual void recreate(Schematic *)
void drawEllipse(int, int, int, int)
void paint(ViewPainter *)
bool getIntegers(const QString &, int *i1=0, int *i2=0, int *i3=0, int *i4=0, int *i5=0, int *i6=0)