git-svn-id: svn://db.shs.com.ru/libs@383 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -15,9 +15,10 @@ class Core : public PIObject
|
||||
Core() {
|
||||
CDCore::instance()->initApp();
|
||||
// piCout << "testCore";
|
||||
CONNECTU(&t, tickEvent, this, timerDone);
|
||||
CONNECTU(&timer, tickEvent, this, timerDone);
|
||||
CONNECTU(&X, received, this, xrecv);
|
||||
CONNECTU(&C, received, this, crecv);
|
||||
t.start(1000);
|
||||
t = 0.;
|
||||
}
|
||||
|
||||
void load() {
|
||||
@@ -48,6 +49,11 @@ class Core : public PIObject
|
||||
}
|
||||
|
||||
void test() {
|
||||
X.lock();
|
||||
X[KD::Frequency] = 100;
|
||||
X.section(KD::Spectrometer)[KD::Temperature_default] = sin(t);
|
||||
t += 0.01;
|
||||
X.unlock();
|
||||
/*piCout << "count" << K.count();
|
||||
piCout << K[First];
|
||||
piCout << K[Second];*/
|
||||
@@ -59,6 +65,11 @@ class Core : public PIObject
|
||||
C.connect(C.section(KD::Logs).section(KD::Spec).section(KD::Formats)[KD::Binary], this, HANDLER(cmd));
|
||||
C.autoConnect(this);
|
||||
}
|
||||
EVENT_HANDLER(void, xrecv) {
|
||||
piCout << "received x";
|
||||
if (!timer.isRunning()) timer.start(10);
|
||||
X.start();
|
||||
}
|
||||
EVENT_HANDLER(void, timerDone) {test();}
|
||||
EVENT_HANDLER(void, cmd) {piCout << "command cmd";}
|
||||
EVENT_HANDLER(void, c_Pause) {piCout << "command pause";}
|
||||
@@ -66,7 +77,8 @@ class Core : public PIObject
|
||||
|
||||
private:
|
||||
PIFile rf;
|
||||
PITimer t;
|
||||
PITimer timer;
|
||||
double t;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user