• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

paulmthompson / WhiskerToolbox / 18045385035

26 Sep 2025 05:53PM UTC coverage: 69.782% (+0.01%) from 69.77%
18045385035

push

github

paulmthompson
fix corrupted lambda capture with notification in data transform sub widgets

42952 of 61552 relevant lines covered (69.78%)

1129.6 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.0
/src/WhiskerToolbox/Analysis_Dashboard/PlotFactory.cpp
1
#include "PlotFactory.hpp"
2
#include "PlotContainer.hpp"
3
#include "Plots/AbstractPlotWidget.hpp"
4
#include "Properties/AbstractPlotPropertiesWidget.hpp"
5
#include "Widgets/EventPlotWidget/EventPlotPropertiesWidget.hpp"
6
#include "Widgets/EventPlotWidget/EventPlotWidget.hpp"
7
#include "Widgets/ScatterPlotWidget/ScatterPlotPropertiesWidget.hpp"
8
#include "Widgets/ScatterPlotWidget/ScatterPlotWidget.hpp"
9
#include "Widgets/SpatialOverlayPlotWidget/SpatialOverlayPlotPropertiesWidget.hpp"
10
#include "Widgets/SpatialOverlayPlotWidget/SpatialOverlayPlotWidget.hpp"
11

12
#include <QDebug>
13

14
std::unique_ptr<PlotContainer> PlotFactory::createPlotContainer(QString const & plot_type) {
14✔
15
    auto plot_widget = createPlotWidget(plot_type);
14✔
16
    auto properties_widget = createPropertiesWidget(plot_type);
14✔
17

18
    if (!plot_widget || !properties_widget) {
14✔
19
        qDebug() << "Failed to create plot or properties widget for type:" << plot_type;
×
20
        return nullptr;
×
21
    }
22

23
    return std::make_unique<PlotContainer>(std::move(plot_widget), std::move(properties_widget));
14✔
24
}
14✔
25

26
std::unique_ptr<AbstractPlotWidget> PlotFactory::createPlotWidget(QString const & plot_type) {
14✔
27
    if (plot_type == "scatter_plot") {
14✔
28
        return std::make_unique<ScatterPlotWidget>();
1✔
29
    } else if (plot_type == "spatial_overlay_plot") {
13✔
30
        qDebug() << "Creating spatial overlay plot widget";
11✔
31
        return std::make_unique<SpatialOverlayPlotWidget>();
11✔
32
    } else if (plot_type == "event_plot") {
2✔
33
        qDebug() << "Creating event plot widget";
2✔
34
        return std::make_unique<EventPlotWidget>();
2✔
35
    }
36

37
    // Add more plot types here as they are implemented
38
    // else if (plot_type == "line_plot") {
39
    //     return std::make_unique<LinePlotWidget>();
40
    // }
41

42
    qDebug() << "Unknown plot type:" << plot_type;
×
43
    return nullptr;
×
44
}
45

46
std::unique_ptr<AbstractPlotPropertiesWidget> PlotFactory::createPropertiesWidget(QString const & plot_type) {
14✔
47
    if (plot_type == "scatter_plot") {
14✔
48
        return std::make_unique<ScatterPlotPropertiesWidget>();
1✔
49
    } else if (plot_type == "spatial_overlay_plot") {
13✔
50
        qDebug() << "Creating spatial overlay plot properties widget";
11✔
51
        return std::make_unique<SpatialOverlayPlotPropertiesWidget>();
11✔
52
    } else if (plot_type == "event_plot") {
2✔
53
        qDebug() << "Creating event plot properties widget";
2✔
54
        return std::make_unique<EventPlotPropertiesWidget>();
2✔
55
    }
56

57
    // Add more plot types here as they are implemented
58
    // else if (plot_type == "line_plot") {
59
    //     return std::make_unique<LinePlotPropertiesWidget>();
60
    // }
61

62
    qDebug() << "Unknown plot properties type:" << plot_type;
×
63
    return nullptr;
×
64
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc