21 #include <QTextStream>
36 QObject::tr(
"Name of Verilog file")));
49 p->
Props.getFirst()->Value =
Props.getFirst()->Value;
57 Name = QObject::tr(
"Verilog file");
58 BitmapFile = (
char *)
"vhdlfile";
78 for(pp =
Ports.next(); pp != 0; pp =
Ports.next())
91 QString s, File(
Props.getFirst()->Value);
97 if(!f.open(QIODevice::ReadOnly))
100 QTextStream stream(&f);
101 File = stream.read();
114 int fHeight = metrics.lineSpacing();
117 QString tmp, PortNames =
loadFile();
118 if(!PortNames.isEmpty())
119 No = PortNames.count(
',') + 1;
123 int h = 30*((No-1)/2) + 15;
129 tmp = QObject::tr(
"verilog");
130 int w = metrics.width(tmp);
131 Texts.append(
new Text(w/-2, fHeight/-2, tmp));
138 tmp = PortNames.section(
',', i, i);
139 w = metrics.width(tmp);
140 Texts.append(
new Text(-26-w, y-fHeight-2, tmp));
146 tmp = PortNames.section(
',', i, i);
147 Texts.append(
new Text( 27, y-fHeight-2, tmp));
162 QString FileName =
Props.getFirst()->Value;
172 QString FileName =
Props.getFirst()->Value;
173 if(FileName.isEmpty()) {
174 ErrText += QObject::tr(
"ERROR: No file name in %1 component \"%2\".").
184 if(!f.open(QIODevice::ReadOnly)) {
185 ErrText += QObject::tr(
"ERROR: Cannot open %1 file \"%2\".").
186 arg(
Model).arg(FileName);
191 QByteArray FileContent = f.readAll();
195 (*stream) << FileContent.data();
212 if(!f.open(QIODevice::ReadOnly))
215 QByteArray FileContent = f.readAll();
216 File = QString(FileContent);
223 while((i=File.find(
"//", i)) >= 0) {
224 j = File.find(
'\n', i+2);
232 while((i=File.find(
"/*", i)) >= 0) {
233 j = File.find(
"*/", i+2);
237 File.remove(i, j-i+2);
241 Expr.setCaseSensitive(
true);
242 Expr1.setCaseSensitive(
true);
244 Expr.setPattern(
"\\bmodule\\b");
245 k = File.findRev(Expr, k);
249 Expr.setPattern(
"\\bendmodule\\b");
250 i = File.find(Expr, k+7);
253 s = File.mid(k+7, i-k-7);
255 Expr.setPattern(
"\\b");
259 j = s.find(Expr, i+1);
271 s = s.mid(i+1, j-i-1);
281 Expr.setCaseSensitive(
true);
282 Expr1.setCaseSensitive(
true);
286 Expr.setPattern(
"(\\binput\\b|\\boutput\\b|\\binout\\b)");
287 Expr1.setPattern(
"(\\b)");
288 while((i=s.find(Expr, i)) >= 0) {
289 j = s.find(Expr1, i+1);
tQucsSettings QucsSettings
#define isDigitalComponent
Definitions and declarations for the main application.
QString properAbsFileName(const QString &Name)
Q3PtrList< Property > Props
QString parsePorts(QString, int)
static Element * info(QString &, char *&, bool getNewOne=false)
bool createSubNetlist(QTextStream *)
Superclass of all schematic drawing elements.
void recreate(Schematic *)
QString getSubcircuitFile()