28 #include <qfileinfo.h>
43 QObject::tr(
"name of qucs schematic file")));
56 p->
Props.getFirst()->Value =
Props.getFirst()->Value;
64 Name = QObject::tr(
"Subcircuit");
65 BitmapFile = (
char *)
"subcircuit";
81 QString FileName(
Props.getFirst()->Value);
87 if(
tx == INT_MIN)
tx =
x1+4;
88 if(
ty == INT_MIN)
ty =
y2+4;
90 for(
Port *pp =
Ports.first(); pp != 0; ) {
91 if(!pp->avail) {
Ports.remove(); pp =
Ports.current (); }
92 else pp =
Ports.next();
107 int h = 30*((No-1)/2) + 15;
108 Lines.append(
new Line(-15, -h, 15, -h,QPen(QPen::darkBlue,2)));
109 Lines.append(
new Line( 15, -h, 15, h,QPen(QPen::darkBlue,2)));
110 Lines.append(
new Line(-15, h, 15, h,QPen(QPen::darkBlue,2)));
111 Lines.append(
new Line(-15, -h,-15, h,QPen(QPen::darkBlue,2)));
117 Lines.append(
new Line(-30, y,-15, y,QPen(QPen::darkBlue,2)));
119 Texts.append(
new Text(-25,y-14,QString::number(i)));
123 Lines.append(
new Line( 15, y, 30, y,QPen(QPen::darkBlue,2)));
125 Texts.append(
new Text( 19,y-14,QString::number(i)));
141 if(!file.open(IO_ReadOnly))
148 QTextStream ReadWhole(&file);
149 QString FileString = ReadWhole.read();
151 QTextStream stream(&FileString, IO_ReadOnly);
156 if(stream.atEnd())
return -2;
157 Line = stream.readLine();
158 Line = Line.stripWhiteSpace();
159 }
while(Line.isEmpty());
161 if(Line.left(16) !=
"<Qucs Schematic ")
164 Line = Line.mid(16, Line.length()-17);
169 while(!stream.atEnd()) {
170 Line = stream.readLine();
171 if(Line ==
"<Symbol>")
break;
178 while(!stream.atEnd()) {
179 Line = stream.readLine();
180 if(Line ==
"</Symbol>") {
188 Line = Line.stripWhiteSpace();
189 if(Line.at(0) !=
'<')
return -5;
190 if(Line.at(Line.length()-1) !=
'>')
return -6;
191 Line = Line.mid(1, Line.length()-2);
193 if(Result < 0)
return -7;
207 s +=
" "+p1->Connection->Name;
215 s +=
" "+pp->Name+
"=\""+pp->Value+
"\"";
228 s +=
" generic map (";
230 for(pr =
Props.next(); pr != 0; pr =
Props.next())
231 s +=
", " + pr->
Value;
239 for(pp =
Ports.next(); pp != 0; pp =
Ports.next())
257 for(pr =
Props.next(); pr != 0; pr =
Props.next())
263 s +=
" " +
Name +
" (";
266 for(pp =
Ports.next(); pp != 0; pp =
Ports.next())
277 QString FileName =
Props.getFirst()->Value;