summaryrefslogtreecommitdiffstats
path: root/src/xml_to_data/device_xml_to_data.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2011-12-15 15:33:27 -0600
committerTimothy Pearson <[email protected]>2011-12-15 15:33:27 -0600
commit9d6927a7d6a543332f828bffedf65eecf6774c6d (patch)
tree9f8210096908fddb7d266b477152021c45fa1a00 /src/xml_to_data/device_xml_to_data.cpp
parent3534213800bd8d151759df307755f2bbd592dfa1 (diff)
downloadpiklab-9d6927a7d6a543332f828bffedf65eecf6774c6d.tar.gz
piklab-9d6927a7d6a543332f828bffedf65eecf6774c6d.zip
Rename a number of old tq methods that are no longer tq specific
Diffstat (limited to 'src/xml_to_data/device_xml_to_data.cpp')
-rw-r--r--src/xml_to_data/device_xml_to_data.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/xml_to_data/device_xml_to_data.cpp b/src/xml_to_data/device_xml_to_data.cpp
index c1d41ac..c0861d4 100644
--- a/src/xml_to_data/device_xml_to_data.cpp
+++ b/src/xml_to_data/device_xml_to_data.cpp
@@ -10,7 +10,7 @@
#include <tqdir.h>
#include <tqfile.h>
-#include <tqtextstream.h>
+#include <textstream.h>
#include <tqregexp.h>
bool Device::XmlToDataBase::getFrequencyRange(OperatingCondition oc, Special special, TQDomElement element)
@@ -84,27 +84,27 @@ void Device::XmlToDataBase::processDevice(TQDomElement device)
{
TQString name = device.attribute("name").upper();
if ( name.isEmpty() ) qFatal("Device has no name");
- if ( _map.contains(name) ) qFatal(TQString("Device \"%1\" already defined").tqarg(name));
+ if ( _map.contains(name) ) qFatal(TQString("Device \"%1\" already defined").arg(name));
_data = createData();
_map[name] = _data;
_data->_name = name;
_data->_alternatives = TQStringList::split(' ', device.attribute("alternative"));
if ( _data->_alternatives.count() ) _alternatives[name] = _data->_alternatives;
- _data->_status = tqStatus::fromKey(device.attribute("status"));
+ _data->_status = Status::fromKey(device.attribute("status"));
switch (_data->_status.type()) {
- case tqStatus::Nb_Types:
+ case Status::Nb_Types:
qFatal("Unrecognized or absent device status");
break;
- case tqStatus::Future:
+ case Status::Future:
if ( _data->_alternatives.count() ) qFatal("Future device has alternative");
break;
- case tqStatus::NotRecommended:
- case tqStatus::Mature:
+ case Status::NotRecommended:
+ case Status::Mature:
if ( _data->_alternatives.count()==0 ) warning("Not-recommended/mature device has no alternative");
break;
- case tqStatus::InProduction:
- case tqStatus::EOL:
- case tqStatus::Unknown: break;
+ case Status::InProduction:
+ case Status::EOL:
+ case Status::Unknown: break;
}
// document
@@ -119,26 +119,26 @@ void Device::XmlToDataBase::processDevice(TQDomElement device)
_data->_documents.datasheet = documents.attribute("datasheet");
TQRegExp rexp("\\d{5}");
if ( _data->_documents.datasheet=="?" ) warning("No datasheet specified");
- if ( !rexp.exactMatch(_data->_documents.datasheet) ) qFatal(TQString("Malformed datasheet \"%1\" (5 digits)").tqarg(_data->_documents.datasheet));
+ if ( !rexp.exactMatch(_data->_documents.datasheet) ) qFatal(TQString("Malformed datasheet \"%1\" (5 digits)").arg(_data->_documents.datasheet));
_data->_documents.progsheet = documents.attribute("progsheet");
if ( _data->_documents.progsheet=="?" ) warning("No progsheet specified");
- if ( !rexp.exactMatch(_data->_documents.datasheet) ) qFatal(TQString("Malformed progsheet \"%1\" (5 digits)").tqarg(_data->_documents.progsheet));
+ if ( !rexp.exactMatch(_data->_documents.datasheet) ) qFatal(TQString("Malformed progsheet \"%1\" (5 digits)").arg(_data->_documents.progsheet));
_data->_documents.erratas = TQStringList::split(" ", documents.attribute("erratas"));
for (uint i=0; i<uint(_data->_documents.erratas.count()); i++) {
TQString errata = _data->_documents.erratas[i];
if ( !rexp.exactMatch(errata) ) {
TQRegExp rexp2("\\d{5}e\\d");
if ( !rexp2.exactMatch(errata) && !errata.startsWith("er") && errata.mid(2)!=_data->_name.lower() )
- qFatal(TQString("Malformed erratas \"%1\" (5 digits or 5 digits + e + 1 digit or \"er\" + name)").tqarg(errata));
+ qFatal(TQString("Malformed erratas \"%1\" (5 digits or 5 digits + e + 1 digit or \"er\" + name)").arg(errata));
}
}
}
if ( _data->_documents.webpage=="?" ) warning("No webpage specified");
else {
TQRegExp rexp("\\d{6}");
- if ( !rexp.exactMatch(_data->_documents.webpage) ) qFatal(TQString("Malformed webpage \"%1\" (6 digits)").tqarg(_data->_documents.webpage));
+ if ( !rexp.exactMatch(_data->_documents.webpage) ) qFatal(TQString("Malformed webpage \"%1\" (6 digits)").arg(_data->_documents.webpage));
if ( _documents.contains(_data->_documents.webpage) )
- qFatal(TQString("webpage duplicated (already used for %1)").tqarg(_documents[_data->_documents.webpage]));
+ qFatal(TQString("webpage duplicated (already used for %1)").arg(_documents[_data->_documents.webpage]));
_documents[_data->_documents.webpage] = name;
}
@@ -194,21 +194,21 @@ Device::Package Device::XmlToDataBase::processPackage(TQDomElement element)
for (; Package::TYPE_DATA[i].name; i++) {
if ( types[k]!=Package::TYPE_DATA[i].name ) continue;
for (uint j=0; j<uint(package.types.count()); j++)
- if ( package.types[j]==i ) qFatal(TQString("Duplicated package type %1").tqarg(types[k]));
+ if ( package.types[j]==i ) qFatal(TQString("Duplicated package type %1").arg(types[k]));
uint j = 0;
for (; j<Package::MAX_NB; j++)
if ( nb==Package::TYPE_DATA[i].nbPins[j] ) break;
- if ( j==Package::MAX_NB ) qFatal(TQString("Package %1 does not have the correct number of pins %2 (%3)").tqarg(types[k]).tqarg(nb).tqarg(Package::TYPE_DATA[i].nbPins[0]));
+ if ( j==Package::MAX_NB ) qFatal(TQString("Package %1 does not have the correct number of pins %2 (%3)").arg(types[k]).arg(nb).arg(Package::TYPE_DATA[i].nbPins[0]));
package.types.append(i);
break;
}
- if ( Package::TYPE_DATA[i].name==0 ) qFatal(TQString("Unknown package type \"%1\"").tqarg(types[k]));
+ if ( Package::TYPE_DATA[i].name==0 ) qFatal(TQString("Unknown package type \"%1\"").arg(types[k]));
}
// pins
TQString name = Package::TYPE_DATA[package.types[0]].name;
if ( name=="sot23" ) {
if ( package.types.count()!=1 ) qFatal("SOT23 should be a specific package");
- } else if ( (nb%2)!=0 ) qFatal(TQString("\"nb_pins\" should be even for package \"%1\"").tqarg(name));
+ } else if ( (nb%2)!=0 ) qFatal(TQString("\"nb_pins\" should be even for package \"%1\"").arg(name));
uint have_pins = false;
TQMemArray<bool> found(nb);
found.fill(false);
@@ -234,7 +234,7 @@ Device::Package Device::XmlToDataBase::processPackage(TQDomElement element)
child = child.nextSibling();
}
if ( !have_pins ) ;//warning("Pins not specified"); // #### REMOVE ME !!
- else for (uint i=0; i<nb; i++) if ( !found[i] ) qFatal(TQString("Pin #%1 not specified").tqarg(i+1));
+ else for (uint i=0; i<nb; i++) if ( !found[i] ) qFatal(TQString("Pin #%1 not specified").arg(i+1));
return package;
}
@@ -255,6 +255,6 @@ void Device::XmlToDataBase::parse()
for (; ait!=_alternatives.end(); ++ait) {
TQStringList::const_iterator lit = ait.data().begin();
for (; lit!=ait.data().end(); ++lit)
- if ( !_map.contains(*lit) ) qFatal(TQString("Unknown alternative %1 for device %2").tqarg((*lit)).tqarg(ait.key()));
+ if ( !_map.contains(*lit) ) qFatal(TQString("Unknown alternative %1 for device %2").arg((*lit)).arg(ait.key()));
}
}