@@ -10,6 +10,7 | |||||
10 | #include <Common/MimeTypesDef.h> |
|
10 | #include <Common/MimeTypesDef.h> | |
11 | #include <Data/ArrayData.h> |
|
11 | #include <Data/ArrayData.h> | |
12 | #include <Data/IDataSeries.h> |
|
12 | #include <Data/IDataSeries.h> | |
|
13 | #include <Data/SpectrogramSeries.h> | |||
13 | #include <DragAndDrop/DragDropHelper.h> |
|
14 | #include <DragAndDrop/DragDropHelper.h> | |
14 | #include <Settings/SqpSettingsDefs.h> |
|
15 | #include <Settings/SqpSettingsDefs.h> | |
15 | #include <SqpApplication.h> |
|
16 | #include <SqpApplication.h> | |
@@ -293,9 +294,17 void VisualizationGraphWidget::accept(IVisualizationWidgetVisitor *visitor) | |||||
293 |
|
294 | |||
294 | bool VisualizationGraphWidget::canDrop(const Variable &variable) const |
|
295 | bool VisualizationGraphWidget::canDrop(const Variable &variable) const | |
295 | { |
|
296 | { | |
296 | /// @todo : for the moment, a graph can always accomodate a variable |
|
297 | auto isSpectrogram = [](const auto &variable) { | |
297 | Q_UNUSED(variable); |
|
298 | return std::dynamic_pointer_cast<SpectrogramSeries>(variable.dataSeries()) != nullptr; | |
298 | return true; |
|
299 | }; | |
|
300 | ||||
|
301 | // - A spectrogram series can't be dropped on graph with existing plottables | |||
|
302 | // - No data series can be dropped on graph with existing spectrogram series | |||
|
303 | return isSpectrogram(variable) | |||
|
304 | ? impl->m_VariableToPlotMultiMap.empty() | |||
|
305 | : std::none_of( | |||
|
306 | impl->m_VariableToPlotMultiMap.cbegin(), impl->m_VariableToPlotMultiMap.cend(), | |||
|
307 | [isSpectrogram](const auto &entry) { return isSpectrogram(*entry.first); }); | |||
299 | } |
|
308 | } | |
300 |
|
309 | |||
301 | bool VisualizationGraphWidget::contains(const Variable &variable) const |
|
310 | bool VisualizationGraphWidget::contains(const Variable &variable) const |
General Comments 0
You need to be logged in to leave comments.
Login now