From 0404250e71984968c15bf71a5d0b1a0ee59a6424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=8B=D1=87=D0=BA=D0=BE=D0=B2=20=D0=90=D0=BD=D0=B4?= =?UTF-8?q?=D1=80=D0=B5=D0=B9?= Date: Tue, 16 May 2017 11:21:10 +0000 Subject: [PATCH] git-svn-id: svn://db.shs.com.ru/pip@498 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- CMakeLists.txt | 7 ++--- main.cpp | 51 +++++++++++++++++++--------------- main.h | 27 ------------------ src_main/code/picodeparser.cpp | 2 +- 4 files changed, 32 insertions(+), 55 deletions(-) delete mode 100644 main.h diff --git a/CMakeLists.txt b/CMakeLists.txt index c3a63dce..4621c78c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -324,11 +324,8 @@ endif() # Test program -find_package(Qt4 REQUIRED) -include_directories(${QT_INCLUDES}) -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}) +add_executable(pip_test "main.cpp") +target_link_libraries(pip_test pip) # Install diff --git a/main.cpp b/main.cpp index b628f8bd..2d8959aa 100644 --- a/main.cpp +++ b/main.cpp @@ -1,26 +1,33 @@ -#include "main.h" -#include +#include "pip.h" +#include "pivector2d.h" + int main(int argc, char *argv[]) { - A a; - B b; - a.setName("__a__"); - b.setName("__b__"); - /*CONNECTU_QUEUED(&a, ev1, &b, eh0, &b); - CONNECTU_QUEUED(&a, ev1, &b, eh1, &a); - piCout << "start"; - a.ev1(1.5); - piSleep(1); - piCout << a.maybeCallQueuedEvents(); - piSleep(1); - piCout << b.maybeCallQueuedEvents();*/ - //piCout << "end"; - /*b.executeQueued(&a, "eh1", PIVariant(0.1), "0150", 10, 40); - piSleep(1); - a.maybeCallQueuedEvents();*/ - //dumpApplication(); - b.execute("eh1", PIVariant(0.1), "0150", 10, 40); - b.executeQueued(&a, "eh1", PIVariant(0.1), "0150", 10, 40); - a.callQueuedEvents(); + PIVector > in; + in.resize(5); + for (int i = 0; i < in.size_s(); ++i) + for (int j = 0; j < 20; ++j) + in[i] << j+i*100; +// piCout << in.size() << in[0].size(); + PIVector2D f0; + PIVector2D f1(30, 40); + //in.resize(1); + PIVector2D f2(in); + f0 = f2; +// piCout << f0; +// piCout << f1; +// piCout << f2; +// piCout << f2.rows() << f2.cols() << f2.size_all() << f2.rows()*f2.cols(); +// piCout << in; + piCout << f2; + f2.setRow(2, f2[2]);; + piCout << f2; +// piCout << f2.toVectors(); +// PIVector t = f2.toPlainVector(); +// piCout << t; +// piCout << PIVector2D(f2.rows(), f2.cols(), t); + return 0; + return 0; } + diff --git a/main.h b/main.h deleted file mode 100644 index 8abef8a2..00000000 --- a/main.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -#include -#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 diff --git a/src_main/code/picodeparser.cpp b/src_main/code/picodeparser.cpp index 96be0981..5377c936 100755 --- a/src_main/code/picodeparser.cpp +++ b/src_main/code/picodeparser.cpp @@ -144,7 +144,7 @@ bool PICodeParser::parseFileInternal(const PIString & file, bool follow_includes f.open(PIIODevice::ReadOnly); } if (!f.isOpened()) { - //piCout << ("Error: can`t open file \"" + file + "\"!"); + piCout << ("Error: can`t open file \"" + file + "\"!"); return false; } //piCout << "add" << file;