├── bin ├── x64 │ ├── hdf.dll │ ├── hdf5.dll │ ├── jpeg.dll │ ├── xdr.dll │ ├── Qt6Core.dll │ ├── Qt6Gui.dll │ ├── hdf5_hl.dll │ ├── libcurl.dll │ ├── mfhdf.dll │ ├── netcdf.dll │ ├── zlib1.dll │ ├── PlotCFTS.exe │ ├── hdf5_cpp.dll │ ├── msvcp140.dll │ ├── Qt6Widgets.dll │ ├── hdf5_hl_cpp.dll │ ├── hdf5_tools.dll │ ├── vcruntime140.dll │ ├── vcruntime140_1.dll │ ├── Qt6PrintSupport.dll │ ├── platforms │ │ ├── qdirect2d.dll │ │ ├── qminimal.dll │ │ ├── qwindows.dll │ │ └── qoffscreen.dll │ └── styles │ │ ├── plotcfts_style_cms.qss │ │ ├── plotcfts_style_dark_fusion.qss │ │ ├── plotcfts_style_enabled_disabled.qss │ │ ├── plotcfts_style_dark_orange.qss │ │ └── plotcfts_style.qss └── ucrt64 │ ├── Qt6Gui.dll │ ├── PlotCFTS.exe │ ├── Qt6Core.dll │ ├── Qt6Widgets.dll │ ├── Qt6PrintSupport.dll │ ├── doc │ └── plotcfts_um.pdf │ └── platforms │ ├── qdirect2d.dll │ ├── qminimal.dll │ ├── qwindows.dll │ └── qoffscreen.dll ├── doc ├── plotcfts_um.pdf ├── plotcfts_um.tex ├── pictures │ ├── main.png │ ├── plot.png │ ├── menu_file.png │ ├── menu_help.png │ ├── menu_export.png │ ├── status_bar.png │ ├── group_plotting.png │ ├── menu_file_open.png │ ├── multiple_yaxis.png │ ├── plot_velocity.png │ ├── menu_export_csv.png │ ├── menu_help_about.png │ ├── plot_context_menu.png │ ├── plot_zoom_x_axis.png │ ├── plot_zoom_y_axis.png │ ├── message_not_cf_file.png │ ├── plot_selected_graph.png │ ├── plot_selected_line.png │ ├── menu_help_user_manual.png │ ├── plot_selected_x_axis.png │ ├── plot_selected_y_axis.png │ ├── group_filenames_tooltip.png │ ├── group_global_attributes.png │ ├── group_select_time_series.png │ ├── plot_zoom_edit_graph_name.png │ ├── group_filenames_context_menu.png │ ├── group_parameter_location_time.png │ ├── plot_double_click_selected_graph.png │ ├── plot_zoom_point_multiplication.png │ └── plotcfts_with_chinese_karakters2.png └── uml_qgis_his_cf.uxf ├── lib └── x64 │ ├── debug │ └── netcdf.lib │ └── release │ └── netcdf.lib ├── packages ├── include │ ├── version_number.ini │ ├── plot_cf_time_series_version.rc.vcs │ ├── program_arguments.h │ ├── resource.h │ ├── read_json.h │ ├── plot_cf_time_series_version.h.vcs │ ├── time_series_plot.h │ ├── perf_timer.h │ ├── cf_time_series.h │ └── mainwindow.h ├── src │ ├── vsi.xpm │ ├── read_json.cpp │ ├── plot_cf_time_series_version.cpp │ ├── perf_timer.cpp │ ├── main.cpp │ └── time_series_plot.cpp ├── plot_cf_time_series.vcxproj.filters ├── CMakeLists.txt └── plot_cf_time_series.vcxproj ├── scripts ├── git_insert_hash.cmd └── read_ini.cmd ├── .gitignore ├── sonar-project.properties ├── cmake ├── DefaultCXX.cmake ├── DefaultFortran.cmake ├── Default.cmake └── Utils.cmake ├── dispatch_plotcfts.bat ├── plot_cf_time_series.sln ├── CMakeLists.txt ├── README.md ├── .github └── workflows │ └── build.yml └── LICENSE /bin/x64/hdf.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/hdf.dll -------------------------------------------------------------------------------- /bin/x64/hdf5.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/hdf5.dll -------------------------------------------------------------------------------- /bin/x64/jpeg.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/jpeg.dll -------------------------------------------------------------------------------- /bin/x64/xdr.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/xdr.dll -------------------------------------------------------------------------------- /bin/x64/Qt6Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/Qt6Core.dll -------------------------------------------------------------------------------- /bin/x64/Qt6Gui.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/Qt6Gui.dll -------------------------------------------------------------------------------- /bin/x64/hdf5_hl.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/hdf5_hl.dll -------------------------------------------------------------------------------- /bin/x64/libcurl.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/libcurl.dll -------------------------------------------------------------------------------- /bin/x64/mfhdf.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/mfhdf.dll -------------------------------------------------------------------------------- /bin/x64/netcdf.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/netcdf.dll -------------------------------------------------------------------------------- /bin/x64/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/zlib1.dll -------------------------------------------------------------------------------- /doc/plotcfts_um.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/plotcfts_um.pdf -------------------------------------------------------------------------------- /doc/plotcfts_um.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/plotcfts_um.tex -------------------------------------------------------------------------------- /bin/ucrt64/Qt6Gui.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/ucrt64/Qt6Gui.dll -------------------------------------------------------------------------------- /bin/x64/PlotCFTS.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/PlotCFTS.exe -------------------------------------------------------------------------------- /bin/x64/hdf5_cpp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/hdf5_cpp.dll -------------------------------------------------------------------------------- /bin/x64/msvcp140.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/msvcp140.dll -------------------------------------------------------------------------------- /doc/pictures/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/main.png -------------------------------------------------------------------------------- /doc/pictures/plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/plot.png -------------------------------------------------------------------------------- /bin/ucrt64/PlotCFTS.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/ucrt64/PlotCFTS.exe -------------------------------------------------------------------------------- /bin/ucrt64/Qt6Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/ucrt64/Qt6Core.dll -------------------------------------------------------------------------------- /bin/x64/Qt6Widgets.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/Qt6Widgets.dll -------------------------------------------------------------------------------- /bin/x64/hdf5_hl_cpp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/hdf5_hl_cpp.dll -------------------------------------------------------------------------------- /bin/x64/hdf5_tools.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/hdf5_tools.dll -------------------------------------------------------------------------------- /bin/x64/vcruntime140.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/vcruntime140.dll -------------------------------------------------------------------------------- /lib/x64/debug/netcdf.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/lib/x64/debug/netcdf.lib -------------------------------------------------------------------------------- /bin/ucrt64/Qt6Widgets.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/ucrt64/Qt6Widgets.dll -------------------------------------------------------------------------------- /bin/x64/vcruntime140_1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/vcruntime140_1.dll -------------------------------------------------------------------------------- /doc/pictures/menu_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/menu_file.png -------------------------------------------------------------------------------- /doc/pictures/menu_help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/menu_help.png -------------------------------------------------------------------------------- /lib/x64/release/netcdf.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/lib/x64/release/netcdf.lib -------------------------------------------------------------------------------- /bin/x64/Qt6PrintSupport.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/Qt6PrintSupport.dll -------------------------------------------------------------------------------- /doc/pictures/menu_export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/menu_export.png -------------------------------------------------------------------------------- /doc/pictures/status_bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/status_bar.png -------------------------------------------------------------------------------- /packages/include/version_number.ini: -------------------------------------------------------------------------------- 1 | [versionnumbers] 2 | major = 4 3 | minor = 05 4 | revision = 00 5 | -------------------------------------------------------------------------------- /scripts/git_insert_hash.cmd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/scripts/git_insert_hash.cmd -------------------------------------------------------------------------------- /bin/ucrt64/Qt6PrintSupport.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/ucrt64/Qt6PrintSupport.dll -------------------------------------------------------------------------------- /bin/ucrt64/doc/plotcfts_um.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/ucrt64/doc/plotcfts_um.pdf -------------------------------------------------------------------------------- /bin/x64/platforms/qdirect2d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/platforms/qdirect2d.dll -------------------------------------------------------------------------------- /bin/x64/platforms/qminimal.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/platforms/qminimal.dll -------------------------------------------------------------------------------- /bin/x64/platforms/qwindows.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/platforms/qwindows.dll -------------------------------------------------------------------------------- /doc/pictures/group_plotting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/group_plotting.png -------------------------------------------------------------------------------- /doc/pictures/menu_file_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/menu_file_open.png -------------------------------------------------------------------------------- /doc/pictures/multiple_yaxis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/multiple_yaxis.png -------------------------------------------------------------------------------- /doc/pictures/plot_velocity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/plot_velocity.png -------------------------------------------------------------------------------- /bin/ucrt64/platforms/qdirect2d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/ucrt64/platforms/qdirect2d.dll -------------------------------------------------------------------------------- /bin/ucrt64/platforms/qminimal.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/ucrt64/platforms/qminimal.dll -------------------------------------------------------------------------------- /bin/ucrt64/platforms/qwindows.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/ucrt64/platforms/qwindows.dll -------------------------------------------------------------------------------- /bin/x64/platforms/qoffscreen.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/x64/platforms/qoffscreen.dll -------------------------------------------------------------------------------- /doc/pictures/menu_export_csv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/menu_export_csv.png -------------------------------------------------------------------------------- /doc/pictures/menu_help_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/menu_help_about.png -------------------------------------------------------------------------------- /doc/pictures/plot_context_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/plot_context_menu.png -------------------------------------------------------------------------------- /doc/pictures/plot_zoom_x_axis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/plot_zoom_x_axis.png -------------------------------------------------------------------------------- /doc/pictures/plot_zoom_y_axis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/plot_zoom_y_axis.png -------------------------------------------------------------------------------- /bin/ucrt64/platforms/qoffscreen.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/bin/ucrt64/platforms/qoffscreen.dll -------------------------------------------------------------------------------- /doc/pictures/message_not_cf_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/message_not_cf_file.png -------------------------------------------------------------------------------- /doc/pictures/plot_selected_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/plot_selected_graph.png -------------------------------------------------------------------------------- /doc/pictures/plot_selected_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/plot_selected_line.png -------------------------------------------------------------------------------- /doc/pictures/menu_help_user_manual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/menu_help_user_manual.png -------------------------------------------------------------------------------- /doc/pictures/plot_selected_x_axis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/plot_selected_x_axis.png -------------------------------------------------------------------------------- /doc/pictures/plot_selected_y_axis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/plot_selected_y_axis.png -------------------------------------------------------------------------------- /doc/pictures/group_filenames_tooltip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/group_filenames_tooltip.png -------------------------------------------------------------------------------- /doc/pictures/group_global_attributes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/group_global_attributes.png -------------------------------------------------------------------------------- /doc/pictures/group_select_time_series.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/group_select_time_series.png -------------------------------------------------------------------------------- /doc/pictures/plot_zoom_edit_graph_name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/plot_zoom_edit_graph_name.png -------------------------------------------------------------------------------- /doc/pictures/group_filenames_context_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/group_filenames_context_menu.png -------------------------------------------------------------------------------- /doc/pictures/group_parameter_location_time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/group_parameter_location_time.png -------------------------------------------------------------------------------- /doc/pictures/plot_double_click_selected_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/plot_double_click_selected_graph.png -------------------------------------------------------------------------------- /doc/pictures/plot_zoom_point_multiplication.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/plot_zoom_point_multiplication.png -------------------------------------------------------------------------------- /doc/pictures/plotcfts_with_chinese_karakters2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/doc/pictures/plotcfts_with_chinese_karakters2.png -------------------------------------------------------------------------------- /packages/include/plot_cf_time_series_version.rc.vcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deltares/PlotCFTS/master/packages/include/plot_cf_time_series_version.rc.vcs -------------------------------------------------------------------------------- /packages/include/program_arguments.h: -------------------------------------------------------------------------------- 1 | /* Nefis data structure */ 2 | 3 | #ifndef __program_arguments__ 4 | #define __program_arguments__ 5 | 6 | struct _program_arguments{ 7 | QFileInfo * ncfile; 8 | FILE_TYPE type; 9 | }; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vs/ 2 | packages/generated/moc_mainwindow.cpp 3 | packages/generated/moc_qcustomplot.cpp 4 | packages/generated/moc_time_series_plot.cpp 5 | *.obj 6 | packages/Release/ 7 | packages/plot_cf_time_series.vcxproj.user 8 | packages/include/plot_cf_time_series_version.h 9 | packages/include/plot_cf_time_series_version.rc 10 | /_build 11 | -------------------------------------------------------------------------------- /sonar-project.properties: -------------------------------------------------------------------------------- 1 | sonar.projectKey=Deltares_PlotCFTS 2 | sonar.organization=deltares 3 | 4 | # This is the name and version displayed in the SonarCloud UI. 5 | #sonar.projectName=PlotCFTS 6 | #sonar.projectVersion=1.0 7 | 8 | # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. 9 | #sonar.sources=. 10 | 11 | # Encoding of the source code. Default is default system encoding 12 | #sonar.sourceEncoding=UTF-8 -------------------------------------------------------------------------------- /packages/include/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by version_number.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /cmake/DefaultCXX.cmake: -------------------------------------------------------------------------------- 1 | include("${CMAKE_CURRENT_LIST_DIR}/Default.cmake") 2 | 3 | set_config_specific_property("OUTPUT_DIRECTORY" "${CMAKE_SOURCE_DIR}$<$>:/${CMAKE_VS_PLATFORM_NAME}>/${PROPS_CONFIG}") 4 | 5 | if(MSVC) 6 | create_property_reader("DEFAULT_CXX_EXCEPTION_HANDLING") 7 | create_property_reader("DEFAULT_CXX_DEBUG_INFORMATION_FORMAT") 8 | 9 | set_target_properties("${PROPS_TARGET}" PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") 10 | set_config_specific_property("DEFAULT_CXX_EXCEPTION_HANDLING" "/EHsc") 11 | set_config_specific_property("DEFAULT_CXX_DEBUG_INFORMATION_FORMAT" "/Zi") 12 | endif() 13 | -------------------------------------------------------------------------------- /cmake/DefaultFortran.cmake: -------------------------------------------------------------------------------- 1 | include("${CMAKE_CURRENT_LIST_DIR}/Default.cmake") 2 | 3 | set_config_specific_property("OUTPUT_DIRECTORY" "${CMAKE_CURRENT_SOURCE_DIR}$<$>:/${CMAKE_VS_PLATFORM_NAME}>/${PROPS_CONFIG}") 4 | 5 | get_target_property(${PROPS_TARGET}_BINARY_DIR ${PROPS_TARGET} BINARY_DIR) 6 | set(DEFAULT_FORTRAN_MODULES_DIR "${${PROPS_TARGET}_BINARY_DIR}/${PROPS_TARGET}.Modules.dir") 7 | set_target_properties(${PROPS_TARGET} PROPERTIES Fortran_MODULE_DIRECTORY ${DEFAULT_FORTRAN_MODULES_DIR}) 8 | 9 | if(${CMAKE_GENERATOR} MATCHES "Visual Studio") 10 | # Hack for visual studio generator (https://gitlab.kitware.com/cmake/cmake/issues/19552) 11 | add_custom_command(TARGET ${PROPS_TARGET} PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory $/${CMAKE_CFG_INTDIR}) 12 | endif() -------------------------------------------------------------------------------- /packages/include/read_json.h: -------------------------------------------------------------------------------- 1 | #ifndef __READ_JSON_H 2 | #define __READ_JSON_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | using namespace boost; 9 | using namespace property_tree; 10 | 11 | class READ_JSON 12 | { 13 | public: 14 | READ_JSON(std::string); 15 | ~READ_JSON(); 16 | long get(std::string, std::vector &); 17 | long get(std::string, std::vector &); 18 | long find(std::string); 19 | 20 | void prop_get_json(boost::property_tree::ptree &, const std::string, std::vector &); 21 | void prop_get_json(boost::property_tree::ptree &, const std::string, std::vector &); 22 | template void gett(std::string, std::vector); 23 | 24 | private: 25 | std::string m_filename; 26 | boost::property_tree::ptree m_ptrtree; 27 | }; 28 | #endif // __READ_JSON_H 29 | -------------------------------------------------------------------------------- /dispatch_plotcfts.bat: -------------------------------------------------------------------------------- 1 | arem copy to local "c:\Program Files\Deltares" needed for QGIS 2 | copy .\bin\x64\release\plotcfts.exe "c:\Program Files\Deltares\plotcfts\plotcfts.exe" 3 | copy .\bin\x64\release\*.dll "c:\Program Files\Deltares\plotcfts\*.*" 4 | copy .\bin\x64\release\platforms\*.dll "c:\Program Files\Deltares\plotcfts\platforms\*.*" 5 | copy .\doc\plotcfts_um.pdf "c:\Program Files\Deltares\plotcfts\doc\plotcfts_um.pdf" 6 | 7 | rem copy to Bulletin 8 | copy .\bin\x64\release\plotcfts.exe n:\Deltabox\Bulletin\mooiman\programs\PlotCFTS_4.04.03\plotcfts.exe 9 | copy .\bin\x64\release\*.dll n:\Deltabox\Bulletin\mooiman\programs\PlotCFTS_4.04.03\*.* 10 | copy .\bin\x64\release\platforms\*.dll n:\Deltabox\Bulletin\mooiman\programs\PlotCFTS_4.04.03\platforms\*.* 11 | copy .\doc\plotcfts_um.pdf n:\Deltabox\Bulletin\mooiman\programs\PlotCFTS_4.04.03\doc\plotcfts_um.pdf 12 | -------------------------------------------------------------------------------- /packages/include/plot_cf_time_series_version.h.vcs: -------------------------------------------------------------------------------- 1 | #ifndef plot_cf_time_series_VERSION 2 | #define plot_cf_time_series_VERSION 3 | 4 | #define plot_cf_time_series_major "VN_MAJOR" 5 | #define plot_cf_time_series_minor "VN_MINOR" 6 | #define plot_cf_time_series_revision "VN_REVISION" 7 | #define plot_cf_time_series_build "VCS_BUILD_HASH" 8 | 9 | #define plot_cf_time_series_company "Deltares" 10 | #define plot_cf_time_series_company_url "https://www.deltares.nl" 11 | #define plot_cf_time_series_source_url "VCS_SOURCE_URL" 12 | #define plot_cf_time_series_program "PlotCFTS" 13 | 14 | /*=================================================== DO NOT MAKE CHANGES BELOW THIS LINE ===================================================================== */ 15 | 16 | extern "C" { 17 | extern char * getcompanystring_plot_cf_time_series(void); 18 | extern char * getfullversionstring_plot_cf_time_series(void); 19 | extern char * getprogramstring_plot_cf_time_series(void); 20 | extern char * getversionstring_plot_cf_time_series(void); 21 | extern char * getsourceurlstring_plot_cf_time_series(void); 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /plot_cf_time_series.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.902 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "plot_cf_time_series", "packages\plot_cf_time_series.vcxproj", "{E416BD51-4B40-316F-9703-D9547497EF04}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {E416BD51-4B40-316F-9703-D9547497EF04}.Debug|x64.ActiveCfg = Debug|x64 15 | {E416BD51-4B40-316F-9703-D9547497EF04}.Debug|x64.Build.0 = Debug|x64 16 | {E416BD51-4B40-316F-9703-D9547497EF04}.Release|x64.ActiveCfg = Release|x64 17 | {E416BD51-4B40-316F-9703-D9547497EF04}.Release|x64.Build.0 = Release|x64 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | Qt5Version = Qt5.12.6 24 | SolutionGuid = {EF4C37BE-FE80-4C47-BF06-18042A47E8A3} 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.30.0) 2 | 3 | project(PlotCFTS VERSION 4.4.0 LANGUAGES CXX) 4 | 5 | set(CMAKE_CXX_STANDARD 17) 6 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 7 | set(CMAKE_CXX_EXTENSIONS OFF) 8 | if (MSVC) 9 | message("*** MSVC ") 10 | set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/../bin/x64) 11 | set(CMAKE_CXX_COMPILER cl) 12 | set(CMAKE_BUILD_TYPE Release) 13 | else() 14 | message("*** UCRT64 ") 15 | set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/../bin/ucrt64) 16 | set(CMAKE_CXX_COMPILER g++) 17 | endif() 18 | 19 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 20 | 21 | find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets PrintSupport) 22 | if (Qt6_FOUND) 23 | message("*** Qt6 found") 24 | else() 25 | message("*** Qt6 not found") 26 | endif() 27 | 28 | find_package(Boost 1.85.0 REQUIRED COMPONENTS 29 | date_time filesystem iostreams) 30 | if(Boost_FOUND) 31 | message("*** Boost found") 32 | else() 33 | message("*** Boost not found") 34 | endif() 35 | 36 | find_package(netCDF 4.9.2 REQUIRED) 37 | if(netCDF_FOUND) 38 | message("*** netCDF found") 39 | message(STATUS " ${netCDF_LIBRARIES}") 40 | message(STATUS " ${netCDF_INCLUDE_DIR}") 41 | else() 42 | message("*** netCDF not found") 43 | endif() 44 | 45 | add_subdirectory(packages) 46 | 47 | -------------------------------------------------------------------------------- /packages/src/vsi.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char *vsi[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "32 32 4 1 ", 5 | " c black", 6 | ". c yellow", 7 | "X c white", 8 | "o c None", 9 | /* pixels */ 10 | "...............................o", 11 | "...............................o", 12 | "...............................o", 13 | "... ...o", 14 | "... ..... ..... ..... ..... ...o", 15 | "... ..... ..... ..... ..... ...o", 16 | "... ..... ..... ..... ..... ...o", 17 | "... ..... .... ... ... ..o", 18 | "... ..... ... . . .o", 19 | "... .o", 20 | "... ..... ... . . .o", 21 | "... ..... .... ... ... ..o", 22 | "... ..... ..... ..... ..... ...o", 23 | "... .... .... ....XXX.... ...o", 24 | "... ... ... ...XXXXX... ...o", 25 | "... XXXXX ...o", 26 | "... ... ... ...XXXXX... ...o", 27 | "... .... .... ....XXX.... ...o", 28 | "... ..... ..... ..... ..... ...o", 29 | "... ....XXX...XXX.... ..... ...o", 30 | "... ...XXXXX.XXXXX... ..... ...o", 31 | "... XXXXX XXXXX ...o", 32 | "... ...XXXXX.XXXXX... ..... ...o", 33 | "... ....XXX...XXX.... ..... ...o", 34 | "... ..... ..... ..... ..... ...o", 35 | "... ..... ..... ..... ..... ...o", 36 | "... ..... ..... ..... ..... ...o", 37 | "... ...o", 38 | "...............................o", 39 | "...............................o", 40 | "...............................o", 41 | "oooooooooooooooooooooooooooooooo" 42 | }; 43 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PlotCFTS 2 | Plot program to plot time series which are Climate and Forecast compliant. 3 | 4 | To build the program PlotCTS you have to install QT 6.8.2 LTS, BOOST 1.87.0 and netCDF4. 5 | The executable plot_cf_time_series.exe will be placed in folder bin/x64/debug or bin/x64/release. 6 | The batch file dispatch_plotcfts.bat is used to dispatch and rename the executable to plotcfts.exe 7 | 8 | ![alt tag](doc/pictures/plotcfts_with_chinese_karakters2.png) 9 | 10 | ## Development environment 11 | At this moment the environment is based on Visual Studio 2022 12 | 13 | ## Environment variables 14 | Environment variables (example) 15 | QT6DIR=c:\Qt\qt6.8.2\6.8.2\msvc2022_64\ 16 | 17 | ## Link Libraries 18 | netCDF library: 19 | debug and release folder contain the same libraries 20 | ./lib/x64/release/netcdf.lib 21 | ./lib/x64/debug/netcdf.lib 22 | 23 | ## Runtime libraries 24 | On the debug and release folder you need the runtime libraries of QT 6.8.2 and netCDF4. 25 | Only release folder is given. 26 | ./release/platforms/qdirect2d.dll 27 | qminimal.dll 28 | qoffscreen.dll 29 | qwindows.dll 30 | ./release/hdf.dll 31 | hdf5.dll 32 | hdf5_cpp.dll 33 | hdf5_hl.dll 34 | hdf5_hl_cpp.dll 35 | hdf5_tools.dll 36 | jpeg.dll 37 | libcurl.dll 38 | mfhdf.dll 39 | msvcp140.dll 40 | netcdf.dll 41 | Qt5Core.dll 42 | Qt5Gui.dll 43 | Qt5PrintSupport.dll 44 | Qt5Widgets.dll 45 | style.qss1 46 | xdr.dll 47 | zlib1.dll 48 | 49 | end document 50 | 51 | -------------------------------------------------------------------------------- /packages/include/time_series_plot.h: -------------------------------------------------------------------------------- 1 | #ifndef TIME_SERIES_PLOT_H 2 | #define TIME_SERIES_PLOT_H 3 | 4 | #include 5 | #include 6 | #include "qcustomplot.h" 7 | #include "cf_time_series.h" 8 | #include "perf_timer.h" 9 | 10 | 11 | class TSPlot : public QMainWindow 12 | { 13 | Q_OBJECT 14 | 15 | private slots: 16 | void axisLabelDoubleClick(QCPAxis* axis, QCPAxis::SelectablePart part); 17 | void legendDoubleClick(QCPLegend* legend, QCPAbstractLegendItem* item); 18 | void titleDoubleClick(QMouseEvent*); 19 | void selectionChanged(); 20 | void mousePress(); 21 | void mouseWheel(); 22 | void contextMenuRequest(QPoint pos); 23 | void graphClicked(QCPAbstractPlottable *plottable, int dataIndex); 24 | void graphDoubleClicked(QCPAbstractPlottable *plottable, int dataIndex); 25 | void moveLegend(); 26 | void contextMenuRescaleAxes(); 27 | void contextMenuSaveAsPDF(); 28 | void contextMenuRemoveSelectedGraph(); 29 | 30 | void onMouseMove(QMouseEvent *); 31 | 32 | public: 33 | TSPlot(QWidget *, QIcon, int); 34 | ~TSPlot(); 35 | void add_to_plot(TSFILE *, QListWidget *, QListWidget *, QListWidget *, QComboBox *, QSpinBox *, QPushButton *); 36 | void add_data_to_plot(); 37 | int get_active_plot_nr(); 38 | void draw_plot(int, QString, QString); 39 | void draw_data(QVector, QVector); 40 | QWidget * get_parent(); 41 | 42 | private: 43 | void TimeSeriesGraph(int, int, int, int); 44 | QString set_yaxis_label(QString, QString, QString); 45 | QString get_yaxis_label(QString, QString); 46 | 47 | TSFILE * tsfile; 48 | QCustomPlot * customPlot; 49 | QIcon icon; 50 | int current_plot; 51 | int has_focus; 52 | QWidget * parent; 53 | QListWidget * lb_parameters; 54 | QListWidget * lb_locations; 55 | QListWidget * lb_times; 56 | QComboBox * cb_parloc; 57 | QSpinBox * sb_layer; 58 | QPushButton * pb_add_to_plot; 59 | QString tmp_label; 60 | QString m_yaxis_label; 61 | long _nr_y_axis_labels; 62 | long _nr_graphs; 63 | long _nr_max_ylabel; 64 | int plot_width; 65 | int plot_height; 66 | 67 | QMap _ylabel_dic; 68 | }; 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build and SonarCloud 2 | on: 3 | push: 4 | branches: [ main ] 5 | pull_request: 6 | branches: [ main ] 7 | workflow_dispatch: 8 | # Allow manual trigger for debugging the workflow. 9 | env: 10 | SONAR_WRAPPER_URL: https://sonarcloud.io/static/cpp/build-wrapper-win-x86.zip 11 | SONAR_SCANNER_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-windows.zip 12 | jobs: 13 | CIChecks: 14 | runs-on: windows-latest 15 | steps: 16 | - name: Checkout branch 17 | uses: actions/checkout@master 18 | with: 19 | # Disabling shallow clone is required to report the correct blame information. 20 | fetch-depth: 0 21 | - name: Add msbuild to PATH 22 | uses: microsoft/setup-msbuild@v1.0.2 23 | - name: Environment 24 | shell: bash 25 | run: | 26 | mkdir -p build 27 | org="$(cut -d/ -f1 <<< "$GITHUB_REPOSITORY")" 28 | repo="$(cut -d/ -f2 <<< "$GITHUB_REPOSITORY")" 29 | echo "SONAR_ORGANIZATION=${org}" >> "$GITHUB_ENV" 30 | echo "SONAR_PROJECT_KEY=${org}_${repo}" >> "$GITHUB_ENV" 31 | - name: Install Sonar Scanner 32 | run: | 33 | Invoke-WebRequest -Uri "${{ env.SONAR_WRAPPER_URL }}" -OutFile build/build-wrapper.zip 34 | Invoke-WebRequest -Uri "${{ env.SONAR_SCANNER_URL }}" -OutFile build/sonar-scanner.zip 35 | Expand-Archive -LiteralPath build/build-wrapper.zip -DestinationPath build 36 | Expand-Archive -LiteralPath build/sonar-scanner.zip -DestinationPath build 37 | - name: Build with Sonar Wrapper 38 | shell: cmd 39 | run: | 40 | SET PATH=%PATH%;%cd%\build\build-wrapper-win-x86 41 | build-wrapper-win-x86-64 --out-dir build\bw_output build-all.bat 42 | - name: Prepare Sonar Scanner 43 | shell: bash 44 | run: | 45 | set -x 46 | cd build 47 | ls -la bw_output 48 | mv sonar-scanner-*-windows sonar-scanner 49 | - name: Sonar Scanner 50 | env: 51 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 52 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} 53 | shell: cmd 54 | run: | 55 | SET PATH=%PATH%;%cd%\build\sonar-scanner\bin 56 | ECHO PATH=%PATH% 57 | ECHO DIR %cd%\build\bw_output\ 58 | DIR %cd%\build\bw_output\ 59 | sonar-scanner.bat -Dsonar.cfamily.build-wrapper-output=%cd%\build\bw_output 60 | -------------------------------------------------------------------------------- /packages/plot_cf_time_series.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Source Files 6 | 7 | 8 | Source Files 9 | 10 | 11 | Source Files 12 | 13 | 14 | Source Files 15 | 16 | 17 | Source Files 18 | 19 | 20 | Source Files 21 | 22 | 23 | Generated Files 24 | 25 | 26 | Generated Files 27 | 28 | 29 | Generated Files 30 | 31 | 32 | Source Files 33 | 34 | 35 | Source Files 36 | 37 | 38 | 39 | 40 | Header Files 41 | 42 | 43 | Header Files 44 | 45 | 46 | Header Files 47 | 48 | 49 | Header Files 50 | 51 | 52 | 53 | 54 | Header Files 55 | 56 | 57 | Header Files 58 | 59 | 60 | Header Files 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | {db90bee9-88fe-4e4b-8e10-d80bcd4300c2} 69 | 70 | 71 | {b693a3a2-1a5e-4013-b9c7-01bcb3125249} 72 | 73 | 74 | {1ddc7630-21fe-4ec8-b425-5d9fabc9dac9} 75 | 76 | 77 | -------------------------------------------------------------------------------- /packages/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | message("*** Enter packages directory") 2 | 3 | set(CMAKE_AUTOMOC ON) 4 | # set(CMAKE_AUTORCC ON) 5 | # set(CMAKE_AUTOUIC ON) 6 | 7 | set(exe_name PlotCFTS) 8 | 9 | # include_directories(include) 10 | set(headers_files 11 | include/mainwindow.h 12 | include/qcustomplot.h 13 | include/cf_time_series.h 14 | include/netcdf.h 15 | include/program_arguments.h 16 | include/perf_timer.h 17 | include/read_json.h 18 | include/time_series_plot.h 19 | include/plot_cf_time_series_version.h 20 | # include/plot_cf_time_series_version.rc 21 | include/resource.h 22 | ) 23 | 24 | set(no_group_source_files 25 | "include/version_number.ini" 26 | ) 27 | 28 | set(source_files 29 | src/cf_timeseries.cpp 30 | src/main.cpp 31 | src/mainwindow.cpp 32 | src/perf_timer.cpp 33 | src/plot_cf_time_series_version.cpp 34 | src/qcustomplot.cpp 35 | src/read_json.cpp 36 | src/time_series_plot.cpp 37 | ) 38 | 39 | qt_add_executable(${exe_name} ${source_files} ${headers_files}) 40 | add_custom_target( 41 | myHeaderTarget 42 | COMMAND cmd /c ${CMAKE_CURRENT_SOURCE_DIR}\\..\\scripts\\git_insert_hash.cmd ..\\..\\packages\\include plot_cf_time_series_version.h 43 | ) 44 | add_dependencies(${exe_name} myHeaderTarget) 45 | add_custom_command( 46 | TARGET ${exe_name} 47 | PRE_BUILD 48 | COMMAND cmd /c ${CMAKE_CURRENT_SOURCE_DIR}\\..\\scripts\\git_insert_hash.cmd ..\\..\\packages\\include plot_cf_time_series_version.rc 49 | ) 50 | 51 | if (MSVC) 52 | message("*** MSVC ") 53 | target_include_directories(${exe_name} PUBLIC 54 | "${CMAKE_CURRENT_SOURCE_DIR}/." 55 | "${CMAKE_CURRENT_SOURCE_DIR}/include" 56 | "c:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.40.33807/include/" 57 | "c:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/ucrt/" 58 | "c:/Qt/Qt6.7.2/6.7.2/msvc2019_64" 59 | "c:/boost/boost_1_85_0/" 60 | ) 61 | else() 62 | message("*** UCRT64 ") 63 | target_include_directories(${exe_name} PUBLIC 64 | "${CMAKE_CURRENT_SOURCE_DIR}/." 65 | "${CMAKE_CURRENT_SOURCE_DIR}/include" 66 | "c:/msys64/ucrt64/include/Qt6/" 67 | "c:/msys64/ucrt64/include/boost/" 68 | ) 69 | endif() 70 | 71 | target_link_libraries(${exe_name} PRIVATE Qt6::Core) 72 | target_link_libraries(${exe_name} PRIVATE Qt6::Gui) 73 | target_link_libraries(${exe_name} PRIVATE Qt6::Widgets) 74 | target_link_libraries(${exe_name} PRIVATE Qt6::PrintSupport) 75 | if (MSVC) 76 | target_link_libraries(${exe_name} PRIVATE "c:/Program Files/netCDF 4.9.2/lib/netcdf.lib") 77 | else() 78 | target_link_libraries(${exe_name} PRIVATE netcdf) 79 | endif() 80 | 81 | set_property(TARGET ${exe_name} PROPERTY WIN32_EXECUTABLE true) 82 | 83 | set(install_dir ${CMAKE_BINARY_DIR}) 84 | set(build_dir ${CMAKE_BINARY_DIR}) 85 | install(TARGETS ${exe_name} RUNTIME DESTINATION bin) 86 | 87 | message("*** Exiting packages directory") 88 | -------------------------------------------------------------------------------- /packages/include/perf_timer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Programmer: Jan Mooiman 3 | // Date: 14 April 2021 4 | // Email: jan.mooiman@deltares.nl 5 | // 6 | #ifndef __PERF_TIMER_H__ 7 | #define __PERF_TIMER_H__ 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #define DO_TIMING 0 17 | #if DO_TIMING == 1 18 | # define TOSTRING(x) #x 19 | # define START_TIMER(x) tt = TestTimer::get_instance(); tt->start(TOSTRING(x), __FILE__, __FUNCTION__, __LINE__); 20 | # define START_TIMERN(x) TestTimer * tt = TestTimer::get_instance(); tt->start(TOSTRING(x), __FILE__, __FUNCTION__, __LINE__); 21 | # define CLEAR_TIMER() if (tt->get_count() != 0){ tt->clear(); } 22 | # define DELETE_TIMER() delete tt ; 23 | # define DELETE_TIMERN() TestTimer * tt = TestTimer::get_instance(); delete tt ; 24 | # define STOP_TIMER(x) tt->stop(TOSTRING(x)); 25 | # define PRINT_TIMER(x) tt->log(x); // parameter x is a filename 26 | # define PRINT_TIMERN(x) TestTimer * tt = TestTimer::get_instance(); tt->log(x); // paramter x is a filename 27 | #else 28 | # define START_TIMERN(x) 29 | # define START_TIMER(x) 30 | # define CLEAR_TIMER() 31 | # define DELETE_TIMER() 32 | # define DELETE_TIMERN() 33 | # define STOP_TIMER(x) 34 | # define PRINT_TIMER(x) 35 | # define PRINT_TIMERN(x) 36 | # define PRINT_TIMERS(x) 37 | #endif 38 | 39 | class Timing { 40 | public: 41 | Timing() = default; 42 | Timing(std::string name, 43 | std::string fileName, 44 | std::string functionName, 45 | int lineNumber) : 46 | level(level), name(std::move(name)), filename(std::move(fileName)), functionname(std::move(functionName)), line_number(lineNumber) 47 | { 48 | start = std::chrono::high_resolution_clock::now(); 49 | nr_calls = 1; 50 | } 51 | 52 | bool running; 53 | std::string name; 54 | int level; 55 | int line_number; 56 | int nr_calls; 57 | double elapse_time; 58 | std::string filename; 59 | std::string functionname; 60 | std::chrono::high_resolution_clock::time_point start; 61 | std::chrono::high_resolution_clock::time_point stop; 62 | }; 63 | 64 | 65 | 66 | class TestTimer 67 | { 68 | public: 69 | static TestTimer* get_instance() 70 | { 71 | if (obj == nullptr) 72 | { 73 | obj = new TestTimer(std::string("root"), 74 | std::string("---"), 75 | std::string("---"), 76 | 0); 77 | obj->m_level = 0; 78 | } 79 | object_count = 1; 80 | return obj; 81 | } 82 | 83 | int get_count(); 84 | void log(std::string); 85 | std::vector timing; 86 | 87 | TestTimer(const std::string& name, 88 | const std::string& fileName, 89 | const std::string& functionName, 90 | int lineNumber); 91 | 92 | ~TestTimer() = default; 93 | 94 | void clear(); 95 | void start(const std::string& name, const std::string& fileName, const std::string& functionName, int lineNumber); 96 | void stop(const std::string& name); 97 | 98 | private: 99 | static TestTimer * obj; 100 | static int object_count; 101 | 102 | int m_level; 103 | std::string m_name; 104 | std::string m_filename; 105 | std::string m_functionname; 106 | int m_line_number; 107 | }; 108 | #endif // __PERF_TIMER_H__ -------------------------------------------------------------------------------- /cmake/Default.cmake: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Command for variable_watch. This command issues error message, if a variable 3 | # is changed. If variable PROPERTY_READER_GUARD_DISABLED is TRUE nothing happens 4 | # variable_watch( property_reader_guard) 5 | ################################################################################ 6 | function(property_reader_guard VARIABLE ACCESS VALUE CURRENT_LIST_FILE STACK) 7 | if("${PROPERTY_READER_GUARD_DISABLED}") 8 | return() 9 | endif() 10 | 11 | if("${ACCESS}" STREQUAL "MODIFIED_ACCESS") 12 | message(FATAL_ERROR 13 | " Variable ${VARIABLE} is not supposed to be changed.\n" 14 | " It is used only for reading target property ${VARIABLE}.\n" 15 | " Use\n" 16 | " set_target_properties(\"\" PROPERTIES \"${VARIABLE}\" \"\")\n" 17 | " or\n" 18 | " set_target_properties(\"\" PROPERTIES \"${VARIABLE}_\" \"\")\n" 19 | " instead.\n") 20 | endif() 21 | endfunction() 22 | 23 | ################################################################################ 24 | # Create variable with generator expression that expands to value of 25 | # target property _. If property is empty or not set then property 26 | # is used instead. Variable has watcher property_reader_guard that 27 | # doesn't allow to edit it. 28 | # create_property_reader() 29 | # Input: 30 | # name - Name of watched property and output variable 31 | ################################################################################ 32 | function(create_property_reader NAME) 33 | set(PROPERTY_READER_GUARD_DISABLED TRUE) 34 | set(CONFIG_VALUE "$>>>") 35 | set(IS_CONFIG_VALUE_EMPTY "$") 36 | set(GENERAL_VALUE "$>") 37 | set("${NAME}" "$" PARENT_SCOPE) 38 | variable_watch("${NAME}" property_reader_guard) 39 | endfunction() 40 | 41 | ################################################################################ 42 | # Set property $_${PROPS_CONFIG_U} of ${PROPS_TARGET} to 43 | # set_config_specific_property( ) 44 | # Input: 45 | # name - Prefix of property name 46 | # value - New value 47 | ################################################################################ 48 | function(set_config_specific_property NAME VALUE) 49 | set_target_properties("${PROPS_TARGET}" PROPERTIES "${NAME}_${PROPS_CONFIG_U}" "${VALUE}") 50 | endfunction() 51 | 52 | ################################################################################ 53 | 54 | create_property_reader("TARGET_NAME") 55 | create_property_reader("OUTPUT_DIRECTORY") 56 | 57 | set_config_specific_property("TARGET_NAME" "${PROPS_TARGET}") 58 | set_config_specific_property("OUTPUT_NAME" "${TARGET_NAME}") 59 | set_config_specific_property("ARCHIVE_OUTPUT_NAME" "${TARGET_NAME}") 60 | set_config_specific_property("LIBRARY_OUTPUT_NAME" "${TARGET_NAME}") 61 | set_config_specific_property("RUNTIME_OUTPUT_NAME" "${TARGET_NAME}") 62 | 63 | set_config_specific_property("ARCHIVE_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}") 64 | set_config_specific_property("LIBRARY_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}") 65 | set_config_specific_property("RUNTIME_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}") -------------------------------------------------------------------------------- /packages/src/read_json.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | A json file parser based on boost libraries. It creates a tree structure and parses the json file. 4 | prop_get templated function does the work of extracting the numbers(integer, float or double) from the strings 5 | using c++11 regular expression functionality. 6 | */ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include "read_json.h" 18 | #include 19 | 20 | struct Getter 21 | { 22 | template 23 | static void prop_get_json(Ptree &pt, const std::string & data, std::vector & results) 24 | { 25 | try { 26 | // first strip key from data, ex. data=data.boundary.nodeid, chapter==data.boundary, key==nodeid 27 | size_t i = data.find_last_of("."); 28 | std::string chapter = data.substr(0, i); 29 | std::string key = data.substr(i + 1); 30 | auto child = pt.get_child(chapter); 31 | for (auto& p : child) 32 | { 33 | //cout << p.first.data() << ": " << p.second.data() << endl; 34 | if (p.first.data() == key) 35 | { 36 | T val = p.second.template get_value(); 37 | results.push_back(val); 38 | } 39 | } 40 | for (auto& pv : child) 41 | { 42 | //cout << endl; 43 | for (auto& p : pv.second) 44 | { 45 | //cout << p.first.data() << ": " << p.second.data() << endl; 46 | if (p.first.data() == key) 47 | { 48 | T val = p.second.template get_value(); 49 | results.push_back(val); 50 | } 51 | } 52 | } 53 | } 54 | catch (const ptree_error &e) 55 | { 56 | //cout << e.what() << endl; 57 | QString msg = QString::fromStdString(e.what()).trimmed(); 58 | #if defined DEBUG 59 | QMessageBox::warning(0, "DEBUG: READ_JSON::prop_get_json", QString("%1").arg(msg)); 60 | #endif 61 | } 62 | } 63 | }; 64 | 65 | READ_JSON::READ_JSON(std::string file_json) 66 | { 67 | m_filename = file_json; 68 | try 69 | { 70 | boost::property_tree::ptree pt; 71 | boost::property_tree::read_json(file_json, pt); 72 | m_ptrtree = pt; 73 | } 74 | catch (const ptree_error &e) 75 | { 76 | //cout << e.what() << endl; 77 | QString msg = QString::fromStdString(e.what()).trimmed(); 78 | QMessageBox::warning(0, "READ_JSON::READ_JSON", QString("%1").arg(msg)); 79 | } 80 | } 81 | READ_JSON::~READ_JSON() 82 | { 83 | ; 84 | } 85 | long READ_JSON::get(std::string data, std::vector & strJsonResults) 86 | { 87 | Getter::prop_get_json(m_ptrtree, data, strJsonResults); 88 | return 0; 89 | } 90 | long READ_JSON::get(std::string data, std::vector & strJsonResults) 91 | { 92 | Getter::prop_get_json(m_ptrtree, data, strJsonResults); 93 | return 0; 94 | } 95 | long READ_JSON::find(std::string data) 96 | { 97 | long error = 1; 98 | boost::optional c = m_ptrtree.get_optional(data); 99 | if (c.is_initialized()) 100 | { 101 | error = 0; 102 | } 103 | return error; 104 | } 105 | -------------------------------------------------------------------------------- /packages/src/plot_cf_time_series_version.cpp: -------------------------------------------------------------------------------- 1 | //---- LGPL -------------------------------------------------------------------- 2 | // 3 | // Copyright (C) Stichting Deltares, 2011-2015. 4 | // 5 | // This library is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU Lesser General Public 7 | // License as published by the Free Software Foundation version 2.1. 8 | // 9 | // This library is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | // Lesser General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public 15 | // License along with this library; if not, see . 16 | // 17 | // contact: delft3d.support@deltares.nl 18 | // Stichting Deltares 19 | // P.O. Box 177 20 | // 2600 MH Delft, The Netherlands 21 | // 22 | // All indications and logos of, and references to, "Delft3D" and "Deltares" 23 | // are registered trademarks of Stichting Deltares, and remain the property of 24 | // Stichting Deltares. All rights reserved. 25 | // 26 | //------------------------------------------------------------------------------ 27 | // $Id: plot_cf_time_series_version.cpp 1771 2019-01-28 07:29:32Z mooiman $ 28 | // $HeadURL: file:///D:/SVNrepository/examples/plot_time_series_ugrid/trunk/src/plot_cf_time_series_version.cpp $ 29 | //#include 30 | #include "string.h" 31 | #include "plot_cf_time_series_version.h" 32 | 33 | #if defined(WIN64) 34 | # define strdup _strdup 35 | #endif 36 | 37 | #if defined(LINUX64) 38 | static char plot_cf_time_series_version[] = {plot_cf_time_series_major "." plot_cf_time_series_minor "." plot_cf_time_series_revision "." plot_cf_time_series_build" (Linux64)"}; 39 | static char plot_cf_time_series_version_id[] = {"@(#)Deltares, "plot_cf_time_series_program" Version "plot_cf_time_series_major "." plot_cf_time_series_minor "." plot_cf_time_series_revision "." plot_cf_time_series_build" (Linux64), "__DATE__", "__TIME__""}; 40 | #elif defined(UCRT64) 41 | static char plot_cf_time_series_version[] = { plot_cf_time_series_major "." plot_cf_time_series_minor "." plot_cf_time_series_revision "." plot_cf_time_series_build " (Win64)" }; 42 | static char plot_cf_time_series_version_id[] = {"@(#)Deltares, " plot_cf_time_series_program " Version " plot_cf_time_series_major "." plot_cf_time_series_minor "." plot_cf_time_series_revision "." plot_cf_time_series_build " (Win64), " __DATE__ ", " __TIME__ "" }; 43 | #elif defined(WIN32) || defined(WIN64) 44 | static char plot_cf_time_series_version[] = { plot_cf_time_series_major "." plot_cf_time_series_minor "." plot_cf_time_series_revision "." plot_cf_time_series_build " (Win64)" }; 45 | static char plot_cf_time_series_version_id[] = {"@(#)Deltares, " plot_cf_time_series_program " Version " plot_cf_time_series_major "." plot_cf_time_series_minor "." plot_cf_time_series_revision "." plot_cf_time_series_build " (Win64), " __DATE__ ", " __TIME__ "" }; 46 | #else 47 | static char plot_cf_time_series_version[] = {plot_cf_time_series_major "." plot_cf_time_series_minor "." plot_cf_time_series_revision "." plot_cf_time_series_build" (Unknown)"}; 48 | static char plot_cf_time_series_version_id[] = {"@(#)Deltares, "plot_cf_time_series_program" Version "plot_cf_time_series_major "." plot_cf_time_series_minor "." plot_cf_time_series_revision "." plot_cf_time_series_build" (Unknown), "__DATE__", "__TIME__""}; 49 | #endif 50 | static char plot_cf_time_series_company_name[] = {"Deltares"}; 51 | static char plot_cf_time_series_program_name[] = { plot_cf_time_series_program }; 52 | 53 | char * getfullversionstring_plot_cf_time_series(void) 54 | { 55 | return strdup(plot_cf_time_series_version_id); 56 | }; 57 | char * getversionstring_plot_cf_time_series(void) 58 | { 59 | return strdup(plot_cf_time_series_version); 60 | }; 61 | char * getcompanystring_plot_cf_time_series(void) 62 | { 63 | return strdup(plot_cf_time_series_company_name); 64 | }; 65 | char * getprogramstring_plot_cf_time_series(void) 66 | { 67 | return strdup(plot_cf_time_series_program_name); 68 | }; 69 | char * getsourceurlstring_plot_cf_time_series(void) 70 | { 71 | return strdup(plot_cf_time_series_source_url); 72 | }; 73 | -------------------------------------------------------------------------------- /doc/uml_qgis_his_cf.uxf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 4 | 5 | UMLPackage 6 | 7 | 1012 8 | 319 9 | 154 10 | 110 11 | 12 | Observation Area 13 | -- 14 | Name 15 | Location (x,y-polygon) 16 | bg=orange 17 | 18 | 19 | 20 | UMLPackage 21 | 22 | 1012 23 | 187 24 | 154 25 | 99 26 | 27 | Observation Point 28 | -- 29 | Name 30 | Location (x,y-point) 31 | bg=orange 32 | 33 | 34 | 35 | UMLPackage 36 | 37 | 99 38 | 429 39 | 154 40 | 88 41 | 42 | HIS CF 43 | -- 44 | Time Series 45 | Mapping 46 | bg=orange 47 | 48 | 49 | 50 | UMLPackage 51 | 52 | 385 53 | 572 54 | 275 55 | 242 56 | 57 | Mapping 58 | -- 59 | char * name; 60 | long epsg; 61 | char * grid_mapping_name; 62 | double longitude_of_prime_meridian; 63 | double semi_major_axis; 64 | double semi_minor_axis; 65 | double inverse_flattening; 66 | char * epsg_code; 67 | char * value; 68 | char * projection_name; 69 | char * wkt; 70 | bg=orange 71 | 72 | 73 | 74 | UMLPackage 75 | 76 | 374 77 | 330 78 | 154 79 | 88 80 | 81 | TIme Series 82 | -- 83 | Observation Points 84 | Observation Areas 85 | Cross Sections 86 | bg=orange 87 | 88 | 89 | 90 | Relation 91 | 92 | 242 93 | 374 94 | 154 95 | 121 96 | 97 | lt=<- 98 | 10.0;90.0;120.0;10.0 99 | 100 | 101 | Relation 102 | 103 | 242 104 | 484 105 | 165 106 | 242 107 | 108 | lt=<- 109 | 10.0;10.0;130.0;200.0 110 | 111 | 112 | UMLPackage 113 | 114 | 1012 115 | 506 116 | 154 117 | 77 118 | 119 | Cross Section 120 | -- 121 | Name 122 | Location (x,y polyline) 123 | bg=orange 124 | 125 | 126 | 127 | Relation 128 | 129 | 517 130 | 231 131 | 517 132 | 154 133 | 134 | lt=<- 135 | 10.0;120.0;450.0;10.0 136 | 137 | 138 | Relation 139 | 140 | 517 141 | 374 142 | 517 143 | 33 144 | 145 | lt=<- 146 | 10.0;10.0;450.0;10.0 147 | 148 | 149 | Relation 150 | 151 | 517 152 | 385 153 | 517 154 | 187 155 | 156 | lt=<- 157 | 10.0;10.0;450.0;150.0 158 | 159 | 160 | UMLPackage 161 | 162 | 1122 163 | 1210 164 | 154 165 | 77 166 | 167 | EmptyPackage 168 | -- 169 | 79-xdh-7 170 | bg=orange 171 | 172 | 173 | 174 | -------------------------------------------------------------------------------- /packages/include/cf_time_series.h: -------------------------------------------------------------------------------- 1 | #ifndef TSFILE_H 2 | #define TSFILE_H 3 | 4 | #include 5 | 6 | typedef enum{ 7 | UNKNOWN, 8 | HISTORY, 9 | } FILE_TYPE; 10 | 11 | struct _global_attributes { 12 | int count; 13 | struct _global_attribute ** attribute; 14 | }; 15 | struct _global_attribute { 16 | int type; 17 | int length; 18 | char * name; 19 | char * cvalue; 20 | char ** svalue; 21 | char * ivalue; 22 | char * rvalue; 23 | char * dvalue; 24 | }; 25 | 26 | struct _parameter { 27 | long ndim; 28 | long * dim_id; 29 | long * dim_val; 30 | char ** dim_name; 31 | char * name; 32 | char * unit; 33 | int pre_selected; // tri-state: 0: not pre-selected (show all); only when saved to json file (also in memory will this action be performed to generate a new set of preselected parameters) 34 | // 1: pre-selected (show all); increase by 1 show then show only (2) (Should know what was previously selected) 35 | }; 36 | 37 | struct _location { 38 | QString * name; 39 | int pre_selected; // tri-state: 0: not pre-selected (show all); only when saved to json file (also in memory will this action be performed to generate a new set of preselected parameters) 40 | // 1: pre-selected (show all); increase by 1 show then show only (2) 41 | // 2: show pre-selected; decrease by 1, show all (0 and 1) (Should know what was previously selected) 42 | }; 43 | 44 | struct _time_series { 45 | QString long_name; 46 | QString unit; 47 | std::vector times; // vector of seconds 48 | QList qdt_time; // date time presentation yyyy-MM-dd hh:mm:ss.zzz 49 | std::vector pre_selected; // tri-state: 0: not pre-selected (show all); only when saved to json file (also in memory will this action be performed to generate a new set of preselected parameters) 50 | // 1: pre-selected (show all); increase by 1 show then show only (2) 51 | // 2: show pre-selected; decrease by 1, show all (0 and 1) (Should know what was previously selected) 52 | }; 53 | 54 | struct _par_loc { 55 | char * location_var_name; // to check the coordinate attribute 56 | char * location_long_name; // to present in combobox 57 | char * location_dim_name; 58 | long ndim; 59 | long nr_parameters; 60 | long nr_locations; 61 | bool pre_selection; // one of the parameters and locaions is pre-selected 62 | struct _parameter ** parameter; 63 | struct _location ** location; 64 | }; 65 | 66 | 67 | class TSFILE 68 | { 69 | public: 70 | TSFILE(QFileInfo filename, FILE_TYPE ftype); 71 | ~TSFILE(); 72 | long read(QProgressBar *); 73 | void read_times(QProgressBar *, long, long); 74 | void read_global_attributes(); 75 | void read_parameters(); 76 | long read_locations(); 77 | struct _global_attributes * get_global_attributes(void); 78 | std::vector get_time_series(long, std::string, long, long); 79 | QString get_xaxis_label(void); 80 | long get_count_par_loc(); 81 | long get_count_parameters(long); 82 | char * get_par_loc_long_name(long); 83 | struct _parameter * get_parameters(long); 84 | long get_count_locations(long); 85 | struct _location * get_locations(long); 86 | long put_location(long, long, struct _location *); 87 | long put_parameter(long, long, struct _parameter *); 88 | 89 | _time_series m_times; 90 | long get_count_times(); 91 | _time_series get_times(); 92 | void put_times(_time_series); 93 | 94 | // Needed for reading times; taken from read_ugrid example 95 | struct _time_series m_time_series; 96 | QVector qdt_times; 97 | std::vector<_time_series> time_series; 98 | 99 | QList get_qdt_times(); 100 | QDateTime * get_reference_date(); 101 | 102 | bool get_pre_selection(); 103 | void put_pre_selection(bool); 104 | int get_cb_parloc_index(); 105 | void put_cb_parloc_index(int); 106 | 107 | void ensure_capacity_par_loc(long); 108 | void ensure_capacity_parameters(long, long); 109 | void ensure_capacity_locations(long, long); 110 | 111 | QFileInfo fname; 112 | FILE_TYPE type; 113 | struct _meta * meta; 114 | _global_attributes * global_attributes; 115 | struct _parameter * m_param; 116 | size_t datetime_ntimes; 117 | QString datetime_units; 118 | QDateTime * RefDate; 119 | 120 | char ** location_name; 121 | char ** parameter; 122 | 123 | private: 124 | int get_attribute(int, int, std::string, std::string*); 125 | int get_attribute(int, int, std::string, double*); 126 | int get_attribute(int, int, std::string, int*); 127 | int get_attribute(int, int, std::string, long*); 128 | int get_name_for_variable(int, int, std::string*); 129 | int get_unit_for_variable(int, int, std::string*); 130 | 131 | std::string trim(std::string); 132 | char* trim(char*); 133 | 134 | char * tsfilefilename; 135 | struct _par_loc ** par_loc; // array of parameters, locations and time-series 136 | QStringList m_date_time; 137 | QStringList datetime_ref_date; 138 | QStringList datetime_ref_time; 139 | char* m_time_var_name; 140 | QString xaxis_label; 141 | QString xaxis_unit; 142 | QString m_yaxis_label; 143 | QString yaxis_unit; 144 | size_t name_len; 145 | long m_nr_par_loc; 146 | long m_nr_parameters; 147 | long m_nr_locations; 148 | bool m_pre_selection; 149 | int m_cb_parloc_index; 150 | int m_ncid; 151 | std::vector m_y_values; 152 | }; 153 | 154 | #endif 155 | -------------------------------------------------------------------------------- /packages/src/perf_timer.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Programmer: Jan Mooiman 3 | // Date: 14 April 2021 4 | // Email: jan.mooiman@deltares.nl 5 | // 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include "perf_timer.h" 14 | 15 | int TestTimer::object_count = 0; 16 | TestTimer* TestTimer::obj = nullptr; // Initialize static member of class System 17 | 18 | TestTimer::TestTimer(const std::string& name, const std::string& fileName, const std::string& functionName, const int lineNumber) : 19 | m_name(name), m_filename(fileName), m_functionname(functionName), m_line_number(lineNumber) 20 | { 21 | if (object_count == 0) 22 | { 23 | object_count = 1; 24 | m_level = 0; 25 | timing.emplace_back(m_name, m_filename, m_functionname, m_line_number); 26 | timing.back().level = m_level; 27 | timing.back().running = false; 28 | timing.back().elapse_time = 0.0; 29 | } 30 | } 31 | int TestTimer::get_count() 32 | { 33 | return object_count; 34 | } 35 | void TestTimer::clear() 36 | { 37 | if (object_count == 1) 38 | { 39 | object_count = 0; 40 | m_level = 0; 41 | } 42 | timing.resize(1); 43 | } 44 | void TestTimer::start(const std::string& name, const std::string& fileName, const std::string& functionName, const int lineNumber) 45 | { 46 | bool found = false; 47 | for (auto& t : timing) 48 | { 49 | if (t.name == name) 50 | { 51 | t.start = std::chrono::high_resolution_clock::now(); 52 | t.running = true; 53 | t.nr_calls += 1; 54 | m_level += 1; 55 | found = true; 56 | break; 57 | } 58 | } 59 | if (!found) 60 | { 61 | timing.emplace_back(Timing(name, fileName, functionName, lineNumber)); 62 | m_level += 1; 63 | timing.back().level = m_level; 64 | timing.back().running = true; 65 | timing.back().elapse_time = 0.0; 66 | } 67 | } 68 | void TestTimer::stop(const std::string& name) 69 | { 70 | for (auto& t : timing) 71 | { 72 | if (t.name == name) 73 | { 74 | m_level -= 1; 75 | t.running = false; 76 | t.stop = std::chrono::high_resolution_clock::now(); 77 | std::chrono::high_resolution_clock::duration d = t.stop - t.start; 78 | t.elapse_time += d.count() * (double)std::chrono::high_resolution_clock::duration::period::num / std::chrono::high_resolution_clock::duration::period::den; 79 | } 80 | } 81 | } 82 | void TestTimer::log(std::string out_file) 83 | { 84 | if (timing.size() > 1) 85 | { 86 | std::ofstream os; 87 | os.open(out_file); 88 | for (auto& t : timing) 89 | { 90 | if (t.running) 91 | { 92 | t.running = false; 93 | t.stop = std::chrono::high_resolution_clock::now(); 94 | std::chrono::high_resolution_clock::duration d = t.stop - t.start; 95 | t.elapse_time += d.count() * (double)std::chrono::high_resolution_clock::duration::period::num / std::chrono::high_resolution_clock::duration::period::den; 96 | } 97 | } 98 | 99 | // determine string length, needed for nice layout 100 | size_t name_strlen = 4; 101 | size_t file_strlen = 4; 102 | size_t function_strlen = 8; 103 | for (auto& t : timing) 104 | { 105 | std::string s(2*t.level, '-'); 106 | std::string t_name = s + t.name ; 107 | name_strlen = std::max(name_strlen, t_name.length()); 108 | std::string file_str = t.filename.substr(t.filename.find_last_of("/\\") + 1); 109 | file_strlen = std::max(file_strlen, file_str.length()); 110 | function_strlen = std::max(function_strlen, t.functionname.length()); 111 | } 112 | size_t const total_strlen = 5 + 3 + // level 113 | 5 + 3 + // calls 114 | 10 + 3 + // time[s] 115 | name_strlen + 3 + // name 116 | file_strlen + 3 + // file 117 | function_strlen + 3 + //function name 118 | 6; // line number 119 | 120 | os << std::string(total_strlen, '=') << std::endl; 121 | os << "level" << " " << "calls" << " " 122 | << std::right << std::setw(10) << " time[s]" 123 | << " " 124 | << std::left << std::setw(name_strlen) << "name" 125 | << " " 126 | << std::left << std::setw(file_strlen) << "file" 127 | << " " 128 | << std::left << std::setw(function_strlen) << "function" 129 | << " " 130 | << std::right << std::setw(6) << "line" 131 | << std::endl; 132 | os << std::string(total_strlen, '-') << std::endl; 133 | for (auto& t : timing) 134 | { 135 | if (t.name == "root") 136 | { 137 | continue; // skip the first one 138 | } 139 | std::string file_str = t.filename.substr(t.filename.find_last_of("/\\") + 1); 140 | std::string s(2 * (t.level-1), ' '); 141 | std::string t_name = s + t.name; 142 | os << std::setw(5) << t.level 143 | << " " 144 | << std::setw(5) << t.nr_calls 145 | << " " 146 | << std::setw(10) << std::fixed << std::setprecision(3) << t.elapse_time 147 | << " " 148 | << std::left << std::setw(name_strlen) << t_name 149 | << " " 150 | << std::left << std::setw(file_strlen) << file_str 151 | << " " 152 | << std::left << std::setw(function_strlen) << t.functionname 153 | << " " 154 | << std::right << std::setw(6) << t.line_number 155 | << std::endl; 156 | } 157 | os << std::string(total_strlen, '=') << std::endl; 158 | os.close(); 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /packages/include/mainwindow.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2004-2006 Trolltech ASA. All rights reserved. 4 | ** 5 | ** This file is part of the example classes of the Qt Toolkit. 6 | ** 7 | ** Licensees holding a valid Qt License Agreement may use this file in 8 | ** accordance with the rights, responsibilities and obligations 9 | ** contained therein. Please consult your licensing agreement or 10 | ** contact sales@trolltech.com if any conditions of this licensing 11 | ** agreement are not clear to you. 12 | ** 13 | ** Further information about Qt licensing is available at: 14 | ** http://www.trolltech.com/products/qt/licensing.html or by 15 | ** contacting info@trolltech.com. 16 | ** 17 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 18 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19 | ** 20 | ****************************************************************************/ 21 | 22 | #ifndef MAINWINDOW_H 23 | #define MAINWINDOW_H 24 | 25 | //#include 26 | //#include 27 | //#include 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | #include 56 | #include 57 | #include 58 | #include 59 | #include 60 | #include 61 | #include 62 | #include 63 | #include 64 | #include 65 | #include 66 | #include 67 | #include 68 | #include 69 | #include 70 | 71 | #include "cf_time_series.h" 72 | #include "qcustomplot.h" 73 | #include "time_series_plot.h" 74 | #include "read_json.h" 75 | 76 | #define WAIT_MODE 1 77 | #define NO_WAIT_MODE 0 78 | 79 | class MainWindow : public QMainWindow 80 | { 81 | Q_OBJECT 82 | 83 | public: 84 | MainWindow(QDir, QDir); 85 | ~MainWindow(); 86 | 87 | protected: 88 | void dragEnterEvent(QDragEnterEvent *); 89 | void dropEvent(QDropEvent *); 90 | 91 | public slots: 92 | void openFile(QFileInfo, FILE_TYPE); 93 | 94 | private slots: 95 | void openFile(); 96 | void closeFile(); 97 | void ExportToCSV(); 98 | void OpenPreSelection(); 99 | void OpenPreSelection(TSFILE *, QFileInfo); 100 | void SavePreSelection(); 101 | void about(); 102 | void ShowUserManual(); 103 | void close(); 104 | void exit(); 105 | void closeEvent(QCloseEvent *); 106 | 107 | void contextMenuFileListBox(const QPoint &); 108 | 109 | void lb_filenames_clicked(QListWidgetItem *); 110 | void lb_filenames_selection_changed(); 111 | 112 | void lb_parameter_clicked(QListWidgetItem *); 113 | void lb_parameter_selection_changed(); 114 | void lb_location_clicked(QListWidgetItem *); 115 | void lb_location_selection_changed(); 116 | void lb_times_clicked(QListWidgetItem *); 117 | void lb_times_selection_changed(); 118 | 119 | void plot_button_clicked(); 120 | void plot_button_add_clicked(); 121 | void cb_clicked(int); 122 | 123 | void destroyed(); 124 | 125 | private: 126 | void createActions(); 127 | void createMenus(); 128 | void createFilenameList(); 129 | void createPLTList(); 130 | void createParameterList(); 131 | void createLocationList(); 132 | void createTimeList(); 133 | void createPlotButton(); 134 | void createComboBox(); 135 | void createDisplayMeta(); 136 | void createStatusBar(); 137 | 138 | 139 | void loadFile(const QString &fileName); 140 | void updateListBoxes(TSFILE *); 141 | void updateFileListBox(TSFILE *); 142 | void update_cb_add_to_plot(void); 143 | void DisplayFileName(char *, char *); 144 | char * get_basename(char *); 145 | int QT_SpawnProcess(int, char *, char **); 146 | 147 | struct _program_arguments * prg_arg; 148 | 149 | int nr_plot; 150 | int m_fil_index; 151 | bool m_pre_selection; 152 | 153 | TSPlot ** cplot; 154 | QCustomPlot * customPlot; 155 | TSFILE ** openedUgridFile; 156 | 157 | // QT Stuff 158 | QWidget * mainWidget; 159 | QProgressBar * pgBar; 160 | 161 | QComboBox * cb_par_loc; 162 | QSpinBox * sb_layer; 163 | QLabel * layerLabelPrefix; 164 | QLabel * layerLabelSuffix; 165 | 166 | QListWidget * lb_filenames; 167 | QListWidget * lb_parameters; 168 | QListWidget * lb_locations; 169 | QListWidget * lb_times; 170 | 171 | // Menubar item 172 | QMenu * fileMenu; 173 | QAction * openAct; 174 | QAction * closeAct; 175 | QAction * openPreSelect; 176 | QAction * savePreSelect; 177 | QAction * exitAct; 178 | 179 | QMenu * exportMenu; 180 | QAction * ecsvAct; 181 | 182 | QMenu * helpMenu; 183 | QAction * aboutAct; 184 | QAction * showUserManualAct; 185 | 186 | // Groupboxes 187 | QGroupBox * gb_filenames; 188 | QGroupBox * gb_parameters; 189 | QGroupBox * gb_locations; 190 | QGroupBox * gb_times; 191 | QGroupBox * gb_plotting; 192 | 193 | // Push buttons 194 | QPushButton * pb_plot; 195 | QPushButton * pb_add_to_plot; 196 | QComboBox * cb_add_to_plot; 197 | QLabel * cb_add_to_plot_prefix; 198 | 199 | // Global attributes data 200 | QTableView * table; 201 | QStandardItemModel * table_model; 202 | }; 203 | 204 | #endif 205 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /packages/src/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include 5 | #include 6 | #if defined(WIN32) || defined(WIN64) 7 | # include 8 | #else 9 | # include 10 | #endif 11 | 12 | #if defined(WIN32) || defined(WIN64) 13 | # define strdup _strdup 14 | # define strcat strcat_s 15 | # define getcwd _getcwd 16 | # define FILE_NAME_MAX _MAX_PATH 17 | #else 18 | # define FILE_NAME_MAX FILENAME_MAX 19 | #endif 20 | 21 | #include "mainwindow.h" 22 | #include "cf_time_series.h" 23 | #include "program_arguments.h" 24 | 25 | char * get_dirname(char *); 26 | void GetArguments(long, char **, struct _program_arguments *); 27 | void set_theme(QApplication *, QDir); 28 | 29 | struct _program_arguments m_prg_arg; 30 | 31 | /* 32 | * commandline arguments 33 | * --ncfile NetCDF file 34 | */ 35 | 36 | int main(int argc, char *argv[]) 37 | { 38 | QApplication app(argc, argv); 39 | QCoreApplication::setAttribute(Qt::AA_UseStyleSheetPropagationInWidgetStyles, true); 40 | 41 | QDir exec_dir = QFileInfo(argv[0]).absolutePath(); 42 | QDir startup_dir = QDir::currentPath(); // getcwd(current_dir, FILE_NAME_MAX); 43 | if (!exec_dir.exists()) 44 | { 45 | exec_dir = startup_dir; 46 | } 47 | 48 | (void)GetArguments(argc, argv, &m_prg_arg); 49 | set_theme(&app, exec_dir); 50 | 51 | MainWindow * mainWin = new MainWindow(exec_dir, startup_dir); 52 | mainWin->setAcceptDrops(true); 53 | mainWin->show(); 54 | 55 | app.processEvents(); 56 | 57 | if (m_prg_arg.ncfile != nullptr && m_prg_arg.ncfile->exists() && m_prg_arg.type != UNKNOWN) 58 | { 59 | mainWin->openFile(*m_prg_arg.ncfile, m_prg_arg.type); 60 | } 61 | 62 | return app.exec(); 63 | } 64 | //------------------------------------------------------------------------------ 65 | char * get_dirname(char * filename) 66 | { 67 | char * str = strdup (filename); 68 | size_t length = strlen(filename); 69 | for (size_t i=length; i<0; i--) 70 | { 71 | if (str[i]=='\\' || str[i]=='/') 72 | { 73 | str[i] = '\0'; 74 | return str; 75 | } 76 | } 77 | return str; 78 | } 79 | //------------------------------------------------------------------------------ 80 | /* @@ GetArguments 81 | * 82 | * Scan command-line arguments 83 | */ 84 | void GetArguments(long argc, /* I Number of command line arguments */ 85 | char ** argv, /* I Pointers to these arguments */ 86 | struct _program_arguments * prg_arg) /* O Propeties structure */ 87 | /* Returns nothing */ 88 | { 89 | long i; 90 | /* 91 | * Initialize the properties structure 92 | */ 93 | prg_arg->ncfile = nullptr; 94 | prg_arg->type = HISTORY; 95 | 96 | i = 0; 97 | while (i < argc) 98 | { 99 | if (strcmp(argv[i], "--ncfile") == 0) 100 | { 101 | i = i + 1; 102 | if (i < argc) prg_arg->ncfile = new QFileInfo(argv[i]); 103 | } 104 | else if (i != 0) 105 | { 106 | i = argc; 107 | } 108 | i = i + 1; 109 | } 110 | return; 111 | } 112 | void set_theme(QApplication * app, QDir exec_dir) 113 | { 114 | QPalette palette; 115 | long theme = 1; 116 | switch(theme) 117 | { 118 | case 1: 119 | { 120 | app->setStyle(QStyleFactory::create("Fusion")); 121 | QFile styleFile(exec_dir.absolutePath() + "/plotcfts.qss" ); 122 | bool succes = styleFile.open(QFile::ReadOnly); 123 | if (succes) 124 | { 125 | QString style(styleFile.readAll()); 126 | app->setStyleSheet(style); 127 | } 128 | } 129 | break; 130 | case 2: 131 | // Delft3D steelblue3 style 132 | app->setStyle(QStyleFactory::create("Fusion")); 133 | 134 | palette.setColor(QPalette::AlternateBase, QColor(79, 148, 205)); 135 | palette.setColor(QPalette::Base, QColor(79, 148, 205)); 136 | palette.setColor(QPalette::BrightText, Qt::red); 137 | palette.setColor(QPalette::Button, QColor(79, 148, 205)); 138 | palette.setColor(QPalette::ButtonText, Qt::white); 139 | palette.setColor(QPalette::Dark, QColor(35, 35, 35)); 140 | palette.setColor(QPalette::Link, QColor(42, 130, 218)); 141 | palette.setColor(QPalette::Shadow, QColor(20, 20, 20)); 142 | palette.setColor(QPalette::Text, Qt::white); 143 | palette.setColor(QPalette::ToolTipBase, Qt::white); 144 | palette.setColor(QPalette::ToolTipText, Qt::white); 145 | palette.setColor(QPalette::Window, QColor(79, 148, 205)); 146 | palette.setColor(QPalette::WindowText, Qt::white); 147 | 148 | palette.setColor(QPalette::Highlight, QColor(131, 180, 220)); 149 | palette.setColor(QPalette::HighlightedText, Qt::white); 150 | 151 | palette.setColor(QPalette::Disabled, QPalette::Button, QColor(63, 119, 165)); 152 | palette.setColor(QPalette::Disabled, QPalette::ButtonText, QColor(55, 103, 143)); 153 | palette.setColor(QPalette::Disabled, QPalette::Highlight, QColor(80, 80, 80)); 154 | palette.setColor(QPalette::Disabled, QPalette::HighlightedText, QColor(127, 127, 127)); 155 | palette.setColor(QPalette::Disabled, QPalette::Text, QColor(55, 103, 143)); 156 | palette.setColor(QPalette::Disabled, QPalette::WindowText, QColor(55, 103, 143)); 157 | 158 | app->setPalette(palette); 159 | 160 | break; 161 | case 3: 162 | // Dark style 163 | app->setStyle(QStyleFactory::create("Fusion")); 164 | 165 | palette.setColor(QPalette::AlternateBase, QColor(53, 53, 53)); 166 | palette.setColor(QPalette::Base, QColor(25, 25, 25)); 167 | palette.setColor(QPalette::BrightText, Qt::red); 168 | palette.setColor(QPalette::Button, QColor(53, 53, 53)); 169 | palette.setColor(QPalette::ButtonText, Qt::white); 170 | palette.setColor(QPalette::Link, QColor(180, 180, 180)); 171 | palette.setColor(QPalette::Text, Qt::white); 172 | palette.setColor(QPalette::ToolTipBase, Qt::white); 173 | palette.setColor(QPalette::ToolTipText, Qt::white); 174 | palette.setColor(QPalette::Window, QColor(53, 53, 53)); 175 | palette.setColor(QPalette::WindowText, Qt::white); 176 | 177 | palette.setColor(QPalette::Highlight, QColor(180, 180, 180)); 178 | palette.setColor(QPalette::HighlightedText, Qt::black); 179 | 180 | app->setPalette(palette); 181 | break; 182 | case 4: 183 | // Default windows style, experiment colour settings 184 | app->setStyle(QStyleFactory::create("WindowsXP")); 185 | 186 | palette.setColor(QPalette::AlternateBase, Qt::white); 187 | palette.setColor(QPalette::Base, Qt::green); // background listboxes, tables 188 | palette.setColor(QPalette::BrightText, Qt::white); 189 | palette.setColor(QPalette::Button, Qt::red); 190 | palette.setColor(QPalette::ButtonText, Qt::darkBlue); // text on button 191 | palette.setColor(QPalette::Shadow, Qt::white); 192 | palette.setColor(QPalette::Text, Qt::darkBlue); // text on listbox, combo box, spinner 193 | palette.setColor(QPalette::ToolTipBase, Qt::blue); 194 | palette.setColor(QPalette::ToolTipText, Qt::white); 195 | palette.setColor(QPalette::Window, Qt::yellow); // background window, groupbox lines changed 196 | palette.setColor(QPalette::WindowText, Qt::darkCyan); 197 | 198 | palette.setColor(QPalette::Highlight, Qt::darkBlue); // highlighter in spinner 199 | palette.setColor(QPalette::HighlightedText, Qt::white); // highlighted text in spinner 200 | 201 | palette.setColor(QPalette::Disabled, QPalette::Base, QColor(0, 255, 0)); 202 | palette.setColor(QPalette::Disabled, QPalette::Button, QColor(63, 119, 165)); 203 | palette.setColor(QPalette::Disabled, QPalette::ButtonText, QColor(55, 103, 143)); 204 | palette.setColor(QPalette::Disabled, QPalette::Text, QColor(55, 103, 143)); 205 | palette.setColor(QPalette::Disabled, QPalette::WindowText, QColor(55, 103, 143)); 206 | 207 | app->setPalette(palette); 208 | 209 | break; 210 | default: 211 | break; 212 | } 213 | } -------------------------------------------------------------------------------- /scripts/read_ini.cmd: -------------------------------------------------------------------------------- 1 | @if (@a==@b) @end /* -- batch / JScript hybrid line to begin JScript comment 2 | 3 | :: -------------------- 4 | :: ini.bat 5 | :: ini.bat /? for usage 6 | :: -------------------- 7 | 8 | @echo off 9 | setlocal enabledelayedexpansion 10 | 11 | goto begin 12 | 13 | :: color code by jeb -- https://stackoverflow.com/a/5344911/1683264 14 | :c 15 | set "param=^%~2" ! 16 | set "param=!param:"=\"!" 17 | findstr /p /A:%1 "." "!param!\..\X" nul 18 | X set /p ".=." 27 | 28 | echo Usage: 29 | call :c 07 " query:" 30 | call :c 0F " %~nx0 "&call :s&call :c 0F "i item ["&call :s&call :c 0F "s section] inifile"&echo; 31 | call :c 07 " create or modify:" 32 | call :c 0F " %~nx0 "&call :s&call :c 0F "i item "&call :s&call :c 0F "v value ["&call :s&call :c 0F "s section] inifile"&echo; 33 | call :c 07 " delete:" 34 | call :c 0F " %~nx0 "&call :s&call :c 0F "d item ["&call :s&call :c 0F "s section] inifile"&echo; 35 | echo; 36 | echo Take the following ini file for example: 37 | echo; 38 | echo [Config] 39 | echo password=1234 40 | echo usertries=0 41 | echo allowterminate=0 42 | echo; 43 | echo To read the "password" value: 44 | call :c 0F " %~nx0 "&call :s&call :c 0F "s Config "&call :s&call :c 0F "i password inifile"&echo; 45 | echo; 46 | echo To modify the "usertries" value to 5: 47 | call :c 0F " %~nx0 "&call :s&call :c 0F "s Config "&call :s&call :c 0F "i usertries "&call :s&call :c 0F "v 5 inifile"&echo; 48 | echo; 49 | echo To add a "timestamp" key with a value of the current date and time: 50 | call :c 0F " %~nx0 "&call :s&call :c 0F "s Config "&call :s&call :c 0F "i timestamp "&call :s&call :c 0F "v ""%DEL%%%%%date%%%% %%%%time%%%%""%DEL% inifile"&echo; 51 | echo; 52 | echo To delete the "allowterminate" key: 53 | call :c 0F " %~nx0 "&call :s&call :c 0F "s Config "&call :s&call :c 0F "d allowterminate inifile"&echo; 54 | echo; 55 | call :c 07 "In the above examples, "&call :s 56 | call :c 0F "s Config " 57 | echo is optional, but will allow the selection of 58 | echo a specific item where the ini file contains similar items in multiple sections. 59 | del X 60 | goto :EOF 61 | 62 | :begin 63 | if "%~1"=="" goto usage 64 | for %%I in (item value section found) do set %%I= 65 | for %%I in (%*) do ( 66 | if defined next ( 67 | if !next!==/i set "item=%%~I" 68 | if !next!==/v ( 69 | set modify=true 70 | set "value=%%~I" 71 | ) 72 | if !next!==/d ( 73 | set "item=%%~I" 74 | set modify=true 75 | set delete=true 76 | ) 77 | if !next!==/s set "section=%%~I" 78 | set next= 79 | ) else ( 80 | for %%x in (/i /v /s /d) do if "%%~I"=="%%x" set "next=%%~I" 81 | if not defined next ( 82 | set "arg=%%~I" 83 | if "!arg:~0,1!"=="/" ( 84 | 1>&2 echo Error: Unrecognized option "%%~I" 85 | 1>&2 echo; 86 | 1>&2 call :usage 87 | exit /b 1 88 | ) else set "inifile=%%~I" 89 | ) 90 | ) 91 | ) 92 | for %%I in (item inifile) do if not defined %%I goto usage 93 | if not exist "%inifile%" ( 94 | 1>&2 echo Error: %inifile% not found. 95 | exit /b 1 96 | ) 97 | 98 | cscript /nologo /e:jscript "%~f0" "%inifile%" "!section!" "!item!" "!value!" "%modify%" "%delete%" 99 | 100 | exit /b %ERRORLEVEL% 101 | 102 | :: Begin JScript portion */ 103 | var inifile = WSH.Arguments(0), 104 | section = WSH.Arguments(1), 105 | item = WSH.Arguments(2), 106 | value = WSH.Arguments(3), 107 | modify = WSH.Arguments(4), 108 | del = WSH.Arguments(5), 109 | fso = new ActiveXObject("Scripting.FileSystemObject"), 110 | stream = fso.OpenTextFile(inifile, 1), 111 | 112 | // (stream.ReadAll() will not preserve blank lines.) 113 | data = []; 114 | while (!stream.atEndOfStream) { data.push(stream.ReadLine()); } 115 | stream.Close(); 116 | 117 | // trims whitespace from edges 118 | String.prototype.trim = function() { return this.replace(/^\s+|\s+$/,'') } 119 | 120 | // trim + toLowerCase 121 | String.prototype.unify = function() { return this.trim().toLowerCase(); }; 122 | 123 | // unquotes each side of "var"="value" 124 | String.prototype.splitEx = function(x) { 125 | for (var i=0, ret = this.split(x) || []; i0 && !this[--i].length) {}; 136 | for (var j=0; j:${DUMMY}>$<${CONDITION}:${TOKEN}>") 28 | elseif("${TOKEN_ROLE}" STREQUAL "ARG") 29 | list(APPEND COMMANDS "$<${CONDITION}:${TOKEN}>") 30 | endif() 31 | endforeach() 32 | endmacro() 33 | cmake_policy(POP) 34 | 35 | ################################################################################ 36 | # Transform all the tokens to absolute paths 37 | ################################################################################ 38 | macro(prepare_output) 39 | unset(OUTPUT) 40 | foreach(TOKEN ${ARG_OUTPUT}) 41 | if(IS_ABSOLUTE ${TOKEN}) 42 | list(APPEND OUTPUT "${TOKEN}") 43 | else() 44 | list(APPEND OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/${TOKEN}") 45 | endif() 46 | endforeach() 47 | endmacro() 48 | 49 | ################################################################################ 50 | # Parse add_custom_command_if args. 51 | # 52 | # Input: 53 | # PRE_BUILD - Pre build event option 54 | # PRE_LINK - Pre link event option 55 | # POST_BUILD - Post build event option 56 | # TARGET - Target 57 | # OUTPUT - List of output files 58 | # DEPENDS - List of files on which the command depends 59 | # COMMANDS - List of commands(COMMAND condition1 commannd1 args1 COMMAND 60 | # condition2 commannd2 args2 ...) 61 | # Output: 62 | # OUTPUT - Output files 63 | # DEPENDS - Files on which the command depends 64 | # COMMENT - Comment 65 | # PRE_BUILD - TRUE/FALSE 66 | # PRE_LINK - TRUE/FALSE 67 | # POST_BUILD - TRUE/FALSE 68 | # TARGET - Target name 69 | # COMMANDS - Prepared commands(every token is wrapped in CONDITION) 70 | # NAME - Unique name for custom target 71 | # STEP - PRE_BUILD/PRE_LINK/POST_BUILD 72 | ################################################################################ 73 | function(add_custom_command_if_parse_arguments) 74 | cmake_parse_arguments("ARG" "PRE_BUILD;PRE_LINK;POST_BUILD" "TARGET;COMMENT" "DEPENDS;OUTPUT;COMMANDS" ${ARGN}) 75 | 76 | if(WIN32) 77 | set(DUMMY "cd.") 78 | elseif(UNIX) 79 | set(DUMMY "true") 80 | endif() 81 | 82 | prepare_commands() 83 | prepare_output() 84 | 85 | set(DEPENDS "${ARG_DEPENDS}") 86 | set(COMMENT "${ARG_COMMENT}") 87 | set(PRE_BUILD "${ARG_PRE_BUILD}") 88 | set(PRE_LINK "${ARG_PRE_LINK}") 89 | set(POST_BUILD "${ARG_POST_BUILD}") 90 | set(TARGET "${ARG_TARGET}") 91 | if(PRE_BUILD) 92 | set(STEP "PRE_BUILD") 93 | elseif(PRE_LINK) 94 | set(STEP "PRE_LINK") 95 | elseif(POST_BUILD) 96 | set(STEP "POST_BUILD") 97 | endif() 98 | set(NAME "${TARGET}_${STEP}") 99 | 100 | set(OUTPUT "${OUTPUT}" PARENT_SCOPE) 101 | set(DEPENDS "${DEPENDS}" PARENT_SCOPE) 102 | set(COMMENT "${COMMENT}" PARENT_SCOPE) 103 | set(PRE_BUILD "${PRE_BUILD}" PARENT_SCOPE) 104 | set(PRE_LINK "${PRE_LINK}" PARENT_SCOPE) 105 | set(POST_BUILD "${POST_BUILD}" PARENT_SCOPE) 106 | set(TARGET "${TARGET}" PARENT_SCOPE) 107 | set(COMMANDS "${COMMANDS}" PARENT_SCOPE) 108 | set(STEP "${STEP}" PARENT_SCOPE) 109 | set(NAME "${NAME}" PARENT_SCOPE) 110 | endfunction() 111 | 112 | ################################################################################ 113 | # Add conditional custom command 114 | # 115 | # Generating Files 116 | # The first signature is for adding a custom command to produce an output: 117 | # add_custom_command_if( 118 | # 119 | # 120 | # 121 | # [COMMAND condition command2 [args2...]] 122 | # [DEPENDS [depends...]] 123 | # [COMMENT comment] 124 | # 125 | # Build Events 126 | # add_custom_command_if( 127 | # 128 | # 129 | # 130 | # [COMMAND condition command2 [args2...]] 131 | # [COMMENT comment] 132 | # 133 | # Input: 134 | # output - Output files the command is expected to produce 135 | # condition - Generator expression for wrapping the command 136 | # command - Command-line(s) to execute at build time. 137 | # args - Command`s args 138 | # depends - Files on which the command depends 139 | # comment - Display the given message before the commands are executed at 140 | # build time. 141 | # PRE_BUILD - Run before any other rules are executed within the target 142 | # PRE_LINK - Run after sources have been compiled but before linking the 143 | # binary 144 | # POST_BUILD - Run after all other rules within the target have been 145 | # executed 146 | ################################################################################ 147 | function(add_custom_command_if) 148 | add_custom_command_if_parse_arguments(${ARGN}) 149 | 150 | if(OUTPUT AND TARGET) 151 | message(FATAL_ERROR "Wrong syntax. A TARGET and OUTPUT can not both be specified.") 152 | endif() 153 | 154 | if(OUTPUT) 155 | add_custom_command(OUTPUT ${OUTPUT} 156 | ${COMMANDS} 157 | DEPENDS ${DEPENDS} 158 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 159 | COMMENT ${COMMENT}) 160 | elseif(TARGET) 161 | if(PRE_BUILD AND NOT ${CMAKE_GENERATOR} MATCHES "Visual Studio") 162 | add_custom_target( 163 | ${NAME} 164 | ${COMMANDS} 165 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 166 | COMMENT ${COMMENT}) 167 | add_dependencies(${TARGET} ${NAME}) 168 | else() 169 | add_custom_command( 170 | TARGET ${TARGET} 171 | ${STEP} 172 | ${COMMANDS} 173 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 174 | COMMENT ${COMMENT}) 175 | endif() 176 | else() 177 | message(FATAL_ERROR "Wrong syntax. A TARGET or OUTPUT must be specified.") 178 | endif() 179 | endfunction() 180 | 181 | ################################################################################ 182 | # Use props file for a target and configs 183 | # use_props( ) 184 | # Inside there are following variables: 185 | # PROPS_TARGET - 186 | # PROPS_CONFIG - One of 187 | # PROPS_CONFIG_U - Uppercase PROPS_CONFIG 188 | # Input: 189 | # target - Target to apply props file 190 | # configs - Build configurations to apply props file 191 | # props_file - CMake script 192 | ################################################################################ 193 | macro(use_props TARGET CONFIGS PROPS_FILE) 194 | set(PROPS_TARGET "${TARGET}") 195 | foreach(PROPS_CONFIG ${CONFIGS}) 196 | string(TOUPPER "${PROPS_CONFIG}" PROPS_CONFIG_U) 197 | 198 | get_filename_component(ABSOLUTE_PROPS_FILE "${PROPS_FILE}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_LIST_DIR}") 199 | if(EXISTS "${ABSOLUTE_PROPS_FILE}") 200 | include("${ABSOLUTE_PROPS_FILE}") 201 | else() 202 | message(WARNING "Corresponding cmake file from props \"${ABSOLUTE_PROPS_FILE}\" doesn't exist") 203 | endif() 204 | endforeach() 205 | endmacro() 206 | 207 | ################################################################################ 208 | # Function for MSVC precompiled headers 209 | # add_precompiled_header( ) 210 | # Input: 211 | # target - Target to which add precompiled header 212 | # precompiled_header - Name of precompiled header 213 | # precompiled_source - Name of precompiled source file 214 | ################################################################################ 215 | function(add_precompiled_header TARGET PRECOMPILED_HEADER PRECOMPILED_SOURCE) 216 | get_target_property(SOURCES "${TARGET}" SOURCES) 217 | list(REMOVE_ITEM SOURCES "${PRECOMPILED_SOURCE}") 218 | 219 | if(MSVC) 220 | set(PRECOMPILED_BINARY "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}.pch") 221 | 222 | set_source_files_properties( 223 | "${PRECOMPILED_SOURCE}" 224 | PROPERTIES 225 | COMPILE_OPTIONS "/Yc${PRECOMPILED_HEADER};/Fp${PRECOMPILED_BINARY}" 226 | OBJECT_OUTPUTS "${PRECOMPILED_BINARY}") 227 | 228 | set_source_files_properties( 229 | ${SOURCES} 230 | PROPERTIES 231 | COMPILE_OPTIONS "$<$,$>:/Yu${PRECOMPILED_HEADER};/Fp${PRECOMPILED_BINARY}>" 232 | OBJECT_DEPENDS "${PRECOMPILED_BINARY}") 233 | endif() 234 | 235 | list(INSERT SOURCES 0 "${PRECOMPILED_SOURCE}") 236 | set_target_properties("${TARGET}" PROPERTIES SOURCES "${SOURCES}") 237 | endfunction() 238 | 239 | ################################################################################ 240 | # Add compile options to source file 241 | # source_file_compile_options( [compile_options...]) 242 | # Input: 243 | # source_file - Source file 244 | # compile_options - Options to add to COMPILE_FLAGS property 245 | ################################################################################ 246 | function(source_file_compile_options SOURCE_FILE) 247 | if("${ARGC}" LESS_EQUAL "1") 248 | return() 249 | endif() 250 | 251 | get_source_file_property(COMPILE_OPTIONS "${SOURCE_FILE}" COMPILE_OPTIONS) 252 | 253 | if(COMPILE_OPTIONS) 254 | list(APPEND COMPILE_OPTIONS ${ARGN}) 255 | else() 256 | set(COMPILE_OPTIONS "${ARGN}") 257 | endif() 258 | 259 | set_source_files_properties("${SOURCE_FILE}" PROPERTIES COMPILE_OPTIONS "${COMPILE_OPTIONS}") 260 | endfunction() 261 | 262 | ################################################################################ 263 | # Default properties of visual studio projects 264 | ################################################################################ 265 | set(DEFAULT_CXX_PROPS "${CMAKE_CURRENT_LIST_DIR}/DefaultCXX.cmake") 266 | set(DEFAULT_Fortran_PROPS "${CMAKE_CURRENT_LIST_DIR}/DefaultFortran.cmake") 267 | -------------------------------------------------------------------------------- /bin/x64/styles/plotcfts_style_cms.qss: -------------------------------------------------------------------------------- 1 | QToolTip 2 | { 3 | border: 1px solid black; 4 | background-color: #cadef0; 5 | padding: 1px; 6 | border-radius: 3px; 7 | } 8 | 9 | QWidget 10 | { 11 | color: #ffffff; 12 | background-color: #4f94cd; 13 | } 14 | 15 | QWidget:item:hover 16 | { 17 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2f587b, stop: 1 #3f76a4); 18 | color: #000000; 19 | } 20 | 21 | QWidget:item:selected 22 | { 23 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #72a9d7, stop: 1 #3f76a4); 24 | color: #ffffff; 25 | } 26 | 27 | QWidget::disabled 28 | { 29 | color: lightgray; 30 | border-color: lightgray; 31 | } 32 | 33 | QMenuBar::item 34 | { 35 | background: transparent; 36 | } 37 | 38 | QMenuBar::item:selected 39 | { 40 | background: #3f76a4; 41 | border: 1px solid #000000; 42 | } 43 | 44 | QMenuBar::item:pressed 45 | { 46 | border: 1px solid #000000; 47 | margin-bottom:-1px; 48 | padding-bottom:1px; 49 | } 50 | 51 | QMenu 52 | { 53 | border: 1px solid #000000; 54 | } 55 | 56 | QMenu::item 57 | { 58 | padding: 2px 20px 2px 20px; 59 | } 60 | 61 | QMenu::item:selected 62 | { 63 | color: #000000; 64 | } 65 | 66 | QAbstractItemView 67 | { 68 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #4f94cd, stop: 0.1 #4f94cd, stop: 1 #4f94cd); 69 | } 70 | 71 | QWidget:focus 72 | { 73 | /*border: 2px solid QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #72a9d7, stop: 1 #4f94cd);*/ 74 | } 75 | 76 | QLineEdit 77 | { 78 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #4f94cd, stop: 1 #4f94cd); 79 | padding: 1px; 80 | border-style: solid; 81 | border: 1px solid #3f76a4; 82 | border-radius: 3; 83 | } 84 | 85 | QPushButton 86 | { 87 | color: #ffffff; 88 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #72a9d7, stop: 1 #3f76a4); 89 | border-width: 1px; 90 | border-color: #1e1e1e; 91 | border-style: solid; 92 | border-radius: 3; 93 | padding: 3px; 94 | font-size: 12px; 95 | padding-left: 5px; 96 | padding-right: 5px; 97 | } 98 | 99 | QPushButton:pressed 100 | { 101 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #72a9d7, stop: 1 #3f76a4); 102 | } 103 | 104 | QPushButton:disabled 105 | { 106 | color: lightgray; 107 | border-color: lightgray; 108 | } 109 | 110 | QComboBox 111 | { 112 | selection-background-color: #ffaa00; 113 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #72a9d7, stop: 1 #3f76a4); 114 | border-style: solid; 115 | border: 1px solid #1e1e1e; 116 | border-radius: 3; 117 | min-width: 68px; 118 | min-height: 22px; 119 | } 120 | 121 | QComboBox:hover,QPushButton:hover 122 | { 123 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2f587b, stop: 1 #3f76a4); 124 | } 125 | 126 | 127 | QComboBox:on 128 | { 129 | padding-top: 3px; 130 | padding-left: 4px; 131 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2d2d2d, stop: 0.1 #2b2b2b, stop: 0.5 #292929, stop: 0.9 #282828, stop: 1 #252525); 132 | selection-background-color: #ffaa00; 133 | } 134 | 135 | QComboBox QAbstractItemView 136 | { 137 | border: 2px solid darkgray; 138 | selection-background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #72a9d7, stop: 1 #4f94cd); 139 | } 140 | 141 | QComboBox::drop-down 142 | { 143 | subcontrol-origin: padding; 144 | subcontrol-position: top right; 145 | width: 15px; 146 | 147 | border-left-width: 0px; 148 | border-left-color: darkgray; 149 | border-left-style: solid; /* just a single line */ 150 | border-top-right-radius: 3px; /* same radius as the QComboBox */ 151 | border-bottom-right-radius: 3px; 152 | } 153 | 154 | QComboBox::disabled 155 | { 156 | color: lightgray; 157 | border-color: lightgray; 158 | } 159 | 160 | QComboBox::down-arrow 161 | { 162 | image: url(:/down_arrow.png); 163 | } 164 | 165 | QGroupBox:focus 166 | { 167 | border: 2px solid QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #72a9d7, stop: 1 #4f94cd); 168 | } 169 | 170 | QTextEdit:focus 171 | { 172 | border: 2px solid QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #72a9d7, stop: 1 #4f94cd); 173 | } 174 | 175 | QScrollBar:horizontal { 176 | border: 1px solid #222222; 177 | background: #3f76a4; 178 | margin: 0px 16px 0 16px; 179 | } 180 | 181 | QScrollBar::handle:horizontal 182 | { 183 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #72a9d7, stop: 1 #72a9d7); 184 | min-height: 20px; 185 | border-radius: 2px; 186 | } 187 | 188 | QScrollBar::add-line:horizontal { 189 | border: 1px solid #1b1b19; 190 | border-radius: 2px; 191 | background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #72a9d7, stop: 1 #4f94cd); 192 | width: 14px; 193 | subcontrol-position: right; 194 | subcontrol-origin: margin; 195 | } 196 | 197 | QScrollBar::sub-line:horizontal { 198 | border: 1px solid #1b1b19; 199 | border-radius: 2px; 200 | background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #72a9d7, stop: 1 #72a9d7); 201 | width: 14px; 202 | subcontrol-position: left; 203 | subcontrol-origin: margin; 204 | } 205 | 206 | QScrollBar::right-arrow:horizontal, QScrollBar::left-arrow:horizontal 207 | { 208 | border: 1px solid black; 209 | width: 1px; 210 | height: 1px; 211 | background: white; 212 | } 213 | 214 | QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal 215 | { 216 | background: none; 217 | } 218 | 219 | QScrollBar:vertical 220 | { 221 | background: #3f76a4; 222 | margin: 16px 0 16px 0; 223 | border: 1px solid #222222; 224 | } 225 | 226 | QScrollBar::handle:vertical 227 | { 228 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #72a9d7, stop: 1 #72a9d7); 229 | min-height: 20px; 230 | border-radius: 2px; 231 | } 232 | 233 | QScrollBar::add-line:vertical 234 | { 235 | border: 1px solid #1b1b19; 236 | border-radius: 2px; 237 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #72a9d7, stop: 1 #4f94cd); 238 | height: 14px; 239 | subcontrol-position: bottom; 240 | subcontrol-origin: margin; 241 | } 242 | 243 | QScrollBar::sub-line:vertical 244 | { 245 | border: 1px solid #1b1b19; 246 | border-radius: 2px; 247 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #72a9d7, stop: 1 #72a9d7); 248 | height: 14px; 249 | subcontrol-position: top; 250 | subcontrol-origin: margin; 251 | } 252 | 253 | QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical 254 | { 255 | border: 1px solid black; 256 | width: 1px; 257 | height: 1px; 258 | background: white; 259 | } 260 | 261 | 262 | QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical 263 | { 264 | background: none; 265 | } 266 | 267 | QTextEdit 268 | { 269 | background-color: #242424; 270 | } 271 | 272 | QPlainTextEdit 273 | { 274 | background-color: #ffff00; 275 | } 276 | 277 | QHeaderView::section 278 | { 279 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #72a9d7, stop: 1 #3f76a4); 280 | color: white; 281 | padding-left: 4px; 282 | border: 1px solid #3f76a4; 283 | } 284 | 285 | TableView::item:focus 286 | { 287 | selection-background-color: yellow; 288 | } 289 | QCheckBox:disabled 290 | { 291 | color: #414141; 292 | } 293 | 294 | QDockWidget::title 295 | { 296 | text-align: center; 297 | spacing: 3px; /* spacing between items in the tool bar */ 298 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #323232, stop: 0.5 #242424, stop:1 #323232); 299 | } 300 | 301 | QDockWidget::close-button, QDockWidget::float-button 302 | { 303 | text-align: center; 304 | spacing: 1px; /* spacing between items in the tool bar */ 305 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #323232, stop: 0.5 #242424, stop:1 #323232); 306 | } 307 | 308 | QDockWidget::close-button:hover, QDockWidget::float-button:hover 309 | { 310 | background: #242424; 311 | } 312 | 313 | QDockWidget::close-button:pressed, QDockWidget::float-button:pressed 314 | { 315 | padding: 1px -1px -1px 1px; 316 | } 317 | 318 | QMainWindow::separator 319 | { 320 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #161616, stop: 0.5 #151515, stop: 0.6 #212121, stop:1 #343434); 321 | color: white; 322 | padding-left: 4px; 323 | border: 1px solid #4c4c4c; 324 | spacing: 3px; /* spacing between items in the tool bar */ 325 | } 326 | 327 | QMainWindow::separator:hover 328 | { 329 | 330 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #d7801a, stop:0.5 #b56c17 stop:1 #72a9d7); 331 | color: white; 332 | padding-left: 4px; 333 | border: 1px solid #6c6c6c; 334 | spacing: 3px; /* spacing between items in the tool bar */ 335 | } 336 | 337 | QToolBar::handle 338 | { 339 | spacing: 3px; /* spacing between items in the tool bar */ 340 | background: url(:/images/handle.png); 341 | } 342 | 343 | QMenu::separator 344 | { 345 | height: 1px; 346 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #161616, stop: 0.5 #151515, stop: 0.6 #212121, stop:1 #343434); 347 | color: white; 348 | padding-left: 4px; 349 | margin-left: 10px; 350 | margin-right: 5px; 351 | } 352 | 353 | QProgressBar 354 | { 355 | border: 2px solid grey; 356 | border-radius: 5px; 357 | text-align: center; 358 | } 359 | 360 | QProgressBar::chunk 361 | { 362 | width: 2.15px; 363 | margin: 0.5px; 364 | } 365 | 366 | QTabBar::tab { 367 | color: #ffffff; 368 | border: 1px solid #444; 369 | border-bottom-style: none; 370 | background-color: #323232; 371 | padding-left: 10px; 372 | padding-right: 10px; 373 | padding-top: 3px; 374 | padding-bottom: 2px; 375 | margin-right: -1px; 376 | } 377 | 378 | QTabWidget::pane { 379 | border: 1px solid #444; 380 | top: 1px; 381 | } 382 | 383 | QTabBar::tab:last 384 | { 385 | margin-right: 0; /* the last selected tab has nothing to overlap with on the right */ 386 | border-top-right-radius: 3px; 387 | } 388 | 389 | QTabBar::tab:first:!selected 390 | { 391 | margin-left: 0px; /* the last selected tab has nothing to overlap with on the right */ 392 | 393 | 394 | border-top-left-radius: 3px; 395 | } 396 | 397 | QTabBar::tab:!selected 398 | { 399 | color: #ffffff; 400 | border-bottom-style: solid; 401 | margin-top: 3px; 402 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:1 #212121, stop:.4 #343434); 403 | } 404 | 405 | QTabBar::tab:selected 406 | { 407 | border-top-left-radius: 3px; 408 | border-top-right-radius: 3px; 409 | margin-bottom: 0px; 410 | } 411 | 412 | QTabBar::tab:!selected:hover 413 | { 414 | /*border-top: 2px solid #ffaa00; 415 | padding-bottom: 3px;*/ 416 | border-top-left-radius: 3px; 417 | border-top-right-radius: 3px; 418 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:1 #212121, stop:0.4 #343434, stop:0.2 #343434, stop:0.1 #ffaa00); 419 | } 420 | 421 | QRadioButton::indicator:checked, QRadioButton::indicator:unchecked{ 422 | color: #ffffff; 423 | background-color: #323232; 424 | border: 1px solid #ffffff; 425 | border-radius: 6px; 426 | } 427 | 428 | QRadioButton::indicator:checked 429 | { 430 | background-color: qradialgradient( 431 | cx: 0.5, cy: 0.5, 432 | fx: 0.5, fy: 0.5, 433 | radius: 1.0, 434 | stop: 0.25 #ffaa00, 435 | stop: 0.3 #323232 436 | ); 437 | } 438 | 439 | QCheckBox::indicator{ 440 | color: #ffffff; 441 | background-color: #4f94cd; 442 | border: 1px solid #ffffff; 443 | width: 9px; 444 | height: 9px; 445 | } 446 | 447 | QRadioButton::indicator 448 | { 449 | border-radius: 6px; 450 | } 451 | 452 | QRadioButton::indicator:hover, QCheckBox::indicator:hover 453 | { 454 | border: 1px solid #ffaa00; 455 | } 456 | 457 | QCheckBox::indicator:checked 458 | { 459 | image:url(:/images/checkbox.png); 460 | } 461 | 462 | QCheckBox::indicator:disabled, QRadioButton::indicator:disabled 463 | { 464 | border: 1px solid #444; 465 | } -------------------------------------------------------------------------------- /bin/x64/styles/plotcfts_style_dark_fusion.qss: -------------------------------------------------------------------------------- 1 | /* https://github.com/Jorgen-VikingGod/Qt-Frameless-Window-DarkStyle/blob/master/darkstyle/darkstyle.qss */ 2 | QToolTip{ 3 | color:#ffffff; 4 | background-color:palette(base); 5 | border:1px solid palette(highlight); 6 | border-radius:4px; 7 | } 8 | QStatusBar{ 9 | background-color:qlineargradient(x1:0,y1:0,x2:0,y2:1,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75)); 10 | color:palette(mid); 11 | } 12 | QMenuBar{ 13 | background-color:qlineargradient(x1:0,y1:0,x2:0,y2:1,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75)); 14 | border-bottom:2px solid rgba(25,25,25,75); 15 | } 16 | QMenuBar::item{ 17 | spacing:2px; 18 | padding:3px 4px; 19 | background:transparent; 20 | } 21 | QMenuBar::item:selected{ 22 | background-color:qlineargradient(x1:0,y1:0,x2:0,y2:1,stop:0 rgba(106,106,106,255),stop:1 rgba(106,106,106,75)); 23 | border-left:1px solid rgba(106,106,106,127); 24 | border-right:1px solid rgba(106,106,106,127); 25 | } 26 | QMenuBar::item:pressed{ 27 | background-color:palette(highlight); 28 | border-left:1px solid rgba(25,25,25,127); 29 | border-right:1px solid rgba(25,25,25,127); 30 | } 31 | QMenu{ 32 | background-color:palette(window); 33 | border:1px solid palette(shadow); 34 | } 35 | QMenu::item{ 36 | padding:3px 25px 3px 25px; 37 | border:1px solid transparent; 38 | } 39 | QMenu::item:disabled{ 40 | background-color:rgba(35,35,35,127); 41 | color:palette(disabled); 42 | } 43 | QMenu::item:selected{ 44 | border-color:rgba(147,191,236,127); 45 | background:palette(highlight); 46 | } 47 | QMenu::icon:checked{ 48 | background-color:qlineargradient(x1:0,y1:1,x2:0,y2:0,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75)); 49 | border:1px solid palette(highlight); 50 | border-radius:2px; 51 | } 52 | QMenu::separator{ 53 | height:1px; 54 | background:palette(alternate-base); 55 | margin-left:5px; 56 | margin-right:5px; 57 | } 58 | QMenu::indicator{ 59 | width:18px; 60 | height:18px; 61 | } 62 | QMenu::indicator:non-exclusive:checked{ 63 | image:url(:/darkstyle/icon_checkbox_checked.png); 64 | padding-left:2px; 65 | } 66 | QMenu::indicator:non-exclusive:unchecked{ 67 | image:url(:/darkstyle/icon_checkbox_unchecked.png); 68 | padding-left:2px; 69 | } 70 | QMenu::indicator:exclusive:checked{ 71 | image:url(:/darkstyle/icon_radiobutton_checked.png); 72 | padding-left:2px; 73 | } 74 | QMenu::indicator:exclusive:unchecked{ 75 | image:url(:/darkstyle/icon_radiobutton_unchecked.png); 76 | padding-left:2px; 77 | } 78 | QToolBar::top{ 79 | background-color:qlineargradient(x1:0,y1:0,x2:0,y2:1,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75)); 80 | border-bottom:3px solid qlineargradient(x1:0,y1:0,x2:0,y2:1,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75)); 81 | } 82 | QToolBar::bottom{ 83 | background-color:qlineargradient(x1:0,y1:1,x2:0,y2:0,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75)); 84 | border-top:3px solid qlineargradient(x1:0,y1:1,x2:0,y2:0,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75)); 85 | } 86 | QToolBar::left{ 87 | background-color:qlineargradient(x1:0,y1:0,x2:1,y2:0,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75)); 88 | border-right:3px solid qlineargradient(x1:0,y1:0,x2:1,y2:0,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75)); 89 | } 90 | QToolBar::right{ 91 | background-color:qlineargradient(x1:1,y1:0,x2:0,y2:0,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75)); 92 | border-left:3px solid qlineargradient(x1:1,y1:0,x2:0,y2:0,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75)); 93 | } 94 | QMainWindow::separator{ 95 | width:6px; 96 | height:5px; 97 | padding:2px; 98 | } 99 | QSplitter::handle:horizontal{ 100 | width:10px; 101 | } 102 | QSplitter::handle:vertical{ 103 | height:10px; 104 | } 105 | QMainWindow::separator:hover,QSplitter::handle:hover{ 106 | background:palette(highlight); 107 | } 108 | QDockWidget::title{ 109 | padding:4px; 110 | background-color:qlineargradient(x1:0,y1:1,x2:0,y2:0,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75)); 111 | border:1px solid rgba(25,25,25,75); 112 | border-bottom:2px solid rgba(25,25,25,75); 113 | } 114 | QDockWidget{ 115 | titlebar-close-icon:url(:/darkstyle/icon_close.png); 116 | titlebar-normal-icon:url(:/darkstyle/icon_restore.png); 117 | } 118 | QDockWidget::close-button,QDockWidget::float-button{ 119 | subcontrol-position:top right; 120 | subcontrol-origin:margin; 121 | position:absolute; 122 | top:3px; 123 | bottom:0px; 124 | width:20px; 125 | height:20px; 126 | } 127 | QDockWidget::close-button{ 128 | right:3px; 129 | } 130 | QDockWidget::float-button{ 131 | right:25px; 132 | } 133 | QGroupBox{ 134 | background-color:rgba(66,66,66,50%); 135 | margin-top:27px; 136 | border:1px solid rgba(25,25,25,127); 137 | border-radius:4px; 138 | } 139 | QGroupBox::title{ 140 | subcontrol-origin:margin; 141 | subcontrol-position:left top; 142 | padding:4px 6px; 143 | margin-left:3px; 144 | background-color:qlineargradient(x1:0,y1:1,x2:0,y2:0,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75)); 145 | border:1px solid rgba(25,25,25,75); 146 | border-bottom:2px solid rgb(127,127,127); 147 | border-top-left-radius:4px; 148 | border-top-right-radius:4px; 149 | } 150 | QTabWidget::pane{ 151 | background-color:rgba(66,66,66,50%); 152 | border-top:1px solid rgba(25,25,25,50%); 153 | } 154 | QTabWidget::tab-bar{ 155 | left:3px; 156 | top:1px; 157 | } 158 | QTabBar{ 159 | background-color:transparent; 160 | qproperty-drawBase:0; 161 | border-bottom:1px solid rgba(25,25,25,50%); 162 | } 163 | QTabBar::tab{ 164 | padding:4px 6px; 165 | background-color:qlineargradient(x1:0,y1:1,x2:0,y2:0,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75)); 166 | border:1px solid rgba(25,25,25,75); 167 | border-top-left-radius:4px; 168 | border-top-right-radius:4px; 169 | } 170 | QTabBar::tab:selected,QTabBar::tab:hover{ 171 | background-color:qlineargradient(x1:0,y1:0,x2:0,y2:1,stop:0 rgba(53,53,53,127),stop:1 rgba(66,66,66,50%)); 172 | border-bottom-color:rgba(66,66,66,75%); 173 | } 174 | QTabBar::tab:selected{ 175 | border-bottom:2px solid palette(highlight); 176 | } 177 | QTabBar::tab::selected:disabled{ 178 | border-bottom:2px solid rgb(127,127,127); 179 | } 180 | QTabBar::tab:!selected{ 181 | margin-top:2px; 182 | } 183 | QCheckBox::indicator{ 184 | width:18px; 185 | height:18px; 186 | } 187 | QCheckBox::indicator:checked,QTreeView::indicator:checked,QTableView::indicator:checked,QGroupBox::indicator:checked{ 188 | image:url(:/darkstyle/icon_checkbox_checked.png); 189 | } 190 | QCheckBox::indicator:checked:pressed,QTreeView::indicator:checked:pressed,QTableView::indicator:checked:pressed,QGroupBox::indicator:checked:pressed{ 191 | image:url(:/darkstyle/icon_checkbox_checked_pressed.png); 192 | } 193 | QCheckBox::indicator:checked:disabled,QTreeView::indicator:checked:disabled,QTableView::indicator:checked:disabled,QGroupBox::indicator:checked:disabled{ 194 | image:url(:/darkstyle/icon_checkbox_checked_disabled.png); 195 | } 196 | QCheckBox::indicator:unchecked,QTreeView::indicator:unchecked,QTableView::indicator:unchecked,QGroupBox::indicator:unchecked{ 197 | image:url(:/darkstyle/icon_checkbox_unchecked.png); 198 | } 199 | QCheckBox::indicator:unchecked:pressed,QTreeView::indicator:unchecked:pressed,QTableView::indicator:unchecked:pressed,QGroupBox::indicator:unchecked:pressed{ 200 | image:url(:/darkstyle/icon_checkbox_unchecked_pressed.png); 201 | } 202 | QCheckBox::indicator:unchecked:disabled,QTreeView::indicator:unchecked:disabled,QTableView::indicator:unchecked:disabled,QGroupBox::indicator:unchecked:disabled{ 203 | image:url(:/darkstyle/icon_checkbox_unchecked_disabled.png); 204 | } 205 | QCheckBox::indicator:indeterminate,QTreeView::indicator:indeterminate,QTableView::indicator:indeterminate,QGroupBox::indicator:indeterminate{ 206 | image:url(:/darkstyle/icon_checkbox_indeterminate.png); 207 | } 208 | QCheckBox::indicator:indeterminate:pressed,QTreeView::indicator:indeterminate:pressed,QTableView::indicator:indeterminate:pressed,QGroupBox::indicator:indeterminate:pressed{ 209 | image:url(:/darkstyle/icon_checkbox_indeterminate_pressed.png); 210 | } 211 | QCheckBox::indicator:indeterminate:disabled,QTreeView::indicator:indeterminate:disabled,QTableView::indicator:indeterminate:disabled,QGroupBox::indicator:indeterminate:disabled{ 212 | image:url(:/darkstyle/icon_checkbox_indeterminate_disabled.png); 213 | } 214 | QRadioButton::indicator{ 215 | width:18px; 216 | height:18px; 217 | } 218 | QRadioButton::indicator:checked{ 219 | image:url(:/darkstyle/icon_radiobutton_checked.png); 220 | } 221 | QRadioButton::indicator:checked:pressed{ 222 | image:url(:/darkstyle/icon_radiobutton_checked_pressed.png); 223 | } 224 | QRadioButton::indicator:checked:disabled{ 225 | image:url(:/darkstyle/icon_radiobutton_checked_disabled.png); 226 | } 227 | QRadioButton::indicator:unchecked{ 228 | image:url(:/darkstyle/icon_radiobutton_unchecked.png); 229 | } 230 | QRadioButton::indicator:unchecked:pressed{ 231 | image:url(:/darkstyle/icon_radiobutton_unchecked_pressed.png); 232 | } 233 | QRadioButton::indicator:unchecked:disabled{ 234 | image:url(:/darkstyle/icon_radiobutton_unchecked_disabled.png); 235 | } 236 | QTreeView, QTableView{ 237 | alternate-background-color:palette(window); 238 | background:palette(base); 239 | } 240 | QTreeView QHeaderView::section, QTableView QHeaderView::section{ 241 | background-color:qlineargradient(x1:0,y1:1,x2:0,y2:0,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75)); 242 | border-style:none; 243 | border-bottom:1px solid palette(dark); 244 | padding-left:5px; 245 | padding-right:5px; 246 | } 247 | QTreeView::item:selected:disabled, QTableView::item:selected:disabled{ 248 | background:rgb(80,80,80); 249 | } 250 | QTreeView::branch{ 251 | background-color:palette(base); 252 | } 253 | QTreeView::branch:has-siblings:!adjoins-item{ 254 | border-image:url(:/darkstyle/icon_vline.png) 0; 255 | } 256 | QTreeView::branch:has-siblings:adjoins-item{ 257 | border-image:url(:/darkstyle/icon_branch_more.png) 0; 258 | } 259 | QTreeView::branch:!has-children:!has-siblings:adjoins-item{ 260 | border-image:url(:/darkstyle/icon_branch_end.png) 0; 261 | } 262 | QTreeView::branch:has-children:!has-siblings:closed, 263 | QTreeView::branch:closed:has-children:has-siblings{ 264 | border-image:none; 265 | image:url(:/darkstyle/icon_branch_closed.png); 266 | } 267 | QTreeView::branch:open:has-children:!has-siblings, 268 | QTreeView::branch:open:has-children:has-siblings{ 269 | border-image:none; 270 | image:url(:/darkstyle/icon_branch_open.png); 271 | } 272 | QScrollBar:vertical{ 273 | background:palette(base); 274 | border-top-right-radius:2px; 275 | border-bottom-right-radius:2px; 276 | width:16px; 277 | margin:0px; 278 | } 279 | QScrollBar::handle:vertical{ 280 | background-color:palette(alternate-base); 281 | border-radius:2px; 282 | min-height:20px; 283 | margin:2px 4px 2px 4px; 284 | } 285 | QScrollBar::handle:vertical:hover{ 286 | background-color:palette(highlight); 287 | } 288 | QScrollBar::add-line:vertical{ 289 | background:none; 290 | height:0px; 291 | subcontrol-position:right; 292 | subcontrol-origin:margin; 293 | } 294 | QScrollBar::sub-line:vertical{ 295 | background:none; 296 | height:0px; 297 | subcontrol-position:left; 298 | subcontrol-origin:margin; 299 | } 300 | QScrollBar:horizontal{ 301 | background:palette(base); 302 | height:16px; 303 | margin:0px; 304 | } 305 | QScrollBar::handle:horizontal{ 306 | background-color:palette(alternate-base); 307 | border-radius:2px; 308 | min-width:20px; 309 | margin:4px 2px 4px 2px; 310 | } 311 | QScrollBar::handle:horizontal:hover{ 312 | background-color:palette(highlight); 313 | } 314 | QScrollBar::add-line:horizontal{ 315 | background:none; 316 | width:0px; 317 | subcontrol-position:bottom; 318 | subcontrol-origin:margin; 319 | } 320 | QScrollBar::sub-line:horizontal{ 321 | background:none; 322 | width:0px; 323 | subcontrol-position:top; 324 | subcontrol-origin:margin; 325 | } 326 | QSlider::handle:horizontal{ 327 | border-radius:4px; 328 | border:1px solid rgba(25,25,25,255); 329 | background-color:palette(alternate-base); 330 | min-height:20px; 331 | margin:0 -4px; 332 | } 333 | QSlider::handle:horizontal:hover{ 334 | background:palette(highlight); 335 | } 336 | QSlider::add-page:horizontal{ 337 | background:palette(base); 338 | } 339 | QSlider::sub-page:horizontal{ 340 | background:palette(highlight); 341 | } 342 | QSlider::sub-page:horizontal:disabled{ 343 | background:rgb(80,80,80); 344 | } -------------------------------------------------------------------------------- /bin/x64/styles/plotcfts_style_enabled_disabled.qss: -------------------------------------------------------------------------------- 1 | /* http://www.yasinuludag.com/darkorange.stylesheet */ 2 | QToolTip 3 | { 4 | border: 1px solid black; 5 | color: #0000ff; 6 | background-color: #00ff00; 7 | padding: 1px; 8 | border-radius: 3px; 9 | opacity: 100; 10 | } 11 | 12 | QWidget::enabled 13 | { 14 | color: #0000ff; 15 | background-color: #ffff00; 16 | } 17 | 18 | QWidget:item:hover 19 | { 20 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #ca0619); 21 | color: #000000; 22 | } 23 | 24 | QWidget:item:selected 25 | { 26 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); 27 | } 28 | 29 | QWidget:disabled 30 | { 31 | color: #0000ff; 32 | background-color: #ff00ff; 33 | } 34 | 35 | QMenuBar::item 36 | { 37 | background: transparent; 38 | } 39 | 40 | QMenuBar::item:selected 41 | { 42 | background: transparent; 43 | border: 1px solid #ffaa00; 44 | } 45 | 46 | QMenuBar::item:pressed 47 | { 48 | background: #444; 49 | border: 1px solid #000; 50 | background-color: QLinearGradient( 51 | x1:0, y1:0, 52 | x2:0, y2:1, 53 | stop:1 #212121, 54 | stop:0.4 #343434/*, 55 | stop:0.2 #343434, 56 | stop:0.1 #ffaa00*/ 57 | ); 58 | margin-bottom:-1px; 59 | padding-bottom:1px; 60 | } 61 | 62 | QMenu 63 | { 64 | border: 1px solid #000; 65 | } 66 | 67 | QMenu::item 68 | { 69 | padding: 2px 20px 2px 20px; 70 | } 71 | 72 | QMenu::item:selected 73 | { 74 | color: #000000; 75 | } 76 | 77 | 78 | QAbstractItemView 79 | { 80 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #4d4d4d, stop: 0.1 #646464, stop: 1 #5d5d5d); 81 | } 82 | 83 | QWidget:focus 84 | { 85 | /*border: 2px solid QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a);*/ 86 | } 87 | 88 | QLineEdit 89 | { 90 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #4d4d4d, stop: 0 #646464, stop: 1 #5d5d5d); 91 | padding: 1px; 92 | border-style: solid; 93 | border: 1px solid #1e1e1e; 94 | border-radius: 5; 95 | } 96 | 97 | QPushButton 98 | { 99 | color: #b1b1b1; 100 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #565656, stop: 0.1 #525252, stop: 0.5 #4e4e4e, stop: 0.9 #4a4a4a, stop: 1 #464646); 101 | border-width: 1px; 102 | border-color: #1e1e1e; 103 | border-style: solid; 104 | border-radius: 6; 105 | padding: 3px; 106 | font-size: 12px; 107 | padding-left: 5px; 108 | padding-right: 5px; 109 | } 110 | 111 | QPushButton:pressed 112 | { 113 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2d2d2d, stop: 0.1 #2b2b2b, stop: 0.5 #292929, stop: 0.9 #282828, stop: 1 #252525); 114 | } 115 | 116 | QComboBox::enabled 117 | { 118 | selection-background-color: #0000ff; 119 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ff0000, stop: 0.5 #ffff00, stop: 1 #ff0000); 120 | border-style: solid; 121 | border: 1px solid #1e1e1e; 122 | border-radius: 2px; 123 | } 124 | 125 | QComboBox:hover,QPushButton:hover 126 | { 127 | border: 2px solid #0000ff; 128 | } 129 | 130 | 131 | QComboBox:on 132 | { 133 | padding-top: 3px; 134 | padding-left: 4px; 135 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ff0000, stop: 0.5 #ffff00, stop: 1 #ff0000); 136 | selection-background-color: #0000ff; 137 | } 138 | 139 | QComboBox QAbstractItemView 140 | { 141 | border: 2px solid darkgray; 142 | selection-background-color: #ffff00; 143 | } 144 | 145 | QComboBox::drop-down 146 | { 147 | subcontrol-origin: padding; 148 | subcontrol-position: top right; 149 | width: 15px; 150 | background-color: #ff0000; 151 | 152 | border-left-width: 0px; 153 | border-left-color: darkgray; 154 | border-left-style: solid; /* just a single line */ 155 | border-top-right-radius: 3px; /* same radius as the QComboBox */ 156 | border-bottom-right-radius: 3px; 157 | } 158 | 159 | QComboBox::down-arrow 160 | { 161 | image: url(:/down_arrow.png); 162 | } 163 | 164 | QGroupBox:focus 165 | { 166 | border: 2px solid QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); 167 | } 168 | 169 | QTextEdit:focus 170 | { 171 | border: 2px solid QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); 172 | } 173 | 174 | QScrollBar:horizontal { 175 | border: 1px solid #222222; 176 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0.0 #121212, stop: 0.2 #282828, stop: 1 #484848); 177 | height: 7px; 178 | margin: 0px 16px 0 16px; 179 | } 180 | 181 | QScrollBar::handle:horizontal 182 | { 183 | background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #ffa02f, stop: 0.5 #d7801a, stop: 1 #ffa02f); 184 | min-height: 20px; 185 | border-radius: 2px; 186 | } 187 | 188 | QScrollBar::add-line:horizontal { 189 | border: 1px solid #1b1b19; 190 | border-radius: 2px; 191 | background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #ffa02f, stop: 1 #d7801a); 192 | width: 14px; 193 | subcontrol-position: right; 194 | subcontrol-origin: margin; 195 | } 196 | 197 | QScrollBar::sub-line:horizontal { 198 | border: 1px solid #1b1b19; 199 | border-radius: 2px; 200 | background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #ffa02f, stop: 1 #d7801a); 201 | width: 14px; 202 | subcontrol-position: left; 203 | subcontrol-origin: margin; 204 | } 205 | 206 | QScrollBar::right-arrow:horizontal, QScrollBar::left-arrow:horizontal 207 | { 208 | border: 1px solid black; 209 | width: 1px; 210 | height: 1px; 211 | background: white; 212 | } 213 | 214 | QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal 215 | { 216 | background: none; 217 | } 218 | 219 | QScrollBar:vertical 220 | { 221 | background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0.0 #121212, stop: 0.2 #282828, stop: 1 #484848); 222 | width: 7px; 223 | margin: 16px 0 16px 0; 224 | border: 1px solid #222222; 225 | } 226 | 227 | QScrollBar::handle:vertical 228 | { 229 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 0.5 #d7801a, stop: 1 #ffa02f); 230 | min-height: 20px; 231 | border-radius: 2px; 232 | } 233 | 234 | QScrollBar::add-line:vertical 235 | { 236 | border: 1px solid #1b1b19; 237 | border-radius: 2px; 238 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); 239 | height: 14px; 240 | subcontrol-position: bottom; 241 | subcontrol-origin: margin; 242 | } 243 | 244 | QScrollBar::sub-line:vertical 245 | { 246 | border: 1px solid #1b1b19; 247 | border-radius: 2px; 248 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #d7801a, stop: 1 #ffa02f); 249 | height: 14px; 250 | subcontrol-position: top; 251 | subcontrol-origin: margin; 252 | } 253 | 254 | QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical 255 | { 256 | border: 1px solid black; 257 | width: 1px; 258 | height: 1px; 259 | background: white; 260 | } 261 | 262 | 263 | QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical 264 | { 265 | background: none; 266 | } 267 | 268 | QTextEdit 269 | { 270 | background-color: #ff0000; 271 | } 272 | 273 | QPlainTextEdit 274 | { 275 | background-color: #ff0000; 276 | } 277 | 278 | QHeaderView::section 279 | { 280 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #616161, stop: 0.5 #505050, stop: 0.6 #434343, stop:1 #656565); 281 | color: white; 282 | padding-left: 4px; 283 | border: 1px solid #6c6c6c; 284 | } 285 | 286 | QCheckBox:disabled 287 | { 288 | color: #414141; 289 | } 290 | 291 | QDockWidget::title 292 | { 293 | text-align: center; 294 | spacing: 3px; /* spacing between items in the tool bar */ 295 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #323232, stop: 0.5 #242424, stop:1 #323232); 296 | } 297 | 298 | QDockWidget::close-button, QDockWidget::float-button 299 | { 300 | text-align: center; 301 | spacing: 1px; /* spacing between items in the tool bar */ 302 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #323232, stop: 0.5 #242424, stop:1 #323232); 303 | } 304 | 305 | QDockWidget::close-button:hover, QDockWidget::float-button:hover 306 | { 307 | background: #242424; 308 | } 309 | 310 | QDockWidget::close-button:pressed, QDockWidget::float-button:pressed 311 | { 312 | padding: 1px -1px -1px 1px; 313 | } 314 | 315 | QMainWindow::separator 316 | { 317 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #161616, stop: 0.5 #151515, stop: 0.6 #212121, stop:1 #343434); 318 | color: white; 319 | padding-left: 4px; 320 | border: 1px solid #4c4c4c; 321 | spacing: 3px; /* spacing between items in the tool bar */ 322 | } 323 | 324 | QMainWindow::separator:hover 325 | { 326 | 327 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #d7801a, stop:0.5 #b56c17 stop:1 #ffa02f); 328 | color: white; 329 | padding-left: 4px; 330 | border: 1px solid #6c6c6c; 331 | spacing: 3px; /* spacing between items in the tool bar */ 332 | } 333 | 334 | QToolBar::handle 335 | { 336 | spacing: 3px; /* spacing between items in the tool bar */ 337 | background: url(:/images/handle.png); 338 | } 339 | 340 | QMenu::separator 341 | { 342 | height: 2px; 343 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #161616, stop: 0.5 #151515, stop: 0.6 #212121, stop:1 #343434); 344 | color: white; 345 | padding-left: 4px; 346 | margin-left: 10px; 347 | margin-right: 5px; 348 | } 349 | 350 | QProgressBar 351 | { 352 | border: 2px solid grey; 353 | border-radius: 5px; 354 | text-align: center; 355 | } 356 | 357 | QProgressBar::chunk 358 | { 359 | background-color: #d7801a; 360 | width: 2.15px; 361 | margin: 0.5px; 362 | } 363 | 364 | QTabBar::tab { 365 | color: #b1b1b1; 366 | border: 1px solid #444; 367 | border-bottom-style: none; 368 | background-color: #323232; 369 | padding-left: 10px; 370 | padding-right: 10px; 371 | padding-top: 3px; 372 | padding-bottom: 2px; 373 | margin-right: -1px; 374 | } 375 | 376 | QTabWidget::pane { 377 | border: 1px solid #444; 378 | top: 1px; 379 | } 380 | 381 | QTabBar::tab:last 382 | { 383 | margin-right: 0; /* the last selected tab has nothing to overlap with on the right */ 384 | border-top-right-radius: 3px; 385 | } 386 | 387 | QTabBar::tab:first:!selected 388 | { 389 | margin-left: 0px; /* the last selected tab has nothing to overlap with on the right */ 390 | 391 | 392 | border-top-left-radius: 3px; 393 | } 394 | 395 | QTabBar::tab:!selected 396 | { 397 | color: #b1b1b1; 398 | border-bottom-style: solid; 399 | margin-top: 3px; 400 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:1 #212121, stop:.4 #343434); 401 | } 402 | 403 | QTabBar::tab:selected 404 | { 405 | border-top-left-radius: 3px; 406 | border-top-right-radius: 3px; 407 | margin-bottom: 0px; 408 | } 409 | 410 | QTabBar::tab:!selected:hover 411 | { 412 | /*border-top: 2px solid #ffaa00; 413 | padding-bottom: 3px;*/ 414 | border-top-left-radius: 3px; 415 | border-top-right-radius: 3px; 416 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:1 #212121, stop:0.4 #343434, stop:0.2 #343434, stop:0.1 #ffaa00); 417 | } 418 | 419 | QRadioButton::indicator:checked, QRadioButton::indicator:unchecked{ 420 | color: #b1b1b1; 421 | background-color: #323232; 422 | border: 1px solid #b1b1b1; 423 | border-radius: 6px; 424 | } 425 | 426 | QRadioButton::indicator:checked 427 | { 428 | background-color: qradialgradient( 429 | cx: 0.5, cy: 0.5, 430 | fx: 0.5, fy: 0.5, 431 | radius: 1.0, 432 | stop: 0.25 #ffaa00, 433 | stop: 0.3 #323232 434 | ); 435 | } 436 | 437 | QCheckBox::indicator{ 438 | color: #b1b1b1; 439 | background-color: #323232; 440 | border: 1px solid #b1b1b1; 441 | width: 9px; 442 | height: 9px; 443 | } 444 | 445 | QRadioButton::indicator 446 | { 447 | border-radius: 6px; 448 | } 449 | 450 | QRadioButton::indicator:hover, QCheckBox::indicator:hover 451 | { 452 | border: 1px solid #ffaa00; 453 | } 454 | 455 | QCheckBox::indicator:checked 456 | { 457 | image:url(:/images/checkbox.png); 458 | } 459 | 460 | QCheckBox::indicator:disabled, QRadioButton::indicator:disabled 461 | { 462 | border: 1px solid #444; 463 | } -------------------------------------------------------------------------------- /bin/x64/styles/plotcfts_style_dark_orange.qss: -------------------------------------------------------------------------------- 1 | /* http://www.yasinuludag.com/darkorange.stylesheet */ 2 | QToolTip 3 | { 4 | border: 1px solid black; 5 | background-color: #ffa02f; 6 | padding: 1px; 7 | border-radius: 3px; 8 | opacity: 100; 9 | } 10 | 11 | QWidget 12 | { 13 | color: #b1b1b1; 14 | background-color: #323232; 15 | } 16 | 17 | QWidget:item:hover 18 | { 19 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #ca0619); 20 | color: #000000; 21 | } 22 | 23 | QWidget:item:selected 24 | { 25 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); 26 | } 27 | 28 | QMenuBar::item 29 | { 30 | background: transparent; 31 | } 32 | 33 | QMenuBar::item:selected 34 | { 35 | background: transparent; 36 | border: 1px solid #ffaa00; 37 | } 38 | 39 | QMenuBar::item:pressed 40 | { 41 | background: #444; 42 | border: 1px solid #000; 43 | background-color: QLinearGradient( 44 | x1:0, y1:0, 45 | x2:0, y2:1, 46 | stop:1 #212121, 47 | stop:0.4 #343434/*, 48 | stop:0.2 #343434, 49 | stop:0.1 #ffaa00*/ 50 | ); 51 | margin-bottom:-1px; 52 | padding-bottom:1px; 53 | } 54 | 55 | QMenu 56 | { 57 | border: 1px solid #000; 58 | } 59 | 60 | QMenu::item 61 | { 62 | padding: 2px 20px 2px 20px; 63 | } 64 | 65 | QMenu::item:selected 66 | { 67 | color: #000000; 68 | } 69 | 70 | QWidget:disabled 71 | { 72 | color: #404040; 73 | background-color: #323232; 74 | } 75 | 76 | QAbstractItemView 77 | { 78 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #4d4d4d, stop: 0.1 #646464, stop: 1 #5d5d5d); 79 | } 80 | 81 | QWidget:focus 82 | { 83 | /*border: 2px solid QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a);*/ 84 | } 85 | 86 | QLineEdit 87 | { 88 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #4d4d4d, stop: 0 #646464, stop: 1 #5d5d5d); 89 | padding: 1px; 90 | border-style: solid; 91 | border: 1px solid #1e1e1e; 92 | border-radius: 5; 93 | } 94 | 95 | QPushButton 96 | { 97 | color: #b1b1b1; 98 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #565656, stop: 0.1 #525252, stop: 0.5 #4e4e4e, stop: 0.9 #4a4a4a, stop: 1 #464646); 99 | border-width: 1px; 100 | border-color: #1e1e1e; 101 | border-style: solid; 102 | border-radius: 6; 103 | padding: 3px; 104 | font-size: 12px; 105 | padding-left: 5px; 106 | padding-right: 5px; 107 | } 108 | 109 | QPushButton:pressed 110 | { 111 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2d2d2d, stop: 0.1 #2b2b2b, stop: 0.5 #292929, stop: 0.9 #282828, stop: 1 #252525); 112 | } 113 | 114 | QComboBox 115 | { 116 | selection-background-color: #ffaa00; 117 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #565656, stop: 0.1 #525252, stop: 0.5 #4e4e4e, stop: 0.9 #4a4a4a, stop: 1 #464646); 118 | border-style: solid; 119 | border: 1px solid #1e1e1e; 120 | border-radius: 5; 121 | } 122 | 123 | QComboBox:hover,QPushButton:hover 124 | { 125 | border: 2px solid QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); 126 | } 127 | 128 | 129 | QComboBox:on 130 | { 131 | padding-top: 3px; 132 | padding-left: 4px; 133 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2d2d2d, stop: 0.1 #2b2b2b, stop: 0.5 #292929, stop: 0.9 #282828, stop: 1 #252525); 134 | selection-background-color: #ffaa00; 135 | } 136 | 137 | QComboBox QAbstractItemView 138 | { 139 | border: 2px solid darkgray; 140 | selection-background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); 141 | } 142 | 143 | QComboBox::drop-down 144 | { 145 | subcontrol-origin: padding; 146 | subcontrol-position: top right; 147 | width: 15px; 148 | 149 | border-left-width: 0px; 150 | border-left-color: darkgray; 151 | border-left-style: solid; /* just a single line */ 152 | border-top-right-radius: 3px; /* same radius as the QComboBox */ 153 | border-bottom-right-radius: 3px; 154 | } 155 | 156 | QComboBox::down-arrow 157 | { 158 | image: url(:/down_arrow.png); 159 | } 160 | 161 | QGroupBox:focus 162 | { 163 | border: 2px solid QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); 164 | } 165 | 166 | QTextEdit:focus 167 | { 168 | border: 2px solid QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); 169 | } 170 | 171 | QScrollBar:horizontal { 172 | border: 1px solid #222222; 173 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0.0 #121212, stop: 0.2 #282828, stop: 1 #484848); 174 | height: 7px; 175 | margin: 0px 16px 0 16px; 176 | } 177 | 178 | QScrollBar::handle:horizontal 179 | { 180 | background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #ffa02f, stop: 0.5 #d7801a, stop: 1 #ffa02f); 181 | min-height: 20px; 182 | border-radius: 2px; 183 | } 184 | 185 | QScrollBar::add-line:horizontal { 186 | border: 1px solid #1b1b19; 187 | border-radius: 2px; 188 | background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #ffa02f, stop: 1 #d7801a); 189 | width: 14px; 190 | subcontrol-position: right; 191 | subcontrol-origin: margin; 192 | } 193 | 194 | QScrollBar::sub-line:horizontal { 195 | border: 1px solid #1b1b19; 196 | border-radius: 2px; 197 | background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #ffa02f, stop: 1 #d7801a); 198 | width: 14px; 199 | subcontrol-position: left; 200 | subcontrol-origin: margin; 201 | } 202 | 203 | QScrollBar::right-arrow:horizontal, QScrollBar::left-arrow:horizontal 204 | { 205 | border: 1px solid black; 206 | width: 1px; 207 | height: 1px; 208 | background: white; 209 | } 210 | 211 | QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal 212 | { 213 | background: none; 214 | } 215 | 216 | QScrollBar:vertical 217 | { 218 | background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0.0 #121212, stop: 0.2 #282828, stop: 1 #484848); 219 | width: 7px; 220 | margin: 16px 0 16px 0; 221 | border: 1px solid #222222; 222 | } 223 | 224 | QScrollBar::handle:vertical 225 | { 226 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 0.5 #d7801a, stop: 1 #ffa02f); 227 | min-height: 20px; 228 | border-radius: 2px; 229 | } 230 | 231 | QScrollBar::add-line:vertical 232 | { 233 | border: 1px solid #1b1b19; 234 | border-radius: 2px; 235 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); 236 | height: 14px; 237 | subcontrol-position: bottom; 238 | subcontrol-origin: margin; 239 | } 240 | 241 | QScrollBar::sub-line:vertical 242 | { 243 | border: 1px solid #1b1b19; 244 | border-radius: 2px; 245 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #d7801a, stop: 1 #ffa02f); 246 | height: 14px; 247 | subcontrol-position: top; 248 | subcontrol-origin: margin; 249 | } 250 | 251 | QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical 252 | { 253 | border: 1px solid black; 254 | width: 1px; 255 | height: 1px; 256 | background: white; 257 | } 258 | 259 | 260 | QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical 261 | { 262 | background: none; 263 | } 264 | 265 | QTextEdit 266 | { 267 | background-color: #242424; 268 | } 269 | 270 | QPlainTextEdit 271 | { 272 | background-color: #242424; 273 | } 274 | 275 | QHeaderView::section 276 | { 277 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #616161, stop: 0.5 #505050, stop: 0.6 #434343, stop:1 #656565); 278 | color: black; 279 | padding-left: 4px; 280 | border: 1px solid #6c6c6c; 281 | } 282 | 283 | QCheckBox:disabled 284 | { 285 | color: #414141; 286 | } 287 | 288 | QDockWidget::title 289 | { 290 | text-align: center; 291 | spacing: 3px; /* spacing between items in the tool bar */ 292 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #323232, stop: 0.5 #242424, stop:1 #323232); 293 | } 294 | 295 | QDockWidget::close-button, QDockWidget::float-button 296 | { 297 | text-align: center; 298 | spacing: 1px; /* spacing between items in the tool bar */ 299 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #323232, stop: 0.5 #242424, stop:1 #323232); 300 | } 301 | 302 | QDockWidget::close-button:hover, QDockWidget::float-button:hover 303 | { 304 | background: #242424; 305 | } 306 | 307 | QDockWidget::close-button:pressed, QDockWidget::float-button:pressed 308 | { 309 | padding: 1px -1px -1px 1px; 310 | } 311 | 312 | QMainWindow::separator 313 | { 314 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #161616, stop: 0.5 #151515, stop: 0.6 #212121, stop:1 #343434); 315 | color: white; 316 | padding-left: 4px; 317 | border: 1px solid #4c4c4c; 318 | spacing: 3px; /* spacing between items in the tool bar */ 319 | } 320 | 321 | QMainWindow::separator:hover 322 | { 323 | 324 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #d7801a, stop:0.5 #b56c17 stop:1 #ffa02f); 325 | color: white; 326 | padding-left: 4px; 327 | border: 1px solid #6c6c6c; 328 | spacing: 3px; /* spacing between items in the tool bar */ 329 | } 330 | 331 | QToolBar::handle 332 | { 333 | spacing: 3px; /* spacing between items in the tool bar */ 334 | background: url(:/images/handle.png); 335 | } 336 | 337 | QMenu::separator 338 | { 339 | height: 2px; 340 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #161616, stop: 0.5 #151515, stop: 0.6 #212121, stop:1 #343434); 341 | color: white; 342 | padding-left: 4px; 343 | margin-left: 10px; 344 | margin-right: 5px; 345 | } 346 | 347 | QProgressBar 348 | { 349 | border: 2px solid grey; 350 | border-radius: 5px; 351 | text-align: center; 352 | } 353 | 354 | QProgressBar::chunk 355 | { 356 | background-color: #d7801a; 357 | width: 2.15px; 358 | margin: 0.5px; 359 | } 360 | 361 | QTabBar::tab { 362 | color: #b1b1b1; 363 | border: 1px solid #444; 364 | border-bottom-style: none; 365 | background-color: #323232; 366 | padding-left: 10px; 367 | padding-right: 10px; 368 | padding-top: 3px; 369 | padding-bottom: 2px; 370 | margin-right: -1px; 371 | } 372 | 373 | QTabWidget::pane { 374 | border: 1px solid #444; 375 | top: 1px; 376 | } 377 | 378 | QTabBar::tab:last 379 | { 380 | margin-right: 0; /* the last selected tab has nothing to overlap with on the right */ 381 | border-top-right-radius: 3px; 382 | } 383 | 384 | QTabBar::tab:first:!selected 385 | { 386 | margin-left: 0px; /* the last selected tab has nothing to overlap with on the right */ 387 | 388 | 389 | border-top-left-radius: 3px; 390 | } 391 | 392 | QTabBar::tab:!selected 393 | { 394 | color: #b1b1b1; 395 | border-bottom-style: solid; 396 | margin-top: 3px; 397 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:1 #212121, stop:.4 #343434); 398 | } 399 | 400 | QTabBar::tab:selected 401 | { 402 | border-top-left-radius: 3px; 403 | border-top-right-radius: 3px; 404 | margin-bottom: 0px; 405 | } 406 | 407 | QTabBar::tab:!selected:hover 408 | { 409 | /*border-top: 2px solid #ffaa00; 410 | padding-bottom: 3px;*/ 411 | border-top-left-radius: 3px; 412 | border-top-right-radius: 3px; 413 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:1 #212121, stop:0.4 #343434, stop:0.2 #343434, stop:0.1 #ffaa00); 414 | } 415 | 416 | QRadioButton::indicator:checked, QRadioButton::indicator:unchecked{ 417 | color: #b1b1b1; 418 | background-color: #323232; 419 | border: 1px solid #b1b1b1; 420 | border-radius: 6px; 421 | } 422 | 423 | QRadioButton::indicator:checked 424 | { 425 | background-color: qradialgradient( 426 | cx: 0.5, cy: 0.5, 427 | fx: 0.5, fy: 0.5, 428 | radius: 1.0, 429 | stop: 0.25 #ffaa00, 430 | stop: 0.3 #323232 431 | ); 432 | } 433 | 434 | QCheckBox::indicator{ 435 | color: #b1b1b1; 436 | background-color: #323232; 437 | border: 1px solid #b1b1b1; 438 | width: 9px; 439 | height: 9px; 440 | } 441 | 442 | QRadioButton::indicator 443 | { 444 | border-radius: 6px; 445 | } 446 | 447 | QRadioButton::indicator:hover, QCheckBox::indicator:hover 448 | { 449 | border: 1px solid #ffaa00; 450 | } 451 | 452 | QCheckBox::indicator:checked 453 | { 454 | image:url(:/images/checkbox.png); 455 | } 456 | 457 | QCheckBox::indicator:disabled, QRadioButton::indicator:disabled 458 | { 459 | border: 1px solid #444; 460 | } -------------------------------------------------------------------------------- /bin/x64/styles/plotcfts_style.qss: -------------------------------------------------------------------------------- 1 | /* http://www.yasinuludag.com/darkorange.stylesheet */ 2 | QToolTip 3 | { 4 | border: 1px solid black; 5 | background-color: #ffa02f; 6 | padding: 1px; 7 | border-radius: 3px; 8 | opacity: 100; 9 | } 10 | 11 | QWidget 12 | { 13 | color: #b1b1b1; 14 | background-color: #323232; 15 | } 16 | 17 | QWidget:item:hover 18 | { 19 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #ca0619); 20 | color: #000000; 21 | } 22 | 23 | QWidget:item:selected 24 | { 25 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); 26 | } 27 | 28 | QMenuBar::item 29 | { 30 | background: transparent; 31 | } 32 | 33 | QMenuBar::item:selected 34 | { 35 | background: transparent; 36 | border: 1px solid #ffaa00; 37 | } 38 | 39 | QMenuBar::item:pressed 40 | { 41 | background: #444; 42 | border: 1px solid #000; 43 | background-color: QLinearGradient( 44 | x1:0, y1:0, 45 | x2:0, y2:1, 46 | stop:1 #212121, 47 | stop:0.4 #343434/*, 48 | stop:0.2 #343434, 49 | stop:0.1 #ffaa00*/ 50 | ); 51 | margin-bottom:-1px; 52 | padding-bottom:1px; 53 | } 54 | 55 | QMenu 56 | { 57 | border: 1px solid #000; 58 | } 59 | 60 | QMenu::item 61 | { 62 | padding: 2px 20px 2px 20px; 63 | } 64 | 65 | QMenu::item:selected 66 | { 67 | color: #000000; 68 | } 69 | 70 | QWidget:disabled 71 | { 72 | color: #404040; 73 | background-color: #323232; 74 | } 75 | 76 | QAbstractItemView 77 | { 78 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #4d4d4d, stop: 0.1 #646464, stop: 1 #5d5d5d); 79 | } 80 | 81 | QWidget:focus 82 | { 83 | /*border: 2px solid QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a);*/ 84 | } 85 | 86 | QLineEdit 87 | { 88 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #4d4d4d, stop: 0 #646464, stop: 1 #5d5d5d); 89 | padding: 1px; 90 | border-style: solid; 91 | border: 1px solid #1e1e1e; 92 | border-radius: 5; 93 | } 94 | 95 | QPushButton 96 | { 97 | color: #b1b1b1; 98 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #565656, stop: 0.1 #525252, stop: 0.5 #4e4e4e, stop: 0.9 #4a4a4a, stop: 1 #464646); 99 | border-width: 1px; 100 | border-color: #1e1e1e; 101 | border-style: solid; 102 | border-radius: 3; 103 | padding: 3px; 104 | font-size: 12px; 105 | padding-left: 5px; 106 | padding-right: 5px; 107 | } 108 | 109 | QPushButton:pressed 110 | { 111 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2d2d2d, stop: 0.1 #2b2b2b, stop: 0.5 #292929, stop: 0.9 #282828, stop: 1 #252525); 112 | } 113 | 114 | QComboBox 115 | { 116 | selection-background-color: #ffaa00; 117 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #565656, stop: 0.1 #525252, stop: 0.5 #4e4e4e, stop: 0.9 #4a4a4a, stop: 1 #464646); 118 | border-style: solid; 119 | border: 1px solid #1e1e1e; 120 | border-radius: 3; 121 | min-width: 68px; 122 | min-height: 22px; 123 | } 124 | 125 | QComboBox:hover,QPushButton:hover 126 | { 127 | border: 2px solid QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); 128 | } 129 | 130 | 131 | QComboBox:on 132 | { 133 | padding-top: 3px; 134 | padding-left: 4px; 135 | background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2d2d2d, stop: 0.1 #2b2b2b, stop: 0.5 #292929, stop: 0.9 #282828, stop: 1 #252525); 136 | selection-background-color: #ffaa00; 137 | } 138 | 139 | QComboBox QAbstractItemView 140 | { 141 | border: 2px solid darkgray; 142 | selection-background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); 143 | } 144 | 145 | QComboBox::drop-down 146 | { 147 | subcontrol-origin: padding; 148 | subcontrol-position: top right; 149 | width: 15px; 150 | 151 | border-left-width: 0px; 152 | border-left-color: darkgray; 153 | border-left-style: solid; /* just a single line */ 154 | border-top-right-radius: 3px; /* same radius as the QComboBox */ 155 | border-bottom-right-radius: 3px; 156 | } 157 | 158 | QComboBox::down-arrow 159 | { 160 | image: url(:/down_arrow.png); 161 | } 162 | 163 | QGroupBox:focus 164 | { 165 | border: 2px solid QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); 166 | } 167 | 168 | QTextEdit:focus 169 | { 170 | border: 2px solid QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); 171 | } 172 | 173 | QScrollBar:horizontal { 174 | border: 1px solid #222222; 175 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0.0 #121212, stop: 0.2 #282828, stop: 1 #484848); 176 | height: 7px; 177 | margin: 0px 16px 0 16px; 178 | } 179 | 180 | QScrollBar::handle:horizontal 181 | { 182 | background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #ffa02f, stop: 0.5 #d7801a, stop: 1 #ffa02f); 183 | min-height: 20px; 184 | border-radius: 2px; 185 | } 186 | 187 | QScrollBar::add-line:horizontal { 188 | border: 1px solid #1b1b19; 189 | border-radius: 2px; 190 | background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #ffa02f, stop: 1 #d7801a); 191 | width: 14px; 192 | subcontrol-position: right; 193 | subcontrol-origin: margin; 194 | } 195 | 196 | QScrollBar::sub-line:horizontal { 197 | border: 1px solid #1b1b19; 198 | border-radius: 2px; 199 | background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #ffa02f, stop: 1 #d7801a); 200 | width: 14px; 201 | subcontrol-position: left; 202 | subcontrol-origin: margin; 203 | } 204 | 205 | QScrollBar::right-arrow:horizontal, QScrollBar::left-arrow:horizontal 206 | { 207 | border: 1px solid black; 208 | width: 1px; 209 | height: 1px; 210 | background: white; 211 | } 212 | 213 | QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal 214 | { 215 | background: none; 216 | } 217 | 218 | QScrollBar:vertical 219 | { 220 | background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0.0 #121212, stop: 0.2 #282828, stop: 1 #484848); 221 | width: 7px; 222 | margin: 16px 0 16px 0; 223 | border: 1px solid #222222; 224 | } 225 | 226 | QScrollBar::handle:vertical 227 | { 228 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 0.5 #d7801a, stop: 1 #ffa02f); 229 | min-height: 20px; 230 | border-radius: 2px; 231 | } 232 | 233 | QScrollBar::add-line:vertical 234 | { 235 | border: 1px solid #1b1b19; 236 | border-radius: 2px; 237 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffa02f, stop: 1 #d7801a); 238 | height: 14px; 239 | subcontrol-position: bottom; 240 | subcontrol-origin: margin; 241 | } 242 | 243 | QScrollBar::sub-line:vertical 244 | { 245 | border: 1px solid #1b1b19; 246 | border-radius: 2px; 247 | background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #d7801a, stop: 1 #ffa02f); 248 | height: 14px; 249 | subcontrol-position: top; 250 | subcontrol-origin: margin; 251 | } 252 | 253 | QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical 254 | { 255 | border: 1px solid black; 256 | width: 1px; 257 | height: 1px; 258 | background: white; 259 | } 260 | 261 | 262 | QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical 263 | { 264 | background: none; 265 | } 266 | 267 | QTextEdit 268 | { 269 | background-color: #242424; 270 | } 271 | 272 | QPlainTextEdit 273 | { 274 | background-color: #242424; 275 | } 276 | 277 | QHeaderView::section 278 | { 279 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #616161, stop: 0.5 #505050, stop: 0.6 #434343, stop:1 #656565); 280 | color: white; 281 | padding-left: 4px; 282 | border: 1px solid #6c6c6c; 283 | } 284 | 285 | QCheckBox:disabled 286 | { 287 | color: #414141; 288 | } 289 | 290 | QDockWidget::title 291 | { 292 | text-align: center; 293 | spacing: 3px; /* spacing between items in the tool bar */ 294 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #323232, stop: 0.5 #242424, stop:1 #323232); 295 | } 296 | 297 | QDockWidget::close-button, QDockWidget::float-button 298 | { 299 | text-align: center; 300 | spacing: 1px; /* spacing between items in the tool bar */ 301 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #323232, stop: 0.5 #242424, stop:1 #323232); 302 | } 303 | 304 | QDockWidget::close-button:hover, QDockWidget::float-button:hover 305 | { 306 | background: #242424; 307 | } 308 | 309 | QDockWidget::close-button:pressed, QDockWidget::float-button:pressed 310 | { 311 | padding: 1px -1px -1px 1px; 312 | } 313 | 314 | QMainWindow::separator 315 | { 316 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #161616, stop: 0.5 #151515, stop: 0.6 #212121, stop:1 #343434); 317 | color: white; 318 | padding-left: 4px; 319 | border: 1px solid #4c4c4c; 320 | spacing: 3px; /* spacing between items in the tool bar */ 321 | } 322 | 323 | QMainWindow::separator:hover 324 | { 325 | 326 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #d7801a, stop:0.5 #b56c17 stop:1 #ffa02f); 327 | color: white; 328 | padding-left: 4px; 329 | border: 1px solid #6c6c6c; 330 | spacing: 3px; /* spacing between items in the tool bar */ 331 | } 332 | 333 | QToolBar::handle 334 | { 335 | spacing: 3px; /* spacing between items in the tool bar */ 336 | background: url(:/images/handle.png); 337 | } 338 | 339 | QMenu::separator 340 | { 341 | height: 2px; 342 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #161616, stop: 0.5 #151515, stop: 0.6 #212121, stop:1 #343434); 343 | color: white; 344 | padding-left: 4px; 345 | margin-left: 10px; 346 | margin-right: 5px; 347 | } 348 | 349 | QProgressBar 350 | { 351 | border: 2px solid grey; 352 | border-radius: 5px; 353 | text-align: center; 354 | } 355 | 356 | QProgressBar::chunk 357 | { 358 | background-color: #d7801a; 359 | width: 2.15px; 360 | margin: 0.5px; 361 | } 362 | 363 | QTabBar::tab { 364 | color: #b1b1b1; 365 | border: 1px solid #444; 366 | border-bottom-style: none; 367 | background-color: #323232; 368 | padding-left: 10px; 369 | padding-right: 10px; 370 | padding-top: 3px; 371 | padding-bottom: 2px; 372 | margin-right: -1px; 373 | } 374 | 375 | QTabWidget::pane { 376 | border: 1px solid #444; 377 | top: 1px; 378 | } 379 | 380 | QTabBar::tab:last 381 | { 382 | margin-right: 0; /* the last selected tab has nothing to overlap with on the right */ 383 | border-top-right-radius: 3px; 384 | } 385 | 386 | QTabBar::tab:first:!selected 387 | { 388 | margin-left: 0px; /* the last selected tab has nothing to overlap with on the right */ 389 | 390 | 391 | border-top-left-radius: 3px; 392 | } 393 | 394 | QTabBar::tab:!selected 395 | { 396 | color: #b1b1b1; 397 | border-bottom-style: solid; 398 | margin-top: 3px; 399 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:1 #212121, stop:.4 #343434); 400 | } 401 | 402 | QTabBar::tab:selected 403 | { 404 | border-top-left-radius: 3px; 405 | border-top-right-radius: 3px; 406 | margin-bottom: 0px; 407 | } 408 | 409 | QTabBar::tab:!selected:hover 410 | { 411 | /*border-top: 2px solid #ffaa00; 412 | padding-bottom: 3px;*/ 413 | border-top-left-radius: 3px; 414 | border-top-right-radius: 3px; 415 | background-color: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:1 #212121, stop:0.4 #343434, stop:0.2 #343434, stop:0.1 #ffaa00); 416 | } 417 | 418 | QRadioButton::indicator:checked, QRadioButton::indicator:unchecked{ 419 | color: #b1b1b1; 420 | background-color: #323232; 421 | border: 1px solid #b1b1b1; 422 | border-radius: 6px; 423 | } 424 | 425 | QRadioButton::indicator:checked 426 | { 427 | background-color: qradialgradient( 428 | cx: 0.5, cy: 0.5, 429 | fx: 0.5, fy: 0.5, 430 | radius: 1.0, 431 | stop: 0.25 #ffaa00, 432 | stop: 0.3 #323232 433 | ); 434 | } 435 | 436 | QCheckBox::indicator{ 437 | color: #b1b1b1; 438 | background-color: #323232; 439 | border: 1px solid #b1b1b1; 440 | width: 9px; 441 | height: 9px; 442 | } 443 | 444 | QRadioButton::indicator 445 | { 446 | border-radius: 6px; 447 | } 448 | 449 | QRadioButton::indicator:hover, QCheckBox::indicator:hover 450 | { 451 | border: 1px solid #ffaa00; 452 | } 453 | 454 | QCheckBox::indicator:checked 455 | { 456 | image:url(:/images/checkbox.png); 457 | } 458 | 459 | QCheckBox::indicator:disabled, QRadioButton::indicator:disabled 460 | { 461 | border: 1px solid #444; 462 | } -------------------------------------------------------------------------------- /packages/plot_cf_time_series.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Release 6 | x64 7 | 8 | 9 | Debug 10 | x64 11 | 12 | 13 | 14 | {E416BD51-4B40-316F-9703-D9547497EF04} 15 | interaction-example 16 | Qt4VSv1.0 17 | 10.0 18 | 19 | 20 | 21 | v143 22 | release\ 23 | false 24 | MultiByte 25 | Application 26 | release\ 27 | interaction-example 28 | x64 29 | true 30 | 31 | 32 | v143 33 | debug\ 34 | false 35 | MultiByte 36 | Application 37 | debug\ 38 | interaction-example 39 | x64 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | $(SolutionDir)bin\$(platform)\$(Configuration)\ 52 | $(Configuration)\ 53 | plotcfts 54 | true 55 | false 56 | $(SolutionDir)bin\$(platform)\$(Configuration)\ 57 | $(Configuration)\ 58 | plotcfts 59 | true 60 | 61 | 62 | $(VC_IncludePath);$(WindowsSDK_IncludePath) 63 | 64 | 65 | $(VC_IncludePath);$(WindowsSDK_IncludePath);c:\boost\boost_1_81_0 66 | 67 | 68 | 69 | .;.\include;$(QT6DIR)\include;$(QT6DIR)\include\QtGui;$(BOOST_ROOT_DIR);%(AdditionalIncludeDirectories) 70 | -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -utf-8 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions) 71 | release\ 72 | false 73 | None 74 | Sync 75 | release\ 76 | MaxSpeed 77 | _WINDOWS;UNICODE;WIN64;QT_NO_DEBUG;NDEBUG;%(PreprocessorDefinitions) 78 | false 79 | 80 | 81 | MultiThreadedDLL 82 | true 83 | true 84 | true 85 | Level4 86 | Default 87 | stdcpp17 88 | false 89 | stdc17 90 | 91 | 92 | Qt6EntryPoint.lib;Qt6Core.lib;Qt6Gui.lib;Qt6Widgets.lib;Qt6PrintSupport.lib;netcdf.lib;%(AdditionalDependencies) 93 | $(QT6DIR)\lib;..\lib\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) 94 | "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions) 95 | true 96 | false 97 | true 98 | false 99 | $(OutDir)plotcfts.exe 100 | true 101 | Windows 102 | true 103 | 104 | 105 | Unsigned 106 | None 107 | 0 108 | 109 | 110 | _WINDOWS;UNICODE;WIN32;WIN64;QT_NO_DEBUG;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_CORE_LIB;%(PreprocessorDefinitions) 111 | 112 | 113 | call ..\scripts\git_insert_hash.cmd .\include plot_cf_time_series_version.h 114 | call ..\scripts\git_insert_hash.cmd .\include plot_cf_time_series_version.rc 115 | 116 | 117 | 118 | 119 | .;.\include;$(QT6DIR)\include;$(QT6DIR)\include\QtGui;$(BOOST_ROOT_DIR);%(AdditionalIncludeDirectories) 120 | -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -utf-8 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions) 121 | debug\ 122 | false 123 | ProgramDatabase 124 | Sync 125 | debug\ 126 | Disabled 127 | DEBUG;_WINDOWS;UNICODE;WIN64;%(PreprocessorDefinitions) 128 | false 129 | MultiThreadedDebugDLL 130 | true 131 | true 132 | true 133 | Level4 134 | EnableFastChecks 135 | stdcpp17 136 | false 137 | stdc17 138 | 139 | 140 | Qt6EntryPointd.lib;Qt6Cored.lib;Qt6Guid.lib;Qt6Widgetsd.lib;Qt6PrintSupportd.lib;netcdf.lib;%(AdditionalDependencies) 141 | $(qt6dir)\lib;..\lib\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) 142 | "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions) 143 | true 144 | true 145 | true 146 | $(OutDir)plotcfts.exe 147 | true 148 | Windows 149 | true 150 | 151 | 152 | Unsigned 153 | None 154 | 0 155 | 156 | 157 | _WINDOWS;UNICODE;WIN32;WIN64;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_CORE_LIB;_DEBUG;%(PreprocessorDefinitions) 158 | 159 | 160 | call ..\scripts\git_insert_hash.cmd .\include plot_cf_time_series_version.h 161 | call ..\scripts\git_insert_hash.cmd .\include plot_cf_time_series_version.rc 162 | 163 | 164 | 165 | 166 | .;.\include;$(qt6dir)\include;release;.;$(qt6dir)\mkspecs\winrt-x64-msvc2017;%(AdditionalIncludeDirectories) 167 | .;.\include;$(qt6dir)\include;debug;.;$(qt6dir)\mkspecs\winrt-x64-msvc2017;%(AdditionalIncludeDirectories) 168 | 169 | 170 | .;.\include;$(qt6dir)\include;debug;.;$(qt6dir)\mkspecs\winrt-x64-msvc2017;%(AdditionalIncludeDirectories) 171 | .;.\include;$(qt6dir)\include;release;.;$(qt6dir)\mkspecs\winrt-x64-msvc2017;%(AdditionalIncludeDirectories) 172 | 173 | 174 | .;.\include;$(qt6dir)\include;release;.;$(qt6dir)\mkspecs\winrt-x64-msvc2017;%(AdditionalIncludeDirectories) 175 | .;.\include;$(qt6dir)\include;debug;.;$(qt6dir)\mkspecs\winrt-x64-msvc2017;%(AdditionalIncludeDirectories) 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | .;.\include;$(qt6dir)\include;$(qt6dir)\include\QtPrintSupport;$(qt6dir)\include\QtWidgets;$(qt6dir)\include\QtGui;$(qt6dir)\include\QtANGLE;$(qt6dir)\include\QtCore;release;.;$(qt6dir)\mkspecs\win32-msvc2013;%(AdditionalIncludeDirectories) 184 | 185 | 186 | .;.\include;$(qt6dir)\include;$(BOOST_INCLUDEDIR);%(AdditionalIncludeDirectories) 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | "$(qt6dir)\bin\moc.exe" "%(FullPath)" -o ".\generated\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN64 -DQT_NO_DEBUG -DNDEBUG -D%(PreprocessorDefinitions) "-I." "-I.\include" "-I$(qt6dir)\include" "-I$(qt6dir)\include\QtPrintSupport" "-I$(qt6dir)\include\QtWidgets" "-I$(qt6dir)\include\QtGui" "-I$(qt6dir)\include\QtANGLE" "-I$(qt6dir)\include\QtCore" "-I.\release" "-I$(qt6dir)\mkspecs\win32-msvc2013" 195 | Performing Custom Build Step: MOC%27ing %(FullPath) 196 | generated\moc_%(Filename).cpp;%(Outputs) 197 | 198 | 199 | "$(qt6dir)\bin\moc.exe" "%(FullPath)" -o ".\generated\moc_%(Filename).cpp" -DDEBUG -D_WINDOWS -DUNICODE -DWIN64 -D%(PreprocessorDefinitions) "-I." "-I.\include" "-I$(qt6dir)\include" 200 | Performing Custom Build Step: MOC%27ing %(FullPath) 201 | generated\moc_%(Filename).cpp;%(Outputs) 202 | 203 | 204 | 205 | 206 | "$(qt6dir)\bin\moc.exe" "%(FullPath)" -o ".\generated\moc_%(Filename).cpp" -DDEBUG -D_WINDOWS -DUNICODE -DWIN64 -D%(PreprocessorDefinitions) "-I." "-I.\include" "-I$(qt6dir)\include" 207 | Performing Custom Build Step: MOC%27ing %(FullPath) 208 | Performing Custom Build Step: MOC%27ing %(FullPath) 209 | "$(qt6dir)\bin\moc.exe" "%(FullPath)" -o ".\generated\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN64 -DQT_NO_DEBUG -DNDEBUG -D%(PreprocessorDefinitions) "-I." "-I.\include" "-I$(qt6dir)\include" 210 | generated\moc_%(Filename).cpp;%(Outputs) 211 | generated\moc_%(Filename).cpp;%(Outputs) 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | "$(qt6dir)\bin\moc.exe" "%(FullPath)" -o ".\generated\moc_%(Filename).cpp" -DDEBUG -D_WINDOWS -DUNICODE -DWIN64 -D%(PreprocessorDefinitions) "-I." "-I.\include" "-I$(qt6dir)\include" 228 | "$(qt6dir)\bin\moc.exe" "%(FullPath)" -o ".\generated\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN64 -DQT_NO_DEBUG -DNDEBUG -D%(PreprocessorDefinitions) "-I." "-I.\include" "-I$(qt6dir)\include" 229 | Performing Custom Build Step: MOC%27ing %(FullPath) 230 | Performing Custom Build Step: MOC%27ing %(FullPath) 231 | generated\moc_%(Filename).cpp;%(Outputs) 232 | generated\moc_%(Filename).cpp;%(Outputs) 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | -------------------------------------------------------------------------------- /packages/src/time_series_plot.cpp: -------------------------------------------------------------------------------- 1 | #include "time_series_plot.h" 2 | 3 | TSPlot::TSPlot(QWidget * qparent, QIcon qicon, int qnr_plot) 4 | { 5 | tsfile = nullptr; 6 | customPlot = new QCustomPlot(qparent); 7 | customPlot->setAttribute(Qt::WA_DeleteOnClose, true); 8 | //customPlot->axisRect()->setBackground(QColor(240, 240, 240)); 9 | //customPlot->setBackground(QColor(230, 230, 230)); 10 | 11 | icon = qicon; 12 | current_plot = qnr_plot; 13 | has_focus = -1; 14 | parent = qparent; 15 | 16 | // Center and resize application window; suppose that the taskbar 17 | // is at the bottom of the screen 18 | // 19 | QScreen* screen = QGuiApplication::primaryScreen(); 20 | QRect screenGeometry = screen->geometry(); 21 | plot_width = screenGeometry.width(); 22 | plot_height = screenGeometry.height(); 23 | 24 | plot_width = (int)(0.495 * double(plot_width)); 25 | plot_height = (int)(0.495 * double(plot_height)); // Do not count the taskbar pixels, assumed to be 1 percent of the screen 26 | if (plot_width > 2 * plot_height) 27 | { 28 | plot_width = 2 * plot_height; 29 | } 30 | else 31 | { 32 | plot_height = int(0.5 * double(plot_width)); 33 | } 34 | 35 | QVBoxLayout * vl_main = new QVBoxLayout; 36 | vl_main->setSpacing(0); 37 | vl_main->setContentsMargins(0, 0, 0, 0); 38 | vl_main->addWidget(customPlot); 39 | 40 | parent->setLayout(vl_main); 41 | parent->show(); 42 | parent->resize(plot_width, plot_height); 43 | 44 | qparent->setWindowIcon(icon); 45 | _nr_y_axis_labels = 0; 46 | _nr_graphs = 0; 47 | _nr_max_ylabel = 0; 48 | } 49 | TSPlot::~TSPlot() 50 | { 51 | parent->deleteLater(); 52 | delete customPlot; 53 | } 54 | void TSPlot::add_to_plot(TSFILE * qtsfile, QListWidget * qlb_parameters, QListWidget * qlb_locations, QListWidget * qlb_times, QComboBox * qcb_parloc, QSpinBox * qsb_layer, QPushButton * qpb_add_to_plot) 55 | { 56 | tsfile = qtsfile; 57 | lb_parameters = qlb_parameters; 58 | lb_locations = qlb_locations; 59 | lb_times = qlb_times; 60 | cb_parloc = qcb_parloc; 61 | sb_layer = qsb_layer; 62 | pb_add_to_plot = qpb_add_to_plot; 63 | } 64 | void TSPlot::add_data_to_plot() 65 | { 66 | int cb_index = tsfile->get_cb_parloc_index(); 67 | int i_layer = sb_layer->value() - 1; 68 | 69 | _nr_max_ylabel = _ylabel_dic.size(); 70 | for (int i_par = 0; i_par < lb_parameters->count(); i_par++) 71 | { 72 | if (lb_parameters->item(i_par)->isSelected()) 73 | { 74 | for (int i_loc = 0; i_loc < lb_locations->count(); i_loc++) 75 | { 76 | if (lb_locations->item(i_loc)->isSelected()) 77 | { 78 | TimeSeriesGraph(cb_index, i_par, i_loc, i_layer); 79 | } 80 | } 81 | } 82 | } 83 | customPlot->rescaleAxes(); 84 | customPlot->xAxis->scaleRange(1.05, customPlot->xAxis->range().center()); 85 | customPlot->yAxis->scaleRange(1.05, customPlot->yAxis->range().center()); 86 | customPlot->replot(); 87 | } 88 | void TSPlot::draw_plot(int nr_plot, QString txt, QString fname) 89 | { 90 | parent->setWindowTitle(QString("Plot %1: %2").arg(nr_plot + 1).arg(txt)); 91 | customPlot->resize(this->plot_width, this->plot_height); 92 | customPlot->show(); 93 | 94 | customPlot->plotLayout()->insertRow(0); 95 | QCPTextElement *title = new QCPTextElement(customPlot, "File: " + fname, QFont("sans", 9, QFont::Bold)); 96 | customPlot->plotLayout()->addElement(0, 0, title); 97 | 98 | int cb_index = tsfile->get_cb_parloc_index(); 99 | int i_layer = sb_layer->value() - 1; 100 | 101 | _nr_max_ylabel = 0; 102 | for (int i_par = 0; i_par < lb_parameters->count(); i_par++) 103 | { 104 | if (lb_parameters->item(i_par)->isSelected()) 105 | { 106 | for (int i_loc = 0; i_loc < lb_locations->count(); i_loc++) 107 | { 108 | if (lb_locations->item(i_loc)->isSelected()) 109 | { 110 | TimeSeriesGraph(cb_index, i_par, i_loc, i_layer); 111 | } 112 | } 113 | } 114 | } 115 | customPlot->rescaleAxes(); 116 | customPlot->xAxis->scaleRange(1.06, customPlot->xAxis->range().center()); 117 | customPlot->yAxis->scaleRange(1.05, customPlot->yAxis->range().center()); 118 | 119 | customPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectAxes | QCP::iSelectLegend | QCP::iSelectPlottables); 120 | customPlot->axisRect()->setupFullAxesBox(); 121 | 122 | customPlot->legend->setVisible(true); 123 | QFont legendFont = font(); 124 | legendFont.setPointSize(10); 125 | customPlot->legend->setFont(legendFont); 126 | customPlot->legend->setSelectedFont(legendFont); 127 | customPlot->legend->setSelectableParts(QCPLegend::spItems); // legend box shall not be selectable, only legend items 128 | 129 | // connect slot that ties some axis selections together (especially opposite axes): 130 | connect(customPlot, &QCustomPlot::selectionChangedByUser, this, &TSPlot::selectionChanged); 131 | // connect slots that takes care that when an axis is selected, only that direction can be dragged and zoomed: 132 | connect(customPlot, &QCustomPlot::mousePress, this, &TSPlot::mousePress); 133 | connect(customPlot, &QCustomPlot::mouseWheel, this, &TSPlot::mouseWheel); 134 | 135 | // make bottom and left axes transfer their ranges to top and right axes: 136 | connect(customPlot->xAxis, SIGNAL(rangeChanged(QCPRange)), customPlot->xAxis2, SLOT(setRange(QCPRange))); 137 | connect(customPlot->yAxis, SIGNAL(rangeChanged(QCPRange)), customPlot->yAxis2, SLOT(setRange(QCPRange))); 138 | 139 | // connect some interaction slots: 140 | connect(customPlot, &QCustomPlot::axisDoubleClick, this, &TSPlot::axisLabelDoubleClick); 141 | connect(customPlot, &QCustomPlot::legendDoubleClick, this, &TSPlot::legendDoubleClick); 142 | connect(title, &QCPTextElement::doubleClicked, this, &TSPlot::titleDoubleClick); 143 | 144 | // connect slot that shows a message in the status bar when a graph is clicked: 145 | connect(customPlot, &QCustomPlot::plottableClick, this, &TSPlot::graphClicked); 146 | connect(customPlot, &QCustomPlot::plottableDoubleClick, this, &TSPlot::graphDoubleClicked); 147 | 148 | // setup policy and connect slot for context menu popup: 149 | customPlot->setContextMenuPolicy(Qt::CustomContextMenu); 150 | connect(customPlot, &QCustomPlot::customContextMenuRequested, this, &TSPlot::contextMenuRequest); 151 | 152 | connect(customPlot, &QCustomPlot::mouseMove, this, &TSPlot::onMouseMove); 153 | // connect(customPlot, SIGNAL(destroyed()), this, SLOT(destroyed())); 154 | } 155 | QWidget * TSPlot::get_parent() 156 | { 157 | return this->parent; 158 | } 159 | 160 | int TSPlot::get_active_plot_nr() 161 | { 162 | int selected_plot = -1; 163 | if (customPlot->focusWidget() != NULL) 164 | { 165 | selected_plot = this->current_plot; 166 | } 167 | return selected_plot; 168 | } 169 | 170 | void TSPlot::TimeSeriesGraph(int cb_index, int i_par, int i_loc, int i_layer) 171 | { 172 | START_TIMERN(TimeSeriesGraph); 173 | _time_series struct_times = tsfile->get_times(); 174 | std::vector x_values = struct_times.times; 175 | int nr_x_values = tsfile->get_count_times(); 176 | int i_tsfile_par = -1; 177 | int i_tsfile_loc = -1; 178 | QListWidgetItem * sel_item; 179 | STOP_TIMER(TimeSeriesGraph); 180 | 181 | // i_par and i_loc taken from sorted listboxes 182 | QDateTime * RefDate = tsfile->get_reference_date(); 183 | struct _parameter * param = tsfile->get_parameters(cb_index); 184 | int nr_parameters = tsfile->get_count_parameters(cb_index); 185 | struct _location * location = tsfile->get_locations(cb_index); 186 | int nr_locations = tsfile->get_count_locations(cb_index); 187 | 188 | sel_item = lb_parameters->item(i_par); 189 | #if defined (DEBUG) 190 | QString janm = sel_item->text(); 191 | #endif 192 | for (long i = 0; i < nr_parameters; i++) 193 | { 194 | if (!strcmp(param[i].name, sel_item->text().toUtf8())) 195 | { 196 | i_tsfile_par = i; 197 | break; 198 | } 199 | } 200 | 201 | sel_item = lb_locations->item(i_loc); 202 | #if defined (DEBUG) 203 | QString janm3 = sel_item->text(); 204 | #endif 205 | for (long i = 0; i < nr_locations; i++) 206 | { 207 | QString q_loc(*location[i].name); 208 | QString s_name = sel_item->text(); 209 | if (!q_loc.compare(s_name)) 210 | { 211 | i_tsfile_loc = i; 212 | break; 213 | } 214 | } 215 | 216 | QString y_label_counter; 217 | QString yaxis_label = set_yaxis_label(param[i_tsfile_par].name, param[i_tsfile_par].unit, y_label_counter); 218 | customPlot->yAxis->setLabel(yaxis_label); 219 | START_TIMER(get_time_series); 220 | std::vector y_values = tsfile->get_time_series(cb_index, std::string(param[i_tsfile_par].name), i_tsfile_loc, i_layer); 221 | STOP_TIMER(get_time_series); 222 | 223 | // x-axis 224 | QString xaxis_label = tsfile->get_xaxis_label(); 225 | customPlot->xAxis->setLabel(xaxis_label); 226 | 227 | // configure bottom axis to show date instead of number: 228 | 229 | // Select part of time series, determine by the time interval selected in the listbox 230 | // if nothing is selected the whole series is used 231 | 232 | if (lb_times->currentRow() != -1) 233 | { 234 | int j = -1; 235 | for (long i = 0; i < lb_times->count(); i++) 236 | { 237 | QListWidgetItem * item = lb_times->item(i); 238 | if (item->isSelected()) 239 | { 240 | j += 1; 241 | x_values[j] = x_values[i]; 242 | y_values[j] = y_values[i]; 243 | nr_x_values = j + 1; // one-based 244 | } 245 | } 246 | } 247 | QSharedPointer dateTimeTicker(new QCPAxisTickerDateTime); 248 | dateTimeTicker->setDateTimeSpec(Qt::UTC); 249 | dateTimeTicker->setTickOrigin(*RefDate); 250 | if (floor(x_values[1] - x_values[0]) - (x_values[1] - x_values[0]) != 0.0 || 251 | floor(x_values[0]) - x_values[0] != 0.0) // timestep is smaller then one second 252 | { 253 | // milli seconds 254 | dateTimeTicker->setDateTimeFormat("hh:mm:ss.zzz\ndd MMM yyyy"); 255 | qint64 offset = RefDate->toMSecsSinceEpoch(); 256 | for (int i = 0; i < nr_x_values; i++) 257 | { 258 | x_values[i] = x_values[i] + 0.001 * double(offset); 259 | } 260 | } 261 | else 262 | { 263 | // whole seconds 264 | dateTimeTicker->setDateTimeFormat("hh:mm:ss\ndd MMM yyyy"); 265 | qint64 offset = RefDate->toSecsSinceEpoch(); 266 | for (int i = 0; i < nr_x_values; i++) 267 | { 268 | x_values[i] = x_values[i] + (double)offset; 269 | } 270 | } 271 | customPlot->xAxis->setTicker(dateTimeTicker); 272 | 273 | std::vector xv(nr_x_values); 274 | for (int i = 0; i < nr_x_values; i++) 275 | { 276 | xv[i] = x_values[i]; 277 | } 278 | QVector x_val = QVector(xv.begin(), xv.end()); 279 | 280 | std::vector yv(nr_x_values); 281 | for (int i = 0; i < nr_x_values; i++) 282 | { 283 | yv[i] = y_values[i]; 284 | } 285 | QVector y_val = QVector(yv.begin(), yv.end()); 286 | 287 | customPlot->addGraph(); 288 | _nr_graphs = customPlot->graphCount(); 289 | if (this->_nr_y_axis_labels == 1) 290 | { 291 | QString name = QString("%1").arg(*location[i_tsfile_loc].name).trimmed(); 292 | customPlot->graph()->setName(name); 293 | } 294 | else 295 | { 296 | for (long i = 0; i < _nr_graphs; i++) 297 | { 298 | QCPGraph * grafiek = customPlot->graph(i); 299 | QCPPlottableLegendItem *plItem = customPlot->legend->itemWithPlottable(grafiek); 300 | QString new_name = plItem->plottable()->name(); 301 | if (!new_name.startsWith("Y")) 302 | { 303 | new_name = QString("Y1: ") + new_name; 304 | plItem->plottable()->setName(new_name); 305 | } 306 | } 307 | // check if parameter name is already in y-axis label, find the y-axis label number 308 | long y_label; 309 | QString parname = param[i_tsfile_par].name; 310 | QString dic_name; 311 | if (yaxis_label.contains(parname)) 312 | { 313 | QStringList yaxis_list = yaxis_label.split('\n'); 314 | long i = 0; // yaxis_list.length(); 315 | for (QStringList::Iterator it = yaxis_list.begin(); it != yaxis_list.end(); it++) 316 | { 317 | i += 1; 318 | QString name = QString(*it); 319 | if (QString(*it).contains(parname)) 320 | { 321 | y_label = i + _nr_max_ylabel; 322 | y_label_counter = QString("Y%1: ").arg(y_label); 323 | QStringList names = (*it).split(":"); 324 | if (names[0] != QString("Y%1").arg(y_label)) 325 | { 326 | dic_name = QString("Y%1").arg(y_label); 327 | y_label_counter = names[0] + QString(": "); 328 | } 329 | } 330 | } 331 | } 332 | customPlot->graph()->setName(y_label_counter + QString("%1").arg(*location[i_tsfile_loc].name).trimmed()); 333 | } 334 | 335 | QPen graphPen; 336 | // set colors 337 | if (fmod(_nr_graphs, 6) == 1) graphPen.setColor(QColor(0, 0, 255)); 338 | if (fmod(_nr_graphs, 6) == 2) graphPen.setColor(QColor(255, 0, 0)); 339 | if (fmod(_nr_graphs, 6) == 3) graphPen.setColor(QColor(0, 0, 0)); 340 | if (fmod(_nr_graphs, 6) == 4) graphPen.setColor(QColor(255, 0, 255)); 341 | if (fmod(_nr_graphs, 6) == 5) graphPen.setColor(QColor(0, 255, 0)); 342 | if (fmod(_nr_graphs, 6) == 0) graphPen.setColor(QColor(0, 255,255)); // 255, 255, 0 == yellow 343 | //graphPen.setColor(QColor(rand() % 245 + 10, rand() % 245 + 10, rand() % 245 + 10)); 344 | 345 | customPlot->graph()->setPen(graphPen); 346 | this->draw_data(x_val, y_val); 347 | 348 | //assert(!listVal.empty()); 349 | //double xmin = *std::min_element(x_val.begin(), x_val.end()); 350 | //double xmax = *std::max_element(x_val.begin(), x_val.end()); 351 | //double ymin = *std::min_element(y_val.begin(), y_val.end()); 352 | //double ymax = *std::max_element(y_val.begin(), y_val.end()); 353 | 354 | //customPlot->xAxis->setRange(xmin, xmax); 355 | //customPlot->yAxis->setRange(ymin, ymax); 356 | x_val.clear(); 357 | y_val.clear(); 358 | } 359 | QString TSPlot::set_yaxis_label(QString parname, QString unit, QString y_label_counter) 360 | { 361 | if (customPlot->graphCount() > 0) 362 | { 363 | QCPGraph * grafiek = customPlot->graph(0); 364 | QCPPlottableLegendItem *plItem = customPlot->legend->itemWithPlottable(grafiek); 365 | QString new_name = plItem->plottable()->name(); 366 | if (!new_name.startsWith("Y") && _ylabel_dic.size()>1) 367 | { 368 | new_name = QString("Y1: ") + new_name; 369 | plItem->plottable()->setName(new_name); 370 | _ylabel_dic[QString("Y1")] = 1; 371 | } 372 | } 373 | // y-axis 374 | if (_nr_y_axis_labels == 0) 375 | { 376 | _nr_y_axis_labels += 1; 377 | m_yaxis_label = this->get_yaxis_label(parname, unit); 378 | _ylabel_dic[QString("Y1")] = 1; 379 | } 380 | else 381 | { 382 | if (m_yaxis_label.contains(parname)) 383 | { 384 | // already in y_axis_label 385 | QStringList yaxis_list = m_yaxis_label.split('\n'); 386 | long i = 0; // yaxis_list.length(); 387 | for (QStringList::Iterator it = yaxis_list.begin(); it != yaxis_list.end(); it++) 388 | { 389 | i += 1; 390 | QString name = QString(*it); 391 | if (QString(*it).contains(parname)) 392 | { 393 | long y_label = i + _nr_max_ylabel; 394 | y_label_counter = QString("Y%1: ").arg(y_label); 395 | QStringList names = (*it).split(":"); 396 | QString janm = names[0]; 397 | if (names.length() == 1) 398 | { 399 | _ylabel_dic[QString("Y%1").arg(y_label)] += 1; 400 | } 401 | else // if (names[0] != QString("Y%1").arg(y_label)) 402 | { 403 | _ylabel_dic[names[0]] += 1; 404 | y_label_counter = names[0]; 405 | } 406 | } 407 | } 408 | } 409 | else 410 | { 411 | // not in y_axis_label 412 | if (_nr_y_axis_labels == 1) 413 | { 414 | m_yaxis_label.insert(0, "Y1: "); 415 | } 416 | _nr_y_axis_labels = _ylabel_dic.size() + 1; 417 | QString dic_name = (QString("Y%1").arg(_nr_y_axis_labels)); 418 | tmp_label.clear(); 419 | tmp_label.append("\n"); 420 | tmp_label.append(dic_name + QString(": ") + this->get_yaxis_label(parname, unit)); 421 | _ylabel_dic[dic_name] = 1; 422 | m_yaxis_label.append(tmp_label); 423 | } 424 | } 425 | return m_yaxis_label; 426 | } 427 | QString TSPlot::get_yaxis_label(QString name, QString unit) 428 | { 429 | return name.trimmed() + " [" + unit.trimmed() + "]"; 430 | } 431 | void TSPlot::draw_data(QVector x_val, QVector y_val) 432 | { 433 | customPlot->graph()->addData(x_val, y_val, true); // x_val is ascending sorted 434 | } 435 | 436 | 437 | void TSPlot::axisLabelDoubleClick(QCPAxis *axis, QCPAxis::SelectablePart part) 438 | { 439 | // Set an axis label by double clicking on it 440 | if (part == QCPAxis::spAxisLabel) // only react when the actual axis label is clicked, not tick label or axis backbone 441 | { 442 | bool ok; 443 | QString newLabel = QInputDialog::getText(this->parent, "Axis label", "New axis label:", QLineEdit::Normal, axis->label(), &ok); 444 | if (ok) 445 | { 446 | axis->setLabel(newLabel); 447 | customPlot->replot(); 448 | } 449 | } 450 | } 451 | 452 | 453 | void TSPlot::legendDoubleClick(QCPLegend *legend, QCPAbstractLegendItem *item) 454 | { 455 | // Rename a graph by double clicking on its legend item 456 | Q_UNUSED(legend) 457 | if (item) // only react if item was clicked (user could have clicked on border padding of legend where there is no item, then item is 0) 458 | { 459 | QCPPlottableLegendItem *plItem = qobject_cast(item); 460 | bool ok; 461 | QString newName = QInputDialog::getText(this->parent, "Graph name", "New graph name:", QLineEdit::Normal, plItem->plottable()->name(), &ok); 462 | if (ok) 463 | { 464 | plItem->plottable()->setName(newName); 465 | customPlot->replot(); 466 | } 467 | } 468 | } 469 | 470 | void TSPlot::titleDoubleClick(QMouseEvent * event) 471 | { 472 | Q_UNUSED(event) 473 | if (QCPTextElement *title = qobject_cast(sender())) 474 | { 475 | // Set the plot title by double clicking on it 476 | bool ok; 477 | QString newTitle = QInputDialog::getText(this->parent, "Title name", "New plot title:", QLineEdit::Normal, title->text(), &ok); 478 | if (ok) 479 | { 480 | title->setText(newTitle); 481 | customPlot->replot(); 482 | } 483 | } 484 | } 485 | 486 | void TSPlot::selectionChanged() 487 | { 488 | /* 489 | normally, axis base line, axis tick labels and axis labels are selectable separately, but we want 490 | the user only to be able to select the axis as a whole, so we tie the selected states of the tick labels 491 | and the axis base line together. However, the axis label shall be selectable individually. 492 | 493 | The selection state of the left and right axes shall be synchronized as well as the state of the 494 | bottom and top axes. 495 | 496 | Further, we want to synchronize the selection of the graphs with the selection state of the respective 497 | legend item belonging to that graph. So the user can select a graph by either clicking on the graph itself 498 | or on its legend item. 499 | */ 500 | 501 | // make top and bottom axes be selected synchronously, and handle axis and tick labels as one selectable object: 502 | if (customPlot->xAxis->selectedParts().testFlag(QCPAxis::spAxis) || customPlot->xAxis->selectedParts().testFlag(QCPAxis::spTickLabels) || 503 | customPlot->xAxis2->selectedParts().testFlag(QCPAxis::spAxis) || customPlot->xAxis2->selectedParts().testFlag(QCPAxis::spTickLabels)) 504 | { 505 | customPlot->xAxis2->setSelectedParts(QCPAxis::spAxis | QCPAxis::spTickLabels); 506 | customPlot->xAxis->setSelectedParts(QCPAxis::spAxis | QCPAxis::spTickLabels); 507 | } 508 | // make left and right axes be selected synchronously, and handle axis and tick labels as one selectable object: 509 | if (customPlot->yAxis->selectedParts().testFlag(QCPAxis::spAxis) || customPlot->yAxis->selectedParts().testFlag(QCPAxis::spTickLabels) || 510 | customPlot->yAxis2->selectedParts().testFlag(QCPAxis::spAxis) || customPlot->yAxis2->selectedParts().testFlag(QCPAxis::spTickLabels)) 511 | { 512 | customPlot->yAxis2->setSelectedParts(QCPAxis::spAxis | QCPAxis::spTickLabels); 513 | customPlot->yAxis->setSelectedParts(QCPAxis::spAxis | QCPAxis::spTickLabels); 514 | } 515 | 516 | // synchronize selection of graphs with selection of corresponding legend items: 517 | for (int i = 0; igraphCount(); ++i) 518 | { 519 | QCPGraph *graph = customPlot->graph(i); 520 | QCPPlottableLegendItem *item = customPlot->legend->itemWithPlottable(graph); 521 | if (item->selected() || graph->selected()) 522 | { 523 | item->setSelected(true); 524 | graph->setSelection(QCPDataSelection(graph->data()->dataRange())); 525 | } 526 | } 527 | } 528 | 529 | void TSPlot::mousePress() 530 | { 531 | QString * text1; 532 | // if an axis is selected, only allow the direction of that axis to be dragged 533 | // if no axis is selected, both directions may be dragged 534 | 535 | if (customPlot->xAxis->selectedParts().testFlag(QCPAxis::spAxis)) 536 | customPlot->axisRect()->setRangeDrag(customPlot->xAxis->orientation()); 537 | else if (customPlot->yAxis->selectedParts().testFlag(QCPAxis::spAxis)) 538 | customPlot->axisRect()->setRangeDrag(customPlot->yAxis->orientation()); 539 | else 540 | customPlot->axisRect()->setRangeDrag(Qt::Horizontal | Qt::Vertical); 541 | 542 | text1 = new QString("Add to Plot"); 543 | //sprintf(count, "%d", this->current_plot+1); 544 | //text1->append(count); 545 | pb_add_to_plot->setText(*text1); 546 | } 547 | 548 | void TSPlot::mouseWheel() 549 | { 550 | // if an axis is selected, only allow the direction of that axis to be zoomed 551 | // if no axis is selected, both directions may be zoomed 552 | 553 | if (customPlot->xAxis->selectedParts().testFlag(QCPAxis::spAxis)) 554 | customPlot->axisRect()->setRangeZoom(customPlot->xAxis->orientation()); 555 | else if (customPlot->yAxis->selectedParts().testFlag(QCPAxis::spAxis)) 556 | customPlot->axisRect()->setRangeZoom(customPlot->yAxis->orientation()); 557 | else 558 | customPlot->axisRect()->setRangeZoom(Qt::Horizontal | Qt::Vertical); 559 | } 560 | 561 | void TSPlot::moveLegend() 562 | { 563 | if (QAction* contextAction = qobject_cast(sender())) // make sure this slot is really called by a context menu action, so it carries the data we need 564 | { 565 | bool ok; 566 | int dataInt = contextAction->data().toInt(&ok); 567 | if (ok) 568 | { 569 | customPlot->axisRect()->insetLayout()->setInsetAlignment(0, (Qt::Alignment)dataInt); 570 | customPlot->replot(); 571 | } 572 | } 573 | } 574 | 575 | void TSPlot::graphClicked(QCPAbstractPlottable *plottable, int dataIndex) 576 | { 577 | // since we know we only have QCPGraphs in the plot, we can immediately access interface1D() 578 | // usually it's better to first check whether interface1D() returns non-zero, and only then use it. 579 | double dataValue = plottable->interface1D()->dataMainValue(dataIndex); 580 | QString message = QString("Clicked on graph '%1' at data point #%2 with value %3.").arg(plottable->name()).arg(dataIndex).arg(dataValue); 581 | //parent->statusBar()->showMessage(message, 2500); // only for QMainWindow 582 | //parent->setStatusTip(message); 583 | //parent->setStatusTip(message); 584 | } 585 | void TSPlot::graphDoubleClicked(QCPAbstractPlottable *plottable, int dataIndex) 586 | { 587 | double dataValue = plottable->interface1D()->dataMainValue(dataIndex); 588 | 589 | QList qdt_times = tsfile->get_qdt_times(); 590 | QString qdt = qdt_times[dataIndex].toString("yyyy-MM-dd hh:mm:ss.zzz"); 591 | QString message = QString("Location: %1\nTime: %2\nValue: %3").arg(plottable->name()).arg(qdt).arg(dataValue); 592 | QMessageBox::information(parent, NULL, message); 593 | } 594 | 595 | void TSPlot::contextMenuRequest(QPoint pos) 596 | { 597 | QMenu *menu = new QMenu(this); 598 | 599 | if (customPlot->legend->selectTest(pos, false) >= 0) // context menu on legend requested 600 | { 601 | menu->addAction("Move to top left", this, SLOT(moveLegend()))->setData((int)(Qt::AlignTop | Qt::AlignLeft)); 602 | menu->addAction("Move to top center", this, SLOT(moveLegend()))->setData((int)(Qt::AlignTop | Qt::AlignHCenter)); 603 | menu->addAction("Move to top right", this, SLOT(moveLegend()))->setData((int)(Qt::AlignTop | Qt::AlignRight)); 604 | menu->addAction("Move to bottom right", this, SLOT(moveLegend()))->setData((int)(Qt::AlignBottom | Qt::AlignRight)); 605 | menu->addAction("Move to bottom left", this, SLOT(moveLegend()))->setData((int)(Qt::AlignBottom | Qt::AlignLeft)); 606 | } 607 | else // general context menu on graphs requested 608 | { 609 | QAction * location_name= new QAction(); 610 | menu->addAction(location_name); 611 | menu->addSeparator(); 612 | location_name->setVisible(false); 613 | 614 | for (int i = 0; igraphCount(); ++i) 615 | { 616 | QCPGraph *graph = customPlot->graph(i); 617 | if (graph->selected()) 618 | { 619 | location_name->setVisible(true); 620 | location_name->setText(QString("Legend item: %1").arg(graph->name())); 621 | break; 622 | } 623 | } 624 | 625 | menu->addAction("Rescale axes", this, SLOT(contextMenuRescaleAxes())); 626 | menu->addAction("Remove selected graph", this, SLOT(contextMenuRemoveSelectedGraph())); 627 | menu->addAction("Print to PDF", this, SLOT(contextMenuSaveAsPDF())); 628 | } 629 | 630 | menu->popup(customPlot->mapToGlobal(pos)); 631 | } 632 | 633 | void TSPlot::contextMenuRescaleAxes() 634 | { 635 | customPlot->rescaleAxes(); 636 | customPlot->xAxis->scaleRange(1.05, customPlot->xAxis->range().center()); 637 | customPlot->yAxis->scaleRange(1.05, customPlot->yAxis->range().center()); 638 | customPlot->replot(); 639 | } 640 | void TSPlot::contextMenuSaveAsPDF() 641 | { 642 | // select first a filename, no actions need to be performed when cancel is pressed 643 | 644 | QString s = QDateTime::currentDateTime().toString("yyyyMMdd_hhmmss"); 645 | QString filename = s.append(".pdf"); 646 | QFileDialog * fd = new QFileDialog(); 647 | fd->setWindowTitle("Save PDF file"); 648 | fd->setNameFilter("PDF-format (*.pdf)"); 649 | fd->selectFile(filename); 650 | fd->setAcceptMode(QFileDialog::AcceptSave); 651 | if (fd->exec() != QDialog::Accepted) 652 | { 653 | return; 654 | } 655 | QStringList * QFilenames = new QStringList; 656 | *QFilenames = fd->selectedFiles(); 657 | for (QStringList::Iterator it = QFilenames->begin(); it != QFilenames->end(); ++it) { 658 | filename = *it; 659 | } 660 | delete fd; 661 | customPlot->savePdf(filename, customPlot->width(), customPlot->height(), QCP::epAllowCosmetic, QString("PlotCFTS"), QString("PlotCFTS")); 662 | } 663 | 664 | void TSPlot::contextMenuRemoveSelectedGraph() 665 | { 666 | if (customPlot->selectedGraphs().size() > 0) 667 | { 668 | _nr_graphs = customPlot->graphCount(); 669 | QString dic_name; 670 | 671 | QCPGraph * ind = customPlot->selectedGraphs().first(); 672 | QString legend_name = ind->name(); // ie legend name 673 | QStringList dic_names = legend_name.split(":"); 674 | dic_name = dic_names[0]; 675 | QStringList names = m_yaxis_label.split('\n'); 676 | m_yaxis_label.clear(); 677 | long j = 0; 678 | for (QStringList::iterator it = names.begin(); it != names.end(); it++) 679 | { 680 | j++; 681 | QString name = *it; 682 | long add_ylabel = 1; 683 | if (!dic_name.contains("Y") && _ylabel_dic[dic_name] > 0) 684 | { 685 | add_ylabel = 0; // there was just one label, so remove it 686 | } 687 | if (name.contains(dic_name)) 688 | { 689 | long k = _ylabel_dic[dic_name]; 690 | _ylabel_dic[dic_name] -= 1; 691 | k = _ylabel_dic[dic_name]; 692 | if (_ylabel_dic[dic_name] == 0) 693 | { 694 | add_ylabel = 0; 695 | } 696 | } 697 | if (add_ylabel == 0) 698 | { 699 | // do not add yaxis-label name to the yaxis_label 700 | j--; 701 | } 702 | else 703 | { 704 | if (j != 1) 705 | { 706 | m_yaxis_label.append("\n"); 707 | } 708 | m_yaxis_label.append(*it); 709 | } 710 | } 711 | // Zoek in naam naar voorvoegsel Y? en verwijder de daarbij behorende yaxis_label 712 | customPlot->removeGraph(customPlot->selectedGraphs().first()); 713 | _nr_graphs = customPlot->graphCount(); 714 | // Update yaxis_label and legend 715 | //set_yaxis_label(name, unit); 716 | //set_legend(); 717 | _nr_y_axis_labels -= 1; 718 | customPlot->yAxis->setLabel(m_yaxis_label); 719 | customPlot->replot(); 720 | 721 | if (_nr_graphs == 0) 722 | { 723 | _ylabel_dic.clear(); 724 | _nr_y_axis_labels = 0; 725 | } 726 | } 727 | } 728 | 729 | void TSPlot::onMouseMove(QMouseEvent *event) 730 | { 731 | int i_time; 732 | 733 | double x = customPlot->xAxis->pixelToCoord(event->pos().x()); 734 | double y = customPlot->yAxis->pixelToCoord(event->pos().y()); 735 | // convert x to date time 736 | QList qdt_times = tsfile->get_qdt_times(); 737 | QDateTime * RefDate = tsfile->get_reference_date(); 738 | _time_series struct_time = tsfile->get_times(); 739 | std::vector times = struct_time.times; 740 | int nr_times = tsfile->get_count_times(); 741 | i_time = -1; 742 | 743 | qint64 offset = RefDate->toSecsSinceEpoch(); 744 | if (x < times[0] + offset || 745 | x > times[nr_times-1] + offset ) 746 | { 747 | // nothing 748 | } 749 | else 750 | { 751 | for (int i = 1; i < nr_times; i++) 752 | { 753 | if (times[i-1] + offset > x && x < times[i] + offset) 754 | { 755 | double alpha = (x - times[i - 1] - offset) / (times[i] - times[i - 1]); 756 | double times_aver = (1.0 - alpha) * times[i - 1] + alpha * times[i]; 757 | QDateTime qdt_aver = RefDate->addMSecs(1000. * times_aver); 758 | QString qdt = qdt_aver.toString("hh:mm:ss.zzz, dd MMM yyyy"); 759 | if (floor(times[i] - times[i - 1]) - (times[i] - times[i - 1]) != 0.0 || 760 | floor(times[i]) - times[i] != 0.0 || 761 | floor(times[i-1]) - times[i-1] != 0.0 ) // timestep is smaller then one second 762 | { 763 | qdt_aver = RefDate->addMSecs(1000.*times_aver); 764 | qdt = qdt_aver.toString("hh:mm:ss.zzz, dd MMM yyyy"); 765 | } 766 | customPlot->setToolTipDuration(5000); 767 | customPlot->setToolTip(QString("%1; %2").arg(qdt).arg(y)); 768 | break; 769 | } 770 | else 771 | { 772 | customPlot->setToolTipDuration(0); 773 | customPlot->setToolTip(QString("")); 774 | } 775 | } 776 | } 777 | } 778 | --------------------------------------------------------------------------------