diff options
Diffstat (limited to 'src/progs/icd2')
-rw-r--r-- | src/progs/icd2/base/icd.cpp | 10 | ||||
-rw-r--r-- | src/progs/icd2/base/icd.h | 8 | ||||
-rw-r--r-- | src/progs/icd2/base/icd2.cpp | 78 | ||||
-rw-r--r-- | src/progs/icd2/base/icd2.h | 14 | ||||
-rw-r--r-- | src/progs/icd2/base/icd2_data.h | 4 | ||||
-rw-r--r-- | src/progs/icd2/base/icd2_debug.cpp | 56 | ||||
-rw-r--r-- | src/progs/icd2/base/icd2_debug.h | 9 | ||||
-rw-r--r-- | src/progs/icd2/base/icd2_debug_specific.cpp | 16 | ||||
-rw-r--r-- | src/progs/icd2/base/icd2_debug_specific.h | 6 | ||||
-rw-r--r-- | src/progs/icd2/base/icd2_prog.cpp | 18 | ||||
-rw-r--r-- | src/progs/icd2/base/icd2_prog.h | 8 | ||||
-rw-r--r-- | src/progs/icd2/base/icd2_serial.cpp | 12 | ||||
-rw-r--r-- | src/progs/icd2/base/icd2_serial.h | 6 | ||||
-rw-r--r-- | src/progs/icd2/base/icd2_usb.cpp | 30 | ||||
-rw-r--r-- | src/progs/icd2/base/icd2_usb.h | 10 | ||||
-rw-r--r-- | src/progs/icd2/base/icd_prog.cpp | 4 | ||||
-rw-r--r-- | src/progs/icd2/base/icd_prog.h | 1 | ||||
-rw-r--r-- | src/progs/icd2/base/microchip.h | 2 | ||||
-rw-r--r-- | src/progs/icd2/gui/icd2_group_ui.cpp | 28 | ||||
-rw-r--r-- | src/progs/icd2/gui/icd2_group_ui.h | 11 | ||||
-rw-r--r-- | src/progs/icd2/xml/xml_icd2_parser.cpp | 14 |
21 files changed, 175 insertions, 170 deletions
diff --git a/src/progs/icd2/base/icd.cpp b/src/progs/icd2/base/icd.cpp index bfb1129..d458981 100644 --- a/src/progs/icd2/base/icd.cpp +++ b/src/progs/icd2/base/icd.cpp @@ -37,9 +37,9 @@ Device::Array Icd::DeviceSpecific::prepareRange(Pic::MemoryRangeType type, const if ( wordOffset!=data.count() ) { uint end = (force ? data.count() : findNonMaskEnd(type, data)); nbWords = end - wordOffset + 1; - log(Log::DebugLevel::Normal, QString(" start=%1 nbWords=%2 total=%3 force=%4") - .arg(toHexLabel(wordOffset, device().nbCharsAddress())).arg(toHexLabel(nbWords, device().nbCharsAddress())) - .arg(toHexLabel(data.count(), device().nbCharsAddress())).arg(force ? "true" : "false")); + log(Log::DebugLevel::Normal, TQString(" start=%1 nbWords=%2 total=%3 force=%4") + .tqarg(toHexLabel(wordOffset, device().nbCharsAddress())).tqarg(toHexLabel(nbWords, device().nbCharsAddress())) + .tqarg(toHexLabel(data.count(), device().nbCharsAddress())).tqarg(force ? "true" : "false")); } _base.progressMonitor().addTaskProgress(data.count()-nbWords); return data.mid(wordOffset, nbWords); @@ -52,7 +52,7 @@ bool Icd::DeviceSpecific::doWrite(Pic::MemoryRangeType type, const Device::Array uint nb = device().nbWordsWriteAlignment(Pic::MemoryRangeType::Code); if ( device().architecture()==Pic::Architecture::P18J && type==Pic::MemoryRangeType::Config ) { Q_ASSERT( data.count()%2==0 ); - int delta = nb - data.count()/2; // config memory words contains 1 byte + int delta = nb - data.count()/2; // config memory words tqcontains 1 byte Q_ASSERT( delta>=0 ); Device::Array rdata(delta); uint wordOffset = device().nbWords(Pic::MemoryRangeType::Code) - delta; @@ -87,7 +87,7 @@ bool Icd::DeviceSpecific::doErase(bool) { if ( device().architecture()==Pic::Architecture::P18J ) { // ### also true for others ? Device::Array data(device().nbWords(Pic::MemoryRangeType::Config)); - for (uint i=0; i<data.size(); i++) data[i] = device().config()._words[i].wmask; + for (uint i=0; i<data.size(); i++) data[i] = device().config()._words[i].wtqmask; if ( !doWrite(Pic::MemoryRangeType::Config, data, true) ) return false; } return hardware().eraseAll(); diff --git a/src/progs/icd2/base/icd.h b/src/progs/icd2/base/icd.h index 9a65755..0aa7208 100644 --- a/src/progs/icd2/base/icd.h +++ b/src/progs/icd2/base/icd.h @@ -20,7 +20,7 @@ namespace Icd class Hardware : public ::Programmer::PicHardware { public: - Hardware(::Programmer::Base &base, Port::Base *port) : ::Programmer::PicHardware(base, port, QString::null) {} + Hardware(::Programmer::Base &base, Port::Base *port) : ::Programmer::PicHardware(base, port, TQString()) {} // initialization virtual bool uploadFirmware(const Pic::Memory &memory) = 0; virtual bool setTarget() = 0; @@ -43,9 +43,9 @@ public: virtual BitValue getProgramCounter() = 0; protected: - QString _rx; - virtual bool internalConnect(const QString &mode) = 0; - virtual QString receivedData() const = 0; + TQString _rx; + virtual bool internalConnect(const TQString &mode) = 0; + virtual TQString receivedData() const = 0; virtual bool internalConnectHardware() { return internalConnect("U"); } }; diff --git a/src/progs/icd2/base/icd2.cpp b/src/progs/icd2/base/icd2.cpp index 375fc60..6765340 100644 --- a/src/progs/icd2/base/icd2.cpp +++ b/src/progs/icd2/base/icd2.cpp @@ -57,7 +57,7 @@ Icd2::TestData::TestData() for (uint k=0; k<Nb_VoltageTypes; k++) _voltages[k] = -1; } -Icd2::TestData::TestData(const QString &rx) +Icd2::TestData::TestData(const TQString &rx) { for (uint k=0; k<Nb_VoltageTypes; k++) _voltages[k] = fromHex(rx.mid(5 + 2*k, 2), 0); @@ -70,14 +70,14 @@ bool Icd2::TestData::pass() const return true; } -QString Icd2::TestData::result(VoltageType type) const +TQString Icd2::TestData::result(VoltageType type) const { for (uint i=0; i<=(::Programmer::Nb_ResultTypes); i++) if ( _voltages[type]==RESULT_TYPE_VALUES[i] ) return i18n(::Programmer::RESULT_TYPE_LABELS[i]); return toHex(_voltages[type], 2); } -QString Icd2::TestData::pretty(VoltageType type) const +TQString Icd2::TestData::pretty(VoltageType type) const { return i18n(VOLTAGE_LABELS[type]) + "=" + result(type); } @@ -136,7 +136,7 @@ bool Icd2::Hardware::uploadFirmware(const Pic::Memory &memory) if ( !internalConnect("V") ) return false; log(Log::LineType::Information, " Uploading firmware to ICD2..."); uint start = 0x0004, size = 0x1BFB; - QString cmd = "10" + toHex(start, 4) + toHex(size, 4); + TQString cmd = "10" + toHex(start, 4) + toHex(size, 4); if ( !command(cmd, 0) ) return false; uint nbBytesWord = memory.device().nbBytesWord(Pic::MemoryRangeType::Code); // should be 2 for 16F876 Device::Array data = memory.arrayForWriting(Pic::MemoryRangeType::Code); @@ -151,7 +151,7 @@ bool Icd2::Hardware::setTarget() log(Log::DebugLevel::Normal, " Set target"); // set target family const Icd2::Data &d = data(device().name()); - if ( !command(QString("2A") + toHex(d.famid, 2), 0) ) return false; + if ( !command(TQString("2A") + toHex(d.famid, 2), 0) ) return false; // set code range end Address end = device().range(Pic::MemoryRangeType::Code).end; if ( device().range(Pic::MemoryRangeType::Cal).start==end ) end += 1; @@ -167,47 +167,47 @@ bool Icd2::Hardware::setup() // ?? _port->send("$7F00\x0D", 6); - QString s; + TQString s; if ( !_port->receive(2, s) ) return false; if ( s!="02" ) { - log(Log::LineType::Error, i18n("Unexpected answer ($7F00) from ICD2 (%1).").arg(s)); + log(Log::LineType::Error, i18n("Unexpected answer ($7F00) from ICD2 (%1).").tqarg(s)); return false; } // ?? if ( !command("08", 2) ) return false; if ( _rx.mid(5, 2)!="00" ) { - log(Log::LineType::Error, i18n("Unexpected answer (08) from ICD2 (%1).").arg(_rx)); + log(Log::LineType::Error, i18n("Unexpected answer (08) from ICD2 (%1).").tqarg(_rx)); return false; } return !hasError(); } -bool Icd2::Hardware::sendCommand(const QString &s) +bool Icd2::Hardware::sendCommand(const TQString &s) { //format: <LLXX....CC> - QString cs = s.upper(); - QString tx = "<"; + TQString cs = s.upper(); + TQString tx = "<"; tx += toHex(cs.length() + 6, 2); tx += cs; uchar chk = tx[1].latin1() + tx[2].latin1(); for (uint i=0; i<uint(s.length()); i++) chk += cs[i].latin1(); tx += toHex(chk, 2); tx += '>'; - log(Log::DebugLevel::Extra, QString("send command: '%1'").arg(tx)); - QByteArray a = toAscii(tx); + log(Log::DebugLevel::Extra, TQString("send command: '%1'").tqarg(tx)); + TQByteArray a = toAscii(tx); return _port->send(a.data(), a.count()); } -bool Icd2::Hardware::receiveResponse(const QString &command, uint responseSize, bool poll) +bool Icd2::Hardware::receiveResponse(const TQString &command, uint responseSize, bool poll) { // format: [LLXX...CC] uint size = responseSize + 8; if ( poll && _port->type()==PortType::USB ) { if ( !static_cast<USBPort *>(_port)->poll(size, _rx) ) return false; } else if ( !_port->receive(size, _rx, 180000) ) return false; // is 3 minutes enough ?? (we should really have an abort button here...) - log(Log::DebugLevel::Extra, QString("received answer: '%1'").arg(_rx)); + log(Log::DebugLevel::Extra, TQString("received answer: '%1'").tqarg(_rx)); if ( size!=fromHex(_rx.mid(1, 2), 0) ) { log(Log::LineType::Error, i18n("Received length too short.")); return false; @@ -217,12 +217,12 @@ bool Icd2::Hardware::receiveResponse(const QString &command, uint responseSize, return false; } if ( _rx[0]!='[' || _rx[size-1]!=']' ) { - log(Log::LineType::Error, i18n("Malformed string received \"%1\"").arg(_rx)); + log(Log::LineType::Error, i18n("Malformed string received \"%1\"").tqarg(_rx)); return false; } if ( command.mid(0, 2)!=_rx.mid(3, 2) ) { log(Log::LineType::Error, i18n("Wrong return value (\"%1\"; was expecting \"%2\")") - .arg(_rx.mid(3, 2)).arg(command.mid(0, 2))); + .tqarg(_rx.mid(3, 2)).tqarg(command.mid(0, 2))); return false; } // verify the checksum @@ -235,7 +235,7 @@ bool Icd2::Hardware::receiveResponse(const QString &command, uint responseSize, return true; } -bool Icd2::Hardware::command(const QString &command, uint responseSize) +bool Icd2::Hardware::command(const TQString &command, uint responseSize) { if ( hasError() ) return false; if ( !sendCommand(command) ) return false; @@ -265,7 +265,7 @@ bool Icd2::Hardware::getDebugExecVersion(VersionData &version) bool Icd2::Hardware::setTargetPowerOn(bool on) { - return command(QString("05") + (on ? "FF" : "00"), 0); + return command(TQString("05") + (on ? "FF" : "00"), 0); } bool Icd2::Hardware::readVoltage(Pic::VoltageType type, double &value) @@ -299,7 +299,7 @@ bool Icd2::Hardware::getTargetMode(Pic::TargetMode &tmode) bool Icd2::Hardware::setTargetReset(Pic::ResetMode mode) { - return command(QString("33") + RESET_MODE_VALUES[mode], 0); + return command(TQString("33") + RESET_MODE_VALUES[mode], 0); } bool Icd2::Hardware::selfTest(TestData &test) @@ -314,12 +314,12 @@ bool Icd2::Hardware::readBlock(uint nbBytesWord, uint nbWords, Device::Array &da //qDebug("readBlock %i %s", nbBytesWord, toHex(nbWords, 8).data()); // receive data uint length = 2*nbBytesWord*nbWords+4; - QString s; + TQString s; uint i = 0; while ( i<length ) { uint maxSize = (_port->type()==PortType::Serial ? 2*nbBytesWord : 0x100); - uint size = QMIN(maxSize, length-i); - QString tmp; + uint size = TQMIN(maxSize, length-i); + TQString tmp; if ( _port->type()==PortType::USB ) { if ( !static_cast<USBPort *>(_port)->dataReceive(size, tmp) ) return false; } else if ( !_port->receive(size, tmp) ) return false; @@ -334,9 +334,9 @@ bool Icd2::Hardware::readBlock(uint nbBytesWord, uint nbWords, Device::Array &da } log(Log::DebugLevel::Max, "received: " + s); data.resize(nbWords); - Q_UINT8 chk = 0; + TQ_UINT8 chk = 0; for (uint i=0; i<nbWords; i++) { - QString ts = s.mid(1+2*nbBytesWord*i, 2*nbBytesWord); + TQString ts = s.mid(1+2*nbBytesWord*i, 2*nbBytesWord); //if ( i<10 ) qDebug("%i: %s", i, ts.data()); data[i] = 0; for (int k=nbBytesWord-1; k>=0; k--) { @@ -346,9 +346,9 @@ bool Icd2::Hardware::readBlock(uint nbBytesWord, uint nbWords, Device::Array &da } } - QString cs = s.mid(s.length()-3, 2); + TQString cs = s.mid(s.length()-3, 2); if ( chk!=fromHex(cs, 0) ) { - log(Log::LineType::Error, i18n("Bad checksum for read block: %1 (%2 expected).").arg(cs).arg(toHex(chk, 2))); + log(Log::LineType::Error, i18n("Bad checksum for read block: %1 (%2 expected).").tqarg(cs).tqarg(toHex(chk, 2))); return false; } return true; @@ -369,10 +369,10 @@ bool Icd2::Hardware::readMemory(Pic::MemoryRangeType type, uint wordOffset, //qDebug("read size=%s div=%i nbBytes=%i", toHex(size, 8).data(), div, nbBytesWord); data.resize(0); do { - uint size = QMIN(todo, uint(0x1000)); // addresses + uint size = TQMIN(todo, uint(0x1000)); // addresses uint nb = size / inc; // word //qDebug("read %s start=%s size=%s", Pic::MEMORY_RANGE_TYPE_DATA[type].label, toHex(start+offset, 8).data(), toHex(nb, 8).data()); - QString cmd = r + toHex(start+offset, 8) + toHex(nb/div, 8); + TQString cmd = r + toHex(start+offset, 8) + toHex(nb/div, 8); if ( !command(cmd, 0) ) return false; Device::Array pdata; if ( !readBlock(nbBytesWord, nb, pdata) ) return false; @@ -392,13 +392,13 @@ bool Icd2::Hardware::readMemory(Pic::MemoryRangeType type, uint wordOffset, bool Icd2::Hardware::writeBlock(uint nbBytesWord, const Device::Array &data, uint wordIndex, uint nbWords) { - log(Log::DebugLevel::Extra, QString("writeBlock offset:%1 nbWords:%2 (size: %3)").arg(toHex(wordIndex, 8)).arg(toHex(nbWords, 8)).arg(toHex(data.size(), 8))); + log(Log::DebugLevel::Extra, TQString("writeBlock offset:%1 nbWords:%2 (size: %3)").tqarg(toHex(wordIndex, 8)).tqarg(toHex(nbWords, 8)).tqarg(toHex(data.size(), 8))); Q_ASSERT( wordIndex+nbWords<=data.size() ); // prepare data - QString s = "{"; + TQString s = "{"; uchar chk = 0; for (uint i=0; i<nbWords; i++) { - QString ts = toHex(data[wordIndex+i], 2*nbBytesWord); + TQString ts = toHex(data[wordIndex+i], 2*nbBytesWord); for (int k=nbBytesWord-1; k>=0; k--) { //if ( i<10 || i>=nbWords-10 ) qDebug("send: %i-%i %s", i, k, ts.mid(2*k, 2).data()); s += ts.mid(2*k, 2); @@ -414,8 +414,8 @@ bool Icd2::Hardware::writeBlock(uint nbBytesWord, const Device::Array &data, uin while ( i<uint(s.length()) ) { uint maxSize = (_port->description().type==PortType::Serial ? 2*nbBytesWord : 0x100); if ( _port->description().type==PortType::Serial && i==0 ) maxSize = 1; - uint size = QMIN(maxSize, s.length()-i); - QByteArray a = toAscii(s); + uint size = TQMIN(maxSize, s.length()-i); + TQByteArray a = toAscii(s); if ( _port->type()==PortType::USB ) { if ( !static_cast<USBPort *>(_port)->dataSend(a.data()+i, size) ) return false; } else if ( !_port->send(a.data()+i, size) ) return false; @@ -441,10 +441,10 @@ bool Icd2::Hardware::writeMemory(Pic::MemoryRangeType type, uint wordOffset, con uint index = 0; //qDebug("write todo=%s div=%i nbBytes=%i dataSize=%i", toHex(todo, 8).data(), div, nbBytesWord, data.size()); do { - uint size = QMIN(todo, uint(0x1000)); // address + uint size = TQMIN(todo, uint(0x1000)); // address uint nb = size / inc; // word //qDebug("write %s start=%s nbWords=%s", Pic::MEMORY_RANGE_TYPE_DATA[type].label, toHex(start+offset, 8).data(), toHex(nb, 8).data()); - QString cmd = w + toHex(start+offset+index, 8) + toHex(nb/div, 8); + TQString cmd = w + toHex(start+offset+index, 8) + toHex(nb/div, 8); if ( !command(cmd, 0) ) return false; if ( !writeBlock(nbBytesWord, data, index/inc, nb) ) return false; if ( !receiveResponse(cmd, 0, false) ) return false; @@ -482,12 +482,12 @@ bool Icd2::Hardware::resumeRun() bool Icd2::Hardware::setWriteMode(Pic::WriteMode mode) { - return command(QString("4B") + WRITE_MODE_VALUES[mode], 0); + return command(TQString("4B") + WRITE_MODE_VALUES[mode], 0); } bool Icd2::Hardware::writeRegister(Address address, BitValue value, uint nbBytes) { - QString cmd = "1B" + toHex(address, 8) + toHex(nbBytes, 8); + TQString cmd = "1B" + toHex(address, 8) + toHex(nbBytes, 8); if ( !command(cmd, 0) ) return false; Device::Array data(nbBytes); for (uint i=0; i<nbBytes; i++) data[nbBytes-i-1] = value.byte(i); @@ -497,7 +497,7 @@ bool Icd2::Hardware::writeRegister(Address address, BitValue value, uint nbBytes bool Icd2::Hardware::readRegister(Address address, BitValue &value, uint nbBytes) { - QString cmd = "1E" + toHex(address, 8) + toHex(nbBytes, 8); + TQString cmd = "1E" + toHex(address, 8) + toHex(nbBytes, 8); if ( !command(cmd, 0) ) return false; Device::Array data; if ( !readBlock(1, nbBytes, data) ) return false; diff --git a/src/progs/icd2/base/icd2.h b/src/progs/icd2/base/icd2.h index 1c9c1b9..8200f1b 100644 --- a/src/progs/icd2/base/icd2.h +++ b/src/progs/icd2/base/icd2.h @@ -21,12 +21,12 @@ namespace Icd2 class TestData { public: TestData(); - TestData(const QString &rx); + TestData(const TQString &rx); enum VoltageType { TargetVdd = 0, ModuleVpp, MclrGround, MclrVdd, MclrVpp, Nb_VoltageTypes }; bool pass() const; - QString result(VoltageType type) const; - QString pretty(VoltageType type) const; + TQString result(VoltageType type) const; + TQString pretty(VoltageType type) const; static const char * const VOLTAGE_LABELS[Nb_VoltageTypes]; private: @@ -39,7 +39,7 @@ class Hardware : public Icd::Hardware { public: Hardware(::Programmer::Base &base, Port::Base *port) : Icd::Hardware(base, port) {} - bool command(const QString &command, uint responseSize); + bool command(const TQString &command, uint responseSize); // initialization virtual bool uploadFirmware(const Pic::Memory &memory); @@ -72,7 +72,7 @@ public: virtual BitValue getProgramCounter(); protected: - virtual QString receivedData() const { return _rx.mid(5, _rx.length()-8); } + virtual TQString receivedData() const { return _rx.mid(5, _rx.length()-8); } private: struct VoltageTypeData { @@ -82,8 +82,8 @@ private: static const VoltageTypeData VOLTAGE_TYPE_DATA[Pic::Nb_VoltageTypes]; static const char * const WRITE_MODE_VALUES[Pic::Nb_WriteModes]; - bool sendCommand(const QString &command); - bool receiveResponse(const QString &command, uint responseSize, bool poll); + bool sendCommand(const TQString &command); + bool receiveResponse(const TQString &command, uint responseSize, bool poll); bool readBlock(uint nbBytesWord, uint nbWords, Device::Array &data); bool writeBlock(uint nbBytesWord, const Device::Array &data, uint wordOffset, uint nbWords); const char *readCommand(Pic::MemoryRangeType type) const; diff --git a/src/progs/icd2/base/icd2_data.h b/src/progs/icd2/base/icd2_data.h index ceda394..5bf972f 100644 --- a/src/progs/icd2/base/icd2_data.h +++ b/src/progs/icd2/base/icd2_data.h @@ -35,8 +35,8 @@ namespace Icd2 uint famid; ::Group::Support debugSupport; }; - extern const Data &data(const QString &device); - extern uint family(const QString &device); + extern const Data &data(const TQString &device); + extern uint family(const TQString &device); } // namespace #endif diff --git a/src/progs/icd2/base/icd2_debug.cpp b/src/progs/icd2/base/icd2_debug.cpp index 62f6404..ba10a4d 100644 --- a/src/progs/icd2/base/icd2_debug.cpp +++ b/src/progs/icd2/base/icd2_debug.cpp @@ -26,8 +26,8 @@ bool Icd2::Debugger::waitForTargetMode(Pic::TargetMode mode) if ( rmode==mode ) return true; Port::msleep(200); } - log(Log::LineType::Error, QString("Timeout waiting for mode: %1 (target is in mode: %2).") - .arg(i18n(Pic::TARGET_MODE_LABELS[mode])).arg(i18n(Pic::TARGET_MODE_LABELS[rmode]))); + log(Log::LineType::Error, TQString("Timeout waiting for mode: %1 (target is in mode: %2).") + .tqarg(i18n(Pic::TARGET_MODE_LABELS[mode])).tqarg(i18n(Pic::TARGET_MODE_LABELS[rmode]))); return false; } @@ -55,11 +55,11 @@ bool Icd2::Debugger::updateState() return true; } -bool Icd2::Debugger::setBreakpoints(const QValueList<Address> &addresses) +bool Icd2::Debugger::setBreakpoints(const TQValueList<Address> &addresses) { if ( addresses.count()==0 ) return specific()->setBreakpoint(Address()); for (uint i=0; i<uint(addresses.count()); i++) { - log(Log::DebugLevel::Normal, QString("Set breakpoint at %1").arg(toHexLabel(addresses[i], device()->nbCharsAddress()))); + log(Log::DebugLevel::Normal, TQString("Set breakpoint at %1").tqarg(toHexLabel(addresses[i], device()->nbCharsAddress()))); if ( !specific()->setBreakpoint(addresses[i]) ) return false; } return true; @@ -97,14 +97,14 @@ bool Icd2::Debugger::readRegister(const Register::TypeData &data, BitValue &valu { if ( data.type()==Register::Special ) { if ( data.name()=="WREG" ) return hardware()->readRegister(specific()->addressWREG(), value, 1); - if ( data.name()=="PC" ) { value = hardware()->getProgramCounter().maskWith(specific()->maskPC()); return !hasError(); } + if ( data.name()=="PC" ) { value = hardware()->getProgramCounter().tqmaskWith(specific()->tqmaskPC()); return !hasError(); } Q_ASSERT(false); return true; } - QString name = device()->registersData().sfrNames[data.address()]; + TQString name = device()->registersData().sfrNames[data.address()]; if ( name=="WREG" ) return hardware()->readRegister(specific()->addressWREG(), value, 1); - if ( name=="PCL" ) { value = hardware()->getProgramCounter().maskWith(specific()->maskPC()).byte(0); return !hasError(); } - if ( name=="PCLATH" ) { value = hardware()->getProgramCounter().maskWith(specific()->maskPC()).byte(1); return !hasError(); } + if ( name=="PCL" ) { value = hardware()->getProgramCounter().tqmaskWith(specific()->tqmaskPC()).byte(0); return !hasError(); } + if ( name=="PCLATH" ) { value = hardware()->getProgramCounter().tqmaskWith(specific()->tqmaskPC()).byte(1); return !hasError(); } return hardware()->readRegister(specific()->addressRegister(data.address()), value, 1); } @@ -115,7 +115,7 @@ bool Icd2::Debugger::writeRegister(const Register::TypeData &data, BitValue valu Q_ASSERT(false); return true; } - QString name = device()->registersData().sfrNames[data.address()]; + TQString name = device()->registersData().sfrNames[data.address()]; if ( name=="WREG" ) return hardware()->writeRegister(specific()->addressWREG(), value, 1); return hardware()->writeRegister(specific()->addressRegister(data.address()), value, 1); } @@ -143,29 +143,29 @@ bool Icd2::DebugProgrammer::internalSetupHardware() return false; } uint reservedBank = 0; - QString filename; + TQString filename; if ( device()->is18Family() ) { Debugger *debug = static_cast<Debugger *>(debugger()); reservedBank = static_cast<const P18FDebuggerSpecific *>(debug->specific())->reservedBank(); - filename = QString("de18F_BANK%1.hex").arg(QString(toString(NumberBase::Dec, reservedBank, 2))); - } else filename = QString("de%1.hex").arg(fdata.debugExec); + filename = TQString("de18F_BANK%1.hex").tqarg(TQString(toString(NumberBase::Dec, reservedBank, 2))); + } else filename = TQString("de%1.hex").tqarg(fdata.debugExec); PURL::Url url = dir.findMatchingFilename(filename); - log(Log::DebugLevel::Normal, QString(" Debug executive file: %1").arg(url.pretty())); + log(Log::DebugLevel::Normal, TQString(" Debug executive file: %1").tqarg(url.pretty())); if ( !url.exists() ) { - log(Log::LineType::Error, i18n("Could not find debug executive file \"%1\".").arg(url.pretty())); + log(Log::LineType::Error, i18n("Could not find debug executive file \"%1\".").tqarg(url.pretty())); return false; } // upload hex file Log::StringView sview; PURL::File file(url, sview); if ( !file.openForRead() ) { - log(Log::LineType::Error, i18n("Could not open firmware file \"%1\".").arg(url.pretty())); + log(Log::LineType::Error, i18n("Could not open firmware file \"%1\".").tqarg(url.pretty())); return false; } - QStringList errors; + TQStringList errors; HexBuffer hbuffer; if ( !hbuffer.load(file.stream(), errors) ) { - log(Log::LineType::Error, i18n("Could not read debug executive file \"%1\": %2.").arg(url.pretty()).arg(errors[0])); + log(Log::LineType::Error, i18n("Could not read debug executive file \"%1\": %2.").tqarg(url.pretty()).tqarg(errors[0])); return false; } uint nbWords = device()->nbWords(Pic::MemoryRangeType::Code); @@ -173,8 +173,8 @@ bool Icd2::DebugProgrammer::internalSetupHardware() if ( fdata.debugExecOffset!=0 && fdata.debugExecOffset!=offset ) for (uint i=0; i<0x100; i++) hbuffer.insert(offset+i, hbuffer[fdata.debugExecOffset+i]); Pic::Memory::WarningTypes warningTypes; - QStringList warnings; - QMap<uint, bool> inRange; + TQStringList warnings; + TQMap<uint, bool> inRange; Pic::Memory memory(*device()); memory.fromHexBuffer(Pic::MemoryRangeType::Code, hbuffer, warningTypes, warnings, inRange); _deArray = memory.arrayForWriting(Pic::MemoryRangeType::Code); @@ -199,7 +199,7 @@ bool Icd2::DebugProgrammer::internalSetupHardware() _deStart = specific()->findNonMaskStart(Pic::MemoryRangeType::Code, _deArray); _deEnd = specific()->findNonMaskEnd(Pic::MemoryRangeType::Code, _deArray); } - log(Log::DebugLevel::Extra, QString("debug executive: \"%1\" %2:%3").arg(url.pretty()).arg(toHexLabel(_deStart, 4)).arg(toHexLabel(_deEnd, 4))); + log(Log::DebugLevel::Extra, TQString("debug executive: \"%1\" %2:%3").tqarg(url.pretty()).tqarg(toHexLabel(_deStart, 4)).tqarg(toHexLabel(_deEnd, 4))); return Icd2::ProgrammerBase::internalSetupHardware(); } @@ -251,9 +251,9 @@ bool Icd2::DebugProgrammer::writeDebugExecutive() uint inc = device()->addressIncrement(Pic::MemoryRangeType::Code); Address address = device()->range(Pic::MemoryRangeType::Code).start + inc * (_deStart + i); log(Log::LineType::Error, i18n("Device memory doesn't match debug executive (at address %1: reading %2 and expecting %3).") - .arg(toHexLabel(address, device()->nbCharsAddress())) - .arg(toHexLabel(data[i], device()->nbCharsWord(Pic::MemoryRangeType::Code))) - .arg(toHexLabel(_deArray[_deStart+i], device()->nbCharsWord(Pic::MemoryRangeType::Code)))); + .tqarg(toHexLabel(address, device()->nbCharsAddress())) + .tqarg(toHexLabel(data[i], device()->nbCharsWord(Pic::MemoryRangeType::Code))) + .tqarg(toHexLabel(_deArray[_deStart+i], device()->nbCharsWord(Pic::MemoryRangeType::Code)))); return false; } return true; @@ -265,7 +265,7 @@ bool Icd2::DebugProgrammer::doProgram(const Device::Memory &memory, const Device if ( !doConnectDevice() ) return false; _progressMonitor.startNextTask(); // probably needed for all devices that don't have a "erase and write" mode - if ( range.all() && FAMILY_DATA[family(device()->name())].debugExec==QString("16F7X7") ) { + if ( range.all() && FAMILY_DATA[family(device()->name())].debugExec==TQString("16F7X7") ) { Pic::Memory dmemory(*device()); dmemory.setWord(Pic::MemoryRangeType::Code, 0, 0x0028); dmemory.setWord(Pic::MemoryRangeType::Code, 1, 0x0030); @@ -290,7 +290,7 @@ bool Icd2::DebugProgrammer::programAll(const Pic::Memory &mem) if ( !programAndVerifyRange(Pic::MemoryRangeType::UserId, memory) ) return false; if ( device()->is18Family() ) { if ( !hardware()->command("0C00", 0) ) return false; // #### ?? - QString com = "42" + toHex(0xFB5, 8) + toHex(1, 8); // write RSBUG (?) + TQString com = "42" + toHex(0xFB5, 8) + toHex(1, 8); // write RSBUG (?) if ( !hardware()->command(com, 0) ) return false; if ( !hardware()->command("0C01", 0) ) return false; // #### ?? } @@ -311,12 +311,12 @@ bool Icd2::DebugProgrammer::internalRead(Device::Memory *mem, const Device::Memo bool Icd2::DebugProgrammer::readDebugExecutiveVersion() { if ( !hardware()->getDebugExecVersion(_debugExecutiveVersion) ) return false; - log(Log::LineType::Information, i18n(" Debug executive version: %1").arg(_debugExecutiveVersion.pretty())); + log(Log::LineType::Information, i18n(" Debug executive version: %1").tqarg(_debugExecutiveVersion.pretty())); return true; } //---------------------------------------------------------------------------- -void Icd2::DebuggerGroup::addDevice(const QString &name, const Device::Data *ddata, ::Group::Support) +void Icd2::DebuggerGroup::addDevice(const TQString &name, const Device::Data *ddata, ::Group::Support) { if ( FAMILY_DATA[family(name)].debugExec==0 ) return; Group::addDevice(name, ddata, data(name).debugSupport); @@ -326,7 +326,7 @@ void Icd2::DebuggerGroup::addDevice(const QString &name, const Device::Data *dda { const Pic::Data *data = static_cast< ::Debugger::PicBase &>(base).device(); if ( data==0 ) return 0; - QString debugExec = FAMILY_DATA[family(data->name())].debugExec; + TQString debugExec = FAMILY_DATA[family(data->name())].debugExec; switch (data->architecture().type()) { case Pic::Architecture::P16X: if ( debugExec=="16F872" ) return new P16F872DebuggerSpecific(base); diff --git a/src/progs/icd2/base/icd2_debug.h b/src/progs/icd2/base/icd2_debug.h index bd2a6fe..7042a22 100644 --- a/src/progs/icd2/base/icd2_debug.h +++ b/src/progs/icd2/base/icd2_debug.h @@ -20,6 +20,7 @@ class DebuggerSpecific; class DebugProgrammer : public ProgrammerBase { Q_OBJECT + TQ_OBJECT public: DebugProgrammer(const ::Programmer::Group &group, const Pic::Data *data); bool readDebugExecutiveVersion(); @@ -46,7 +47,7 @@ class Debugger : public ::Debugger::PicBase { public: Debugger(DebugProgrammer &programmer) : ::Debugger::PicBase(programmer) {} - virtual bool setBreakpoints(const QValueList<Address> &addresses); + virtual bool setBreakpoints(const TQValueList<Address> &addresses); Hardware *hardware() { return static_cast<Hardware *>(_programmer.hardware()); } DebugProgrammer &programmer() { return static_cast<DebugProgrammer &>(_programmer); } DebuggerSpecific *specific(); @@ -72,13 +73,13 @@ private: class DebuggerGroup : public Group { public: - virtual QString name() const { return "icd2_debugger"; } - virtual QString label() const { return i18n("ICD2 Debugger"); } + virtual TQString name() const { return "icd2_debugger"; } + virtual TQString label() const { return i18n("ICD2 Debugger"); } virtual ::Programmer::Properties properties() const { return Group::properties() | ::Programmer::Debugger; } virtual uint maxNbBreakpoints(const Device::Data *) const { return 1; } protected: - virtual void addDevice(const QString &name, const Device::Data *data, ::Group::Support support); + virtual void addDevice(const TQString &name, const Device::Data *data, ::Group::Support support); virtual ::Programmer::Base *createBase(const Device::Data *data) const { return new DebugProgrammer(*this, static_cast<const Pic::Data *>(data)); } virtual ::Debugger::Base *createDebuggerBase(::Programmer::Base &base) const { return new Debugger(static_cast<DebugProgrammer &>(base)); } virtual ::Debugger::Specific *createDebuggerSpecific(::Debugger::Base &base) const; diff --git a/src/progs/icd2/base/icd2_debug_specific.cpp b/src/progs/icd2/base/icd2_debug_specific.cpp index 56cc178..61bc373 100644 --- a/src/progs/icd2/base/icd2_debug_specific.cpp +++ b/src/progs/icd2/base/icd2_debug_specific.cpp @@ -19,7 +19,7 @@ Address Icd2::P16FDebuggerSpecific::addressWREG() const Address Icd2::P16FDebuggerSpecific::addressRegister(Address address) const { - QString name = device()->registersData().sfrNames[address]; + TQString name = device()->registersData().sfrNames[address]; if ( name=="FSR" ) return FAMILY_DATA[family(device()->name())].fsr; if ( name=="STATUS" ) return FAMILY_DATA[family(device()->name())].status; return address; @@ -41,7 +41,7 @@ bool Icd2::P16FDebuggerSpecific::setBreakpoint(Address address) bool Icd2::P16FDebuggerSpecific::readBreakpoint(BitValue &value) { if ( !hardware()->readRegister(0x18E, value, 2) ) return false; - value = value.maskWith(0x1FFF); + value = value.tqmaskWith(0x1FFF); return true; } @@ -50,7 +50,7 @@ bool Icd2::P16FDebuggerSpecific::beginInit(Device::Array *saved) if ( !hardware()->setTargetReset(Pic::ResetHeld) ) return false; double vdd; if ( !hardware()->readVoltage(Pic::TargetVdd, vdd) ) return false; - log(Log::DebugLevel::Normal, QString(" Target Vdd: %1 V").arg(vdd)); + log(Log::DebugLevel::Normal, TQString(" Target Vdd: %1 V").tqarg(vdd)); if (saved) { saved->resize(1); @@ -73,14 +73,14 @@ bool Icd2::P16FDebuggerSpecific::endInit(BitValue expectedPC) //log(Log::LineType::Information, i18n("Detected custom ICD2")); } if ( value!=expectedPC ) { - log(Log::LineType::Error, i18n(" PC is not at address %1 (%2)").arg(toHexLabel(expectedPC, 4)).arg(toHexLabel(value, 4))); + log(Log::LineType::Error, i18n(" PC is not at address %1 (%2)").tqarg(toHexLabel(expectedPC, 4)).tqarg(toHexLabel(value, 4))); return false; } if ( !setBreakpoint(0x0000) ) return false; if ( !base().update() ) return false; if ( base().pc()!=expectedPC ) { - log(Log::LineType::Error, i18n(" PC is not at address %1 (%2)").arg(toHexLabel(expectedPC, 4)).arg(toHexLabel(base().pc(), 4))); + log(Log::LineType::Error, i18n(" PC is not at address %1 (%2)").tqarg(toHexLabel(expectedPC, 4)).tqarg(toHexLabel(base().pc(), 4))); return false; } return true; @@ -163,7 +163,7 @@ bool Icd2::P16F7X7DebuggerSpecific::init(bool last) log(Log::DebugLevel::Normal, "Probably detected custom ICD2"); } if ( value!=expectedPC ) - log(Log::DebugLevel::Normal, i18n(" PC is not at address %1 (%2)").arg(toHexLabel(expectedPC, 4)).arg(toHexLabel(value, 4))); + log(Log::DebugLevel::Normal, i18n(" PC is not at address %1 (%2)").tqarg(toHexLabel(expectedPC, 4)).tqarg(toHexLabel(value, 4))); if ( !setBreakpoint(0x0000) ) return false; if ( !base().update() ) return false; @@ -205,7 +205,7 @@ Address Icd2::P18FDebuggerSpecific::addressWREG()const Address Icd2::P18FDebuggerSpecific::addressRegister(Address address) const { - QString name = device()->registersData().sfrNames[address]; + TQString name = device()->registersData().sfrNames[address]; if ( name=="PCLATU" ) return reservedRegisterOffset() | 0x0F4; if ( name=="PCLATH" ) return reservedRegisterOffset() | 0x0F5; if ( name=="FSR0H" ) return reservedRegisterOffset() | 0x0FB; @@ -241,7 +241,7 @@ bool Icd2::P18FDebuggerSpecific::reset() log(Log::LineType::Information, i18n("Detected custom ICD2")); } if ( base().pc()!=expectedPC ) { - log(Log::LineType::Error, i18n(" PC is not at address %1 (%2)").arg(toHexLabel(expectedPC, 4)).arg(toHexLabel(base().pc(), 4))); + log(Log::LineType::Error, i18n(" PC is not at address %1 (%2)").tqarg(toHexLabel(expectedPC, 4)).tqarg(toHexLabel(base().pc(), 4))); return false; } return true; diff --git a/src/progs/icd2/base/icd2_debug_specific.h b/src/progs/icd2/base/icd2_debug_specific.h index d14887b..830ab0f 100644 --- a/src/progs/icd2/base/icd2_debug_specific.h +++ b/src/progs/icd2/base/icd2_debug_specific.h @@ -25,7 +25,7 @@ public: DebugProgrammer &programmer() { return base().programmer(); } ::Debugger::PicSpecific *deviceSpecific() { return base().deviceSpecific(); } virtual Address addressWREG() const = 0; - virtual BitValue maskPC() const = 0; + virtual BitValue tqmaskPC() const = 0; virtual Address addressRegister(Address address) const = 0; virtual bool setBreakpoint(Address address) = 0; virtual bool readBreakpoint(BitValue &value) = 0; @@ -42,7 +42,7 @@ public: virtual BitValue writeMaskBreakpointRegister() const { return 0x8000; } virtual BitValue readMaskBreakpointRegister() const { return 0x1FFF; } virtual Address addressWREG() const; - virtual BitValue maskPC() const { return 0x1FFF; } + virtual BitValue tqmaskPC() const { return 0x1FFF; } virtual Address addressRegister(Address address) const; virtual bool setBreakpoint(Address address); virtual bool readBreakpoint(BitValue &value); @@ -80,7 +80,7 @@ class P18FDebuggerSpecific : public DebuggerSpecific public: P18FDebuggerSpecific(::Debugger::Base &base); virtual Address addressWREG() const; - virtual BitValue maskPC() const { return 0xFFFF; } + virtual BitValue tqmaskPC() const { return 0xFFFF; } virtual Address addressRegister(Address address) const; virtual bool setBreakpoint(Address address); virtual bool readBreakpoint(BitValue &value); diff --git a/src/progs/icd2/base/icd2_prog.cpp b/src/progs/icd2/base/icd2_prog.cpp index 7b2a59b..dbea1d3 100644 --- a/src/progs/icd2/base/icd2_prog.cpp +++ b/src/progs/icd2/base/icd2_prog.cpp @@ -47,13 +47,13 @@ bool Icd2::ProgrammerBase::selfTest(bool ask) log(Log::DebugLevel::Normal, " Self-test"); if ( !hardware()->selfTest(_testData) ) return false; if ( !_testData.pass() ) { - QString s; + TQString s; for (uint i=0; i<TestData::Nb_VoltageTypes; i++) { if ( i!=0 ) s += "; "; s += _testData.pretty(TestData::VoltageType(i)); } - log(Log::LineType::Warning, i18n("Self-test failed: %1").arg(s)); - if ( ask && !askContinue(i18n("Self-test failed (%1). Do you want to continue anyway?").arg(s)) ) { + log(Log::LineType::Warning, i18n("Self-test failed: %1").tqarg(s)); + if ( ask && !askContinue(i18n("Self-test failed (%1). Do you want to continue anyway?").tqarg(s)) ) { logUserAbort(); return false; } @@ -77,27 +77,27 @@ VersionData Icd2::ProgrammerBase::mplabVersion(::Programmer::FirmwareVersionType bool Icd2::ProgrammerBase::setupFirmware() { const FamilyData &fdata = FAMILY_DATA[family(device()->name())]; - log(Log::DebugLevel::Normal, QString(" Firmware id is %1 and we want %2").arg(_firmwareId).arg(fdata.efid)); + log(Log::DebugLevel::Normal, TQString(" Firmware id is %1 and we want %2").tqarg(_firmwareId).tqarg(fdata.efid)); if ( fdata.efid==_firmwareId ) return true; log(Log::LineType::Information, i18n(" Incorrect firmware loaded.")); // find firmware file PURL::Directory dir = firmwareDirectory(); if ( dir.isEmpty() ) return false; - QString nameFilter = "ICD" + QString::number(fdata.efid).rightJustify(2, '0') + "??????.hex"; - QStringList files = dir.files(nameFilter); + TQString nameFilter = "ICD" + TQString::number(fdata.efid).rightJustify(2, '0') + "??????.hex"; + TQStringList files = dir.files(nameFilter); if ( files.isEmpty() ) { - log(Log::LineType::Error, i18n("Could not find firmware file \"%1\" in directory \"%2\".").arg(nameFilter).arg(dir.path())); + log(Log::LineType::Error, i18n("Could not find firmware file \"%1\" in directory \"%2\".").tqarg(nameFilter).tqarg(dir.path())); return false; } // upload hex file PURL::Url url(dir, files[files.count()-1]); - log(Log::DebugLevel::Normal, QString(" Firmware file: %1").arg(url.pretty())); + log(Log::DebugLevel::Normal, TQString(" Firmware file: %1").tqarg(url.pretty())); Log::StringView sview; PURL::File file(url, sview); if ( !file.openForRead() ) { - log(Log::LineType::Error, i18n("Could not open firmware file \"%1\".").arg(url.pretty())); + log(Log::LineType::Error, i18n("Could not open firmware file \"%1\".").tqarg(url.pretty())); return false; } if ( !doUploadFirmware(file) ) return false; diff --git a/src/progs/icd2/base/icd2_prog.h b/src/progs/icd2/base/icd2_prog.h index e8be727..14df438 100644 --- a/src/progs/icd2/base/icd2_prog.h +++ b/src/progs/icd2/base/icd2_prog.h @@ -22,6 +22,7 @@ class Hardware; class ProgrammerBase : public Icd::ProgrammerBase { Q_OBJECT + TQ_OBJECT public: ProgrammerBase(const Programmer::Group &group, const Pic::Data *data, const char *name) : Icd::ProgrammerBase(group, data, name) {} @@ -48,6 +49,7 @@ private: class Programmer : public ProgrammerBase { Q_OBJECT + TQ_OBJECT public: Programmer(const ::Programmer::Group &group, const Pic::Data *data); }; @@ -56,7 +58,7 @@ public: class Group : public Icd::Group { public: - virtual QString xmlName() const { return "icd2"; } + virtual TQString xmlName() const { return "icd2"; } virtual ::Programmer::Properties properties() const; virtual ::Programmer::TargetPowerMode targetPowerMode() const { return ::Programmer::TargetPowerModeFromConfig; } virtual bool isPortSupported(PortType type) const { return ( type==PortType::Serial || type==PortType::USB ); } @@ -72,8 +74,8 @@ protected: class ProgrammerGroup : public Group { public: - virtual QString name() const { return "icd2"; } - virtual QString label() const { return i18n("ICD2 Programmer"); } + virtual TQString name() const { return "icd2"; } + virtual TQString label() const { return i18n("ICD2 Programmer"); } protected: virtual ::Programmer::Base *createBase(const Device::Data *data) const { return new Programmer(*this, static_cast<const Pic::Data *>(data)); } diff --git a/src/progs/icd2/base/icd2_serial.cpp b/src/progs/icd2/base/icd2_serial.cpp index 1ab738c..7f276f0 100644 --- a/src/progs/icd2/base/icd2_serial.cpp +++ b/src/progs/icd2/base/icd2_serial.cpp @@ -13,7 +13,7 @@ #include "common/common/misc.h" //----------------------------------------------------------------------------- -Icd2::SerialPort::SerialPort(const QString &device, Log::Base &log) +Icd2::SerialPort::SerialPort(const TQString &device, Log::Base &log) : Port::Serial(device, NeedDrain | NeedFlush, log) {} @@ -24,23 +24,23 @@ bool Icd2::SerialPort::open(Speed speed) } //----------------------------------------------------------------------------- -Icd2::SerialHardware::SerialHardware(::Programmer::Base &base, const QString &portDevice) +Icd2::SerialHardware::SerialHardware(::Programmer::Base &base, const TQString &portDevice) : Hardware(base, new SerialPort(portDevice, base)) {} -bool Icd2::SerialHardware::internalConnect(const QString &mode) +bool Icd2::SerialHardware::internalConnect(const TQString &mode) { if ( !static_cast<SerialPort *>(_port)->open(Port::Serial::S19200) ) return false; if ( !reset() ) return false; if ( !_port->send("Z", 1) ) return false; - QString s; + TQString s; if ( !_port->receive(4, s) ) return false; if ( !reset() ) return false; - QByteArray a = toAscii(mode); + TQByteArray a = toAscii(mode); if ( !_port->send(a.data(), a.count()) ) return false; if ( !_port->receive(1, s) ) return false; if ( s.upper()!=mode ) { - log(Log::LineType::Error, i18n("Failed to set port mode to '%1'.").arg(mode)); + log(Log::LineType::Error, i18n("Failed to set port mode to '%1'.").tqarg(mode)); return false; } //log(Log::Debug, "set fast speed"); diff --git a/src/progs/icd2/base/icd2_serial.h b/src/progs/icd2/base/icd2_serial.h index 546e7b3..0291f49 100644 --- a/src/progs/icd2/base/icd2_serial.h +++ b/src/progs/icd2/base/icd2_serial.h @@ -20,7 +20,7 @@ namespace Icd2 class SerialPort : public Port::Serial { public: - SerialPort(const QString &portDevice, Log::Base &log); + SerialPort(const TQString &portDevice, Log::Base &log); bool open(Speed speed); }; @@ -28,12 +28,12 @@ public: class SerialHardware : public Hardware { public: - SerialHardware(::Programmer::Base &base, const QString &portDevice); + SerialHardware(::Programmer::Base &base, const TQString &portDevice); private: bool setFastSpeed(); bool reset(); - virtual bool internalConnect(const QString &mode); + virtual bool internalConnect(const TQString &mode); }; } // namespace diff --git a/src/progs/icd2/base/icd2_usb.cpp b/src/progs/icd2/base/icd2_usb.cpp index 945ef6f..7cc2458 100644 --- a/src/progs/icd2/base/icd2_usb.cpp +++ b/src/progs/icd2/base/icd2_usb.cpp @@ -27,7 +27,7 @@ Icd2::USBPort::USBPort(uint deviceId, Log::Base &log) bool Icd2::USBPort::doSequence(SequenceType type, char *data, uint size) { - QByteArray tx(0x12); + TQByteArray tx(0x12); for (uint i=0; i<uint(tx.count()); i++) tx[i] = 0x00; tx[0x00] = SEQUENCE_DATA[type].type; tx[0x01] = _seqnum; @@ -51,7 +51,7 @@ bool Icd2::USBPort::doSequence(SequenceType type, char *data, uint size) case Nb_SequenceTypes: Q_ASSERT(false); break; } - QByteArray rx(0x08); + TQByteArray rx(0x08); if ( !read(0x81, rx.data(), rx.size(), 0) ) return false; //Q_ASSERT( rx[0]==tx[1] ); @@ -60,14 +60,14 @@ bool Icd2::USBPort::doSequence(SequenceType type, char *data, uint size) return true; } -bool Icd2::USBPort::connectDevice(const QString &mode) +bool Icd2::USBPort::connectDevice(const TQString &mode) { _seqnum = 0xC1; // preset seqnum _ctype = 0x00; if ( !doSequence(Connect, 0, 0) ) return false; if ( !send("Z", 1) ) return false; - QString s; + TQString s; if ( !receive(4, s) ) return false; _ctype = 0x00; @@ -78,7 +78,7 @@ bool Icd2::USBPort::connectDevice(const QString &mode) return false; } _ctype = 0x02; - QByteArray a = toAscii(mode); + TQByteArray a = toAscii(mode); if ( !doSequence(Send, a.data(), a.count()) ) return false; char c; _ctype = 0x02; @@ -92,7 +92,7 @@ bool Icd2::USBPort::connectDevice(const QString &mode) bool Icd2::USBPort::internalReceive(uint size, char *data, uint) { if (_dataSend) { - //_ctype = qMin(0x65, qRound(4.8 * size)); // timing ?? (1.6 for my ICD2) + //_ctype = qMin(0x65, tqRound(4.8 * size)); // timing ?? (1.6 for my ICD2) _ctype = 0xC9; } else _ctype = 0xC9; bool ok = doSequence(Receive, data, size); @@ -103,7 +103,7 @@ bool Icd2::USBPort::internalReceive(uint size, char *data, uint) bool Icd2::USBPort::internalSend(const char *data, uint size, uint) { if (_dataSend) { - //_ctype = qMin(0x65, qRound(4.8 * size)); // timing ?? (1.6 for my ICD2) + //_ctype = qMin(0x65, tqRound(4.8 * size)); // timing ?? (1.6 for my ICD2) _ctype = 0xC9; } else _ctype = 0xC9; bool ok = doSequence(Send, (char *)data, size); @@ -111,16 +111,16 @@ bool Icd2::USBPort::internalSend(const char *data, uint size, uint) return ok; } -bool Icd2::USBPort::poll(uint size, QString &s) +bool Icd2::USBPort::poll(uint size, TQString &s) { - QMemArray<uchar> a; + TQMemArray<uchar> a; if ( !poll(size, a) ) return false; s.fill(0, size); for (uint i=0; i<size; i++) s[i] = a[i]; return true; } -bool Icd2::USBPort::poll(uint size, QMemArray<uchar> &a) +bool Icd2::USBPort::poll(uint size, TQMemArray<uchar> &a) { a.resize(size); for (;;) { @@ -128,7 +128,7 @@ bool Icd2::USBPort::poll(uint size, QMemArray<uchar> &a) if ( !doSequence(Poll, (char *)a.data(), size) ) return false; if (_poll) break; } - //log(Log::DebugLevel::Max, QString("Receiced: \"%1\"").arg(toPrintable((const char *)a.data(), size))); + //log(Log::DebugLevel::Max, TQString("Receiced: \"%1\"").tqarg(toPrintable((const char *)a.data(), size))); return true; } @@ -138,7 +138,7 @@ bool Icd2::USBPort::dataSend(const char *data, uint size) return Port::USB::send(data, size); } -bool Icd2::USBPort::dataReceive(uint size, QString &s) +bool Icd2::USBPort::dataReceive(uint size, TQString &s) { _dataSend = true; return Port::USB::receive(size, s); @@ -149,10 +149,10 @@ Icd2::USBHardware::USBHardware(::Programmer::Base &base) : Hardware(base, new USBPort(ID_CLIENT, base)) {} -bool Icd2::USBHardware::internalConnect(const QString &mode) +bool Icd2::USBHardware::internalConnect(const TQString &mode) { // load control messages for USB device if needed - log(Log::DebugLevel::Extra, QString("need firmware ? %1").arg(USBPort::findDevice(Microchip::VENDOR_ID, ID_FIRMWARE)!=0)); + log(Log::DebugLevel::Extra, TQString("need firmware ? %1").tqarg(USBPort::findDevice(Microchip::VENDOR_ID, ID_FIRMWARE)!=0)); if ( Port::USB::findDevice(Microchip::VENDOR_ID, ID_FIRMWARE) ) { USBPort port(ID_FIRMWARE, *this); if ( !port.open() ) return false; @@ -163,7 +163,7 @@ bool Icd2::USBHardware::internalConnect(const QString &mode) } port.close(); for (uint i=0; i<10; i++) { - log(Log::DebugLevel::Extra, QString("client here ? %1").arg(USBPort::findDevice(Microchip::VENDOR_ID, ID_CLIENT)!=0)); + log(Log::DebugLevel::Extra, TQString("client here ? %1").tqarg(USBPort::findDevice(Microchip::VENDOR_ID, ID_CLIENT)!=0)); if ( Port::USB::findDevice(Microchip::VENDOR_ID, ID_CLIENT) ) break; Port::msleep(1000); } diff --git a/src/progs/icd2/base/icd2_usb.h b/src/progs/icd2/base/icd2_usb.h index c2677a6..30d9065 100644 --- a/src/progs/icd2/base/icd2_usb.h +++ b/src/progs/icd2/base/icd2_usb.h @@ -22,11 +22,11 @@ class USBPort : public Port::USB { public: USBPort(uint deviceId, Log::Base &log); - bool connectDevice(const QString &mode); - bool poll(uint size, QString &s); - bool poll(uint size, QMemArray<uchar> &data); + bool connectDevice(const TQString &mode); + bool poll(uint size, TQString &s); + bool poll(uint size, TQMemArray<uchar> &data); bool dataSend(const char *data, uint size); - bool dataReceive(uint size, QString &s); + bool dataReceive(uint size, TQString &s); private: uchar _seqnum; @@ -55,7 +55,7 @@ private: enum { ID_FIRMWARE = 0x8000, // ICD2 id before usb firmware is transmitted ID_CLIENT = 0x8001 // ICD2 id after firmware is transmitted }; - virtual bool internalConnect(const QString &mode); + virtual bool internalConnect(const TQString &mode); }; } // namespace diff --git a/src/progs/icd2/base/icd_prog.cpp b/src/progs/icd2/base/icd_prog.cpp index 6fadf06..00f7c25 100644 --- a/src/progs/icd2/base/icd_prog.cpp +++ b/src/progs/icd2/base/icd_prog.cpp @@ -16,10 +16,10 @@ bool Icd::ProgrammerBase::doUploadFirmware(PURL::File &file) { const Device::Data &data = *Device::lister().data("16F876"); Pic::Memory memory(static_cast<const Pic::Data &>(data)); - QStringList errors, warnings; + TQStringList errors, warnings; Pic::Memory::WarningTypes warningTypes; if ( !memory.load(file.stream(), errors, warningTypes, warnings) ) { - log(Log::LineType::Error, i18n("Could not read firmware hex file \"%1\": %2.").arg(file.url().pretty()).arg(errors[0])); + log(Log::LineType::Error, i18n("Could not read firmware hex file \"%1\": %2.").tqarg(file.url().pretty()).tqarg(errors[0])); return false; } if ( warningTypes!=Pic::Memory::NoWarning ) { diff --git a/src/progs/icd2/base/icd_prog.h b/src/progs/icd2/base/icd_prog.h index ba6d9bb..8a0ab2e 100644 --- a/src/progs/icd2/base/icd_prog.h +++ b/src/progs/icd2/base/icd_prog.h @@ -19,6 +19,7 @@ namespace Icd class ProgrammerBase : public ::Programmer::PicBase { Q_OBJECT + TQ_OBJECT public: ProgrammerBase(const Programmer::Group &group, const Pic::Data *data, const char *name) : ::Programmer::PicBase(group, data, name) {} diff --git a/src/progs/icd2/base/microchip.h b/src/progs/icd2/base/microchip.h index 627b2ad..20ac4ed 100644 --- a/src/progs/icd2/base/microchip.h +++ b/src/progs/icd2/base/microchip.h @@ -9,7 +9,7 @@ #ifndef MICROCHIP_H #define MICROCHIP_H -#include <qstring.h> +#include <tqstring.h> namespace Microchip { diff --git a/src/progs/icd2/gui/icd2_group_ui.cpp b/src/progs/icd2/gui/icd2_group_ui.cpp index 6f00788..b8d71df 100644 --- a/src/progs/icd2/gui/icd2_group_ui.cpp +++ b/src/progs/icd2/gui/icd2_group_ui.cpp @@ -14,38 +14,38 @@ #include "progs/icd2/base/icd2_debug.h" //---------------------------------------------------------------------------- -Icd2::AdvancedDialog::AdvancedDialog(ProgrammerBase &base, QWidget *parent) - : ::Programmer::PicAdvancedDialog(base, parent, "icd2_advanced_dialog") +Icd2::AdvancedDialog::AdvancedDialog(ProgrammerBase &base, TQWidget *tqparent) + : ::Programmer::PicAdvancedDialog(base, tqparent, "icd2_advanced_dialog") { uint row = _firmwareContainer->numRows(); - QLabel *label = new QLabel(i18n("Id:"), _firmwareContainer); + TQLabel *label = new TQLabel(i18n("Id:"), _firmwareContainer); _firmwareContainer->addWidget(label, row,row, 0,0); - _firmwareIdLabel = new QLabel(_firmwareContainer); + _firmwareIdLabel = new TQLabel(_firmwareContainer); _firmwareContainer->addWidget(_firmwareIdLabel, row,row, 1,1); row++; row = _programmerContainer->numRows(); if ( base.group().properties() & ::Programmer::Debugger ) { - ButtonContainer *container = new ::Programmer::ButtonContainer(i18n("Debug Executive"), this, SLOT(updateDebugExecutive()), _programmerContainer); + ButtonContainer *container = new ::Programmer::ButtonContainer(i18n("Debug Executive"), TQT_TQOBJECT(this), TQT_SLOT(updateDebugExecutive()), _programmerContainer); _programmerContainer->addWidget(container, row,row, 0,1); - label = new QLabel(i18n("Version:"), container); + label = new TQLabel(i18n("Version:"), container); container->addWidget(label, 1,1, 0,0); - _debugExecLabel = new QLabel(container); + _debugExecLabel = new TQLabel(container); container->addWidget(_debugExecLabel, 1,1, 1,1); row++; } else _debugExecLabel = 0; for (uint i=0; i<TestData::Nb_VoltageTypes; i++) { - QLabel *label = new QLabel(i18n(TestData::VOLTAGE_LABELS[i]) + ":", _selfTestContainer); + TQLabel *label = new TQLabel(i18n(TestData::VOLTAGE_LABELS[i]) + ":", _selfTestContainer); _selfTestContainer->addWidget(label, 1+i,1+i, 0,0); - _tests[i] = new QLabel(_selfTestContainer); + _tests[i] = new TQLabel(_selfTestContainer); _selfTestContainer->addWidget(_tests[i], 1+i,1+i, 1,1); } } void Icd2::AdvancedDialog::updateDebugExecutive() { - ::BusyCursor bc; + ::PBusyCursor bc; if ( ensureConnected() ) { Pic::TargetMode mode; if ( !base().getTargetMode(mode) ) return; @@ -70,12 +70,12 @@ void Icd2::AdvancedDialog::updateDisplay() } //---------------------------------------------------------------------------- -::Programmer::ConfigWidget *Icd2::GroupUI::createConfigWidget(QWidget *parent) const +::Programmer::ConfigWidget *Icd2::GroupUI::createConfigWidget(TQWidget *tqparent) const { - return new ::Programmer::ConfigWidget(static_cast<const Group &>(group()), parent); + return new ::Programmer::ConfigWidget(static_cast<const Group &>(group()), tqparent); } -::Programmer::AdvancedDialog *Icd2::GroupUI::createAdvancedDialog(::Programmer::Base &base, QWidget *parent) const +::Programmer::AdvancedDialog *Icd2::GroupUI::createAdvancedDialog(::Programmer::Base &base, TQWidget *tqparent) const { - return new AdvancedDialog(static_cast<ProgrammerBase &>(base), parent); + return new AdvancedDialog(static_cast<ProgrammerBase &>(base), tqparent); } diff --git a/src/progs/icd2/gui/icd2_group_ui.h b/src/progs/icd2/gui/icd2_group_ui.h index 93d66e7..14c0fdb 100644 --- a/src/progs/icd2/gui/icd2_group_ui.h +++ b/src/progs/icd2/gui/icd2_group_ui.h @@ -21,16 +21,17 @@ class Group; class AdvancedDialog : public ::Programmer::PicAdvancedDialog { Q_OBJECT + TQ_OBJECT public: - AdvancedDialog(ProgrammerBase &base, QWidget *parent); + AdvancedDialog(ProgrammerBase &base, TQWidget *tqparent); virtual void updateDisplay(); private slots: void updateDebugExecutive(); private: - QLabel *_firmwareIdLabel, *_debugExecLabel; - QLabel *_tests[TestData::Nb_VoltageTypes]; + TQLabel *_firmwareIdLabel, *_debugExecLabel; + TQLabel *_tests[TestData::Nb_VoltageTypes]; ProgrammerBase &base() { return static_cast<ProgrammerBase &>(_base); } }; @@ -38,9 +39,9 @@ private: class GroupUI : public ::Programmer::GroupUI { public: - virtual ::Programmer::ConfigWidget *createConfigWidget(QWidget *parent) const; + virtual ::Programmer::ConfigWidget *createConfigWidget(TQWidget *tqparent) const; virtual bool hasAdvancedDialog() const { return true; } - virtual ::Programmer::AdvancedDialog *createAdvancedDialog(::Programmer::Base &base, QWidget *parent) const; + virtual ::Programmer::AdvancedDialog *createAdvancedDialog(::Programmer::Base &base, TQWidget *tqparent) const; }; } // namespace diff --git a/src/progs/icd2/xml/xml_icd2_parser.cpp b/src/progs/icd2/xml/xml_icd2_parser.cpp index 7ce2ad9..06eed27 100644 --- a/src/progs/icd2/xml/xml_icd2_parser.cpp +++ b/src/progs/icd2/xml/xml_icd2_parser.cpp @@ -19,21 +19,21 @@ public: XmlToData() : Programmer::XmlToData<Data>("icd2", "Icd2") {} private: - virtual uint familyIndex(const QString &family) const; - virtual void parseData(QDomElement element, Data &data); - virtual void outputData(const Data &data, QTextStream &s) const; + virtual uint familyIndex(const TQString &family) const; + virtual void parseData(TQDomElement element, Data &data); + virtual void outputData(const Data &data, TQTextStream &s) const; }; -uint Icd2::XmlToData::familyIndex(const QString &family) const +uint Icd2::XmlToData::familyIndex(const TQString &family) const { uint i = 0; for (; Icd2::FAMILY_DATA[i].efid!=0; i++) if ( family==Icd2::FAMILY_DATA[i].name ) break; - if ( Icd2::FAMILY_DATA[i].efid==0 ) qFatal(QString("Family \"%1\" is unknown").arg(family)); + if ( Icd2::FAMILY_DATA[i].efid==0 ) qFatal(TQString("Family \"%1\" is unknown").tqarg(family)); return i; } -void Icd2::XmlToData::parseData(QDomElement element, Data &data) +void Icd2::XmlToData::parseData(TQDomElement element, Data &data) { bool ok; data.famid = fromHexLabel(element.attribute("famid"), 2, &ok); @@ -41,7 +41,7 @@ void Icd2::XmlToData::parseData(QDomElement element, Data &data) data.debugSupport = extractSupport(element.attribute("debug_support_type")); } -void Icd2::XmlToData::outputData(const Data &data, QTextStream &s) const +void Icd2::XmlToData::outputData(const Data &data, TQTextStream &s) const { s << toHexLabel(data.famid, 2) << ", "; s << "::Group::Support::Type(" << data.debugSupport.type() << ")"; |