diff options
Diffstat (limited to 'src/electronics/port.cpp')
-rw-r--r-- | src/electronics/port.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/electronics/port.cpp b/src/electronics/port.cpp index 541195b..cb7f4fb 100644 --- a/src/electronics/port.cpp +++ b/src/electronics/port.cpp @@ -29,7 +29,7 @@ Port::~Port() } -QStringList Port::ports( unsigned probeResult ) +TQStringList Port::ports( unsigned probeResult ) { return SerialPort::ports(probeResult) + ParallelPort::ports(probeResult); } @@ -99,24 +99,24 @@ bool SerialPort::pinState( Pin pin ) if ( m_file == -1 ) return false; - int mask = 0; + int tqmask = 0; switch ( pin ) { case CD: - mask = TIOCM_CD; + tqmask = TIOCM_CD; break; case RD: - mask = TIOCM_SR; + tqmask = TIOCM_SR; break; case CTS: - mask = TIOCM_CTS; + tqmask = TIOCM_CTS; break; case RI: - mask = TIOCM_RI; + tqmask = TIOCM_RI; break; case TD: @@ -127,7 +127,7 @@ bool SerialPort::pinState( Pin pin ) break; } - if ( mask == 0 ) + if ( tqmask == 0 ) { kdError() << k_funcinfo << "Bad pin " << pin << endl; return false; @@ -140,11 +140,11 @@ bool SerialPort::pinState( Pin pin ) return false; } - return bits & mask; + return bits & tqmask; } -Port::ProbeResult SerialPort::probe( const QString & port ) +Port::ProbeResult SerialPort::probe( const TQString & port ) { int file = open( port.ascii(), O_NOCTTY | O_NONBLOCK | O_RDONLY ); if ( file == -1 ) @@ -161,7 +161,7 @@ Port::ProbeResult SerialPort::probe( const QString & port ) } -bool SerialPort::openPort( const QString & port, speed_t baudRate ) +bool SerialPort::openPort( const TQString & port, speed_t baudRate ) { closePort(); @@ -201,34 +201,34 @@ void SerialPort::closePort() } -QStringList SerialPort::ports( unsigned probeResult ) +TQStringList SerialPort::ports( unsigned probeResult ) { - QStringList list; + TQStringList list; for ( int i = 0; i < 8; ++i ) { - QString dev = QString("/dev/ttyS%1").arg(i); + TQString dev = TQString("/dev/ttyS%1").tqarg(i); if ( probe(dev) & probeResult ) list << dev; } for ( unsigned i = 0; i < 8; ++i ) { - QString dev = QString("/dev/tts/%1").arg(i); + TQString dev = TQString("/dev/tts/%1").tqarg(i); if ( probe(dev) & probeResult ) list << dev; } for ( unsigned i = 0; i < 8; ++i ) { - QString dev = QString("/dev/ttyUSB%1").arg(i); + TQString dev = TQString("/dev/ttyUSB%1").tqarg(i); if ( probe(dev) & probeResult ) list << dev; } for ( unsigned i = 0; i < 8; ++i ) { - QString dev = QString("/dev/usb/tts/%1").arg(i); + TQString dev = TQString("/dev/usb/tts/%1").tqarg(i); if ( probe(dev) & probeResult ) list << dev; } @@ -240,7 +240,7 @@ QStringList SerialPort::ports( unsigned probeResult ) //BEGIN class ParallelPort -const int IRQ_MODE_BIT = 1 << 20; // Controls if pin 10 (Ack) causes interrupts +const int IRTQ_MODE_BIT = 1 << 20; // Controls if pin 10 (Ack) causes interrupts const int INPUT_MODE_BIT = 1 << 21; // Controls if the data pins are input or output const int ALWAYS_INPUT_PINS = ParallelPort::STATUS_PINS; @@ -277,10 +277,10 @@ void ParallelPort::reset() { m_file = -1; m_reg[Data] = 0; - m_reg[Status] = 0; + m_reg[tqStatus] = 0; m_reg[Control] = 0; - m_outputPins = INPUT_MODE_BIT | IRQ_MODE_BIT; - m_inputPins = ALWAYS_INPUT_PINS | INPUT_MODE_BIT | IRQ_MODE_BIT; + m_outputPins = INPUT_MODE_BIT | IRTQ_MODE_BIT; + m_inputPins = ALWAYS_INPUT_PINS | INPUT_MODE_BIT | IRTQ_MODE_BIT; } @@ -309,7 +309,7 @@ int ParallelPort::pinState( int pins ) value |= ((readFromRegister( Data ) & ((pins & DATA_PINS) >> 0)) << 0); if ( pins & STATUS_PINS ) - value |= ((readFromRegister( Status ) & ((pins & STATUS_PINS) >> 8)) << 8); + value |= ((readFromRegister( tqStatus ) & ((pins & STATUS_PINS) >> 8)) << 8); if ( pins & CONTROL_PINS ) value |= ((readFromRegister( Control ) & ((pins & CONTROL_PINS) >> 16)) << 16); @@ -429,7 +429,7 @@ void ParallelPort::setControlDirection( int pins, Direction dir ) //END Changing pin directions -Port::ProbeResult ParallelPort::probe( const QString & port ) +Port::ProbeResult ParallelPort::probe( const TQString & port ) { int file = open( port.ascii(), O_RDWR ); if ( file == -1 ) @@ -447,20 +447,20 @@ Port::ProbeResult ParallelPort::probe( const QString & port ) } -QStringList ParallelPort::ports( unsigned probeResult ) +TQStringList ParallelPort::ports( unsigned probeResult ) { - QStringList list; + TQStringList list; for ( unsigned i = 0; i < 8; ++i ) { - QString dev = QString("/dev/parport%1").arg(i); + TQString dev = TQString("/dev/parport%1").tqarg(i); if ( probe(dev) & probeResult ) list << dev; } for ( unsigned i = 0; i < 8; ++i ) { - QString dev = QString("/dev/parports/%1").arg(i); + TQString dev = TQString("/dev/parports/%1").tqarg(i); if ( probe(dev) & probeResult ) list << dev; } @@ -469,7 +469,7 @@ QStringList ParallelPort::ports( unsigned probeResult ) } -bool ParallelPort::openPort( const QString & port ) +bool ParallelPort::openPort( const TQString & port ) { if ( m_file != -1 ) { |