diff --git a/CMakeLists.txt b/CMakeLists.txt index e5e3945d..9d2fc5c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,5 @@ project(pip) cmake_minimum_required(VERSION 2.6) -#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3") include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) include(CheckFunctionExists) @@ -178,7 +177,7 @@ if (DEFINED LIB) #list(APPEND HDRS "pip.h.gch") install(FILES "FindPIP.cmake" DESTINATION ${CMAKE_ROOT}/Modules) else () - install(TARGETS pip DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) + install(TARGETS pip DESTINATION bin) message(STATUS "Install to local \"bin\"") endif () @@ -186,4 +185,3 @@ endif () add_subdirectory("utils/system_test") add_subdirectory("utils/remote_console") add_subdirectory("utils/code_model_generator") -add_subdirectory("utils/system_daemon") diff --git a/CMakeLists.txt.user b/CMakeLists.txt.user deleted file mode 100644 index 9b254f4d..00000000 --- a/CMakeLists.txt.user +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - EnvironmentId - {948faa78-0b50-402e-a285-1bca3b08de64} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - false - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - - ProjectExplorer.Project.Target.0 - - DesktopBuild - DesktopBuild - {3c749452-9483-442d-b011-933a1b5dac10} - 0 - 0 - 0 - - false - C:/libs/pip - - - -j8 - - false - true - Сборка - - CMakeProjectManager.MakeStep - - 1 - Сборка - - ProjectExplorer.BuildSteps.Build - - - - clean - - true - true - Сборка - - CMakeProjectManager.MakeStep - - 1 - Очистка - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - all - - CMakeProjectManager.CMakeBuildConfiguration - - 1 - - - 0 - Установка - - ProjectExplorer.BuildSteps.Deploy - - 1 - Локальная установка - - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - pip_test - - false - - 2 - - pip_test - - CMakeProjectManager.CMakeRunConfiguration.pip_test - 3768 - false - true - false - false - true - - - pip_system_test - - false - - 2 - - pip_system_test - - CMakeProjectManager.CMakeRunConfiguration.pip_system_test - 3768 - false - true - false - false - true - - - pip_remote_console - - false - - 2 - - pip_remote_console - - CMakeProjectManager.CMakeRunConfiguration.pip_remote_console - 3768 - false - true - false - false - true - - - pip_cmg - - false - - 2 - - pip_cmg - - CMakeProjectManager.CMakeRunConfiguration.pip_cmg - 3768 - false - true - false - false - true - - - pisd - - true - - 2 - - pisd - - CMakeProjectManager.CMakeRunConfiguration.pisd - 3768 - false - true - false - false - true - - 5 - - - - ProjectExplorer.Project.TargetCount - 1 - - - ProjectExplorer.Project.Updater.FileVersion - 16 - - - Version - 16 - - diff --git a/FindPIP.cmake b/FindPIP.cmake index 0347577f..78a1831d 100644 --- a/FindPIP.cmake +++ b/FindPIP.cmake @@ -47,7 +47,7 @@ macro (pip_code_model SRC RESULT) endif () if (NEED_PARSE) message(STATUS "Creating code model based on \"${SRC}\", please wait ... ") - execute_process(COMMAND ${PIP_CMG} -qPEs -o ${PROJECT_NAME}_ccm -I${PIP_INCLUDES} ${SRC} OUTPUT_VARIABLE CMG_OUT) + execute_process(COMMAND ${PIP_CMG} -qP -o ${PROJECT_NAME}_ccm -I${PIP_INCLUDES} ${SRC} OUTPUT_VARIABLE CMG_OUT) message(STATUS "Creating code model done, to use it include \"${PROJECT_NAME}_ccm.h\"") string(REPLACE "\n" ";" CMG_LIST ${CMG_OUT}) string(REPLACE "\n" " " CMG_LIST_S ${CMG_OUT}) diff --git a/main.cpp b/main.cpp index 67f01f74..2d242303 100644 --- a/main.cpp +++ b/main.cpp @@ -1,17 +1,19 @@ #include "pip.h" +#include "pifiletransfer.h" +#include "pidatatransfer.h" class Ob: public PIObject { PIOBJECT(Ob) public: Ob() { sft.setName("sft"); - sft.setDirectory(sft.directory().cd("..\\")); - piCout << "Send File Transfer DIrectory" << sft.directory().absolutePath(); + //sft.setDirectory(sft.directory().cd("..\\")); + //piCout << "Send File Transfer DIrectory" << sft.directory().absolutePath(); CONNECTU(&sft, sendRequest, this, ssend); rft.setName("rft"); - rft.setDirectory(rft.directory().cd("..\\1")); - piCout << "Receive File Transfer DIrectory" << rft.directory().absolutePath(); + //rft.setDirectory(rft.directory().cd("..\\1")); + //piCout << "Receive File Transfer DIrectory" << rft.directory().absolutePath(); CONNECTU(&rft, sendRequest, this, rsend); } @@ -19,12 +21,12 @@ public: PIDir dir = PIDir::current(); dir.cd("..\\"); piCout << dir.absolutePath(); - PIVector des = dir.allEntries(); + PIVector des = dir.allEntries(); piCout << "all entries" << des.size(); - PIDir::DirEntry sde; - piForeachC(PIDir::DirEntry de, des) { + PIFile::FileInfo sde; + piForeachC(PIFile::FileInfo de, des) { //piCout << (de.isDir() ? "dir:" : "file") << de.name << de.size; - if (de.name == "0") sde = de; + if (de.name() == "0") sde = de; } //sft.setPacketSize(64096); sft.send(sde); @@ -32,21 +34,21 @@ public: private: EVENT_HANDLER1(void, ssend, PIByteArray &, data) { -// piCout << "[sender]" << sft.stateString() << ". datasize =" << data.size() -// << "(" << PIString::readableSize(sft.bytesFileCur()) << "/" << PIString::readableSize(sft.bytesFileAll()) << ", " -// << PIString::readableSize(sft.bytesTotalCur()) << "/" << PIString::readableSize(sft.bytesTotalAll()) << ")"; + piCout << "[sender]" << sft.stateString() << ". datasize =" << data.size() + << "(" << PIString::readableSize(sft.bytesFileCur()) << "/" << PIString::readableSize(sft.bytesFileAll()) << ", " + << PIString::readableSize(sft.bytesTotalCur()) << "/" << PIString::readableSize(sft.bytesTotalAll()) << ")"; if(rand()%100 != 90) rft.received(data); } EVENT_HANDLER1(void, rsend, PIByteArray &, data) { -// piCout << "[receiver]" << rft.stateString() << ". datasize =" << data.size() -// << "(" << PIString::readableSize(rft.bytesFileCur()) << "/" << PIString::readableSize(rft.bytesFileAll()) << ", " -// << PIString::readableSize(rft.bytesTotalCur()) << "/" << PIString::readableSize(rft.bytesTotalAll()) << ")"; + piCout << "[receiver]" << rft.stateString() << ". datasize =" << data.size() + << "(" << PIString::readableSize(rft.bytesFileCur()) << "/" << PIString::readableSize(rft.bytesFileAll()) << ", " + << PIString::readableSize(rft.bytesTotalCur()) << "/" << PIString::readableSize(rft.bytesTotalAll()) << ")"; if(rand()%100 != 90) sft.received(data); } - PIFileTransfer sft; - PIFileTransfer rft; + PIBaseTransfer sft; + PIBaseTransfer rft; }; @@ -98,6 +100,11 @@ private: }; int main (int argc, char * argv[]) { + Ob o; + PITimeMeasurer tm; + o.startsend(); + piCout << tm.elapsed_s(); + return 0; if (!(argc == 3 || argc == 4)) { piCout << "UDPFileTransfer"; piCout << "USE: piptest [src_ip_port] [dst_ip_port] {filename}"; @@ -119,11 +126,6 @@ int main (int argc, char * argv[]) { } WAIT_FOR_EXIT return 0; -// Ob o; -// ft.setPacketSize(65536); -// PITimeMeasurer tm; -// o.startsend(); -// piCout << tm.elapsed_s(); -// return 0; + } diff --git a/pip.cbp b/pip.cbp index ef30a2e9..8c31f43b 100644 --- a/pip.cbp +++ b/pip.cbp @@ -5,7 +5,7 @@