25 #include <QTextStream>
44 QObject::tr(
"name of qucs schematic file")));
57 p->
Props.getFirst()->Value =
Props.getFirst()->Value;
65 Name = QObject::tr(
"Subcircuit");
66 BitmapFile = (
char *)
"subcircuit";
82 QString FileName(
Props.getFirst()->Value);
88 if(
tx == INT_MIN)
tx =
x1+4;
89 if(
ty == INT_MIN)
ty =
y2+4;
91 for(
Port *pp =
Ports.first(); pp != 0; ) {
92 if(!pp->avail) {
Ports.remove(); pp =
Ports.current (); }
93 else pp =
Ports.next();
108 int h = 30*((No-1)/2) + 15;
109 Lines.append(
new Line(-15, -h, 15, -h,QPen(Qt::darkBlue,2)));
110 Lines.append(
new Line( 15, -h, 15, h,QPen(Qt::darkBlue,2)));
111 Lines.append(
new Line(-15, h, 15, h,QPen(Qt::darkBlue,2)));
112 Lines.append(
new Line(-15, -h,-15, h,QPen(Qt::darkBlue,2)));
118 Lines.append(
new Line(-30, y,-15, y,QPen(Qt::darkBlue,2)));
120 Texts.append(
new Text(-25,y-14,QString::number(i)));
124 Lines.append(
new Line( 15, y, 30, y,QPen(Qt::darkBlue,2)));
126 Texts.append(
new Text( 19,y-14,QString::number(i)));
142 if(!file.open(QIODevice::ReadOnly))
149 QTextStream ReadWhole(&file);
150 QString FileString = ReadWhole.read();
152 QTextStream stream(&FileString, QIODevice::ReadOnly);
157 if(stream.atEnd())
return -2;
158 Line = stream.readLine();
159 Line = Line.stripWhiteSpace();
160 }
while(Line.isEmpty());
162 if(Line.left(16) !=
"<Qucs Schematic ")
165 Line = Line.mid(16, Line.length()-17);
170 while(!stream.atEnd()) {
171 Line = stream.readLine();
172 if(Line ==
"<Symbol>")
break;
179 while(!stream.atEnd()) {
180 Line = stream.readLine();
181 if(Line ==
"</Symbol>") {
189 Line = Line.stripWhiteSpace();
190 if(Line.at(0) !=
'<')
return -5;
191 if(Line.at(Line.length()-1) !=
'>')
return -6;
192 Line = Line.mid(1, Line.length()-2);
194 if(Result < 0)
return -7;
208 s +=
" "+p1->Connection->Name;
216 s +=
" "+pp->Name+
"=\""+pp->Value+
"\"";
229 s +=
" generic map (";
231 for(pr =
Props.next(); pr != 0; pr =
Props.next())
232 s +=
", " + pr->
Value;
240 for(pp =
Ports.next(); pp != 0; pp =
Ports.next())
258 for(pr =
Props.next(); pr != 0; pr =
Props.next())
264 s +=
" " +
Name +
" (";
267 for(pp =
Ports.next(); pp != 0; pp =
Ports.next())
278 QString FileName =
Props.getFirst()->Value;
280 if (FileName.isEmpty())
285 QFileInfo FileInfo(FileName);
287 if (FileInfo.exists())
290 return FileInfo.absoluteFilePath();
296 QString baseName = FileInfo.completeBaseName();
300 if (FileInfo.fileName () == FileName)
309 QFileInfo localFIleInfo (schematicFileInfo.canonicalPath () +
"/" + baseName +
".sch");
310 if (localFIleInfo.exists ())
314 return localFIleInfo.absoluteFilePath();
327 if (hashsearchresult.isEmpty())
336 FileInfo.setFile(hashsearchresult);
338 if (FileInfo.exists())
341 return FileInfo.absoluteFilePath();
QString properFileName(const QString &Name)
QString Verilog_Param(const QString Value)
int analyseLine(const QString &, int)
bool checkVersion(QString &Line)
QFileInfo getFileInfo(void)
QString getSubcircuitFile()
Definitions and declarations for the main application.
void remakeSymbol(int No)
QString properAbsFileName(const QString &Name)
Q3PtrList< Property > Props
Superclass of all schematic drawing elements.
void recreate(Schematic *)
static Element * info(QString &, char *&, bool getNewOne=false)
Schematic * containingSchematic
int loadSymbol(const QString &)
QString properName(const QString &Name)
QHash< QString, QString > schNameHash
static int testFile(const QString &)