##// END OF EJS Templates
Adaptation to last version of catalogue controller
trabillard -
r1196:b6390f556418
parent child
Show More
@@ -52,7 +52,8 public:
52 // Catalogue
52 // Catalogue
53 // bool createCatalogue(const QString &name, QVector<QUuid> eventList);
53 // bool createCatalogue(const QString &name, QVector<QUuid> eventList);
54 /// retrieveEvents with empty repository retrieve them from the default repository
54 /// retrieveEvents with empty repository retrieve them from the default repository
55 std::list<std::shared_ptr<DBCatalogue> > retrieveCatalogues(const QString &repository) const;
55 std::list<std::shared_ptr<DBCatalogue> > retrieveCatalogues(const QString &repository
56 = QString()) const;
56 void updateCatalogue(std::shared_ptr<DBCatalogue> catalogue);
57 void updateCatalogue(std::shared_ptr<DBCatalogue> catalogue);
57 void removeCatalogue(std::shared_ptr<DBCatalogue> catalogue);
58 void removeCatalogue(std::shared_ptr<DBCatalogue> catalogue);
58 void saveCatalogue(std::shared_ptr<DBCatalogue> catalogue);
59 void saveCatalogue(std::shared_ptr<DBCatalogue> catalogue);
@@ -148,7 +148,7 void CatalogueController::removeEvent(std::shared_ptr<DBEvent> event)
148
148
149 void CatalogueController::addEvent(std::shared_ptr<DBEvent> event)
149 void CatalogueController::addEvent(std::shared_ptr<DBEvent> event)
150 {
150 {
151 event->setRepository(impl->toSyncRepository(event->getRepository()));
151 event->setRepository(impl->toWorkRepository(event->getRepository()));
152
152
153 impl->m_CatalogueDao.addEvent(*event);
153 impl->m_CatalogueDao.addEvent(*event);
154
154
@@ -255,14 +255,23 void CatalogueController::waitForFinish()
255 void CatalogueController::CatalogueControllerPrivate::copyDBtoDB(const QString &dbFrom,
255 void CatalogueController::CatalogueControllerPrivate::copyDBtoDB(const QString &dbFrom,
256 const QString &dbTo)
256 const QString &dbTo)
257 {
257 {
258 auto catalogues = m_Q->retrieveCatalogues(dbFrom);
258 auto cataloguesShared = std::list<std::shared_ptr<DBCatalogue> >{};
259 auto events = m_Q->retrieveEvents(dbFrom);
259 auto catalogues = m_CatalogueDao.getCatalogues(dbFrom);
260
261 for (auto catalogue : catalogues) {
260 for (auto catalogue : catalogues) {
262 m_CatalogueDao.copyCatalogue(*catalogue, dbTo, true);
261 cataloguesShared.push_back(std::make_shared<DBCatalogue>(catalogue));
263 }
262 }
264
263
264 auto eventsShared = std::list<std::shared_ptr<DBEvent> >{};
265 auto events = m_CatalogueDao.getEvents(dbFrom);
265 for (auto event : events) {
266 for (auto event : events) {
267 eventsShared.push_back(std::make_shared<DBEvent>(event));
268 }
269
270 for (auto catalogue : cataloguesShared) {
271 m_CatalogueDao.copyCatalogue(*catalogue, dbTo, true);
272 }
273
274 for (auto event : eventsShared) {
266 m_CatalogueDao.copyEvent(*event, dbTo, true);
275 m_CatalogueDao.copyEvent(*event, dbTo, true);
267 }
276 }
268 }
277 }
@@ -47,12 +47,12 struct CatalogueActionManager::CatalogueActionManagerPrivate {
47
47
48 event->setEventProducts(productList);
48 event->setEventProducts(productList);
49
49
50 // TODO
50 sqpApp->catalogueController().addEvent(event);
51
51 if (catalogue) {
52 if (catalogue) {
53 // TODO
52 // catalogue->addEvent(event);
54 // catalogue->addEvent(event);
53 }
55 }
54 else {
55 }
56 }
56 }
57 };
57 };
58
58
@@ -2,6 +2,8
2 #include "ui_CatalogueExplorer.h"
2 #include "ui_CatalogueExplorer.h"
3
3
4 #include <Catalogue/CatalogueActionManager.h>
4 #include <Catalogue/CatalogueActionManager.h>
5 #include <Catalogue/CatalogueController.h>
6 #include <SqpApplication.h>
5 #include <Visualization/VisualizationWidget.h>
7 #include <Visualization/VisualizationWidget.h>
6
8
7 #include <DBCatalogue.h>
9 #include <DBCatalogue.h>
@@ -68,11 +70,15 CatalogueExplorer::CatalogueExplorer(QWidget *parent)
68 connect(ui->events, &CatalogueEventsWidget::selectionCleared,
70 connect(ui->events, &CatalogueEventsWidget::selectionCleared,
69 [this]() { ui->inspector->showPage(CatalogueInspectorWidget::Page::Empty); });
71 [this]() { ui->inspector->showPage(CatalogueInspectorWidget::Page::Empty); });
70
72
71 connect(ui->inspector, &CatalogueInspectorWidget::catalogueUpdated,
73 connect(ui->inspector, &CatalogueInspectorWidget::catalogueUpdated, [this](auto catalogue) {
72 [this](auto catalogue) { ui->catalogues->setCatalogueChanges(catalogue, true); });
74 sqpApp->catalogueController().updateCatalogue(catalogue);
75 ui->catalogues->setCatalogueChanges(catalogue, true);
76 });
73
77
74 connect(ui->inspector, &CatalogueInspectorWidget::eventUpdated,
78 connect(ui->inspector, &CatalogueInspectorWidget::eventUpdated, [this](auto event) {
75 [this](auto event) { ui->events->setEventChanges(event, true); });
79 sqpApp->catalogueController().updateEvent(event);
80 ui->events->setEventChanges(event, true);
81 });
76
82
77 connect(ui->inspector, &CatalogueInspectorWidget::eventProductUpdated,
83 connect(ui->inspector, &CatalogueInspectorWidget::eventProductUpdated,
78 [this](auto event, auto eventProduct) { ui->events->setEventChanges(event, true); });
84 [this](auto event, auto eventProduct) { ui->events->setEventChanges(event, true); });
@@ -176,11 +176,14 void CatalogueSideBarWidget::CatalogueSideBarWidgetPrivate::configureTreeWidget(
176 treeWidget->addTopLevelItem(separatorItem);
176 treeWidget->addTopLevelItem(separatorItem);
177 treeWidget->setItemWidget(separatorItem, 0, separator);
177 treeWidget->setItemWidget(separatorItem, 0, separator);
178
178
179 auto db = addDatabaseItem("Default", treeWidget);
179 auto repositories = sqpApp->catalogueController().getRepositories();
180 for (auto dbname : repositories) {
181 auto db = addDatabaseItem(dbname, treeWidget);
180
182
181 auto catalogues = sqpApp->catalogueController().retrieveCatalogues("Default");
183 auto catalogues = sqpApp->catalogueController().retrieveCatalogues(dbname);
182 for (auto catalogue : catalogues) {
184 for (auto catalogue : catalogues) {
183 addCatalogueItem(catalogue, db);
185 addCatalogueItem(catalogue, db);
186 }
184 }
187 }
185
188
186 treeWidget->expandAll();
189 treeWidget->expandAll();
@@ -1,6 +1,9
1 #include "Catalogue/CatalogueTreeWidgetItem.h"
1 #include "Catalogue/CatalogueTreeWidgetItem.h"
2 #include <Catalogue/CatalogueExplorerHelper.h>
2 #include <Catalogue/CatalogueExplorerHelper.h>
3
3
4 #include <Catalogue/CatalogueController.h>
5 #include <SqpApplication.h>
6
4 #include <memory>
7 #include <memory>
5
8
6 #include <DBCatalogue.h>
9 #include <DBCatalogue.h>
@@ -47,6 +50,7 void CatalogueTreeWidgetItem::setData(int column, int role, const QVariant &valu
47 if (newName != impl->m_Catalogue->getName()) {
50 if (newName != impl->m_Catalogue->getName()) {
48 setText(0, newName);
51 setText(0, newName);
49 impl->m_Catalogue->setName(newName);
52 impl->m_Catalogue->setName(newName);
53 sqpApp->catalogueController().updateCatalogue(impl->m_Catalogue);
50 setHasChanges(true);
54 setHasChanges(true);
51 }
55 }
52 }
56 }
@@ -20,7 +20,7 CreateEventDialog::CreateEventDialog(QWidget *parent)
20 connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
20 connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
21 connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
21 connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
22
22
23 auto catalogues = sqpApp->catalogueController().getCatalogues("Default");
23 auto catalogues = sqpApp->catalogueController().retrieveCatalogues();
24 for (auto cat : catalogues) {
24 for (auto cat : catalogues) {
25 ui->cbCatalogue->addItem(cat->getName());
25 ui->cbCatalogue->addItem(cat->getName());
26 impl->m_DisplayedCatalogues << cat;
26 impl->m_DisplayedCatalogues << cat;
General Comments 4
Under Review
author

Pull request updated. Auto status change to "Under Review"

Changed commits:
  * 1 added
  * 0 removed

Changed files:
  * M app/src/Main.cpp
  * M core/include/Catalogue/CatalogueController.h
  * M core/src/Catalogue/CatalogueController.cpp
  * M core/src/Plugin/PluginManager.cpp
  * M core/tests/Data/TestDataSeriesUtils.cpp
  * M gui/include/Catalogue/CatalogueEventsModel.h
  * M gui/include/Catalogue/CatalogueEventsWidget.h
  * M gui/include/Catalogue/CatalogueTreeWidgetItem.h
  * M gui/meson.build
  * M gui/src/Catalogue/CatalogueEventsModel.cpp
  * M gui/src/Catalogue/CatalogueEventsWidget.cpp
  * M gui/src/Catalogue/CatalogueExplorer.cpp
  * M gui/src/Catalogue/CatalogueSideBarWidget.cpp
  * M gui/src/Catalogue/CatalogueTreeWidgetItem.cpp
  * M gui/src/Visualization/VisualizationActionManager.cpp
  * M gui/src/Visualization/VisualizationGraphWidget.cpp
  * M gui/src/Visualization/VisualizationSelectionZoneItem.cpp
  * M plugins/amda/tests/TestAmdaResultParser.cpp
  * R cmake/FindCatalogueAPI.cmake
  * R core/include/Common/MimeTypesDef.h
  * R core/include/Data/DataSeriesUtils.h
  * R core/include/Data/OptionalAxis.h
  * R core/include/Data/SpectrogramSeries.h
  * R core/include/Data/Unit.h
  * R core/include/DataSource/DataSourceItemMergeHelper.h
  * R core/include/Variable/VariableCacheStrategyFactory.h
  * R core/include/Variable/VariableSingleThresholdCacheStrategy.h
  * R core/src/Common/MimeTypesDef.cpp
  * R core/src/Data/DataSeriesUtils.cpp
  * R core/src/Data/OptionalAxis.cpp
  * R core/src/Data/SpectrogramSeries.cpp
  * R core/src/DataSource/DataSourceItemMergeHelper.cpp
  * R core/tests-resources/TestDataSeriesUtils/TestThresholds.txt
  * R core/tests/Data/DataSeriesBuilders.cpp
  * R core/tests/Data/DataSeriesBuilders.h
  * R core/tests/Data/DataSeriesTestsUtils.cpp
  * R core/tests/Data/DataSeriesTestsUtils.h
  * R core/tests/Data/TestOptionalAxis.cpp
  * R core/tests/Data/TestScalarSeries.cpp
  * R core/tests/Data/TestSpectrogramSeries.cpp
  * R core/tests/Data/TestVectorSeries.cpp
  * R core/tests/DataSource/DataSourceItemBuilder.cpp
  * R core/tests/DataSource/DataSourceItemBuilder.h
  * R core/tests/DataSource/TestDataSourceItem.cpp
  * R core/tests/Variable/TestVariableSync.cpp
  * R extern/CatalogueAPI.cmake
  * R gui/include/Actions/ActionsGuiController.h
  * R gui/include/Actions/SelectionZoneAction.h
  * R gui/include/Catalogue/CatalogueExplorer.h
  * R gui/include/Catalogue/CatalogueInspectorWidget.h
  * R gui/include/Catalogue/CatalogueSideBarWidget.h
  * R gui/include/Common/VisualizationDef.h
  * R gui/include/DataSource/DataSourceTreeWidget.h
  * R gui/include/DragAndDrop/DragDropGuiController.h
  * R gui/include/DragAndDrop/DragDropScroller.h
  * R gui/include/DragAndDrop/DragDropTabSwitcher.h
  * R gui/include/Variable/VariableInspectorTableView.h
  * R gui/include/Visualization/AxisRenderingUtils.h
  * R gui/include/Visualization/ColorScaleEditor.h
  * R gui/include/Visualization/MacScrollBarStyle.h
  * R gui/include/Visualization/PlottablesRenderingUtils.h
  * R gui/include/Visualization/QCPColorMapIterator.h
  * R gui/include/Visualization/SqpColorScale.h
  * R gui/include/Visualization/VisualizationActionManager.h
  * R gui/include/Visualization/VisualizationCursorItem.h
  * R gui/include/Visualization/VisualizationDragDropContainer.h
  * R gui/include/Visualization/VisualizationDragWidget.h
  * R gui/include/Visualization/VisualizationMultiZoneSelectionDialog.h
  * R gui/include/Visualization/VisualizationSelectionZoneItem.h
  * R gui/include/Visualization/VisualizationSelectionZoneManager.h
  * R gui/resources/icones/add.png
  * R gui/resources/icones/allEvents.png
  * R gui/resources/icones/catalogue.png
  * R gui/resources/icones/chart.png
  * R gui/resources/icones/cursor.png
  * R gui/resources/icones/database.png
  * R gui/resources/icones/discard.png
  * R gui/resources/icones/drag.png
  * R gui/resources/icones/pointer.png
  * R gui/resources/icones/rectangle.png
  * R gui/resources/icones/remove.png
  * R gui/resources/icones/save.png
  * R gui/resources/icones/time.png
  * R gui/resources/icones/trash.png
  * R gui/resources/icones/zoom.png
  * R gui/src/Actions/ActionsGuiController.cpp
  * R gui/src/Actions/SelectionZoneAction.cpp
  * R gui/src/Catalogue/CatalogueInspectorWidget.cpp
  * R gui/src/Common/VisualizationDef.cpp
  * R gui/src/DataSource/DataSourceTreeWidget.cpp
  * R gui/src/DragAndDrop/DragDropGuiController.cpp
  * R gui/src/DragAndDrop/DragDropScroller.cpp
  * R gui/src/DragAndDrop/DragDropTabSwitcher.cpp
  * R gui/src/Variable/VariableInspectorTableView.cpp
  * R gui/src/Visualization/AxisRenderingUtils.cpp
  * R gui/src/Visualization/ColorScaleEditor.cpp
  * R gui/src/Visualization/MacScrollBarStyle.cpp
  * R gui/src/Visualization/PlottablesRenderingUtils.cpp
  * R gui/src/Visualization/QCPColorMapIterator.cpp
  * R gui/src/Visualization/SqpColorScale.cpp
  * R gui/src/Visualization/VisualizationCursorItem.cpp
  * R gui/src/Visualization/VisualizationDragDropContainer.cpp
  * R gui/src/Visualization/VisualizationDragWidget.cpp
  * R gui/src/Visualization/VisualizationMultiZoneSelectionDialog.cpp
  * R gui/src/Visualization/VisualizationSelectionZoneManager.cpp
  * R gui/ui/Catalogue/CatalogueEventsWidget.ui
  * R gui/ui/Catalogue/CatalogueExplorer.ui
  * R gui/ui/Catalogue/CatalogueInspectorWidget.ui
  * R gui/ui/Catalogue/CatalogueSideBarWidget.ui
  * R gui/ui/Visualization/ColorScaleEditor.ui
  * R gui/ui/Visualization/VisualizationMultiZoneSelectionDialog.ui
  * R plugins/amda/include/AmdaResultParserDefs.h
  * R plugins/amda/include/AmdaResultParserHelper.h
  * R plugins/amda/include/AmdaServer.h
  * R plugins/amda/resources/samples/AmdaSampleV3.json
  * R plugins/amda/src/AmdaResultParserDefs.cpp
  * R plugins/amda/src/AmdaResultParserHelper.cpp
  * R plugins/amda/src/AmdaServer.cpp
  * R plugins/amda/tests-resources/TestAmdaResultParser/amdaV2/FileNotFound.txt
  * R plugins/amda/tests-resources/TestAmdaResultParser/amdaV2/NaNValue.txt
  * R plugins/amda/tests-resources/TestAmdaResultParser/amdaV2/NaNX.txt
  * R plugins/amda/tests-resources/TestAmdaResultParser/amdaV2/NoUnit.txt
  * R plugins/amda/tests-resources/TestAmdaResultParser/amdaV2/TooManyValues.txt
  * R plugins/amda/tests-resources/TestAmdaResultParser/amdaV2/ValidScalar1.txt
  * R plugins/amda/tests-resources/TestAmdaResultParser/amdaV2/ValidVector1.txt
  * R plugins/amda/tests-resources/TestAmdaResultParser/amdaV2/WrongDate.txt
  * R plugins/amda/tests-resources/TestAmdaResultParser/amdaV2/WrongUnit.txt
  * R plugins/amda/tests-resources/TestAmdaResultParser/amdaV2/WrongValue.txt
  * R plugins/amda/tests-resources/TestAmdaResultParser/spectro/InvalidSpectrogramWrongBands.txt
  * R plugins/amda/tests-resources/TestAmdaResultParser/spectro/ValidSpectrogram1.txt
  * R plugins/amda/tests-resources/TestAmdaResultParser/spectro/ValidSpectrogram2.txt
  * R plugins/amda/tests-resources/TestAmdaResultParser/spectro/ValidSpectrogram3.txt
  * R plugins/amda/tests-resources/TestAmdaResultParser/spectro/ValidSpectrogramDataHoles.txt
  * R plugins/amda/tests-resources/TestAmdaResultParser/spectro/ValidSpectrogramDataHoles2.txt
  * R plugins/amda/tests-resources/TestAmdaResultParser/spectro/ValidSpectrogramFillValues.txt
  * R plugins/amda/tests-resources/TestAmdaResultParser/spectro/ValidSpectrogramNaNValues.txt
  * R plugins/amda/vera-exclusions/exclusions.txt
  * R plugins/mockplugin/include/MockDefs.h
  * R plugins/mockplugin/src/MockDefs.cpp
  * R subprojects/CatalogueAPI.wrap
  * R subprojects/QxOrm.wrap
  * R .gitignore
  * R CMakeLists.txt
  * R app/src/MainWindow.cpp
  * R app/ui/MainWindow.ui
  * R cmake/sciqlop_applications.cmake
  * R cmake/sciqlop_package_qt.cmake
  * R core/CMakeLists.txt
  * R core/cmake/Findsciqlop-core.cmake
  * R core/include/Common/SortUtils.h
  * R core/include/Data/ArrayData.h
  * R core/include/Data/DataSeries.h
  * R core/include/Data/DataSeriesIterator.h
  * R core/include/Data/IDataSeries.h
  * R core/include/Data/VariableRequest.h
  * R core/include/DataSource/DataSourceController.h
  * R core/include/DataSource/DataSourceItem.h
  * R core/include/DataSource/DataSourceItemAction.h
  * R core/include/Plugin/PluginManager.h
  * R core/include/Time/TimeController.h
  * R core/include/Variable/Variable.h
  * R core/include/Variable/VariableCacheStrategy.h
  * R core/include/Variable/VariableController.h
  * R core/include/Variable/VariableModel.h
  * R core/meson.build
  * R core/src/Data/DataSeriesIterator.cpp
  * R core/src/Data/VectorSeries.cpp
  * R core/src/DataSource/DataSourceController.cpp
  * R core/src/DataSource/DataSourceItem.cpp
  * R core/src/DataSource/DataSourceItemAction.cpp
  * R core/src/Time/TimeController.cpp
  * R core/src/Variable/Variable.cpp
  * R core/src/Variable/VariableAcquisitionWorker.cpp
  * R core/src/Variable/VariableController.cpp
  * R core/src/Variable/VariableModel.cpp
  * R core/tests/Data/TestTwoDimArrayData.cpp
  * R core/tests/Variable/TestVariable.cpp
  * R core/tests/meson.build
  * R gui/CMakeLists.txt
  * R gui/cmake/Findsciqlop-gui.cmake
  * R gui/include/DataSource/DataSourceWidget.h
  * R gui/include/SqpApplication.h
  * R gui/include/TimeWidget/TimeWidget.h
  * R gui/include/Visualization/VisualizationGraphHelper.h
  * R gui/include/Visualization/VisualizationGraphRenderingDelegate.h
  * R gui/include/Visualization/VisualizationGraphWidget.h
  * R gui/include/Visualization/VisualizationTabWidget.h
  * R gui/include/Visualization/VisualizationWidget.h
  * R gui/include/Visualization/VisualizationZoneWidget.h
  * R gui/resources/sqpguiresources.qrc
  * R gui/src/DataSource/DataSourceTreeWidgetItem.cpp
  * R gui/src/DataSource/DataSourceWidget.cpp
  * R gui/src/SqpApplication.cpp
  * R gui/src/TimeWidget/TimeWidget.cpp
  * R gui/src/Variable/VariableInspectorWidget.cpp
  * R gui/src/Visualization/VisualizationGraphHelper.cpp
  * R gui/src/Visualization/VisualizationGraphRenderingDelegate.cpp
  * R gui/src/Visualization/VisualizationTabWidget.cpp
  * R gui/src/Visualization/VisualizationWidget.cpp
  * R gui/src/Visualization/VisualizationZoneWidget.cpp
  * R gui/src/Visualization/operations/GenerateVariableMenuOperation.cpp
  * R gui/src/Visualization/operations/RescaleAxeOperation.cpp
  * R gui/ui/DataSource/DataSourceWidget.ui
  * R gui/ui/TimeWidget/TimeWidget.ui
  * R gui/ui/Variable/VariableInspectorWidget.ui
  * R gui/ui/Visualization/VisualizationTabWidget.ui
  * R gui/ui/Visualization/VisualizationZoneWidget.ui
  * R gui/vera-exclusions/exclusions.txt
  * R meson.build
  * R plugins/amda/CMakeLists.txt
  * R plugins/amda/cmake/Findsciqlop-amda.cmake
  * R plugins/amda/include/AmdaDefs.h
  * R plugins/amda/include/AmdaPlugin.h
  * R plugins/amda/include/AmdaProvider.h
  * R plugins/amda/include/AmdaResultParser.h
  * R plugins/amda/meson.build
  * R plugins/amda/resources/amdaresources.qrc
  * R plugins/amda/src/AmdaDefs.cpp
  * R plugins/amda/src/AmdaPlugin.cpp
  * R plugins/amda/src/AmdaProvider.cpp
  * R plugins/amda/src/AmdaResultParser.cpp
  * R plugins/amda/tests/TestAmdaAcquisition.cpp
  * R plugins/mockplugin/cmake/Findsciqlop-mockplugin.cmake
  * R plugins/mockplugin/include/CosinusProvider.h
  * R plugins/mockplugin/meson.build
  * R plugins/mockplugin/src/CosinusProvider.cpp
  * R plugins/mockplugin/src/MockPlugin.cpp
  * R plugins/mockplugin/tests/TestCosinusAcquisition.cpp
  * R core/src/Variable/VariableCacheStrategy.cpp
  * R core/tests/Data/TestDataSeries.cpp
Approved

Status change > Approved

You need to be logged in to leave comments. Login now