diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d842fa..aa3c0dc 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,7 +81,7 @@ if (WIN32) message(STATUS ">>> WIN32") set(ENV{LUA_DIR} "D:/libraries/lua-5.3.3/;C:/lua53/") message(STATUS "IN MINGW") - set(Qt5_DIR "C:/Qt/Qt5.7.0/5.7/mingw53_32;C:/Qt/5.7/mingw53_32") + set(Qt5_DIR "C:/Qt/5.8/mingw53_32;C:/Qt/5.8/mingw53_32") set(ENV{OPENSSL_ROOT_DIR} "C:/OpenSSL-Win32/lib/") endif() diff --git a/doc/biogui_idea.rst b/doc/biogui_idea.rst index b29d976..d328f00 100644 --- a/doc/biogui_idea.rst +++ b/doc/biogui_idea.rst @@ -4,7 +4,7 @@ How does bioGUI work? ********************* -*bioGUI* heavily relies on the philosophy that everything is a network. +*bioGUI* relies on the philosophy that the visual appearance as well as the assembly of the command line arguments can be represented as a network. Especially templates are seen as network, both in their visual description but most importantly also in the execution model. .. _biogui_install_modules : @@ -145,7 +145,7 @@ Finally we can send the template to *bioGUI*, if an IP address and port have bee Make sure to use ``nc`` to send the content, as this will not work on Mac OS otherwise. In order to customize the template inbetween the ``EOF``, bash variables to be replaced must be written as ``${var-name}``. -This conflicts with how *bioGUI* expects variables. Therefore make sure to escape the backslaash where you want to access variables in the *bioGUI* template! +This conflicts with how *bioGUI* expects variables. Therefore, make sure to escape the backslaash where you want to access variables in the *bioGUI* template! bioGUI Templates ================ @@ -248,7 +248,7 @@ The idea is again based on a network of predefined nodes. The nodes can either be visual components, accessed by their respective **id**, or :ref:`biogui_execution_nodes` . Upon starting an application with *bioGUI*, the execution network is responsible to construct the command line arguments with which the target application is called. -Therefore all executable nodes in the ```` part are searched and *evaluated* one after the other (if there exist several). +Therefore, all executable nodes in the ```` part are searched and *evaluated* one after the other (if there exist several). Since execution must be started via an ``action`` visual element, which can have a *program* attribute, this allows to specify which executable nodes are executed: if the ``program`` attribute is set, this must match with the ``program`` attribute of the executable node. Finally an executable node is executed. Upon this the command line arguments are assembled. This is shown exemplarily in the below figure: diff --git a/doc/build_wsl.rst b/doc/build_wsl.rst index 3d7fc0a..fde64e8 100644 --- a/doc/build_wsl.rst +++ b/doc/build_wsl.rst @@ -29,7 +29,7 @@ Step 2: Setup WSL Despite the interest to hide any command line as much as possible from the user, the following initial setup can not be automised. First a Command Prompt or better PowerShell must be started. -Therefore simply search for the *Windows PowerShell* in the start menu. +Search for the *Windows PowerShell* in the start menu. .. image:: ./images/wsl/powershell.PNG :scale: 30 @@ -41,8 +41,8 @@ However, before the download starts, first the user has to acknowledge that he w :scale: 30 Finally, after *WSL* has been downloaded and extracted, *WSL* has to create a linux user account. -Therefore choose a username and password you can easily remember. -Remembering the password is essential here it will be needed for any installation one is performing on *WSL*. +It is recommended to choose a username and password you can easily remember. +Remembering the password is essential here, as it will be needed for any installation one is performing on *WSL*. .. image:: ./images/wsl/powershell_setup_user.PNG :scale: 30 diff --git a/doc/images/templates/existing_templates.png b/doc/images/templates/existing_templates.png index 6558d51..bd84c57 100644 Binary files a/doc/images/templates/existing_templates.png and b/doc/images/templates/existing_templates.png differ diff --git a/doc/images/templates/template_submission.png b/doc/images/templates/template_submission.png index 37d8ea4..8fc39e5 100644 Binary files a/doc/images/templates/template_submission.png and b/doc/images/templates/template_submission.png differ diff --git a/doc/user_guide.rst b/doc/user_guide.rst index b8909f0..1f0d320 100644 --- a/doc/user_guide.rst +++ b/doc/user_guide.rst @@ -33,7 +33,7 @@ Mac OS Download and open the provided dmg package. You can simply drag and drop the bioGUI.app into your Applications folder. In order to productively use bioGUI, it may be required to install the OSX command line tools as well as brew. -Most (install) templates will require you to have wget and netcat install. Using brew installation is simple: +Most (install) templates will require you to have wget and netcat installed. Using brew installation is simple: .. code:: bash @@ -46,9 +46,10 @@ Downloading Templates Part of *bioGUI* is a user-friendly accessibility of templates for various programs. -Therefore application developers and sophisticated users can upload their templates to our website in order to make their template available to other users. +Therefore, application developers and sophisticated users can upload their templates to our website in order to make their template available to other users. The user has to submit his name, eMail address, a template name and the template itself. He can select whether he wants to be an anonymous user (user name is always hidden) and whether this is an installation script (which downloads and creates the \ac{GUI} template specifically for this installed application) or a regular template. +Additionally, categories for the template can be supplied, e.g. whether this is a template for a sequencing tool, or proteomics. A screenshot of the template submission is shown below. .. image:: ./images/templates/template_submission.png @@ -63,7 +64,7 @@ Available templates are only shown and can be downloaded via the *bioGUI* applic Within *bioGUI*, clicking the *Download Templates* button, a new dialog window opens showing a list of available templates. Columns can be sorted by double clicking the header, and using the search only templates which contain the searched words are shown. Upon selecting one or multiple (keep ctrl-key down while clicking) rows and clicking the *Download* button, those templates are downloaded and available for the user. -Since it is possible to copy or alter templates, new templates are created at all times (no information is lost). +Since it is possible to copy or alter templates, *bioGUI* never overwrites existing templates, but will create a new copy. .. image:: ./images/templates/biogui_selection.png :scale: 50 diff --git a/install_templates/install_wsl_first.igui b/install_templates/install_wsl_first.igui index 03d472f..5f28eea 100644 --- a/install_templates/install_wsl_first.igui +++ b/install_templates/install_wsl_first.igui @@ -8,7 +8,7 @@ echo "Dependencies: build-essential dos2unix" if [ ! "$2" = "" ]; then echo "Installing dependencies" echo $2 | sudo -S apt-get update - echo $2 | sudo -S apt-get -y install build-essential dos2unix + echo $2 | sudo -S apt-get -y install build-essential dos2unix unzip echo "Enjoy bioGUI!" else diff --git a/src/app/AdvancedStreamBox.h b/src/app/AdvancedStreamBox.h index bde9682..3ca6ca0 100755 --- a/src/app/AdvancedStreamBox.h +++ b/src/app/AdvancedStreamBox.h @@ -257,8 +257,10 @@ Q_OBJECT { ExtendedProcessBuffer* pBuffer = oIt->second.at(i); - pBuffer->transferText("\n"); + LOGERROR("Deleting PROC Buffer: " + std::to_string((uint64_t) pBuffer)); + + pBuffer->transferText("\n"); pBuffer->deleteLater(); } @@ -272,7 +274,10 @@ Q_OBJECT void finishThread( ExecuteThread* pThread ) { - std::cout << "finishing thread: " << pThread << std::endl; + LOGERROR("Finishing thread: " + std::to_string((uint64_t) pThread)); + + if (pThread == NULL) + return; std::map >::iterator oJt = m_mThreadToBuffer.find(pThread); @@ -466,7 +471,9 @@ protected slots: void receiveText(QString sString, QColor oColor, QString sStreamID) { - std::cout << "received: " << sString.toStdString() << " for stream " << sStreamID.toStdString() << std::endl; + LOGERROR("AdvancedStreamBox received: " + std::to_string((uint64_t) this) + " for STREAM: " + sStreamID.toStdString()); + LOGERROR( sString.toStdString() ); + LOGERROR("RECEIVE END"); AdvancedListWidgetItem* pLastStream = this->getLastItemForStream(&sStreamID); diff --git a/src/app/ExtendedThreadBuffer.h b/src/app/ExtendedThreadBuffer.h index fc83ccd..01817f1 100755 --- a/src/app/ExtendedThreadBuffer.h +++ b/src/app/ExtendedThreadBuffer.h @@ -45,6 +45,7 @@ class ExtendedThreadBuffer : public ExtendedStdBuffer { if (this->m_pParentThread != NULL) { + m_pParentThread->pThread->deleteLater(); delete m_pParentThread; } diff --git a/src/app/ProcessLauncher.h b/src/app/ProcessLauncher.h index 3588413..f6a7114 100755 --- a/src/app/ProcessLauncher.h +++ b/src/app/ProcessLauncher.h @@ -41,6 +41,7 @@ #define __BIOGUI__64 #endif +/* class ProcessThread : public ExecuteThread { @@ -118,6 +119,8 @@ Q_OBJECT }; +*/ + class ProcessLauncher : public QObject { Q_OBJECT @@ -132,7 +135,7 @@ class ProcessLauncher : public QObject { m_pProcess = new QProcess(); } else { - m_pThread = NULL;//new ProcessThread(m_sProgram + " " + m_sParam); + //m_pThread = NULL;//new ProcessThread(m_sProgram + " " + m_sParam); m_pProcess = new QProcess(); } } @@ -162,6 +165,8 @@ class ProcessLauncher : public QObject return m_pProcess; } + /* + ExecuteThread* getThread() { return NULL; @@ -172,6 +177,8 @@ class ProcessLauncher : public QObject return NULL; } + */ + QString startBlocking(uint32_t iWaitMSec = 10000) { this->start(); @@ -259,23 +266,23 @@ class ProcessLauncher : public QObject this->connect(m_pProcess, static_cast(&QProcess::finished), [pProcess, this](int exitCode, QProcess::ExitStatus exitStatus){ - std::cerr << "Exit Code: " << exitCode << std::endl; - std::cerr << "Exit Status: " << exitStatus << std::endl; - - std::string sError = pProcess->errorString().toStdString(); - std::cerr << "Error: " << sError << std::endl; - - std::string sProgram = pProcess->program().toStdString(); - std::cerr << "Program: " << sProgram << std::endl; + LOGERROR( "Exit Code: " + std::to_string(exitCode) ); + LOGERROR( "Exit Status: " + std::to_string(exitStatus) ); + LOGERROR( "Error: " + pProcess->errorString().toStdString() ); + LOGERROR( "Program: " + pProcess->program().toStdString() ); for (int i = 0; i < pProcess->arguments().size(); ++i) { std::string sArgument = pProcess->arguments().at(i).toStdString(); std::cerr << "Argument " << i << " : " << sArgument << std::endl; + + LOGERROR( "Argument " + std::to_string(i) + ": " + pProcess->arguments().at(i).toStdString() ); + } - std::cout << "finished: " << pProcess << std::endl; + LOGERROR( "Process ID: " + std::to_string(pProcess->processId()) ); + LOGERROR( "Process: " + std::to_string((uint64_t) pProcess) ); emit this->finished(); }); @@ -294,8 +301,10 @@ public slots: void executionFinished() { + /* if (m_pThread != NULL) m_pThread->deleteLater(); + */ if (m_pProcess != NULL) m_pProcess->deleteLater(); @@ -389,7 +398,7 @@ public slots: QProcess* m_pProcess = NULL; - ProcessThread* m_pThread = NULL; + //ProcessThread* m_pThread = NULL; bool m_bWindowsProcNoHandle = false; QString m_sProgram; QString m_sParam; diff --git a/src/app/TCPExtendedBuffer.h b/src/app/TCPExtendedBuffer.h index dfe927a..ae2cb91 100755 --- a/src/app/TCPExtendedBuffer.h +++ b/src/app/TCPExtendedBuffer.h @@ -77,7 +77,7 @@ class TCPExtendedBuffer : public ExtendedThreadBuffer ~TCPExtendedBuffer() { - this->stopTransmissions(); + //this->stopTransmissions(); m_pServer->deleteLater(); diff --git a/src/bioGUIapp.h b/src/bioGUIapp.h index 50ae053..f9edaa3 100755 --- a/src/bioGUIapp.h +++ b/src/bioGUIapp.h @@ -259,7 +259,19 @@ class bioGUIapp : public QApplication { { ExecutionNetwork* pNetwork = NULL; - ExecutionRunThread* pThread = NULL; + + if (m_pExecThread != NULL) + { + LOGERROR("QUIT"); + m_pExecThread->quit(); + LOGERROR("WAIT"); + m_pExecThread->wait(); + LOGERROR("DELETE"); + m_pExecThread->deleteLater(); + + m_pExecThread = NULL; + } + this->disableActions(); @@ -267,13 +279,18 @@ class bioGUIapp : public QApplication { std::string sCurrentFilePath = m_pWindowParser->getCurrentDocumentPath(); pParseExecution->initializeFile(sCurrentFilePath); - pThread = new ExecutionRunThread(m_pWindowParser, pParseExecution, sProgramToRun); + m_pExecThread = new ExecutionRunThread(m_pWindowParser, pParseExecution, sProgramToRun); + bioGUIapp* pApp = this; - this->connect(pThread, &QThread::started, pThread, &ExecutionRunThread::startExecution); - this->connect(pThread, &ExecutionRunThread::executionFinished, this, &bioGUIapp::programFinished); - this->connect(pThread, &ExecutionRunThread::executionFinished, pThread, &ExecutionRunThread::deleteLater); + this->connect(m_pExecThread, &QThread::started, m_pExecThread, &ExecutionRunThread::startExecution); + this->connect(m_pExecThread, &ExecutionRunThread::executionFinished, [pApp] () { - pThread->start(); + pApp->programFinished(); + + }); + //this->connect(pThread, &ExecutionRunThread::executionFinished, pThread, &ExecutionRunThread::deleteLater); + + m_pExecThread->start(); } @@ -380,6 +397,10 @@ public slots: QString m_sDownloadServerLocation = ""; + /** TEST PLAYGROUND **/ + ExecutionRunThread* m_pExecThread = NULL; + + }; diff --git a/src/parsing/nodes/ExecutionExecuteNode.h b/src/parsing/nodes/ExecutionExecuteNode.h index 4396ce5..a439cf3 100755 --- a/src/parsing/nodes/ExecutionExecuteNode.h +++ b/src/parsing/nodes/ExecutionExecuteNode.h @@ -137,12 +137,12 @@ class ExecutionExecuteNode : public ExecutionExecutableNode { ProcessLauncher* pLauncher = new ProcessLauncher(QString(sProgram.c_str()), QString(sCLArg.c_str()), bWSL); - this->evaluateChildren(pID2Node, pInputID2Value, pInputID2FunctionWidget, pLauncher->getProcess(), pLauncher->getThread(), false); + this->evaluateChildren(pID2Node, pInputID2Value, pInputID2FunctionWidget, pLauncher->getProcess(), NULL, false); // pLauncher->connect(pLauncher, &ProcessLauncher::finished, [pLauncher, pID2Node, pInputID2Value, pInputID2FunctionWidget, bEmitSignal, this](){ - this->evaluateChildren(pID2Node, pInputID2Value, pInputID2FunctionWidget, pLauncher->getProcess(), pLauncher->getThread(), true); + this->evaluateChildren(pID2Node, pInputID2Value, pInputID2FunctionWidget, pLauncher->getProcess(), NULL, true); pLauncher->deleteLater(); // calculation finished! diff --git a/src/parsing/nodes/ExecutionIfNode.h b/src/parsing/nodes/ExecutionIfNode.h index 1b590ec..48533a4 100755 --- a/src/parsing/nodes/ExecutionIfNode.h +++ b/src/parsing/nodes/ExecutionIfNode.h @@ -155,9 +155,10 @@ class ExecutionIfNode : public ExecutionExecutableNode { * Any method that needs value2 * */ - std::cerr << "Val 1: " << sValue1 << std::endl; - std::cerr << "Val 2: " << sValue2 << std::endl; - std::cerr << "Evaluating else node: " << m_bEvaluateElse << std::endl; + LOGERROR("IF ID: " + m_sID); + LOGERROR("Val 1: " + sValue1); + LOGERROR("Val 2: " + sValue2); + LOGERROR("Go into Else? " + std::to_string(m_bEvaluateElse)); sReturn = this->evaluateChildren(pID2Node, pInputID2Value, pInputID2FunctionWidget, bEmitSignal); diff --git a/src/parsing/nodes/ExecutionNetwork.h b/src/parsing/nodes/ExecutionNetwork.h index cb883c6..40ed970 100755 --- a/src/parsing/nodes/ExecutionNetwork.h +++ b/src/parsing/nodes/ExecutionNetwork.h @@ -132,6 +132,8 @@ class ExecutionNetwork : public QObject{ if (oIt == m_vExecNodes.end()) { + LOGERROR("EXECUTION FINISHED!") + emit executionFinished(); return 0; } diff --git a/src/parsing/nodes/ExecutionOutputNode.h b/src/parsing/nodes/ExecutionOutputNode.h index bba8fc3..5032a06 100755 --- a/src/parsing/nodes/ExecutionOutputNode.h +++ b/src/parsing/nodes/ExecutionOutputNode.h @@ -223,6 +223,8 @@ class ExecutionOutputNode : public ExecutionDeferredNode { } else { + LOGERROR("Deferred Output Node"); + pTextEdit->finishProcess(pProcess); pTextEdit->finishThread(pThread); diff --git a/templates/WSL_install.gui b/templates/WSL_install.gui index 980688b..706bde4 100644 --- a/templates/WSL_install.gui +++ b/templates/WSL_install.gui @@ -84,14 +84,14 @@ " - + 33333 - +