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

paulmthompson / WhiskerToolbox / 17920603410

22 Sep 2025 03:39PM UTC coverage: 71.97% (-0.05%) from 72.02%
17920603410

push

github

paulmthompson
all tests pass

277 of 288 new or added lines in 8 files covered. (96.18%)

520 existing lines in 35 files now uncovered.

40275 of 55961 relevant lines covered (71.97%)

1225.8 hits per line

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

51.85
/src/DataManager/utils/TableView/adapters/DigitalEventDataAdapter.cpp
1
#include "DigitalEventDataAdapter.h"
2

3
#include "DigitalTimeSeries/Digital_Event_Series.hpp"
4

5
#include <stdexcept>
6

7
DigitalEventDataAdapter::DigitalEventDataAdapter(std::shared_ptr<DigitalEventSeries> digitalEventSeries,
57✔
8
                                                 std::shared_ptr<TimeFrame> timeFrame,
9
                                                 std::string name)
57✔
10
    : m_digitalEventSeries(std::move(digitalEventSeries)),
57✔
11
      m_timeFrame(std::move(timeFrame)),
57✔
12
      m_name(std::move(name)) {
114✔
13
    if (!m_digitalEventSeries) {
57✔
14
        throw std::invalid_argument("DigitalEventSeries cannot be null");
×
15
    }
16
}
57✔
17

18
std::string const & DigitalEventDataAdapter::getName() const {
164✔
19
    return m_name;
164✔
20
}
21

22
std::shared_ptr<TimeFrame> DigitalEventDataAdapter::getTimeFrame() const {
12✔
23
    return m_timeFrame;
12✔
24
}
25

26
size_t DigitalEventDataAdapter::size() const {
×
27
    return m_digitalEventSeries->size();
×
28
}
29

UNCOV
30
std::vector<float> DigitalEventDataAdapter::getDataInRange(TimeFrameIndex start,
×
31
                                                           TimeFrameIndex end,
32
                                                           TimeFrame const * target_timeFrame) {
33
    // Use the DigitalEventSeries' built-in method to get events in the time range
34
    // This method handles the time frame conversion internally
UNCOV
35
    auto events_view = m_digitalEventSeries->getEventsInRange(start, end, target_timeFrame, m_timeFrame.get());
×
36

37
    // Convert the view to a vector
UNCOV
38
    std::vector<float> result;
×
UNCOV
39
    for (float event_time: events_view) {
×
UNCOV
40
        result.push_back(event_time);
×
41
    }
42

UNCOV
43
    return result;
×
44
}
×
45

UNCOV
46
EntityId DigitalEventDataAdapter::getEntityIdAt(size_t index) const {
×
UNCOV
47
    auto const & ids = m_digitalEventSeries->getEntityIds();
×
UNCOV
48
    return (index < ids.size()) ? ids[index] : 0;
×
49
}
50

51
std::vector<EventWithId> DigitalEventDataAdapter::getDataInRangeWithEntityIds(TimeFrameIndex start,
4,556✔
52
                                                                              TimeFrameIndex end,
53
                                                                              TimeFrame const * target_timeFrame) {
54

55
    auto events_in_range = m_digitalEventSeries->getEventsWithIdsInRange(start, end, target_timeFrame, m_timeFrame.get());
4,556✔
56

57
    return events_in_range;
4,556✔
58
}
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