git-svn-id: svn://db.shs.com.ru/pip@498 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2017-05-16 11:21:10 +00:00
parent c1bbac0647
commit 0404250e71
4 changed files with 32 additions and 55 deletions

View File

@@ -324,11 +324,8 @@ endif()
# Test program # Test program
find_package(Qt4 REQUIRED) add_executable(pip_test "main.cpp")
include_directories(${QT_INCLUDES}) target_link_libraries(pip_test pip)
qt4_wrap_cpp(CMOCS_TEST "main.h" OPTIONS -nw)
add_executable(pip_test "main.cpp" "main.h" "ccm_kbd.cpp" ${CMOCS_TEST})
target_link_libraries(pip_test pip pip_fftw ${QT_QTCORE_LIBRARY})
# Install # Install

View File

@@ -1,26 +1,33 @@
#include "main.h" #include "pip.h"
#include <stdio.h> #include "pivector2d.h"
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
A a; PIVector<PIVector<double> > in;
B b; in.resize(5);
a.setName("__a__"); for (int i = 0; i < in.size_s(); ++i)
b.setName("__b__"); for (int j = 0; j < 20; ++j)
/*CONNECTU_QUEUED(&a, ev1, &b, eh0, &b); in[i] << j+i*100;
CONNECTU_QUEUED(&a, ev1, &b, eh1, &a); // piCout << in.size() << in[0].size();
piCout << "start"; PIVector2D<double> f0;
a.ev1(1.5); PIVector2D<double> f1(30, 40);
piSleep(1); //in.resize(1);
piCout << a.maybeCallQueuedEvents(); PIVector2D<double> f2(in);
piSleep(1); f0 = f2;
piCout << b.maybeCallQueuedEvents();*/ // piCout << f0;
//piCout << "end"; // piCout << f1;
/*b.executeQueued(&a, "eh1", PIVariant(0.1), "0150", 10, 40); // piCout << f2;
piSleep(1); // piCout << f2.rows() << f2.cols() << f2.size_all() << f2.rows()*f2.cols();
a.maybeCallQueuedEvents();*/ // piCout << in;
//dumpApplication(); piCout << f2;
b.execute("eh1", PIVariant(0.1), "0150", 10, 40); f2.setRow(2, f2[2]);;
b.executeQueued(&a, "eh1", PIVariant(0.1), "0150", 10, 40); piCout << f2;
a.callQueuedEvents(); // piCout << f2.toVectors();
// PIVector<double> t = f2.toPlainVector();
// piCout << t;
// piCout << PIVector2D<double>(f2.rows(), f2.cols(), t);
return 0;
return 0; return 0;
} }

27
main.h
View File

@@ -1,27 +0,0 @@
#ifndef MAIN_H
#define MAIN_H
#include <QObject>
#include "pip.h"
struct _S {
uchar _c[164];
};
class A: public QObject, public PIObject {
PIOBJECT(A)
public:
A() {}
EVENT1(ev1, float, f)
};
class B: public QObject, public PIObject {
PIOBJECT(B)
public:
B() {}
EVENT_HANDLER0(void, eh0) {piCout << "eh0" << emitter();}
EVENT_HANDLER1(void, eh1, float, f) {piCout << "eh1_1" << f << emitter();}
EVENT_HANDLER2(void, eh1, float, f, int, s) {piCout << "eh1_2" << f << s << emitter();}
};
#endif // MAIN_H

View File

@@ -144,7 +144,7 @@ bool PICodeParser::parseFileInternal(const PIString & file, bool follow_includes
f.open(PIIODevice::ReadOnly); f.open(PIIODevice::ReadOnly);
} }
if (!f.isOpened()) { if (!f.isOpened()) {
//piCout << ("Error: can`t open file \"" + file + "\"!"); piCout << ("Error: can`t open file \"" + file + "\"!");
return false; return false;
} }
//piCout << "add" << file; //piCout << "add" << file;