diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 00:15:53 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 00:15:53 +0000 |
commit | 0aaa8e3fc8f8a1481333b564f0922277c8d8ad59 (patch) | |
tree | b95c0ca86c4876dd139af376b9f4afd8917cf0cd /src/progs/icd1/base/icd1.cpp | |
parent | b79a2c28534cf09987eeeba3077fff9236df182a (diff) | |
download | piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.tar.gz piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.zip |
TQt4 port piklab
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1238822 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/progs/icd1/base/icd1.cpp')
-rw-r--r-- | src/progs/icd1/base/icd1.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/progs/icd1/base/icd1.cpp b/src/progs/icd1/base/icd1.cpp index 8c2704a..2ce3c80 100644 --- a/src/progs/icd1/base/icd1.cpp +++ b/src/progs/icd1/base/icd1.cpp @@ -14,24 +14,24 @@ #include "common/port/port_base.h" //----------------------------------------------------------------------------- -Icd1::Hardware::Hardware(::Programmer::Base &base, const QString &portDevice) +Icd1::Hardware::Hardware(::Programmer::Base &base, const TQString &portDevice) : Icd::Hardware(base, new SerialPort(portDevice, base)) {} -bool Icd1::Hardware::internalConnect(const QString &mode) +bool Icd1::Hardware::internalConnect(const TQString &mode) { if ( !port()->open() ) return false; if ( !port()->reset() ) return false; if ( hasError() ) return false; - QByteArray a = toAscii(mode); + TQByteArray a = toAscii(mode); if ( !port()->send(a.data(), a.count()) ) return false; - QString s; + TQString s; if ( !port()->receive(1, s) ) return false; port()->setPinOn(Port::Serial::RTS, false, Port::PositiveLogic); Port::msleep(1); port()->setPinOn(Port::Serial::RTS, true, Port::PositiveLogic); 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; } return true; @@ -52,10 +52,10 @@ bool Icd1::Hardware::readBlockCommand(uint nbBytes) { Q_ASSERT( nbBytes<=0xFF ); if ( !port()->sendCommand(0x7D00 + nbBytes) ) return false; - QByteArray a(nbBytes); + TQByteArray a(nbBytes); for (uint i=0; i<nbBytes; i++) if ( !port()->receiveByte(*(a.data()+i), i!=0) ) return false; - _rx = QString(a); + _rx = TQString(a); return true; } @@ -79,12 +79,12 @@ bool Icd1::Hardware::readVoltages(VoltagesData &voltages) if ( !sendCommand(0x701C, &res) ) return false; voltages[Pic::TargetVdd].value = (2.050 / 256) * res.toUInt(); // voltage at AN0 pin voltages[Pic::TargetVdd].value /= (4.7 / 14.7); // voltage at Vcc - log(Log::DebugLevel::Max, QString("Vdd: %1 %2").arg(toHexLabel(res, 4)).arg(voltages[Pic::TargetVdd].value)); + log(Log::DebugLevel::Max, TQString("Vdd: %1 %2").tqarg(toHexLabel(res, 4)).tqarg(voltages[Pic::TargetVdd].value)); voltages[Pic::TargetVdd].error = false; if ( !sendCommand(0x701D, &res) ) return false; voltages[Pic::TargetVpp].value = (2.050 / 256) * res.byte(0); // voltage at AN1 pin voltages[Pic::TargetVpp].value /= (10.0 / 110.0); // voltage at Vpp - log(Log::DebugLevel::Max, QString("Vpp: %1 %2").arg(toHexLabel(res, 4)).arg(voltages[Pic::TargetVpp].value)); + log(Log::DebugLevel::Max, TQString("Vpp: %1 %2").tqarg(toHexLabel(res, 4)).tqarg(voltages[Pic::TargetVpp].value)); voltages[Pic::TargetVpp].error = false; return sendCommand(0x7001); } @@ -106,7 +106,7 @@ bool Icd1::Hardware::selfTest() BitValue res; if ( !sendCommand(0x700B, &res, 5000) ) return false; if ( res!=0 ) { - log(Log::LineType::Warning, i18n("Self-test failed (returned value is %1)").arg(toLabel(res))); + log(Log::LineType::Warning, i18n("Self-test failed (returned value is %1)").tqarg(toLabel(res))); return false; } return true; @@ -152,7 +152,7 @@ bool Icd1::Hardware::eraseAll() if ( !sendCommand(0x7007, &res) ) return false; if ( !sendCommand(0x7001) ) return false; // disable Vpp if ( res!=0x3FFF ) { - log(Log::LineType::Error, i18n("Erase failed (returned value is %1)").arg(toHexLabel(res, 4))); + log(Log::LineType::Error, i18n("Erase failed (returned value is %1)").tqarg(toHexLabel(res, 4))); return false; } return true; |