##// END OF EJS Templates
Merge pull request 234 from SCIQLOP develop...
perrinel -
r629:79ca90701f8c merge
parent child
Show More
@@ -0,0 +1,39
1
2 app_moc_headers = [
3 'include/MainWindow.h'
4 ]
5
6 app_ui_files = [
7 'ui/MainWindow.ui'
8 ]
9
10 app_qresources = ['resources/qlopapp.qrc']
11
12 app_moc_files = qt5.preprocess(moc_headers : app_moc_headers,
13 ui_files : app_ui_files,
14 qresources : app_qresources)
15
16 app_sources = [
17 'src/Main.cpp',
18 'src/MainWindow.cpp'
19 ]
20
21 app_inc = include_directories(['include'])
22
23 if host_machine.system()=='windows' or build_machine.system()=='windows'
24 winmod = import('windows')
25 rc = winmod.compile_resources('resources/qlopapp.rc')
26 else
27 rc = []
28 endif
29
30 sciqlop_app = executable('sciqlop',
31 app_sources,
32 app_moc_files,
33 rc,
34 link_with : [sciqlop_core, sciqlop_gui],
35 include_directories : [gui_inc, core_inc, app_inc],
36 dependencies : [qt5core, qt5printsupport, qt5gui, qt5widgets, qt5network],
37 install : true
38 )
39
@@ -0,0 +1,1
1 IDI_ICON1 ICON DISCARDABLE "sciqlop.ico"
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
@@ -0,0 +1,22
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 <plist version="1.0">
4 <dict>
5 <key>NSPrincipalClass</key>
6 <string>NSApplication</string>
7 <key>CFBundleIconFile</key>
8 <string>sciqlopLOGO.icns</string>
9 <key>CFBundlePackageType</key>
10 <string>APPL</string>
11 <key>CFBundleGetInfoString</key>
12 <string>Created by Qt/QMake</string>
13 <key>CFBundleSignature</key>
14 <string>????</string>
15 <key>CFBundleExecutable</key>
16 <string>SciQLOP</string>
17 <key>CFBundleIdentifier</key>
18 <string>com.lpp.SciQLOP</string>
19 <key>NOTE</key>
20 <string>This file was generated by Qt/QMake.</string>
21 </dict>
22 </plist>
@@ -0,0 +1,8
1 #!/bin/bash
2
3 mkdir build
4 meson --prefix=/tmp/SciQLOP.app --bindir=Contents/MacOS build
5 cd build
6 ninja
7 ninja install
8
@@ -0,0 +1,11
1 #!/bin/bash
2
3 mkdir -p ${MESON_INSTALL_PREFIX}/Contents/Frameworks
4 mv ${MESON_INSTALL_PREFIX}/lib/*plugin* ${MESON_INSTALL_PREFIX}/Contents/MacOS
5 macdeployqt ${MESON_INSTALL_PREFIX} -verbose=3
6 install_name_tool -change @rpath/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore /tmp/SciQLOP.app/Contents/MacOS/sciqlop
7 install_name_tool -change @rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport @executable_path/../Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport /tmp/SciQLOP.app/Contents/MacOS/sciqlop
8 install_name_tool -change @rpath/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui /tmp/SciQLOP.app/Contents/MacOS/sciqlop
9 install_name_tool -change @rpath/QtWidgets.framework/Versions/5/QtWidgets @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets /tmp/SciQLOP.app/Contents/MacOS/sciqlop
10 install_name_tool -change @rpath/QtNetwork.framework/Versions/5/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork /tmp/SciQLOP.app/Contents/MacOS/sciqlop
11
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
@@ -0,0 +1,8
1 #!/bin/bash
2
3 mkdir build
4 meson --prefix=/tmp/SciQLOP --cross-file build_cfg/windows/cross_fedora_win64.txt build
5 cd build
6 ninja
7 ninja install
8
@@ -0,0 +1,18
1 [binaries]
2 c = 'x86_64-w64-mingw32-gcc'
3 cpp = 'x86_64-w64-mingw32-g++'
4 ar = 'x86_64-w64-mingw32-ar'
5 strip = 'x86_64-w64-mingw32-strip'
6 qmake = 'mingw64-qmake-qt5'
7 qmake-qt5 = 'mingw64-qmake-qt5'
8 moc-qt5 = '/usr/x86_64-w64-mingw32/bin/qt5/moc'
9 windres = 'x86_64-w64-mingw32-windres'
10 pkgconfig = 'mingw64-pkg-config'
11 exe_wrapper = 'wine' # A command used to run generated executables.
12
13 [host_machine]
14 system = 'windows'
15 cpu_family = 'x86'
16 cpu = 'x86_64'
17 endian = 'little'
18
@@ -0,0 +1,26
1 #!/bin/bash
2
3 mkdir -p ${MESON_INSTALL_PREFIX}/plugins
4 mv ${MESON_INSTALL_PREFIX}/bin/*plugin*.dll ${MESON_INSTALL_PREFIX}/plugins/
5 mv ${MESON_INSTALL_PREFIX}/lib64/*.dll ${MESON_INSTALL_PREFIX}/
6 mv ${MESON_INSTALL_PREFIX}/bin/* ${MESON_INSTALL_PREFIX}/
7
8 cp /usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt5/plugins/platforms/qwindows.dll ${MESON_INSTALL_PREFIX}/
9 cp /usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt5/plugins/imageformats/*.dll ${MESON_INSTALL_PREFIX}/
10
11 peldd ${MESON_INSTALL_PREFIX}/sciqlop.exe -a -w libsciqlopcore.dll -w libsciqlopgui.dll -w dwmapi.dll -w UxTheme.dll -w CRYPT32.dll -w DNSAPI.dll -w IPHLPAPI.DLL -w comdlg32.dll -w WINSPOOL.DRV -w IMM32.dll | xargs cp -t ${MESON_INSTALL_PREFIX}/ || true
12 peldd ${MESON_INSTALL_PREFIX}/libsciqlopcore.dll -a -w libsciqlopgui.dll -w dwmapi.dll -w UxTheme.dll -w CRYPT32.dll -w DNSAPI.dll -w IPHLPAPI.DLL -w comdlg32.dll -w WINSPOOL.DRV -w IMM32.dll | xargs cp -t ${MESON_INSTALL_PREFIX}/ || true
13 peldd ${MESON_INSTALL_PREFIX}/libsciqlopgui.dll -a -w libsciqlopcore.dll -w dwmapi.dll -w UxTheme.dll -w CRYPT32.dll -w DNSAPI.dll -w IPHLPAPI.DLL -w comdlg32.dll -w WINSPOOL.DRV -w IMM32.dll | xargs cp -t ${MESON_INSTALL_PREFIX}/ || true
14 peldd ${MESON_INSTALL_PREFIX}/qwindows.dll -a -w libsciqlopcore.dll -w dwmapi.dll -w UxTheme.dll -w CRYPT32.dll -w DNSAPI.dll -w IPHLPAPI.DLL -w comdlg32.dll -w WINSPOOL.DRV -w IMM32.dll | xargs cp -t ${MESON_INSTALL_PREFIX}/ || true
15
16 peldd ${MESON_INSTALL_PREFIX}/qjp2.dll -a -w libsciqlopcore.dll -w dwmapi.dll -w UxTheme.dll -w CRYPT32.dll -w DNSAPI.dll -w IPHLPAPI.DLL -w comdlg32.dll -w WINSPOOL.DRV -w IMM32.dll | xargs cp -t ${MESON_INSTALL_PREFIX}/ || true
17 peldd ${MESON_INSTALL_PREFIX}/qjpeg.dll -a -w libsciqlopcore.dll -w dwmapi.dll -w UxTheme.dll -w CRYPT32.dll -w DNSAPI.dll -w IPHLPAPI.DLL -w comdlg32.dll -w WINSPOOL.DRV -w IMM32.dll | xargs cp -t ${MESON_INSTALL_PREFIX}/ || true
18 peldd ${MESON_INSTALL_PREFIX}/qsvg.dll -a -w libsciqlopcore.dll -w dwmapi.dll -w UxTheme.dll -w CRYPT32.dll -w DNSAPI.dll -w IPHLPAPI.DLL -w comdlg32.dll -w WINSPOOL.DRV -w IMM32.dll | xargs cp -t ${MESON_INSTALL_PREFIX}/ || true
19 peldd ${MESON_INSTALL_PREFIX}/qtiff.dll -a -w libsciqlopcore.dll -w dwmapi.dll -w UxTheme.dll -w CRYPT32.dll -w DNSAPI.dll -w IPHLPAPI.DLL -w comdlg32.dll -w WINSPOOL.DRV -w IMM32.dll | xargs cp -t ${MESON_INSTALL_PREFIX}/ || true
20 peldd ${MESON_INSTALL_PREFIX}/qwebp.dll -a -w libsciqlopcore.dll -w dwmapi.dll -w UxTheme.dll -w CRYPT32.dll -w DNSAPI.dll -w IPHLPAPI.DLL -w comdlg32.dll -w WINSPOOL.DRV -w IMM32.dll | xargs cp -t ${MESON_INSTALL_PREFIX}/ || true
21 peldd ${MESON_INSTALL_PREFIX}/plugins/libamdaplugin.dll -a -w libsciqlopgui.dll -w libsciqlopcore.dll -w dwmapi.dll -w UxTheme.dll -w CRYPT32.dll -w DNSAPI.dll -w IPHLPAPI.DLL -w comdlg32.dll -w WINSPOOL.DRV -w IMM32.dll | xargs cp -t ${MESON_INSTALL_PREFIX}/ || true
22 peldd ${MESON_INSTALL_PREFIX}/plugins/libmockplugin.dll -a -w libsciqlopgui.dll -w libsciqlopcore.dll -w dwmapi.dll -w UxTheme.dll -w CRYPT32.dll -w DNSAPI.dll -w IPHLPAPI.DLL -w comdlg32.dll -w WINSPOOL.DRV -w IMM32.dll | xargs cp -t ${MESON_INSTALL_PREFIX}/ || true
23
24 rm ${MESON_INSTALL_PREFIX}/bin/*plugin*.dll
25
26 rm -r ${MESON_INSTALL_PREFIX}/bin ${MESON_INSTALL_PREFIX}/lib64
@@ -0,0 +1,55
1
2 core_moc_headers = [
3 'include/Data/IDataProvider.h',
4 'include/DataSource/DataSourceController.h',
5 'include/DataSource/DataSourceItemAction.h',
6 'include/Network/NetworkController.h',
7 'include/Time/TimeController.h',
8 'include/Variable/Variable.h',
9 'include/Variable/VariableCacheController.h',
10 'include/Variable/VariableController.h',
11 'include/Variable/VariableAcquisitionWorker.h',
12 'include/Variable/VariableCacheStrategy.h',
13 'include/Variable/VariableSynchronizationGroup.h',
14 'include/Variable/VariableModel.h',
15 'include/Visualization/VisualizationController.h'
16 ]
17
18
19 core_moc_files = qt5.preprocess(moc_headers : core_moc_headers)
20
21 core_sources = [
22 'src/Common/DateUtils.cpp',
23 'src/Data/ScalarSeries.cpp',
24 'src/Data/DataSeriesIterator.cpp',
25 'src/Data/VectorSeries.cpp',
26 'src/DataSource/DataSourceController.cpp',
27 'src/DataSource/DataSourceItem.cpp',
28 'src/DataSource/DataSourceItemAction.cpp',
29 'src/Network/NetworkController.cpp',
30 'src/Plugin/PluginManager.cpp',
31 'src/Settings/SqpSettingsDefs.cpp',
32 'src/Time/TimeController.cpp',
33 'src/Variable/Variable.cpp',
34 'src/Variable/VariableCacheController.cpp',
35 'src/Variable/VariableController.cpp',
36 'src/Variable/VariableAcquisitionWorker.cpp',
37 'src/Variable/VariableCacheStrategy.cpp',
38 'src/Variable/VariableSynchronizationGroup.cpp',
39 'src/Variable/VariableModel.cpp',
40 'src/Visualization/VisualizationController.cpp'
41 ]
42
43 core_inc = include_directories(['include', '../plugin/include'])
44
45 sciqlop_core = library('sciqlopcore',
46 core_sources,
47 core_moc_files,
48 cpp_args : '-DCORE_LIB',
49 include_directories : core_inc,
50 dependencies : [qt5core, qt5widgets, qt5network],
51 install : true
52 )
53
54 subdir('tests')
55
@@ -0,0 +1,20
1
2
3 tests = [
4 [['Data/TestDataSeries.cpp'],['test_data'],['DataSeries test']],
5 [['Data/TestOneDimArrayData.cpp'],['test_1d'],['One Dim Array test']],
6 [['Data/TestTwoDimArrayData.cpp'],['test_2d'],['Two Dim Array test']],
7 [['DataSource/TestDataSourceController.cpp'],['test_data_source'],['DataSourceController test']],
8 [['Variable/TestVariableCacheController.cpp'],['test_variable_cache'],['VariableCacheController test']],
9 [['Variable/TestVariable.cpp'],['test_variable'],['Variable test']]
10 ]
11
12 foreach unit_test : tests
13 test_moc_files = qt5.preprocess(moc_sources : unit_test[0])
14 test_exe = executable(unit_test[1],unit_test[0] , test_moc_files,
15 link_with : sciqlop_core,
16 include_directories : core_inc,
17 dependencies : [qt5core, qt5widgets, qt5network,qt5test])
18 test(unit_test[2], test_exe)
19 endforeach
20
@@ -0,0 +1,72
1
2 gui_moc_headers = [
3 'include/DataSource/DataSourceWidget.h',
4 'include/Settings/SqpSettingsDialog.h',
5 'include/Settings/SqpSettingsGeneralWidget.h',
6 'include/SidePane/SqpSidePane.h',
7 'include/SqpApplication.h',
8 'include/TimeWidget/TimeWidget.h',
9 'include/Variable/VariableInspectorWidget.h',
10 'include/Visualization/qcustomplot.h',
11 'include/Visualization/VisualizationGraphWidget.h',
12 'include/Visualization/VisualizationTabWidget.h',
13 'include/Visualization/VisualizationWidget.h',
14 'include/Visualization/VisualizationZoneWidget.h'
15 ]
16
17 gui_ui_files = [
18 'ui/DataSource/DataSourceWidget.ui',
19 'ui/Settings/SqpSettingsDialog.ui',
20 'ui/Settings/SqpSettingsGeneralWidget.ui',
21 'ui/SidePane/SqpSidePane.ui',
22 'ui/TimeWidget/TimeWidget.ui',
23 'ui/Variable/VariableInspectorWidget.ui',
24 'ui/Variable/VariableMenuHeaderWidget.ui',
25 'ui/Visualization/VisualizationGraphWidget.ui',
26 'ui/Visualization/VisualizationTabWidget.ui',
27 'ui/Visualization/VisualizationWidget.ui',
28 'ui/Visualization/VisualizationZoneWidget.ui'
29 ]
30
31 gui_qresources = ['resources/sqpguiresources.qrc']
32
33 gui_moc_files = qt5.preprocess(moc_headers : gui_moc_headers,
34 ui_files : gui_ui_files,
35 qresources : gui_qresources)
36
37 gui_sources = [
38 'src/SqpApplication.cpp',
39 'src/Common/ColorUtils.cpp',
40 'src/DataSource/DataSourceTreeWidgetItem.cpp',
41 'src/DataSource/DataSourceTreeWidgetHelper.cpp',
42 'src/DataSource/DataSourceWidget.cpp',
43 'src/Settings/SqpSettingsDialog.cpp',
44 'src/Settings/SqpSettingsGeneralWidget.cpp',
45 'src/SidePane/SqpSidePane.cpp',
46 'src/TimeWidget/TimeWidget.cpp',
47 'src/Variable/VariableInspectorWidget.cpp',
48 'src/Variable/VariableMenuHeaderWidget.cpp',
49 'src/Visualization/VisualizationGraphHelper.cpp',
50 'src/Visualization/VisualizationGraphRenderingDelegate.cpp',
51 'src/Visualization/VisualizationGraphWidget.cpp',
52 'src/Visualization/VisualizationTabWidget.cpp',
53 'src/Visualization/VisualizationWidget.cpp',
54 'src/Visualization/VisualizationZoneWidget.cpp',
55 'src/Visualization/qcustomplot.cpp',
56 'src/Visualization/operations/GenerateVariableMenuOperation.cpp',
57 'src/Visualization/operations/MenuBuilder.cpp',
58 'src/Visualization/operations/RemoveVariableOperation.cpp',
59 'src/Visualization/operations/RescaleAxeOperation.cpp'
60 ]
61
62 gui_inc = include_directories(['include'])
63
64 sciqlop_gui = library('sciqlopgui',
65 gui_sources,
66 gui_moc_files,
67 link_with : sciqlop_core,
68 include_directories : [gui_inc, core_inc],
69 dependencies : [qt5core, qt5printsupport, qt5gui, qt5widgets, qt5network],
70 install : true
71 )
72
@@ -0,0 +1,36
1 project('SciQLOP', 'cpp',default_options : ['cpp_std=c++14'])
2
3 qt5 = import('qt5')
4 qt5core = dependency('qt5', modules : 'Core')
5 qt5widgets = dependency('qt5', modules : 'Widgets')
6 qt5gui = dependency('qt5', modules : 'Gui')
7 qt5svg = dependency('qt5', modules : 'Svg')
8 qt5xml = dependency('qt5', modules : 'Xml')
9 qt5network = dependency('qt5', modules : 'Network')
10 qt5printsupport = dependency('qt5', modules : 'PrintSupport')
11 qt5test = dependency('qt5', modules : 'Test')
12
13 moc = find_program('moc','moc-qt5')
14
15 subdir('core')
16 subdir('gui')
17 subdir('app')
18 subdir('plugins')
19
20 if build_machine.system()=='darwin'
21 install_data('build_cfg/mac/sciqlopLOGO.icns', install_dir : 'Contents/Resources')
22 install_data('build_cfg/mac/Info.plist', install_dir : 'Contents')
23 meson.add_install_script('build_cfg/mac/install_script.sh')
24 elif host_machine.system()=='windows'
25 meson.add_install_script('build_cfg/windows/install_script.sh')
26 endif
27
28 cppcheck = find_program('cppcheck', required : false)
29
30 if cppcheck.found()
31 run_target('cppcheck',
32 command : [cppcheck, '--enable=all',
33 '--project=' + join_paths(meson.build_root(), 'compile_commands.json')],
34 build_by_default : true
35 )
36 endif
@@ -0,0 +1,61
1
2 amdaplugin_moc_headers = [
3 'include/AmdaPlugin.h'
4 ]
5
6 amdaplugin_sources = [
7 'src/AmdaDefs.cpp',
8 'src/AmdaParser.cpp',
9 'src/AmdaPlugin.cpp',
10 'src/AmdaProvider.cpp',
11 'src/AmdaResultParser.cpp'
12 ]
13
14 amdaplugin_ui_files = []
15 amdaplugin_resources_files = [
16 'resources/amdaresources.qrc'
17 ]
18
19 amdaplugin_inc = include_directories(['include', '../../plugin/include'])
20
21 gen = generator(moc,
22 output : 'moc_@BASENAME@.cpp',
23 arguments : ['@INPUT@',
24 '-DPLUGIN_JSON_FILE_PATH="'+meson.source_root()+'/plugins/amda/resources/amda.json"',
25 '-I', meson.current_source_dir()+'/include',
26 '-I', meson.current_source_dir()+'/../../plugin/include',
27 '-o', '@OUTPUT@'])
28
29 amdaplugin_moc_plugin_files = gen.process(amdaplugin_moc_headers)
30
31 amdaplugin_moc_files = qt5.preprocess(
32 ui_files : amdaplugin_ui_files,
33 qresources : amdaplugin_resources_files)
34
35 sciqlop_amdaplugin = library('amdaplugin',
36 amdaplugin_sources,
37 amdaplugin_moc_files,
38 amdaplugin_moc_plugin_files,
39 cpp_args : '-DAMDA_LIB',
40 link_with : [sciqlop_core, sciqlop_gui],
41 include_directories : [amdaplugin_inc, core_inc, gui_inc],
42 dependencies : [qt5core, qt5gui, qt5widgets, qt5network],
43 install : true
44 )
45
46
47 tests = [
48 [['tests/TestAmdaParser.cpp'],['test_amda_parser'],['AMDA parser test']],
49 [['tests/TestAmdaResultParser.cpp'],['test_amda_result_parser'],['AMDA result parser test']],
50 [['tests/TestAmdaAcquisition.cpp'],['test_amda_acquisition'],['AMDA Acquisition test']]
51 ]
52
53 foreach unit_test : tests
54 test_moc_files = qt5.preprocess(moc_sources : unit_test[0])
55 test_exe = executable(unit_test[1],unit_test[0] , test_moc_files,
56 link_with : [sciqlop_core, sciqlop_amdaplugin, sciqlop_gui],
57 include_directories : [core_inc, amdaplugin_inc, gui_inc],
58 cpp_args : ['-DAMDA_TESTS_RESOURCES_DIR="'+meson.current_source_dir()+'/tests-resources"'],
59 dependencies : [qt5core, qt5widgets, qt5network,qt5test])
60 test(unit_test[2], test_exe,timeout: 3 * 60)
61 endforeach
@@ -0,0 +1,2
1 subdir('mockplugin')
2 subdir('amda')
@@ -0,0 +1,33
1
2 mockplugin_moc_headers = [
3 'include/MockPlugin.h'
4 ]
5
6 mockplugin_sources = [
7 'src/CosinusProvider.cpp',
8 'src/MockPlugin.cpp'
9 ]
10
11 mockplugin_inc = include_directories(['include', '../../plugin/include'])
12
13
14 gen = generator(moc,
15 output : 'moc_@BASENAME@.cpp',
16 arguments : ['@INPUT@',
17 '-DPLUGIN_JSON_FILE_PATH="'+meson.source_root()+'/plugins/mockplugin/resources/mockplugin.json"',
18 '-I', meson.current_source_dir()+'/include',
19 '-I', meson.current_source_dir()+'/../../plugin/include',
20 '-o', '@OUTPUT@'])
21
22 mockplugin_moc_files = gen.process(mockplugin_moc_headers)
23
24 sciqlop_mockplugin = library('mockplugin',
25 mockplugin_sources,
26 mockplugin_moc_files,
27 cpp_args : '-DMOCKPLUGIN_LIB',
28 link_with : [sciqlop_core, sciqlop_gui],
29 include_directories : [mockplugin_inc, core_inc, gui_inc],
30 dependencies : [qt5core, qt5gui, qt5widgets, qt5network],
31 install : true
32 )
33
@@ -1,121 +1,122
1 #ifndef SCIQLOP_VARIABLECONTROLLER_H
1 #ifndef SCIQLOP_VARIABLECONTROLLER_H
2 #define SCIQLOP_VARIABLECONTROLLER_H
2 #define SCIQLOP_VARIABLECONTROLLER_H
3
3
4 #include "CoreGlobal.h"
4 #include "CoreGlobal.h"
5
5
6 #include <Data/AcquisitionDataPacket.h>
6 #include <Data/AcquisitionDataPacket.h>
7 #include <Data/SqpRange.h>
7 #include <Data/SqpRange.h>
8
8
9 #include <QLoggingCategory>
9 #include <QLoggingCategory>
10 #include <QObject>
10 #include <QObject>
11 #include <QUuid>
11
12
12 #include <Common/spimpl.h>
13 #include <Common/spimpl.h>
13
14
14 class IDataProvider;
15 class IDataProvider;
15 class QItemSelectionModel;
16 class QItemSelectionModel;
16 class TimeController;
17 class TimeController;
17 class Variable;
18 class Variable;
18 class VariableModel;
19 class VariableModel;
19
20
20 Q_DECLARE_LOGGING_CATEGORY(LOG_VariableController)
21 Q_DECLARE_LOGGING_CATEGORY(LOG_VariableController)
21
22
22
23
23 /**
24 /**
24 * Possible types of zoom operation
25 * Possible types of zoom operation
25 */
26 */
26 enum class AcquisitionZoomType { ZoomOut, ZoomIn, PanRight, PanLeft, Unknown };
27 enum class AcquisitionZoomType { ZoomOut, ZoomIn, PanRight, PanLeft, Unknown };
27
28
28
29
29 /**
30 /**
30 * @brief The VariableController class aims to handle the variables in SciQlop.
31 * @brief The VariableController class aims to handle the variables in SciQlop.
31 */
32 */
32 class SCIQLOP_CORE_EXPORT VariableController : public QObject {
33 class SCIQLOP_CORE_EXPORT VariableController : public QObject {
33 Q_OBJECT
34 Q_OBJECT
34 public:
35 public:
35 explicit VariableController(QObject *parent = 0);
36 explicit VariableController(QObject *parent = 0);
36 virtual ~VariableController();
37 virtual ~VariableController();
37
38
38 VariableModel *variableModel() noexcept;
39 VariableModel *variableModel() noexcept;
39 QItemSelectionModel *variableSelectionModel() noexcept;
40 QItemSelectionModel *variableSelectionModel() noexcept;
40
41
41 void setTimeController(TimeController *timeController) noexcept;
42 void setTimeController(TimeController *timeController) noexcept;
42
43
43 /**
44 /**
44 * Deletes from the controller the variable passed in parameter.
45 * Deletes from the controller the variable passed in parameter.
45 *
46 *
46 * Delete a variable includes:
47 * Delete a variable includes:
47 * - the deletion of the various references to the variable in SciQlop
48 * - the deletion of the various references to the variable in SciQlop
48 * - the deletion of the model variable
49 * - the deletion of the model variable
49 * - the deletion of the provider associated with the variable
50 * - the deletion of the provider associated with the variable
50 * - removing the cache associated with the variable
51 * - removing the cache associated with the variable
51 *
52 *
52 * @param variable the variable to delete from the controller.
53 * @param variable the variable to delete from the controller.
53 */
54 */
54 void deleteVariable(std::shared_ptr<Variable> variable) noexcept;
55 void deleteVariable(std::shared_ptr<Variable> variable) noexcept;
55
56
56 /**
57 /**
57 * Deletes from the controller the variables passed in parameter.
58 * Deletes from the controller the variables passed in parameter.
58 * @param variables the variables to delete from the controller.
59 * @param variables the variables to delete from the controller.
59 * @sa deleteVariable()
60 * @sa deleteVariable()
60 */
61 */
61 void deleteVariables(const QVector<std::shared_ptr<Variable> > &variables) noexcept;
62 void deleteVariables(const QVector<std::shared_ptr<Variable> > &variables) noexcept;
62
63
63 /**
64 /**
64 * @brief abort the variable retrieve data progression
65 * @brief abort the variable retrieve data progression
65 */
66 */
66 void abortProgress(std::shared_ptr<Variable> variable);
67 void abortProgress(std::shared_ptr<Variable> variable);
67
68
68 static AcquisitionZoomType getZoomType(const SqpRange &range, const SqpRange &oldRange);
69 static AcquisitionZoomType getZoomType(const SqpRange &range, const SqpRange &oldRange);
69 signals:
70 signals:
70 /// Signal emitted when a variable is about to be deleted from the controller
71 /// Signal emitted when a variable is about to be deleted from the controller
71 void variableAboutToBeDeleted(std::shared_ptr<Variable> variable);
72 void variableAboutToBeDeleted(std::shared_ptr<Variable> variable);
72
73
73 /// Signal emitted when a data acquisition is requested on a range for a variable
74 /// Signal emitted when a data acquisition is requested on a range for a variable
74 void rangeChanged(std::shared_ptr<Variable> variable, const SqpRange &range);
75 void rangeChanged(std::shared_ptr<Variable> variable, const SqpRange &range);
75
76
76 /// Signal emitted when a sub range of the cacheRange of the variable can be displayed
77 /// Signal emitted when a sub range of the cacheRange of the variable can be displayed
77 void updateVarDisplaying(std::shared_ptr<Variable> variable, const SqpRange &range);
78 void updateVarDisplaying(std::shared_ptr<Variable> variable, const SqpRange &range);
78
79
79 public slots:
80 public slots:
80 /// Request the data loading of the variable whithin range
81 /// Request the data loading of the variable whithin range
81 void onRequestDataLoading(QVector<std::shared_ptr<Variable> > variables, const SqpRange &range,
82 void onRequestDataLoading(QVector<std::shared_ptr<Variable> > variables, const SqpRange &range,
82 const SqpRange &oldRange, bool synchronise);
83 const SqpRange &oldRange, bool synchronise);
83 /**
84 /**
84 * Creates a new variable and adds it to the model
85 * Creates a new variable and adds it to the model
85 * @param name the name of the new variable
86 * @param name the name of the new variable
86 * @param metadata the metadata of the new variable
87 * @param metadata the metadata of the new variable
87 * @param provider the data provider for the new variable
88 * @param provider the data provider for the new variable
88 * @return the pointer to the new variable or nullptr if the creation failed
89 * @return the pointer to the new variable or nullptr if the creation failed
89 */
90 */
90 std::shared_ptr<Variable> createVariable(const QString &name, const QVariantHash &metadata,
91 std::shared_ptr<Variable> createVariable(const QString &name, const QVariantHash &metadata,
91 std::shared_ptr<IDataProvider> provider) noexcept;
92 std::shared_ptr<IDataProvider> provider) noexcept;
92
93
93 /// Update the temporal parameters of every selected variable to dateTime
94 /// Update the temporal parameters of every selected variable to dateTime
94 void onDateTimeOnSelection(const SqpRange &dateTime);
95 void onDateTimeOnSelection(const SqpRange &dateTime);
95
96
96
97
97 void onDataProvided(QUuid vIdentifier, const SqpRange &rangeRequested,
98 void onDataProvided(QUuid vIdentifier, const SqpRange &rangeRequested,
98 const SqpRange &cacheRangeRequested,
99 const SqpRange &cacheRangeRequested,
99 QVector<AcquisitionDataPacket> dataAcquired);
100 QVector<AcquisitionDataPacket> dataAcquired);
100
101
101 void onVariableRetrieveDataInProgress(QUuid identifier, double progress);
102 void onVariableRetrieveDataInProgress(QUuid identifier, double progress);
102
103
103 /// Cancel the current request for the variable
104 /// Cancel the current request for the variable
104 void onAbortProgressRequested(std::shared_ptr<Variable> variable);
105 void onAbortProgressRequested(std::shared_ptr<Variable> variable);
105
106
106 /// synchronization group methods
107 /// synchronization group methods
107 void onAddSynchronizationGroupId(QUuid synchronizationGroupId);
108 void onAddSynchronizationGroupId(QUuid synchronizationGroupId);
108 void onRemoveSynchronizationGroupId(QUuid synchronizationGroupId);
109 void onRemoveSynchronizationGroupId(QUuid synchronizationGroupId);
109 void onAddSynchronized(std::shared_ptr<Variable> variable, QUuid synchronizationGroupId);
110 void onAddSynchronized(std::shared_ptr<Variable> variable, QUuid synchronizationGroupId);
110
111
111 void initialize();
112 void initialize();
112 void finalize();
113 void finalize();
113
114
114 private:
115 private:
115 void waitForFinish();
116 void waitForFinish();
116
117
117 class VariableControllerPrivate;
118 class VariableControllerPrivate;
118 spimpl::unique_impl_ptr<VariableControllerPrivate> impl;
119 spimpl::unique_impl_ptr<VariableControllerPrivate> impl;
119 };
120 };
120
121
121 #endif // SCIQLOP_VARIABLECONTROLLER_H
122 #endif // SCIQLOP_VARIABLECONTROLLER_H
@@ -1,25 +1,29
1 #ifndef SCIQLOP_AMDAPLUGIN_H
1 #ifndef SCIQLOP_AMDAPLUGIN_H
2 #define SCIQLOP_AMDAPLUGIN_H
2 #define SCIQLOP_AMDAPLUGIN_H
3
3
4 #include "AmdaGlobal.h"
4 #include "AmdaGlobal.h"
5
5
6 #include <Plugin/IPlugin.h>
6 #include <Plugin/IPlugin.h>
7
7
8 #include <QLoggingCategory>
8 #include <QLoggingCategory>
9
9
10 #include <memory>
10 #include <memory>
11
11
12 Q_DECLARE_LOGGING_CATEGORY(LOG_AmdaPlugin)
12 Q_DECLARE_LOGGING_CATEGORY(LOG_AmdaPlugin)
13
13
14 #ifndef PLUGIN_JSON_FILE_PATH
15 #define PLUGIN_JSON_FILE_PATH "mockplugin.json"
16 #endif
17
14 class DataSourceItem;
18 class DataSourceItem;
15
19
16 class SCIQLOP_AMDA_EXPORT AmdaPlugin : public QObject, public IPlugin {
20 class SCIQLOP_AMDA_EXPORT AmdaPlugin : public QObject, public IPlugin {
17 Q_OBJECT
21 Q_OBJECT
18 Q_INTERFACES(IPlugin)
22 Q_INTERFACES(IPlugin)
19 Q_PLUGIN_METADATA(IID "sciqlop.plugin.IPlugin" FILE "amda.json")
23 Q_PLUGIN_METADATA(IID "sciqlop.plugin.IPlugin" FILE PLUGIN_JSON_FILE_PATH)
20 public:
24 public:
21 /// @sa IPlugin::initialize()
25 /// @sa IPlugin::initialize()
22 void initialize() override;
26 void initialize() override;
23 };
27 };
24
28
25 #endif // SCIQLOP_AMDAPLUGIN_H
29 #endif // SCIQLOP_AMDAPLUGIN_H
@@ -1,25 +1,29
1 #ifndef SCIQLOP_MOCKPLUGIN_H
1 #ifndef SCIQLOP_MOCKPLUGIN_H
2 #define SCIQLOP_MOCKPLUGIN_H
2 #define SCIQLOP_MOCKPLUGIN_H
3
3
4 #include "MockPluginGlobal.h"
4 #include "MockPluginGlobal.h"
5
5
6 #include <Plugin/IPlugin.h>
6 #include <Plugin/IPlugin.h>
7
7
8 #include <QLoggingCategory>
8 #include <QLoggingCategory>
9
9
10 #include <memory>
10 #include <memory>
11
11
12 #ifndef PLUGIN_JSON_FILE_PATH
13 #define PLUGIN_JSON_FILE_PATH "mockplugin.json"
14 #endif
15
12 Q_DECLARE_LOGGING_CATEGORY(LOG_MockPlugin)
16 Q_DECLARE_LOGGING_CATEGORY(LOG_MockPlugin)
13
17
14 class DataSourceItem;
18 class DataSourceItem;
15
19
16 class SCIQLOP_MOCKPLUGIN_EXPORT MockPlugin : public QObject, public IPlugin {
20 class SCIQLOP_MOCKPLUGIN_EXPORT MockPlugin : public QObject, public IPlugin {
17 Q_OBJECT
21 Q_OBJECT
18 Q_INTERFACES(IPlugin)
22 Q_INTERFACES(IPlugin)
19 Q_PLUGIN_METADATA(IID "sciqlop.plugin.IPlugin" FILE "mockplugin.json")
23 Q_PLUGIN_METADATA(IID "sciqlop.plugin.IPlugin" FILE PLUGIN_JSON_FILE_PATH)
20 public:
24 public:
21 /// @sa IPlugin::initialize()
25 /// @sa IPlugin::initialize()
22 void initialize() override;
26 void initialize() override;
23 };
27 };
24
28
25 #endif // SCIQLOP_MOCKPLUGIN_H
29 #endif // SCIQLOP_MOCKPLUGIN_H
General Comments 0
You need to be logged in to leave comments. Login now