04.11.2011 - adjust for Windows & QNX, multiprotocol, repeater, signals, process, codec, console input
This commit is contained in:
@@ -43,8 +43,8 @@ private:
|
||||
class PIRepeater: public PIMultiProtocol {
|
||||
public:
|
||||
PIRepeater(const PIString & config, const PIString & name, int data_size) {
|
||||
ba_f.resize(data_size);
|
||||
ba_s.resize(data_size);
|
||||
ba_f = new PIByteArray(data_size);
|
||||
ba_s = new PIByteArray(data_size);
|
||||
PIConfig conf(config, PIFile::Read);
|
||||
if (!conf.isOpened()) {
|
||||
cout << "[PIRepeater \"" << name << "\"] Can`t open \"" << config << "\"!" << endl;
|
||||
@@ -55,8 +55,8 @@ public:
|
||||
cout << "[PIRepeater \"" << name << "\"] \"" << config << "\" should consist 2 nodes!" << endl;
|
||||
return;
|
||||
}
|
||||
addProtocol(config, b.child(0)->fullName(), 0, 0, ba_f.data(), data_size, ba_s.data(), data_size);
|
||||
addProtocol(config, b.child(1)->fullName(), 0, 0, ba_s.data(), data_size, ba_f.data(), data_size);
|
||||
addProtocol(config, b.child(0)->fullName(), 0, 0, ba_f->data(), data_size, ba_s->data(), data_size);
|
||||
addProtocol(config, b.child(1)->fullName(), 0, 0, ba_s->data(), data_size, ba_f->data(), data_size);
|
||||
start();
|
||||
}
|
||||
|
||||
@@ -68,11 +68,11 @@ public:
|
||||
ullong sendCount() {if (count() == 2) return protocol(0)->sendCount(); return 0;}
|
||||
ullong * sendCount_ptr() {if (count() == 2) return protocol(0)->sendCount_ptr(); return 0;}
|
||||
|
||||
PIByteArray * ba_f, * ba_s;
|
||||
|
||||
private:
|
||||
void received(PIProtocol * prot, bool , char * , int ) {if (prot == protocol(0)) protocol(1)->send(); else protocol(0)->send();}
|
||||
|
||||
PIByteArray ba_f, ba_s;
|
||||
|
||||
};
|
||||
|
||||
#endif // PIMULTIPROTOCOL_H
|
||||
|
||||
Reference in New Issue
Block a user