git-svn-id: svn://db.shs.com.ru/libs@380 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -27,6 +27,7 @@ class CDCore: public PIObject
|
||||
friend class __Core_Initializer__;
|
||||
friend class CDSection;
|
||||
friend class Interface;
|
||||
friend class XInterface;
|
||||
public:
|
||||
static CDCore * instance();
|
||||
|
||||
@@ -39,6 +40,22 @@ public:
|
||||
EVENT_HANDLER(void, K_Request);
|
||||
EVENT_HANDLER2(void, K_DirectChange, PIDeque<int>, path, PIString, value);
|
||||
|
||||
EVENT(X_Sended)
|
||||
EVENT(X_SendFail)
|
||||
EVENT(X_Received)
|
||||
EVENT(X_ReceiveFail)
|
||||
EVENT(X_ChangedGlobal)
|
||||
EVENT_HANDLER(void, X_Send);
|
||||
EVENT_HANDLER(void, X_Request);
|
||||
|
||||
EVENT(C_Sended)
|
||||
EVENT(C_SendFail)
|
||||
EVENT(C_Received)
|
||||
EVENT(C_ReceiveFail)
|
||||
EVENT(C_ChangedGlobal)
|
||||
EVENT_HANDLER(void, C_Send);
|
||||
EVENT_HANDLER(void, C_Request);
|
||||
|
||||
void cd_write (CDSection * cd, PIIODevice * d);
|
||||
void cd_read (CDSection * cd, PIIODevice * d);
|
||||
void cd_parse (CDSection * cd, PIIODevice * d);
|
||||
@@ -47,13 +64,17 @@ public:
|
||||
void cd_send (CDSection * cd, CDPacketType pt, bool direct = false);
|
||||
void initApp();
|
||||
void initPult();
|
||||
void init(const PIString & configuration);
|
||||
void startPing();
|
||||
void init(const PIString & configuration, bool pult = false);
|
||||
void startX(double freq = 20.);
|
||||
void sendCommand(const CDType & c);
|
||||
void registerCHandler(const CDType & c, PIObject * o, Handler h);
|
||||
bool inProgress() {return sendt.isRunning();}
|
||||
|
||||
CDSection & k() {return k_;}
|
||||
CDSection * root(CDType::cdT cdt);
|
||||
PIString typeLetter(CDType::cdT cdt);
|
||||
static PIString pathToString(const PIDeque<int> & p);
|
||||
static PIDeque<int> stringToPath(const PIString & p);
|
||||
|
||||
static PIString pultConfig() {return PIString(pult_config);}
|
||||
static PIString appConfig() {return PIString(app_config);}
|
||||
@@ -72,6 +93,8 @@ private:
|
||||
void sendThreaded(PIByteArray & ba);
|
||||
void procReceivedPacket(PIByteArray & ba);
|
||||
|
||||
typedef PIPair<PIObject * , Handler> OHPair;
|
||||
|
||||
static const char app_config[], pult_config[];
|
||||
PIConnection connection;
|
||||
PIDataTransfer datatr;
|
||||
@@ -79,6 +102,10 @@ private:
|
||||
PIThread sendt;
|
||||
PITimer x_timer;
|
||||
CDSection k_, x_, c_;
|
||||
PIMutex x_mutex;
|
||||
PIVector<PIDeque<int> > x_selected;
|
||||
PIMap<PIString, OHPair> c_handlers;
|
||||
bool need_rebuild_x, x_pult_side;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user