##// END OF EJS Templates
Merge pull request 130 from SCIQLOP-Initialisation feature/ClangAnalyserIntegration...
perrinel -
r16:51ad7e303234 merge
parent child
Show More
@@ -0,0 +1,42
1 # - try to find scan-build tool
2 #
3 # Cache Variables:
4 # CLANGANALYZER_ROOT_DIR
5 # CLANGANALYZER_EXECUTABLE
6 #
7 # Non-cache variables you might use in your CMakeLists.txt:
8 # CLANGANALYZER_FOUND
9 #
10 # Requires these CMake modules:
11 # FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
12
13 file(TO_CMAKE_PATH "${CLANGANALYZER_ROOT_DIR}" CLANGANALYZER_ROOT_DIR)
14 set(CLANGANALYZER_ROOT_DIR
15 "${CLANGANALYZER_ROOT_DIR}"
16 CACHE
17 PATH
18 "Path to search for scan-build")
19
20 if(CLANGANALYZER_EXECUTABLE AND NOT EXISTS "${CLANGANALYZER_EXECUTABLE}")
21 set(CLANGANALYZER_EXECUTABLE "notfound" CACHE PATH FORCE "")
22 endif()
23
24 # If we have a custom path, look there first.
25 if(CLANGANALYZER_ROOT_DIR)
26 find_program(CLANGANALYZER_EXECUTABLE
27 NAMES
28 scan-build
29 PATHS
30 "${CLANGANALYZER_ROOT_DIR}"
31 PATH_SUFFIXES
32 bin
33 NO_DEFAULT_PATH)
34 endif()
35
36 find_program(CLANGANALYZER_EXECUTABLE NAMES scan-build)
37
38 IF(NOT("${CLANGANALYZER_EXECUTABLE}" STREQUAL ""))
39 set(CLANGANALYZER_FOUND TRUE)
40 endif()
41
42 mark_as_advanced(CLANGANALYZER_EXECUTABLE)
@@ -0,0 +1,20
1
2 QT_PATH=".../Qt/5.8/gcc_64/lib/cmake/"
3
4 export CC=/usr/libexec/ccc-analyzer
5 export CXX=/usr/libexec/c++-analyzer
6 export CCC_CC=clang
7 export CCC_CXX=clang++
8 export LD=clang++
9 export CCC_ANALYZER_VERBOSE=1
10
11 LD_LIBRARY_PATH=/usr/local/lib64
12 export LD_LIBRARY_PATH
13
14 rm -rf build_clang-analyzer
15 mkdir build_clang-analyzer
16 cd build_clang-analyzer
17
18 scan-build cmake -DCMAKE_PREFIX_PATH=$QT_PATH -DCMAKE_CXX_COMPILER=clazy -DENABLE_ANALYSIS=false -DENABLE_CPPCHECK=false -DENABLE_FORMATTING=false -DENABLE_CHECKSTYLE=false -BUILD_DOCUMENTATION=false -BUILD_TESTS=false -DCMAKE_BUILD_TYPE=Debug ../../SCIQLOP-Initialisation/
19
20 scan-build -o clang-analyzer-output make -j2
@@ -0,0 +1,52
1 #
2 # sciqlop_code_analysis.cmake
3
4 # Launch code source analysis with cppcheck. Can be activated with the
5 # ENABLE_CPPCHECK option.
6 #
7 # The following CACHE variables are available:
8 # * CPPCHECK_EXTRA_ARGS: extra arguments for cppcheck;
9 # * CPPCHECK_OUTPUT: path to the xml report of cppcheck.
10 #
11 # The following variables are used (must be set by the cmake file calling this
12 # one):
13 # * ANALYSIS_INPUT_DIRS: directories to analyze;
14 # * ANALYSIS_EXCLUDE_DIRS: directories to exclude from the analysis.
15 #
16
17 #
18 # Analyze the source code with cppcheck
19 #
20 OPTION (ENABLE_CPPCHECK "Analyze the source code with cppcheck" ON)
21 IF (ENABLE_CPPCHECK)
22
23 # Make sure cppcheck has been found, otherwise the source code can't be
24 # analyzed
25 IF (CPPCHECK_FOUND)
26 SET (CPPCHECK_EXTRA_ARGS --inline-suppr --xml --xml-version=2 --enable="warning,style" --force -v
27 CACHE STRING "Extra arguments for cppcheck")
28 MARK_AS_ADVANCED (CPPCHECK_EXTRA_ARGS)
29
30 SET (CPPCHECK_OUTPUT "${CMAKE_BINARY_DIR}/cppcheck-report.xml"
31 CACHE STRING "Output file for the cppcheck report")
32 MARK_AS_ADVANCED (CPPCHECK_OUTPUT)
33
34 SET (CPPCHECK_EXCLUDE_DIRS)
35 FOREACH (dir ${ANALYSIS_EXCLUDE_DIRS})
36 LIST (APPEND CPPCHECK_EXCLUDE_DIRS "-i${dir}")
37 ENDFOREACH ()
38
39 # Add the analyze target to launch cppcheck
40 ADD_CUSTOM_TARGET (cppcheck
41 COMMAND
42 ${CPPCHECK_EXECUTABLE}
43 ${CPPCHECK_EXTRA_ARGS}
44 ${ANALYSIS_INPUT_DIRS}
45 ${CPPCHECK_EXCLUDE_DIRS}
46 2> ${CPPCHECK_OUTPUT}
47 )
48
49 ELSE (CPPCHECK_FOUND)
50 MESSAGE (STATUS "The source code won't be analyzed - Cppcheck not found")
51 ENDIF (CPPCHECK_FOUND)
52 ENDIF (ENABLE_CPPCHECK)
@@ -1,2 +1,3
1 build/
1 build/
2 CMakeLists.txt.user
2 CMakeLists.txt.user
3 /.project
1 NO CONTENT: file renamed from cmake/CMakeModules/Findcppcheck.cmake to analyzer/cmake/Findcppcheck.cmake
NO CONTENT: file renamed from cmake/CMakeModules/Findcppcheck.cmake to analyzer/cmake/Findcppcheck.cmake
1 NO CONTENT: file renamed from cmake/CMakeModules/Findcppcheck.cpp to analyzer/cmake/Findcppcheck.cpp
NO CONTENT: file renamed from cmake/CMakeModules/Findcppcheck.cpp to analyzer/cmake/Findcppcheck.cpp
@@ -1,11 +1,14
1 #
1 #
2 # compiler.cmake : configure the compilation flags
2 # compiler.cmake : configure the compilation flags
3 #
3 #
4
4
5 message("Compiler id: ${CMAKE_CXX_COMPILER_ID}")
5 IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
6 IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
6 INCLUDE("cmake/compiler/compiler_gnu.cmake")
7 INCLUDE("cmake/compiler/compiler_gnu.cmake")
8 ELSEIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
9 INCLUDE("cmake/compiler/compiler_gnu.cmake")
7 ELSEIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
10 ELSEIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
8 INCLUDE("cmake/compiler/compiler_msvc.cmake")
11 INCLUDE("cmake/compiler/compiler_msvc.cmake")
9 ELSE()
12 ELSE()
10 MESSAGE(FATAL_ERROR "Compiler not supported")
13 MESSAGE(FATAL_ERROR "Compiler not supported")
11 ENDIF()
14 ENDIF()
@@ -1,30 +1,32
1 #
1 #
2 # findslibs.cmake
2 # findslibs.cmake
3 #
3 #
4
4
5 #
5 #
6 # Qt
6 # Qt
7 #
7 #
8 # Find Qt here so that a message is displayed in the console when executing
8 # Find Qt here so that a message is displayed in the console when executing
9 # cmake, but each application must call SCIQLOP_FIND_QT() to load the Qt modules that
9 # cmake, but each application must call SCIQLOP_FIND_QT() to load the Qt modules that
10 # it needs.
10 # it needs.
11 FIND_PACKAGE(Qt5Core REQUIRED)
11 FIND_PACKAGE(Qt5Core REQUIRED)
12 FIND_PACKAGE(Qt5Test REQUIRED)
12 FIND_PACKAGE(Qt5Test REQUIRED)
13 FIND_PACKAGE(Qt5Gui REQUIRED)
13 FIND_PACKAGE(Qt5Gui REQUIRED)
14
14
15 #
15 #
16 # doxygen tools
16 # doxygen tools
17 #
17 #
18 FIND_PACKAGE(Doxygen)
18 FIND_PACKAGE(Doxygen)
19
19
20 #
20 #
21 # Cppcheck tool
21 # Analyzer tools
22 #
22 #
23 LIST( APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/analyzer/cmake")
23 FIND_PACKAGE(cppcheck)
24 FIND_PACKAGE(cppcheck)
25 FIND_PACKAGE(ClangAnalyzer)
24
26
25 #
27 #
26 # Formatting tools
28 # Formatting tools
27 #
29 #
28 LIST( APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/formatting/cmake")
30 LIST( APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/formatting/cmake")
29 FIND_PACKAGE(vera++)
31 FIND_PACKAGE(vera++)
30 FIND_PACKAGE(ClangFormat)
32 FIND_PACKAGE(ClangFormat)
@@ -1,38 +1,39
1 #
1 #
2 # Sciqlop_modules.cmake
2 # Sciqlop_modules.cmake
3 #
3 #
4 # Set ouptut directories
4 # Set ouptut directories
5 #
5 #
6 SET (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/${CMAKE_BUILD_TYPE})
6 SET (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/${CMAKE_BUILD_TYPE})
7 SET (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/${CMAKE_BUILD_TYPE})
7 SET (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/${CMAKE_BUILD_TYPE})
8
8
9
9
10 #
10 #
11 # Compile the core
11 # Compile the core
12 #
12 #
13 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/sqpcore")
13 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/sqpcore")
14
14
15 #
15 #
16 # Compile the gui
16 # Compile the gui
17 #
17 #
18 #ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/sqpgui")
18 #ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/sqpgui")
19
19
20 #
20 #
21 # Compile the app
21 # Compile the app
22 #
22 #
23 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/sqpapp")
23 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/sqpapp")
24
24
25 #
25 #
26 # Code formatting
26 # Code formatting
27 #
27 #
28 INCLUDE ("cmake/sciqlop_formatting.cmake")
28 INCLUDE ("cmake/sciqlop_formatting.cmake")
29
29
30 #
30 #
31 # Documentation generation
31 # Documentation generation
32 #
32 #
33 INCLUDE ("cmake/sciqlop_doxygen.cmake")
33 INCLUDE ("cmake/sciqlop_doxygen.cmake")
34
34
35 #
35 #
36 # Source code analysis
36 # Source code analysis
37 #
37 #
38 INCLUDE ("cmake/sciqlop_code_analysis.cmake")
38 INCLUDE ("cmake/sciqlop_code_analysis.cmake")
39 INCLUDE ("cmake/sciqlop_code_cppcheck.cmake")
@@ -1,52 +1,44
1 #
1 #
2 # sciqlop_code_analysis.cmake
2 # sciqlop_code_analysis.cmake
3
3
4 # Launch code source analysis with cppcheck. Can be activated with the
4 # Launch code source analysis with CLANGANALYZER. Can be activated with the
5 # ANALYZE_CODE option.
5 # ENABLE_ANALYSIS option.
6 #
6 #
7 # The following CACHE variables are available:
7 # The following CACHE variables are available:
8 # * CPPCHECK_EXTRA_ARGS: extra arguments for cppcheck;
8 # * CLANGANALYZER_EXTRA_ARGS: extra arguments for CLANGANALYZER;
9 # * CPPCHECK_OUTPUT: path to the xml report of cppcheck.
9 # * CLANGANALYZER_OUTPUT: path to the xml report of CLANGANALYZER.
10 #
10 #
11 # The following variables are used (must be set by the cmake file calling this
11 # The following variables are used (must be set by the cmake file calling this
12 # one):
12 # one):
13 # * ANALYSIS_INPUT_DIRS: directories to analyze;
13 # * ANALYSIS_INPUT_DIRS: directories to analyze;
14 # * ANALYSIS_EXCLUDE_DIRS: directories to exclude from the analysis.
14 # * ANALYSIS_EXCLUDE_DIRS: directories to exclude from the analysis.
15 #
15 #
16
16
17 #
17 #
18 # Analyze the source code with cppcheck
18 # Analyze the source code with CLANGANALYZER
19 #
19 #
20 OPTION (ANALYZE_CODE "Analyze the source code with cppcheck" ON)
20 OPTION (ENABLE_ANALYSIS "Analyze the source code with clang_analyze" ON)
21 IF (ANALYZE_CODE)
21 IF (ENABLE_ANALYSIS)
22
22
23 # Make sure cppcheck has been found, otherwise the source code can't be
23 # Make sure CLANGANALYZER has been found, otherwise the source code can't be
24 # analyzed
24 # analyzed
25 IF (CPPCHECK_FOUND)
25 IF (CLANGANALYZER_FOUND)
26 SET (CPPCHECK_EXTRA_ARGS --inline-suppr --xml --xml-version=2 --enable="warning,style" --force -v
27 CACHE STRING "Extra arguments for cppcheck")
28 MARK_AS_ADVANCED (CPPCHECK_EXTRA_ARGS)
29
26
30 SET (CPPCHECK_OUTPUT "${CMAKE_BINARY_DIR}/cppcheck-report.xml"
27 SET (CLANGANALYZER_OUTPUT "${CMAKE_BINARY_DIR}/clang-analyzer-ouput"
31 CACHE STRING "Output file for the cppcheck report")
28 CACHE STRING "Output file for the CLANGANALYZER report")
32 MARK_AS_ADVANCED (CPPCHECK_OUTPUT)
29 MARK_AS_ADVANCED (CLANGANALYZER_OUTPUT)
33
30
34 SET (CPPCHECK_EXCLUDE_DIRS)
31 SET (CLANGANALYZER_EXTRA_ARGS -o ${CLANGANALYZER_OUTPUT}
35 FOREACH (dir ${ANALYSIS_EXCLUDE_DIRS})
32 CACHE STRING "Extra arguments for CLANGANALYZER")
36 LIST (APPEND CPPCHECK_EXCLUDE_DIRS "-i${dir}")
33 MARK_AS_ADVANCED (CLANGANALYZER_EXTRA_ARGS)
37 ENDFOREACH ()
38
34
39 # Add the analyze target to launch cppcheck
35 # Add the analyze target to launch CLANGANALYZER
40 ADD_CUSTOM_TARGET (analyze
36 ADD_CUSTOM_TARGET (analyze
41 COMMAND
37 COMMAND
42 ${CPPCHECK_EXECUTABLE}
38 sh ${CMAKE_CURRENT_SOURCE_DIR}/analyzer/launch-clang-analyzer-linux.sh
43 ${CPPCHECK_EXTRA_ARGS}
44 ${ANALYSIS_INPUT_DIRS}
45 ${CPPCHECK_EXCLUDE_DIRS}
46 2> ${CPPCHECK_OUTPUT}
47 )
39 )
48
40
49 ELSE (CPPCHECK_FOUND)
41 ELSE (CLANGANALYZER_FOUND)
50 MESSAGE (STATUS "The source code won't be analyzed - Cppcheck not found")
42 MESSAGE (STATUS "The source code won't be analyzed - CLANGANALYZER not found")
51 ENDIF (CPPCHECK_FOUND)
43 ENDIF (CLANGANALYZER_FOUND)
52 ENDIF (ANALYZE_CODE)
44 ENDIF (ENABLE_ANALYSIS)
@@ -1,39 +1,39
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22 #include "mainwindow.h"
22 #include "mainwindow.h"
23 #include <QApplication>
23 #include <QApplication>
24 #include <QProcessEnvironment>
24 #include <QProcessEnvironment>
25 #include <QThread>
25 #include <QThread>
26 #include <omp.h>
26 //#include <omp.h>
27 #include <qglobal.h>
27 #include <qglobal.h>
28
28
29 int main(int argc, char *argv[])
29 int main(int argc, char *argv[])
30 {
30 {
31 QApplication a(argc, argv);
31 QApplication a(argc, argv);
32 QApplication::setOrganizationName("LPP");
32 QApplication::setOrganizationName("LPP");
33 QApplication::setOrganizationDomain("lpp.fr");
33 QApplication::setOrganizationDomain("lpp.fr");
34 QApplication::setApplicationName("SciQLop");
34 QApplication::setApplicationName("SciQLop");
35 MainWindow w;
35 MainWindow w;
36 w.show();
36 w.show();
37
37
38 return a.exec();
38 return a.exec();
39 }
39 }
@@ -1,104 +1,104
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22 #include "mainwindow.h"
22 #include "mainwindow.h"
23 #include "ui_mainwindow.h"
23 #include "ui_mainwindow.h"
24 #include <QAction>
24 #include <QAction>
25 #include <QDate>
25 #include <QDate>
26 #include <QDateTime>
26 #include <QDateTime>
27 #include <QDir>
27 #include <QDir>
28 #include <QFileDialog>
28 #include <QFileDialog>
29 #include <omp.h>
29 //#include <omp.h>
30 //#include <network/filedownloader.h>
30 //#include <network/filedownloader.h>
31 //#include <qlopdatabase.h>
31 //#include <qlopdatabase.h>
32 //#include <qlopsettings.h>
32 //#include <qlopsettings.h>
33 //#include <qlopgui.h>
33 //#include <qlopgui.h>
34 //#include <spacedata.h>
34 //#include <spacedata.h>
35 //#include "qlopcore.h"
35 //#include "qlopcore.h"
36 //#include "qlopcodecmanager.h"
36 //#include "qlopcodecmanager.h"
37 //#include "cdfcodec.h"
37 //#include "cdfcodec.h"
38 //#include "amdatxtcodec.h"
38 //#include "amdatxtcodec.h"
39 //#include <qlopplotmanager.h>
39 //#include <qlopplotmanager.h>
40
40
41
41
42 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
42 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
43 {
43 {
44 ui->setupUi(this);
44 ui->setupUi(this);
45 /* QLopGUI::registerMenuBar(menuBar());
45 /* QLopGUI::registerMenuBar(menuBar());
46 this->setWindowIcon(QIcon(":/sciqlopLOGO.svg"));
46 this->setWindowIcon(QIcon(":/sciqlopLOGO.svg"));
47 this->m_progressWidget = new QWidget();
47 this->m_progressWidget = new QWidget();
48 this->m_progressLayout = new QVBoxLayout(this->m_progressWidget);
48 this->m_progressLayout = new QVBoxLayout(this->m_progressWidget);
49 this->m_progressWidget->setLayout(this->m_progressLayout);
49 this->m_progressWidget->setLayout(this->m_progressLayout);
50 this->m_progressWidget->setWindowModality(Qt::WindowModal);
50 this->m_progressWidget->setWindowModality(Qt::WindowModal);
51 m_progressThreadIds = (int*) malloc(OMP_THREADS*sizeof(int));
51 m_progressThreadIds = (int*) malloc(OMP_THREADS*sizeof(int));
52 for(int i=0;i<OMP_THREADS;i++)
52 for(int i=0;i<OMP_THREADS;i++)
53 {
53 {
54 this->m_progress.append(new QProgressBar(this->m_progressWidget));
54 this->m_progress.append(new QProgressBar(this->m_progressWidget));
55 this->m_progress.last()->setMinimum(0);
55 this->m_progress.last()->setMinimum(0);
56 this->m_progress.last()->setMaximum(100);
56 this->m_progress.last()->setMaximum(100);
57 this->m_progressLayout->addWidget(this->m_progress.last());
57 this->m_progressLayout->addWidget(this->m_progress.last());
58 this->m_progressWidget->hide();
58 this->m_progressWidget->hide();
59 this->m_progressThreadIds[i] = -1;
59 this->m_progressThreadIds[i] = -1;
60 }
60 }
61 this->m_progressWidget->setWindowTitle("Loading File");
61 this->m_progressWidget->setWindowTitle("Loading File");
62 const QList<QLopService*>ServicesToLoad=QList<QLopService*>()
62 const QList<QLopService*>ServicesToLoad=QList<QLopService*>()
63 << QLopCore::self()
63 << QLopCore::self()
64 << QLopPlotManager::self()
64 << QLopPlotManager::self()
65 << QLopCodecManager::self()
65 << QLopCodecManager::self()
66 << FileDownloader::self()
66 << FileDownloader::self()
67 << QLopDataBase::self()
67 << QLopDataBase::self()
68 << SpaceData::self();
68 << SpaceData::self();
69
69
70 CDFCodec::registerToManager();
70 CDFCodec::registerToManager();
71 AMDATXTCodec::registerToManager();
71 AMDATXTCodec::registerToManager();
72
72
73
73
74 for(int i=0;i<ServicesToLoad.count();i++)
74 for(int i=0;i<ServicesToLoad.count();i++)
75 {
75 {
76 qDebug()<<ServicesToLoad.at(i)->serviceName();
76 qDebug()<<ServicesToLoad.at(i)->serviceName();
77 ServicesToLoad.at(i)->initialize(); //must be called before getGUI
77 ServicesToLoad.at(i)->initialize(); //must be called before getGUI
78 QDockWidget* wdgt=ServicesToLoad.at(i)->getGUI();
78 QDockWidget* wdgt=ServicesToLoad.at(i)->getGUI();
79 if(wdgt)
79 if(wdgt)
80 {
80 {
81 wdgt->setAllowedAreas(Qt::AllDockWidgetAreas);
81 wdgt->setAllowedAreas(Qt::AllDockWidgetAreas);
82 this->addDockWidget(Qt::TopDockWidgetArea,wdgt);
82 this->addDockWidget(Qt::TopDockWidgetArea,wdgt);
83 }
83 }
84 PythonQt::self()->getMainModule().addObject(ServicesToLoad.at(i)->serviceName(),(QObject*)ServicesToLoad.at(i));
84 PythonQt::self()->getMainModule().addObject(ServicesToLoad.at(i)->serviceName(),(QObject*)ServicesToLoad.at(i));
85 }*/
85 }*/
86 }
86 }
87
87
88 MainWindow::~MainWindow()
88 MainWindow::~MainWindow()
89 {
89 {
90 delete ui;
90 delete ui;
91 }
91 }
92
92
93
93
94 void MainWindow::changeEvent(QEvent *e)
94 void MainWindow::changeEvent(QEvent *e)
95 {
95 {
96 QMainWindow::changeEvent(e);
96 QMainWindow::changeEvent(e);
97 switch (e->type()) {
97 switch (e->type()) {
98 case QEvent::LanguageChange:
98 case QEvent::LanguageChange:
99 ui->retranslateUi(this);
99 ui->retranslateUi(this);
100 break;
100 break;
101 default:
101 default:
102 break;
102 break;
103 }
103 }
104 }
104 }
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now