diff --git a/CMake/FindZeroMQ.cmake b/CMake/FindZeroMQ.cmake new file mode 100644 index 0000000000000000000000000000000000000000..af1c3542cce6243c211fd013b88390e28ae7089b --- /dev/null +++ b/CMake/FindZeroMQ.cmake @@ -0,0 +1,27 @@ +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON) +find_package(PkgConfig) +pkg_check_modules(PC_LIBZMQ QUIET libzmq) +set(ZeroMQ_VERSION ${PC_LIBZMQ_VERSION}) +find_path(ZeroMQ_INCLUDE_DIR zmq.h + PATHS ${ZeroMQ_DIR}/include + ${PC_LIBZMQ_INCLUDE_DIRS}) +find_library(ZeroMQ_LIBRARY + NAMES zmq + PATHS ${ZeroMQ_DIR}/lib + ${PC_LIBZMQ_LIBDIR} + ${PC_LIBZMQ_LIBRARY_DIRS}) +if(ZeroMQ_LIBRARY) + set(ZeroMQ_FOUND ON) +endif() +set ( ZeroMQ_LIBRARIES ${ZeroMQ_LIBRARY} ) +set ( ZeroMQ_INCLUDE_DIRS ${ZeroMQ_INCLUDE_DIR} ) +if(NOT TARGET libzmq) + add_library(libzmq UNKNOWN IMPORTED) + set_target_properties(libzmq PROPERTIES + IMPORTED_LOCATION ${ZeroMQ_LIBRARIES} + INTERFACE_INCLUDE_DIRECTORIES ${ZeroMQ_INCLUDE_DIRS}) +endif() +include ( FindPackageHandleStandardArgs ) +# handle the QUIETLY and REQUIRED arguments and set ZMQ_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args ( ZeroMQ DEFAULT_MSG ZeroMQ_LIBRARIES ZeroMQ_INCLUDE_DIRS ) \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 1940b7c00350cca413a447babfd23b11f8842be1..d7df653c4cf5c8deb13154eaaa1df552efb201b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ cmake_minimum_required( VERSION 3.1 FATAL_ERROR ) # visimpl project and version -project( visimpl VERSION 1.5.0 ) +project( visimpl VERSION 1.5.1 ) set( visimpl_VERSION_ABI 6 ) SET( VISIMPL_LICENSE "GPL") @@ -128,5 +128,9 @@ add_subdirectory( sumrice ) add_subdirectory( visimpl ) add_subdirectory( stackviz ) +# importers subdirectory contains code for processing data and convert it +# to ViSimpl formats, not needed for release. +#add_subdirectory( importers ) + include( CPackConfig ) include( DoxygenRule ) diff --git a/importers/CMakeLists.txt b/importers/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..1a6d728730b1aabb5e01401b365a61a876e8673f --- /dev/null +++ b/importers/CMakeLists.txt @@ -0,0 +1,19 @@ +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) + +find_package(Qt5 COMPONENTS Core) + +set(SOURCES + gdftocsv.cpp + ) + +set(HEADERS + ) + +set(EXTERNAL_LIBS + Qt5::Core + ) + +add_executable(gdf2csv gdf2csv.cpp) +target_link_libraries(gdf2csv ${EXTERNAL_LIBS}) + diff --git a/importers/gdf2csv.cpp b/importers/gdf2csv.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f7e0c22c3f8500abc8fee0107aac17bbff5b7883 --- /dev/null +++ b/importers/gdf2csv.cpp @@ -0,0 +1,182 @@ +/** GDF TO CSV + * File: gdf2csv.cpp + * Author: Félix de las Pozas Ãlvarez + * Date: 22/02/2022 + * + */ + +// C++ +#include <iostream> +#include <fstream> +#include <random> +#include <locale> +#include <sys/stat.h> +#include <dirent.h> +#include <algorithm> +#include <cassert> + +// Qt5 +#include <QString> +#include <QStringList> + +std::string NETWORK_FILENAME = "gdf_network.csv"; +std::string ACTiVITY_FILENAME = "gdf_activity.csv"; + +const double TIME_INTERVAL = 0.1; + +struct dotSeparator: std::numpunct<char> +{ + char do_decimal_point() const { return '.'; } +}; + +template<class T> void ignore( const T& ) { } + +void printUsage(const char *filename) +{ + const std::string name = (filename ? std::string(filename) : "GDF2CSV"); + + std::cout << name << '\n'; + std::cout << "Generates CSV histograms from GDF files." << '\n'; + std::cout << "Usage: " << name << " <gdf_dir>" << std::endl; + std::exit(-1); +} + +int main(int argc, char* argv[]) +{ + if(argc < 2) printUsage(argv[0]); + + std::random_device dev; + std::mt19937 rng(dev()); + std::uniform_int_distribution<std::mt19937::result_type> dist(1,100); + std::uniform_int_distribution<std::mt19937::result_type> height(1,40); + + std::ofstream nFile, aFile; + nFile.open(NETWORK_FILENAME, std::fstream::out|std::fstream::trunc); + aFile.open(ACTiVITY_FILENAME, std::fstream::out|std::fstream::trunc); + + if(nFile.fail() || aFile.fail()) + { + std::cerr << "ERROR: Unable to open: " << NETWORK_FILENAME << " or " << ACTiVITY_FILENAME << std::endl; + std::exit(-1); + } + + // write floating point numbers with dot separation no matter the locale + nFile.imbue(std::locale(nFile.getloc(), new dotSeparator())); + aFile.imbue(std::locale(aFile.getloc(), new dotSeparator())); + + std::cout << "Write network file: " << NETWORK_FILENAME << std::endl; + + for(unsigned int i = 2; i <= 78072; ++i) + { + int level = 1000-height(rng); + + if(i > 20684) level -= 50; + if(i > 26518) level -= 50; + if(i > 48433) level -= 50; + if(i > 53912) level -= 50; + if(i > 58762) level -= 50; + if(i > 59827) level -= 50; + if(i > 74222) level -= 50; + if(i > 77170) level -= 50; + + nFile << i << ", " << dist(rng) << ", " << dist(rng) << ", " << level << '\n'; + } + nFile.flush(); + nFile.close(); + + auto path = std::string(argv[1]); + if(path.back() != '/') + path += '/'; + + DIR *dir; + struct dirent *ent; + std::vector<std::string> filenames; + + if((dir = opendir(path.c_str())) != nullptr) + { + /* print all the files and directories within directory */ + while ((ent = readdir (dir)) != nullptr) + { + filenames.emplace_back(ent->d_name); + } + closedir (dir); + } + else + { + std::cerr << "Unable to open directory: " << path << std::endl; + std::exit(-1); + } + + // remove dotfiles + auto itr = std::find(filenames.begin(), filenames.end(), "."); + if (itr != filenames.end()) filenames.erase(itr); + itr = std::find(filenames.begin(), filenames.end(), ".."); + if (itr != filenames.end()) filenames.erase(itr); + + std::sort(filenames.begin(), filenames.end()); + const int EVENTS = filenames.size(); + std::cout << "Found " << EVENTS << " file(s)" << std::endl; + + unsigned char **buffer = new unsigned char*[100000]; + for(int i = 0; i < 100000; ++i) + { + buffer[i] = new unsigned char[78072]; + memset(buffer[i], 0, sizeof(unsigned char)*78072); + } + + for(int i = 0; i < EVENTS; ++i) + { + const auto file = path + filenames.at(i); + std::cout << "Processing " << i+1 << ": " << file << std::endl; + + std::ifstream dataFile; + dataFile.open(file, std::fstream::in); + + if(dataFile.fail()) + { + std::cerr << "ERROR: Unable to open: " << file << std::endl; + std::exit(-1); + } + + unsigned int lineNum = 0; + for(std::string line; getline(dataFile, line); ) + { + ++lineNum; + auto qLine = QString::fromStdString(line); + auto parts = qLine.split('\t'); + parts.removeAll(QString()); + if(parts.size() != 2) + { + std::cerr << "ERROR: Unable parse line " << lineNum << ": " << line << " from file " << file << std::endl; + std::exit(-1); + } + + const auto num = parts.first().toInt(); + const auto timeval = static_cast<int>(parts.last().toDouble() * 10); + buffer[timeval][num] = 1; + assert(timeval < 100000); + } + + dataFile.close(); + } + + for(int i = 0; i < 100000; ++i) + { + const double time = TIME_INTERVAL * i; + for(int j = 2; j <= 78072; ++j) + { + if(buffer[i][j] == 1) + { + aFile << j << ", " << time << '\n'; + } + } + } + aFile.flush(); + aFile.close(); + + std::cout << "Write activity file: " << ACTiVITY_FILENAME << std::endl; + std::cout << "Processed " << filenames.size() << " files successfully" << std::endl; + + return 0; +} + diff --git a/stackviz/CMakeLists.txt b/stackviz/CMakeLists.txt index 90dba55e963a7f3d41b5face94aa59b6233709a3..b69845b6470de3d203912d824c5920dd0ed1c8ed 100644 --- a/stackviz/CMakeLists.txt +++ b/stackviz/CMakeLists.txt @@ -50,6 +50,7 @@ set(STACKVIZ_LINK_LIBRARIES prefr sumrice scoop + acuterecorder ) if(WIN32) diff --git a/stackviz/MainWindow.cpp b/stackviz/MainWindow.cpp index 50235d63509835dee5fba9eab6b273e3dee87bd5..d4160b6d56100875252119696f0bac425e2dd7e7 100644 --- a/stackviz/MainWindow.cpp +++ b/stackviz/MainWindow.cpp @@ -55,6 +55,8 @@ #include <thread> +#include <acuterecorder/acuterecorder.h> + #include <sumrice/sumrice.h> #include <sumrice/Utils.h> @@ -85,6 +87,7 @@ MainWindow::MainWindow( QWidget* parent_ ) , m_loader{nullptr} , m_loaderDialog{nullptr} , m_dataInspector{nullptr} +, _recorder{nullptr} { _ui->setupUi( this ); @@ -101,8 +104,9 @@ MainWindow::MainWindow( QWidget* parent_ ) connect( _ui->actionAbout, SIGNAL( triggered( void )), this, SLOT( aboutDialog( void ))); - // only used for data refresh in case of REST API. Similar one included - // in Summary class, refactor? + connect( _ui->actionRecorder , SIGNAL( triggered( void )) , this , + SLOT( openRecorder( void ))); + m_dataInspector = new DataInspector(""); m_dataInspector->hide(); } @@ -138,6 +142,8 @@ void MainWindow::init( const std::string &session ) connect( _ui->actionOpenSubsetEventsFile, SIGNAL( triggered( void )), this, SLOT( openSubsetEventsFileThroughDialog( void ))); + _ui->actionOpenSubsetEventsFile->setEnabled(false); + initPlaybackDock( ); connect( _dockSimulation->toggleViewAction( ), SIGNAL( toggled( bool )), @@ -508,6 +514,9 @@ void MainWindow::initSummaryWidget( ) connect( _ui->actionFill_Plots, SIGNAL( triggered( bool )), _summary, SLOT( fillPlots( bool ))); + connect(_ui->actionShowPanels, SIGNAL(triggered(bool)), + _summary, SLOT( showConfigPanels(bool))); + connect( _summary, SIGNAL( histogramClicked( float )), this, SLOT( PlayAtPercentage( float ))); @@ -1002,6 +1011,7 @@ void MainWindow::updateUIonOpen(const std::string &eventsFile) _displayManager->refresh( ); _ui->actionShowDataManager->setEnabled(true); + _ui->actionOpenSubsetEventsFile->setEnabled(true); } void stackviz::MainWindow::loadData(const simil::TDataType type, @@ -1031,6 +1041,55 @@ void stackviz::MainWindow::loadData(const simil::TDataType type, m_loader->start(); } +void MainWindow::openRecorder( void ) +{ + // The button stops the recorder if found. + if( _recorder != nullptr ) + { + _ui->actionRecorder->setDisabled( true ); + _recorder->stop(); + + // Recorder will be deleted after finishing. + _recorder = nullptr; + _ui->actionRecorder->setChecked( false ); + return; + } + + RSWParameters params; + params.widgetsToRecord.emplace_back( "Main Widget" , this ); + params.defaultFPS = 30; + params.includeScreens = false; + params.stabilizeFramerate = true; + + if(!_ui->actionAdvancedRecorderOptions->isChecked()) + { + params.showWorker = false; + params.showWidgetSourceMode = false; + params.showSourceParameters = false; + } + + RecorderDialog dialog( nullptr , params , true ); + dialog.setWindowIcon( QIcon( ":/visimpl.png" )); + dialog.setFixedSize( 800 , 600 ); + if ( dialog.exec( ) == QDialog::Accepted) + { + _recorder = dialog.getRecorder( ); + connect( _recorder , SIGNAL( finished( )) , + _recorder , SLOT( deleteLater( ))); + connect( _recorder , SIGNAL( finished( )) , + this , SLOT( finishRecording( ))); + _ui->actionRecorder->setChecked( true ); + } else + { + _ui->actionRecorder->setChecked( false ); + } +} + +void MainWindow::finishRecording( ) +{ + _ui->actionRecorder->setEnabled( true ); +} + void stackviz::MainWindow::onLoadFinished() { if(m_loader) diff --git a/stackviz/MainWindow.h b/stackviz/MainWindow.h index c068f53870ce67dbc80b2c5307a5ef5c82a93e66..d32333a22ff90c0aae94b53608d6d634038f17b4 100644 --- a/stackviz/MainWindow.h +++ b/stackviz/MainWindow.h @@ -48,6 +48,8 @@ #include "ui_stackviz.h" #include "DisplayManagerWidget.h" +class Recorder; + namespace Ui { class MainWindow; @@ -123,6 +125,10 @@ namespace stackviz void onDataUpdated(); + void openRecorder(); + + void finishRecording(); + protected: void configurePlayer( void ); @@ -189,6 +195,9 @@ namespace stackviz std::shared_ptr<LoaderThread> m_loader; LoadingDialog *m_loaderDialog; DataInspector * m_dataInspector; + + // Recorder + Recorder* _recorder; }; diff --git a/stackviz/icons/recorder.svg b/stackviz/icons/recorder.svg new file mode 100644 index 0000000000000000000000000000000000000000..947269bc99779555e5d921b191df4d5d69a1b7e2 --- /dev/null +++ b/stackviz/icons/recorder.svg @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + width="123.49702mm" + height="123.49702mm" + viewBox="0 0 123.49705 123.49705" + version="1.1" + id="svg5" + inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)" + sodipodi:docname="recorder.svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> + <sodipodi:namedview + id="namedview7" + pagecolor="#505050" + bordercolor="#eeeeee" + borderopacity="1" + inkscape:pageshadow="0" + inkscape:pageopacity="0" + inkscape:pagecheckerboard="0" + inkscape:document-units="mm" + showgrid="false" + fit-margin-top="15" + fit-margin-left="15" + fit-margin-right="15" + fit-margin-bottom="15" + lock-margins="false" + width="107.89702mm" + inkscape:zoom="0.74029882" + inkscape:cx="-127.65116" + inkscape:cy="226.93539" + inkscape:window-width="1920" + inkscape:window-height="1013" + inkscape:window-x="2560" + inkscape:window-y="1440" + inkscape:window-maximized="1" + inkscape:current-layer="layer1" /> + <defs + id="defs2"> + <filter + style="color-interpolation-filters:sRGB" + inkscape:label="Blur" + id="filter721" + x="-0.077007798" + y="-0.077007798" + width="1.1540156" + height="1.1540156"> + <feGaussianBlur + stdDeviation="3 3" + result="blur" + id="feGaussianBlur719" /> + </filter> + </defs> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(-38.877594,-60.209427)"> + <circle + style="fill:#2b0000;fill-rule:evenodd;stroke-width:0.264583;filter:url(#filter721)" + id="circle413" + cx="106.41572" + cy="129.05154" + r="46.748512" + transform="matrix(0.80142274,0,0,0.80142274,21.131741,25.626701)" /> + <circle + style="fill:#aa0000;fill-rule:evenodd;stroke-width:0.212043" + id="path129" + cx="101.77579" + cy="123.36657" + r="37.465321" /> + </g> +</svg> diff --git a/stackviz/icons/toolconfig.svg b/stackviz/icons/toolconfig.svg new file mode 100644 index 0000000000000000000000000000000000000000..366cef3fb46e0de0fdfc4004073bf081424f6689 --- /dev/null +++ b/stackviz/icons/toolconfig.svg @@ -0,0 +1,154 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + id="Layer_1" + x="0px" + y="0px" + viewBox="0 0 512.003 512.003" + style="enable-background:new 0 0 512.003 512.003;" + xml:space="preserve" + sodipodi:docname="toolconfig.svg" + inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"><metadata + id="metadata43"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs + id="defs41"><radialGradient + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,0,0,0.315315,0,26.81305)" + r="19.622213" + fy="39.161163" + fx="25.455845" + cy="39.161163" + cx="25.455845" + id="radialGradient3262" + xlink:href="#linearGradient3256" /><linearGradient + id="linearGradient3256"><stop + id="stop3258" + offset="0" + style="stop-color:#000000;stop-opacity:1;" /><stop + id="stop3260" + offset="1" + style="stop-color:#000000;stop-opacity:0;" /></linearGradient><linearGradient + gradientTransform="matrix(1.241935,0,0,1.241935,-5.027508,-7.208988)" + y2="39.684914" + x2="34.534348" + y1="12.284524" + x1="14.462892" + gradientUnits="userSpaceOnUse" + id="linearGradient3281" + xlink:href="#linearGradient3264" /><linearGradient + id="linearGradient3264"><stop + id="stop3266" + offset="0" + style="stop-color:#c9c9c9;stop-opacity:1;" /><stop + style="stop-color:#f8f8f8;stop-opacity:1;" + offset="0.25" + id="stop3276" /><stop + style="stop-color:#e2e2e2;stop-opacity:1;" + offset="0.5" + id="stop3272" /><stop + id="stop3274" + offset="0.75" + style="stop-color:#b0b0b0;stop-opacity:1;" /><stop + id="stop3268" + offset="1" + style="stop-color:#c9c9c9;stop-opacity:1;" /></linearGradient></defs><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1848" + inkscape:window-height="1136" + id="namedview39" + showgrid="false" + inkscape:zoom="0.83007328" + inkscape:cx="256.0015" + inkscape:cy="256.0015" + inkscape:window-x="72" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:current-layer="Layer_1" /> +<path + style="fill:#F77935;" + d="M503.187,81.861c-4.012-0.793-8.018,1.38-9.548,5.171l-39.929,98.955l-34.662-36.981 c-2.075-2.214-5.174-3.157-8.129-2.476c-2.957,0.682-5.329,2.885-6.226,5.784l-48.352,156.29l-19.445-24.206 c-1.536-1.911-3.82-3.068-6.27-3.175c-2.45-0.11-4.826,0.846-6.523,2.615l-24.949,26.021l-38.003-132.095 c-1.026-3.566-4.242-6.058-7.952-6.16c-3.674-0.091-7.059,2.207-8.28,5.711l-42.893,123.001l-25.196-17.328 c-1.923-1.322-4.304-1.796-6.59-1.315c-2.284,0.483-4.27,1.881-5.494,3.869l-40.625,65.993l-59.784-12.958 c-4.359-0.945-8.705,1.629-9.973,5.903L10.578,492.061c-0.765,2.578-0.268,5.365,1.34,7.52c1.609,2.154,4.14,3.424,6.827,3.424 H499.31c4.687,0,8.494-3.786,8.52-8.473l2.229-404.264C510.082,86.179,507.197,82.651,503.187,81.861z" + id="path2" /> + + +<g + id="g8"> +</g> +<g + id="g10"> +</g> +<g + id="g12"> +</g> +<g + id="g14"> +</g> +<g + id="g16"> +</g> +<g + id="g18"> +</g> +<g + id="g20"> +</g> +<g + id="g22"> +</g> +<g + id="g24"> +</g> +<g + id="g26"> +</g> +<g + id="g28"> +</g> +<g + id="g30"> +</g> +<g + id="g32"> +</g> +<g + id="g34"> +</g> +<g + id="g36"> +</g> +<g + transform="matrix(7.5365445,0,0,7.4517263,134.63166,136.06701)" + id="layer1"><path + inkscape:connector-curvature="0" + transform="translate(-0.883885,2.474874)" + d="m 45.078058,39.161163 a 19.622213,6.187185 0 1 1 -39.2444265,0 19.622213,6.187185 0 1 1 39.2444265,0 z" + id="path3254" + style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.40909089;fill:url(#radialGradient3262);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none" /><path + inkscape:connector-curvature="0" + id="path3243" + d="M 23.25,0.46875 C 22.784561,0.50059628 22.332166,0.57268469 21.875,0.625 H 21.84375 L 20.75,6.59375 C 18.967275,6.9997399 17.290091,7.6887415 15.78125,8.625 L 10.875,5.09375 C 9.5487118,6.1234406 8.3418016,7.3243453 7.28125,8.625 l 3.40625,4.96875 c -1.0342329,1.580515 -1.8119683,3.385224 -2.25,5.28125 -7.5e-5,0.009 -6.09e-5,0.02969 0,0.03125 L 2.5,19.84375 c -0.1085533,0.886633 -0.15625,1.802939 -0.15625,2.71875 10e-8,0.7493 0.020689,1.488589 0.09375,2.21875 l 5.9375,1.0625 c 0.422279,2.061892 1.2244587,3.987512 2.34375,5.6875 L 7.1875,36.375 c 1.0113261,1.255518 2.1788917,2.398616 3.4375,3.40625 l 5,-3.4375 c 1.747433,1.114717 3.698083,1.896374 5.8125,2.28125 l 0.9375,5.90625 c 0.666183,0.06064 1.349349,0.0625 2.03125,0.0625 0.962685,-10e-7 1.882237,-0.03648 2.8125,-0.15625 l 1.125,-6.03125 C 30.351311,37.906649 32.237219,37.03996 33.875,35.875 l 4.8125,3.5 c 1.248028,-1.061797 2.389277,-2.282256 3.375,-3.59375 l -3.5,-5.0625 c 0.947853,-1.63699 1.604629,-3.443141 1.9375,-5.375 l 5.90625,-0.9375 c 0.05179,-0.616346 0.0625,-1.214087 0.0625,-1.84375 0,-1.094214 -0.127182,-2.167084 -0.28125,-3.21875 l -6,-1.09375 C 39.717306,16.513776 38.945824,14.893898 37.96875,13.4375 L 41.5,8.59375 C 40.405427,7.2551429 39.156822,6.0185688 37.78125,4.96875 l -5.09375,3.5 C 31.223504,7.6029126 29.648037,6.9385679 27.9375,6.5625 L 27,0.625 C 26.146701,0.52462461 25.286379,0.46875 24.40625,0.46875 c -0.237872,10e-9 -0.482684,-0.007485 -0.71875,0 -0.115083,0.003649 -0.228966,-0.006695 -0.34375,0 -0.03109,0.001813 -0.06272,-0.002123 -0.09375,0 z m 0.8125,15.1875 c 0.114166,-0.0058 0.228152,0 0.34375,0 3.699127,0 6.71875,3.019624 6.71875,6.71875 1e-6,3.699126 -3.019624,6.6875 -6.71875,6.6875 -3.699125,1e-6 -6.6875,-2.988374 -6.6875,-6.6875 1e-6,-3.583527 2.8046,-6.539158 6.34375,-6.71875 z" + style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:url(#linearGradient3281);fill-opacity:1;fill-rule:nonzero;stroke:#808080;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none" /><path + inkscape:connector-curvature="0" + transform="matrix(0.606518,0,0,0.606518,10.15021,7.936835)" + d="m 36.239223,23.781593 a 12.727922,12.727922 0 1 1 -25.455844,0 12.727922,12.727922 0 1 1 25.455844,0 z" + id="path3283" + style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.64772728;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:1.64875567;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none" /><path + inkscape:connector-curvature="0" + style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.34659089;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.9999997;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none" + d="M 22.557788,1.6501132 21.679599,7.4291233 C 20.008601,7.8096689 16.934874,8.9735344 15.520595,9.8511162 L 10.848562,6.3639293 C 9.6053938,7.3290873 9.5201391,7.3945394 8.5260544,8.6136804 l 3.3780526,5.0099536 c -0.969415,1.481461 -2.1338039,4.121495 -2.5518734,6.008088 0,0 -5.9194088,0.997841 -5.9194088,0.997841 -0.1017499,0.831066 -0.05285,2.609798 0.015632,3.294198 l 5.6542436,1.018588 c 0.395814,1.932669 1.8770306,5.043588 2.9261736,6.637034 l -3.575576,4.724044 c 0.9479445,1.176832 1.1376642,1.284521 2.317393,2.229005 l 4.781168,-3.50282 c 1.637918,1.044855 4.889033,2.315886 6.870935,2.676641 l 0.784687,5.706254 c 0.624432,0.05684 2.349481,0.216281 3.221443,0.10402 l 0.878188,-5.940154 c 1.881743,-0.468289 5.13316,-1.80296 6.668298,-2.89491 l 4.776055,3.450808 c 1.169811,-0.995251 1.180292,-1.145216 2.104238,-2.374516 l -3.539198,-5.030701 c 0.888449,-1.534398 2.037228,-4.535223 2.349237,-6.346009 l 5.794642,-0.961463 c 0.04855,-0.577719 0.05091,-2.188789 -0.0935,-3.174545 L 39.463105,19.226449 C 39.022378,17.599038 37.509894,14.666467 36.594056,13.301345 L 40.346408,8.5773019 C 39.320436,7.3225876 38.938964,7.150431 37.649602,6.1664065 L 32.707289,9.7056032 C 31.335043,8.8940304 28.598675,7.6568558 26.995341,7.3043568 L 26.122266,1.6501132 c -0.799821,-0.094085 -3.107395,-0.052306 -3.564478,0 z" + id="path3285" /></g></svg> \ No newline at end of file diff --git a/stackviz/resources.qrc b/stackviz/resources.qrc index d6888421c5e83e1e7ebd4fcc167e72761de6ffc3..6ad7fba7ad999629e3c7c442e9d595845173440b 100644 --- a/stackviz/resources.qrc +++ b/stackviz/resources.qrc @@ -23,5 +23,7 @@ <file>visimpl.png</file> <file>icons/generic-info.svg</file> <file>icons/fill.svg</file> + <file>icons/toolconfig.svg</file> + <file>icons/recorder.svg</file> </qresource> </RCC> diff --git a/stackviz/stackviz.ui b/stackviz/stackviz.ui index 75b9e49cbcbcbcb961e6223cd9495df86896537f..2d155724695650e00b474086685921bc47ec16ea 100644 --- a/stackviz/stackviz.ui +++ b/stackviz/stackviz.ui @@ -54,7 +54,11 @@ <addaction name="separator"/> <addaction name="actionAutoNamingSelections"/> <addaction name="actionFill_Plots"/> + <addaction name="actionShowPanels"/> <addaction name="actionAddZeroEQhistograms"/> + <addaction name="separator"/> + <addaction name="actionRecorder"/> + <addaction name="actionAdvancedRecorderOptions"/> </widget> <widget class="QMenu" name="menuPlayback"> <property name="title"> @@ -88,11 +92,14 @@ <addaction name="actionTogglePlaybackDock"/> <addaction name="actionCloseData"/> <addaction name="actionShowDataManager"/> + <addaction name="actionShowPanels"/> <addaction name="separator"/> <addaction name="actionFocusOnPlayhead"/> <addaction name="actionFollowPlayhead"/> <addaction name="separator"/> <addaction name="actionFill_Plots"/> + <addaction name="separator"/> + <addaction name="actionRecorder"/> </widget> <action name="actionQuit"> <property name="text"> @@ -274,6 +281,50 @@ <string>Add ZeroEQ selections as histograms</string> </property> </action> + <action name="actionShowPanels"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>true</bool> + </property> + <property name="icon"> + <iconset resource="resources.qrc"> + <normaloff>:/icons/toolconfig.svg</normaloff>:/icons/toolconfig.svg</iconset> + </property> + <property name="text"> + <string>Show Configuration Panels</string> + </property> + <property name="toolTip"> + <string>Shows/Hides the configuration panels.</string> + </property> + </action> + <action name="actionRecorder"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="icon"> + <iconset resource="resources.qrc"> + <normaloff>:/icons/recorder.svg</normaloff>:/icons/recorder.svg</iconset> + </property> + <property name="text"> + <string>Recorder</string> + </property> + <property name="toolTip"> + <string>Starts/Stops the recorder</string> + </property> + <property name="shortcut"> + <string>Ctrl+R</string> + </property> + </action> + <action name="actionAdvancedRecorderOptions"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>Advanced recorder options</string> + </property> + </action> </widget> <resources> <include location="resources.qrc"/> diff --git a/sumrice/DataInspector.cpp b/sumrice/DataInspector.cpp index d7f7cce9eae4b26724b344051eef226fae9155ce..643df99b8956582200823fb4aed1f335d8142309 100644 --- a/sumrice/DataInspector.cpp +++ b/sumrice/DataInspector.cpp @@ -101,9 +101,6 @@ void DataInspector::updateInfo( ) } } - if ( updated ) - { - emit simDataChanged( ); - } + if ( updated ) emit simDataChanged( ); } } diff --git a/sumrice/StackViz.cpp b/sumrice/StackViz.cpp index 9ac1dcd8f4294104d95d1965c27dad2742901a10..d647a4321e53b1ae0d99785d1a4f5e273b4ddddb 100644 --- a/sumrice/StackViz.cpp +++ b/sumrice/StackViz.cpp @@ -50,14 +50,13 @@ StackViz::StackViz( QWidget *parent_ ) setLayout( new QGridLayout( )); } -void StackViz::init( simil::SimulationPlayer* p ) +void StackViz::init( simil::SimulationPlayer* player ) { - // StackViz already loaded. - if ( p == nullptr || _player != nullptr ) return; + if ( !player ) return; QApplication::setOverrideCursor( Qt::WaitCursor ); - _player = p; + _player = player; _simulationType = _player->data( )->simulationType( ); _subsetEventManager = _player->data( )->subsetsEvents( ); @@ -82,7 +81,7 @@ void StackViz::openSubsetEventsFile( bool fromH5 ) _displayManager->refresh( ); } -void StackViz::showDisplayManagerWidget( void ) +void StackViz::showDisplayManagerWidget( ) { if(!_summary) return; @@ -113,7 +112,12 @@ void StackViz::showDisplayManagerWidget( void ) void StackViz::initSummaryWidget( ) { - _summary = new visimpl::Summary( this , visimpl::T_STACK_EXPANDABLE ); + const bool hasSummary = _summary != nullptr; + + if(!hasSummary) + { + _summary = new visimpl::Summary( this , visimpl::T_STACK_EXPANDABLE ); + } if ( _simulationType == simil::TSimSpikes ) { @@ -123,13 +127,16 @@ void StackViz::initSummaryWidget( ) _summary->simulationPlayer( _player ); } + if(!hasSummary) + { + layout( )->addWidget( _summary ); - layout( )->addWidget( _summary ); - - connect( _summary , SIGNAL( histogramClicked( visimpl::HistogramWidget * )) , - this , SLOT( HistogramClicked( visimpl::HistogramWidget * )) ); + connect( _summary , SIGNAL( histogramClicked( visimpl::HistogramWidget * )) , + this , SLOT( HistogramClicked( visimpl::HistogramWidget * )) ); - //_ui->actionFocusOnPlayhead->setVisible( true ); + connect( _summary, SIGNAL(changedBins(const unsigned int)), + this, SIGNAL(changedBins(const unsigned int))); + } if ( _autoCalculateCorrelations ) { @@ -139,7 +146,6 @@ void StackViz::initSummaryWidget( ) QTimer::singleShot( 0 , _summary , SLOT( adjustSplittersSize( )) ); } - void StackViz::HistogramClicked(visimpl::HistogramWidget *histogram) { #ifdef VISIMPL_USE_ZEROEQ @@ -177,10 +183,7 @@ void StackViz::HistogramClicked(visimpl::HistogramWidget *histogram) void StackViz::addSelection(const visimpl::Selection &selection) { - if (_summary) - { - _summary->AddNewHistogram(selection); - } + if (_summary) _summary->AddNewHistogram(selection); } void StackViz::removeSubset(const unsigned int i) @@ -228,29 +231,19 @@ void StackViz::calculateCorrelations(void) void visimpl::StackViz::changeHistogramName(const unsigned idx, const QString &name) { - if(_summary) - { - _summary->changeHistogramName(idx + 1, name); - - } + if(_summary) _summary->changeHistogramName(idx + 1, name); } void visimpl::StackViz::setHistogramVisible(const unsigned idx, const bool state) { - if(_summary) - { - _summary->changeHistogramVisibility(idx + 1, state); - - } + if(_summary) _summary->changeHistogramVisibility(idx + 1, state); } void visimpl::StackViz::updateHistograms( ) { - if ( _summary ) - _summary->repaintHistograms( ); + if ( _summary ) _summary->UpdateHistograms( ); - if ( _followPlayhead ) - _summary->focusPlayback( ); + if ( _followPlayhead ) _summary->focusPlayback( ); } void visimpl::StackViz::toggleAutoNameSelections( ) @@ -272,3 +265,18 @@ void StackViz::followPlayhead( bool follow ) { _followPlayhead = follow; } + +void visimpl::StackViz::showStackVizPanels(bool value) +{ + if(_summary) _summary->showConfigPanels(value); +} + +void visimpl::StackViz::repaintHistograms() +{ + if(_summary) + { + if(_followPlayhead) _summary->focusPlayback(); + + _summary->repaintHistograms(); + } +} diff --git a/sumrice/StackViz.h b/sumrice/StackViz.h index c655c2db08088b25477dbe0233e882374855ead1..eaf5d703ed2a0989f18277254b9a3f57d00ee27c 100644 --- a/sumrice/StackViz.h +++ b/sumrice/StackViz.h @@ -77,6 +77,9 @@ namespace visimpl */ void setHistogramVisible(const unsigned idx, const bool state); + signals: + void changedBins(const unsigned int); + public slots: void openSubsetEventsFile( bool fromH5 ); @@ -87,6 +90,8 @@ namespace visimpl void updateHistograms( ); + void repaintHistograms(); + void toggleAutoNameSelections( ); void fillPlots( bool fill ); @@ -95,6 +100,12 @@ namespace visimpl void followPlayhead ( bool follow ); + /** \brief Shows/Hides the StackViz configuration panels. + * \param[in] value True to show the panels and false otherwise. + * + */ + void showStackVizPanels( bool value); + protected slots: void HistogramClicked( visimpl::HistogramWidget * ); @@ -123,4 +134,4 @@ namespace visimpl } // namespace stackviz -#endif //STACKVIZ_H_ \ No newline at end of file +#endif //STACKVIZ_H_ diff --git a/sumrice/Summary.cpp b/sumrice/Summary.cpp index 729f158a09081f373055f7eabff4870c8fd68ad8..8faa1d183efe0c2b7918764aa6fbc4c6530743b9 100644 --- a/sumrice/Summary.cpp +++ b/sumrice/Summary.cpp @@ -126,6 +126,7 @@ namespace visimpl _initCentralGUI(); auto footWidget = _initFootGUI(); + footWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); if( _stackType == T_STACK_EXPANDABLE ) { @@ -135,7 +136,7 @@ namespace visimpl _splitVertEventsHisto->addWidget( footWidget ); _splitVertEventsHisto->setSizes( { 1000, 1000, 2000 } ); - _layoutMain->addWidget(_splitVertEventsHisto ); + _layoutMain->addWidget(_splitVertEventsHisto , 1); } #ifdef VISIMPL_USE_ZEROEQ @@ -152,6 +153,8 @@ namespace visimpl // but rearranging to have consecutive colors with different hue. _eventsPalette = scoop::ColorPalette::colorBrewerQualitative( scoop::ColorPalette::ColorBrewerQualitative::Set1, 9 ); + + this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); } void Summary::Init( simil::SimulationData* data_ ) @@ -320,6 +323,7 @@ namespace visimpl _focusWidget->colorGlobal( _colorGlobal ); _focusWidget->setMinimumHeight( 200 ); _focusWidget->setMinimumWidth( 200 ); + _focusWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); // NORMALIZATION @@ -502,8 +506,9 @@ namespace visimpl void Summary::Init() { - if( !_spikeReport ) - return; + if( !_spikeReport ) return; + + if(_mainHistogram) clear(); _mainHistogram = new visimpl::HistogramWidget( *_spikeReport ); _mainHistogram->setMinimumHeight( _heightPerRow ); @@ -1093,6 +1098,7 @@ namespace visimpl { const unsigned int binsNumber = _spinBoxBins->value(); bins( binsNumber ); + emit changedBins(binsNumber); } void Summary::bins( unsigned int bins_ ) @@ -1361,7 +1367,6 @@ namespace visimpl delete summaryRow.label; delete summaryRow.histogram; - delete summaryRow.checkBox; _histogramWidgets.erase( _histogramWidgets.begin() + i ); @@ -1800,4 +1805,27 @@ namespace visimpl } } + void Summary::showConfigPanels(bool value) + { + _footToolBox->setVisible(value); + } + + void Summary::clear() + { + clearEvents(); + + auto row = _histogramRows.front(); + + _layoutHistoLabels->removeWidget( row.label ); + _layoutHistograms->removeWidget( row.histogram ); + + delete row.label; + delete row.histogram; + + _histogramWidgets.erase( _histogramWidgets.begin()); + _histogramRows.erase( _histogramRows.begin()); + + while(!_histogramRows.empty()) removeSubset(0); + } + } diff --git a/sumrice/Summary.h b/sumrice/Summary.h index 6fbedcd6ef490518f02dccbb6d1adaa289b3a32e..05d3318e8b0c892f8af1d777b918093e22cea8ef 100644 --- a/sumrice/Summary.h +++ b/sumrice/Summary.h @@ -142,6 +142,7 @@ namespace visimpl void histogramClicked( float ); void histogramClicked( visimpl::HistogramWidget* ); + void changedBins(const unsigned int); public slots: @@ -170,6 +171,11 @@ namespace visimpl void focusPlayback( void ); void setFocusAt( float perc ); + /** \brief Shows/hides the toolbox panels. + * \param[in] value True to show and false otherwise. + */ + void showConfigPanels(bool value); + protected slots: void childHistogramPressed( const QPoint&, float ); @@ -195,10 +201,16 @@ namespace visimpl void _updateScaleHorizontal( void ); void _updateScaleVertical( void ); + protected: virtual void showEvent(QShowEvent *); + /** \brief Removes all widgets. + * + */ + void clear(); + struct HistogramRow { public: @@ -206,7 +218,6 @@ namespace visimpl HistogramRow( ) : histogram( nullptr ) , label( nullptr ) - , checkBox( nullptr ) { } ~HistogramRow( ) @@ -214,8 +225,6 @@ namespace visimpl visimpl::HistogramWidget* histogram; QLabel* label; - QCheckBox* checkBox; - }; struct EventRow @@ -225,7 +234,6 @@ namespace visimpl EventRow( ) : widget( nullptr ) , label( nullptr ) - , checkBox( nullptr ) { } ~EventRow( ) @@ -233,8 +241,6 @@ namespace visimpl visimpl::EventWidget* widget; QLabel* label; - QCheckBox* checkBox; - }; #ifdef VISIMPL_USE_ZEROEQ @@ -342,7 +348,7 @@ namespace visimpl QScrollArea* _scrollEvent; QVBoxLayout* _layoutMain; -// QSplitter* _splitVertCentralFoot; + QSplitter* _splitVertEventsHisto; QSplitter* _splitHorizEvents; QSplitter* _splitHorizHisto; @@ -400,8 +406,6 @@ namespace visimpl float _defaultCorrelationDeltaTime; scoop::ColorPalette _eventsPalette; -// std::vector< QColor > _subsetEventColorPalette; - }; } diff --git a/visimpl/MainWindow.cpp b/visimpl/MainWindow.cpp index 8c71a29236ac61a6f65265061cb7e29432be67ca..4214721b734431a41ebd172c38cd0420693da959 100644 --- a/visimpl/MainWindow.cpp +++ b/visimpl/MainWindow.cpp @@ -213,8 +213,9 @@ namespace visimpl SLOT( openHDF5ThroughDialog( void )) ); connect( _ui->actionOpenSubsetEventsFile , SIGNAL( triggered( void )) , - this , - SLOT( openSubsetEventsFileThroughDialog( void )) ); + this , SLOT( openSubsetEventsFileThroughDialog( void )) ); + + _ui->actionOpenSubsetEventsFile->setEnabled(false); connect( _ui->actionCloseData , SIGNAL( triggered( void )) , this , SLOT( closeData( void )) ); @@ -326,7 +327,7 @@ namespace visimpl _subsetEvents = _openGLWidget->player( )->data( )->subsetsEvents( ); _ui->actionToggleStackVizDock->setEnabled(true); - _stackViz->init( _openGLWidget->player( )); + _ui->actionOpenSubsetEventsFile->setEnabled(true); if(_openGLWidget) { @@ -499,7 +500,6 @@ namespace visimpl void MainWindow::openRecorder( void ) { - // The button stops the recorder if found. if( _recorder != nullptr ) { @@ -526,12 +526,12 @@ namespace visimpl params.showSourceParameters = false; } - auto dialog = new RecorderDialog( nullptr , params , false ); - dialog->setWindowIcon( QIcon( ":/visimpl.png" )); - dialog->setFixedSize( 800 , 600 ); - if ( dialog->exec( ) == QDialog::Accepted) + RecorderDialog dialog( nullptr , params , false ); + dialog.setWindowIcon( QIcon( ":/visimpl.png" )); + dialog.setFixedSize( 800 , 600 ); + if ( dialog.exec( ) == QDialog::Accepted) { - _recorder = dialog->getRecorder( ); + _recorder = dialog.getRecorder( ); connect( _recorder , SIGNAL( finished( )) , _recorder , SLOT( deleteLater( ))); connect( _recorder , SIGNAL( finished( )) , @@ -543,10 +543,8 @@ namespace visimpl { _ui->actionRecorder->setChecked( false ); } - dialog->deleteLater( ); } - void MainWindow::closeData( void ) { // TODO @@ -717,6 +715,7 @@ namespace visimpl _stackVizDock->setVisible(false); _stackViz = new StackViz( this ); + if ( _openGLWidget && _openGLWidget->player( )) { _stackViz->init( _openGLWidget->player( )); @@ -725,35 +724,37 @@ namespace visimpl _stackVizDock->setWidget( _stackViz ); this->addDockWidget( Qt::LeftDockWidgetArea , _stackVizDock ); - connect( - _ui->actionStackVizShowDataManager , SIGNAL( triggered( bool )) , - _stackViz , SLOT( showDisplayManagerWidget( )) - ); + connect( _objectInspectorGB, SIGNAL( simDataChanged()), + _stackViz, SLOT( updateHistograms())); - connect( - _ui->actionStackVizShowDataManager , SIGNAL( triggered( bool )) , - _stackViz , SLOT( showDisplayManagerWidget( )) - ); + connect(_stackViz, SIGNAL(changedBins(const unsigned int)), + _summary, SLOT(bins(unsigned int))); - connect( - _ui->actionStackVizAutoNamingSelections , SIGNAL( triggered( )) , - _stackViz , SLOT( toggleAutoNameSelections( )) - ); + connect(_ui->actionStackVizShowDataManager , SIGNAL( triggered( bool )) , + _stackViz , SLOT( showDisplayManagerWidget( ))); - connect( - _ui->actionStackVizFillPlots , SIGNAL( triggered( bool )) , - _stackViz , SLOT( fillPlots( bool )) - ); + connect(_ui->actionStackVizShowPanels , SIGNAL( triggered( bool )) , + _stackViz , SLOT( showStackVizPanels(bool ))); - connect( - _ui->actionStackVizFocusOnPlayhead , SIGNAL( triggered( )) , - _stackViz , SLOT( focusPlayback( )) - ); + connect(_ui->actionStackVizShowDataManager , SIGNAL( triggered( bool )) , + _stackViz , SLOT( showDisplayManagerWidget( ))); - connect( - _ui->actionStackVizFollowPlayHead , SIGNAL( triggered( bool )) , - _stackViz , SLOT( followPlayhead( bool )) - ); + connect(_ui->actionStackVizAutoNamingSelections , SIGNAL( triggered( )) , + _stackViz , SLOT( toggleAutoNameSelections( ))); + + connect(_ui->actionStackVizFillPlots , SIGNAL( triggered( bool )) , + _stackViz , SLOT( fillPlots( bool ))); + + connect(_ui->actionStackVizFocusOnPlayhead , SIGNAL( triggered( )) , + _stackViz , SLOT( focusPlayback( ))); + + connect(_ui->actionStackVizFollowPlayHead , SIGNAL( triggered( bool )) , + _stackViz , SLOT( followPlayhead( bool ))); + + // this avoids making the dock smaller when the stackviz config panels + // hide. + QObject::connect(_ui->actionStackVizShowPanels , &QAction::triggered , + [=](bool){ this->resizeDocks({_stackVizDock}, {_stackVizDock->width()}, Qt::Horizontal);}); } void MainWindow::_initPlaybackDock( void ) @@ -1329,7 +1330,7 @@ namespace visimpl if ( _summary ) _summary->repaintHistograms( ); - _stackViz->updateHistograms( ); + _stackViz->repaintHistograms( ); } void MainWindow::UpdateSimulationColorMapping( void ) @@ -1932,7 +1933,6 @@ void MainWindow::clearGroups( void ) selection.name = groupName.toStdString( ); _stackViz->addSelection( selection ); - } void MainWindow::checkGroupsVisibility( void ) @@ -2246,6 +2246,8 @@ void MainWindow::clearGroups( void ) _comboAttribSelection->clear(); + _stackViz->init( _openGLWidget->player( )); + switch(m_type) { case simil::TDataType::TBlueConfig: @@ -2658,6 +2660,7 @@ void MainWindow::clearGroups( void ) _ui->actionStackVizFocusOnPlayhead->setEnabled(status); _ui->actionStackVizFollowPlayHead->setEnabled(status); _ui->actionStackVizShowDataManager->setEnabled(status); + _ui->actionStackVizShowPanels->setEnabled(status); } void MainWindow::finishRecording( ) diff --git a/visimpl/icons/toolconfig.svg b/visimpl/icons/toolconfig.svg new file mode 100644 index 0000000000000000000000000000000000000000..366cef3fb46e0de0fdfc4004073bf081424f6689 --- /dev/null +++ b/visimpl/icons/toolconfig.svg @@ -0,0 +1,154 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + id="Layer_1" + x="0px" + y="0px" + viewBox="0 0 512.003 512.003" + style="enable-background:new 0 0 512.003 512.003;" + xml:space="preserve" + sodipodi:docname="toolconfig.svg" + inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"><metadata + id="metadata43"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs + id="defs41"><radialGradient + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,0,0,0.315315,0,26.81305)" + r="19.622213" + fy="39.161163" + fx="25.455845" + cy="39.161163" + cx="25.455845" + id="radialGradient3262" + xlink:href="#linearGradient3256" /><linearGradient + id="linearGradient3256"><stop + id="stop3258" + offset="0" + style="stop-color:#000000;stop-opacity:1;" /><stop + id="stop3260" + offset="1" + style="stop-color:#000000;stop-opacity:0;" /></linearGradient><linearGradient + gradientTransform="matrix(1.241935,0,0,1.241935,-5.027508,-7.208988)" + y2="39.684914" + x2="34.534348" + y1="12.284524" + x1="14.462892" + gradientUnits="userSpaceOnUse" + id="linearGradient3281" + xlink:href="#linearGradient3264" /><linearGradient + id="linearGradient3264"><stop + id="stop3266" + offset="0" + style="stop-color:#c9c9c9;stop-opacity:1;" /><stop + style="stop-color:#f8f8f8;stop-opacity:1;" + offset="0.25" + id="stop3276" /><stop + style="stop-color:#e2e2e2;stop-opacity:1;" + offset="0.5" + id="stop3272" /><stop + id="stop3274" + offset="0.75" + style="stop-color:#b0b0b0;stop-opacity:1;" /><stop + id="stop3268" + offset="1" + style="stop-color:#c9c9c9;stop-opacity:1;" /></linearGradient></defs><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1848" + inkscape:window-height="1136" + id="namedview39" + showgrid="false" + inkscape:zoom="0.83007328" + inkscape:cx="256.0015" + inkscape:cy="256.0015" + inkscape:window-x="72" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:current-layer="Layer_1" /> +<path + style="fill:#F77935;" + d="M503.187,81.861c-4.012-0.793-8.018,1.38-9.548,5.171l-39.929,98.955l-34.662-36.981 c-2.075-2.214-5.174-3.157-8.129-2.476c-2.957,0.682-5.329,2.885-6.226,5.784l-48.352,156.29l-19.445-24.206 c-1.536-1.911-3.82-3.068-6.27-3.175c-2.45-0.11-4.826,0.846-6.523,2.615l-24.949,26.021l-38.003-132.095 c-1.026-3.566-4.242-6.058-7.952-6.16c-3.674-0.091-7.059,2.207-8.28,5.711l-42.893,123.001l-25.196-17.328 c-1.923-1.322-4.304-1.796-6.59-1.315c-2.284,0.483-4.27,1.881-5.494,3.869l-40.625,65.993l-59.784-12.958 c-4.359-0.945-8.705,1.629-9.973,5.903L10.578,492.061c-0.765,2.578-0.268,5.365,1.34,7.52c1.609,2.154,4.14,3.424,6.827,3.424 H499.31c4.687,0,8.494-3.786,8.52-8.473l2.229-404.264C510.082,86.179,507.197,82.651,503.187,81.861z" + id="path2" /> + + +<g + id="g8"> +</g> +<g + id="g10"> +</g> +<g + id="g12"> +</g> +<g + id="g14"> +</g> +<g + id="g16"> +</g> +<g + id="g18"> +</g> +<g + id="g20"> +</g> +<g + id="g22"> +</g> +<g + id="g24"> +</g> +<g + id="g26"> +</g> +<g + id="g28"> +</g> +<g + id="g30"> +</g> +<g + id="g32"> +</g> +<g + id="g34"> +</g> +<g + id="g36"> +</g> +<g + transform="matrix(7.5365445,0,0,7.4517263,134.63166,136.06701)" + id="layer1"><path + inkscape:connector-curvature="0" + transform="translate(-0.883885,2.474874)" + d="m 45.078058,39.161163 a 19.622213,6.187185 0 1 1 -39.2444265,0 19.622213,6.187185 0 1 1 39.2444265,0 z" + id="path3254" + style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.40909089;fill:url(#radialGradient3262);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none" /><path + inkscape:connector-curvature="0" + id="path3243" + d="M 23.25,0.46875 C 22.784561,0.50059628 22.332166,0.57268469 21.875,0.625 H 21.84375 L 20.75,6.59375 C 18.967275,6.9997399 17.290091,7.6887415 15.78125,8.625 L 10.875,5.09375 C 9.5487118,6.1234406 8.3418016,7.3243453 7.28125,8.625 l 3.40625,4.96875 c -1.0342329,1.580515 -1.8119683,3.385224 -2.25,5.28125 -7.5e-5,0.009 -6.09e-5,0.02969 0,0.03125 L 2.5,19.84375 c -0.1085533,0.886633 -0.15625,1.802939 -0.15625,2.71875 10e-8,0.7493 0.020689,1.488589 0.09375,2.21875 l 5.9375,1.0625 c 0.422279,2.061892 1.2244587,3.987512 2.34375,5.6875 L 7.1875,36.375 c 1.0113261,1.255518 2.1788917,2.398616 3.4375,3.40625 l 5,-3.4375 c 1.747433,1.114717 3.698083,1.896374 5.8125,2.28125 l 0.9375,5.90625 c 0.666183,0.06064 1.349349,0.0625 2.03125,0.0625 0.962685,-10e-7 1.882237,-0.03648 2.8125,-0.15625 l 1.125,-6.03125 C 30.351311,37.906649 32.237219,37.03996 33.875,35.875 l 4.8125,3.5 c 1.248028,-1.061797 2.389277,-2.282256 3.375,-3.59375 l -3.5,-5.0625 c 0.947853,-1.63699 1.604629,-3.443141 1.9375,-5.375 l 5.90625,-0.9375 c 0.05179,-0.616346 0.0625,-1.214087 0.0625,-1.84375 0,-1.094214 -0.127182,-2.167084 -0.28125,-3.21875 l -6,-1.09375 C 39.717306,16.513776 38.945824,14.893898 37.96875,13.4375 L 41.5,8.59375 C 40.405427,7.2551429 39.156822,6.0185688 37.78125,4.96875 l -5.09375,3.5 C 31.223504,7.6029126 29.648037,6.9385679 27.9375,6.5625 L 27,0.625 C 26.146701,0.52462461 25.286379,0.46875 24.40625,0.46875 c -0.237872,10e-9 -0.482684,-0.007485 -0.71875,0 -0.115083,0.003649 -0.228966,-0.006695 -0.34375,0 -0.03109,0.001813 -0.06272,-0.002123 -0.09375,0 z m 0.8125,15.1875 c 0.114166,-0.0058 0.228152,0 0.34375,0 3.699127,0 6.71875,3.019624 6.71875,6.71875 1e-6,3.699126 -3.019624,6.6875 -6.71875,6.6875 -3.699125,1e-6 -6.6875,-2.988374 -6.6875,-6.6875 1e-6,-3.583527 2.8046,-6.539158 6.34375,-6.71875 z" + style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:url(#linearGradient3281);fill-opacity:1;fill-rule:nonzero;stroke:#808080;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none" /><path + inkscape:connector-curvature="0" + transform="matrix(0.606518,0,0,0.606518,10.15021,7.936835)" + d="m 36.239223,23.781593 a 12.727922,12.727922 0 1 1 -25.455844,0 12.727922,12.727922 0 1 1 25.455844,0 z" + id="path3283" + style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.64772728;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:1.64875567;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none" /><path + inkscape:connector-curvature="0" + style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.34659089;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.9999997;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none" + d="M 22.557788,1.6501132 21.679599,7.4291233 C 20.008601,7.8096689 16.934874,8.9735344 15.520595,9.8511162 L 10.848562,6.3639293 C 9.6053938,7.3290873 9.5201391,7.3945394 8.5260544,8.6136804 l 3.3780526,5.0099536 c -0.969415,1.481461 -2.1338039,4.121495 -2.5518734,6.008088 0,0 -5.9194088,0.997841 -5.9194088,0.997841 -0.1017499,0.831066 -0.05285,2.609798 0.015632,3.294198 l 5.6542436,1.018588 c 0.395814,1.932669 1.8770306,5.043588 2.9261736,6.637034 l -3.575576,4.724044 c 0.9479445,1.176832 1.1376642,1.284521 2.317393,2.229005 l 4.781168,-3.50282 c 1.637918,1.044855 4.889033,2.315886 6.870935,2.676641 l 0.784687,5.706254 c 0.624432,0.05684 2.349481,0.216281 3.221443,0.10402 l 0.878188,-5.940154 c 1.881743,-0.468289 5.13316,-1.80296 6.668298,-2.89491 l 4.776055,3.450808 c 1.169811,-0.995251 1.180292,-1.145216 2.104238,-2.374516 l -3.539198,-5.030701 c 0.888449,-1.534398 2.037228,-4.535223 2.349237,-6.346009 l 5.794642,-0.961463 c 0.04855,-0.577719 0.05091,-2.188789 -0.0935,-3.174545 L 39.463105,19.226449 C 39.022378,17.599038 37.509894,14.666467 36.594056,13.301345 L 40.346408,8.5773019 C 39.320436,7.3225876 38.938964,7.150431 37.649602,6.1664065 L 32.707289,9.7056032 C 31.335043,8.8940304 28.598675,7.6568558 26.995341,7.3043568 L 26.122266,1.6501132 c -0.799821,-0.094085 -3.107395,-0.052306 -3.564478,0 z" + id="path3285" /></g></svg> \ No newline at end of file diff --git a/visimpl/resources.qrc b/visimpl/resources.qrc index bf14017fca331fce7e44ac924c5121b27a43c3b9..efa370bf25914c07a975b40cd6a8b841a4830ea8 100644 --- a/visimpl/resources.qrc +++ b/visimpl/resources.qrc @@ -27,6 +27,7 @@ <file>icons/trash.svg</file> <file>icons/stackviz.svg</file> <file>icons/recorder.svg</file> + <file>icons/toolconfig.svg</file> <file>visimpl.png</file> </qresource> </RCC> diff --git a/visimpl/visimpl.ui b/visimpl/visimpl.ui index 6a709a145a7e9e25561c871e32d4dec954ce54fc..7a412dd92632b6de66c91f5dbe2f82f70fb25ce9 100644 --- a/visimpl/visimpl.ui +++ b/visimpl/visimpl.ui @@ -79,6 +79,7 @@ <addaction name="actionStackVizShowDataManager"/> <addaction name="actionStackVizFocusOnPlayhead"/> <addaction name="actionStackVizFollowPlayHead"/> + <addaction name="actionStackVizShowPanels"/> </widget> <addaction name="menuFile"/> <addaction name="menuOptions"/> @@ -115,6 +116,7 @@ <addaction name="separator"/> <addaction name="actionStackVizShowDataManager"/> <addaction name="actionStackVizFillPlots"/> + <addaction name="actionStackVizShowPanels"/> <addaction name="separator"/> <addaction name="actionStackVizFocusOnPlayhead"/> <addaction name="actionStackVizFollowPlayHead"/> @@ -509,6 +511,24 @@ <string>Follow playhead</string> </property> </action> + <action name="actionStackVizShowPanels"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>true</bool> + </property> + <property name="icon"> + <iconset resource="resources.qrc"> + <normaloff>:/icons/toolconfig.svg</normaloff>:/icons/toolconfig.svg</iconset> + </property> + <property name="text"> + <string>Show StackViz Panels</string> + </property> + <property name="toolTip"> + <string>Shows/Hides the StackViz configuration panels.</string> + </property> + </action> </widget> <resources> <include location="resources.qrc"/>