git-svn-id: svn://db.shs.com.ru/pip@258 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -265,10 +265,10 @@ WORD PIScreen::SystemConsole::attributes(const PIScreenTypes::Cell & c) {
|
||||
case White: attr = attr | BACKGROUND_MASK; break;
|
||||
}
|
||||
if ((c.format.flags & Inverse) == Inverse) {
|
||||
uchar f = c.format.flags & 0xFF;
|
||||
c.format.flags &= 0xFFFFFF00;
|
||||
uchar f = attr & 0xFF;
|
||||
attr &= 0xFFFFFF00;
|
||||
f = (f << 4) | (f >> 4);
|
||||
c.format.flags |= f;
|
||||
attr |= f;
|
||||
}
|
||||
return attr;
|
||||
}
|
||||
|
||||
@@ -937,7 +937,7 @@ PIIODevice * PIConnection::DevicePool::addDevice(PIConnection * parent, const PI
|
||||
dd->rthread = 0;
|
||||
dd->started = false;
|
||||
}
|
||||
dd->rthread = new PIThread(dd, threadReadDP);
|
||||
dd->rthread = new PIThread(dd, __DevicePool_threadReadDP);
|
||||
dd->rthread->setName("__S__connection_" + fp + "_read_thread");
|
||||
need_start = true;
|
||||
pmode |= PIIODevice::ReadOnly;
|
||||
@@ -1066,12 +1066,13 @@ void PIConnection::DevicePool::run() {
|
||||
}
|
||||
|
||||
|
||||
void PIConnection::DevicePool::threadReadDP(void * ddp) {
|
||||
DeviceData * dd((DeviceData * )ddp);
|
||||
void __DevicePool_threadReadDP(void * ddp) {
|
||||
PIConnection::DevicePool::DeviceData * dd((PIConnection::DevicePool::DeviceData * )ddp);
|
||||
if (dd->dev == 0) {piMSleep(100); return;}
|
||||
PIByteArray ba;
|
||||
ba = dd->dev->read(dd->dev->threadedReadBufferSize());
|
||||
if (ba.isEmpty()) {piMSleep(10); return;}
|
||||
dd->dev->threadedRead(ba.data(), ba.size_s());
|
||||
//piCout << "Readed from" << dd->dev->path() << Hex << ba;
|
||||
__device_pool__->deviceReaded(dd, ba);
|
||||
}
|
||||
|
||||
@@ -284,6 +284,7 @@ public:
|
||||
|
||||
class DevicePool: public PIThread {
|
||||
PIOBJECT_SUBCLASS(DevicePool, PIThread)
|
||||
friend void __DevicePool_threadReadDP(void * ddp);
|
||||
friend class PIConnection;
|
||||
public:
|
||||
DevicePool();
|
||||
@@ -309,7 +310,6 @@ public:
|
||||
|
||||
void run();
|
||||
|
||||
static void threadReadDP(void * ddp);
|
||||
void deviceReaded(DeviceData * dd, const PIByteArray & data);
|
||||
|
||||
typedef PIMap<PIString, DeviceData * >::value_type DDPair;
|
||||
@@ -407,6 +407,8 @@ private:
|
||||
|
||||
};
|
||||
|
||||
void __DevicePool_threadReadDP(void * ddp);
|
||||
|
||||
|
||||
extern PIConnection::DevicePool * __device_pool__;
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ typedef bool (*ReadRetFunc)(void * , uchar * , int );
|
||||
class PIP_EXPORT PIIODevice: public PIThread
|
||||
{
|
||||
PIOBJECT_SUBCLASS(PIIODevice, PIThread)
|
||||
friend void __DevicePool_threadReadDP(void * ddp);
|
||||
public:
|
||||
|
||||
//! Constructs a empty PIIODevice
|
||||
|
||||
Reference in New Issue
Block a user