MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / SetFlux

Method SetFlux

src/gui/fluxviewercontrol.cc:62–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62void FluxViewerControl::SetFlux(std::shared_ptr<const TrackFlux> flux)
63{
64 _flux = flux;
65
66 _scrollPosition = 0;
67 _totalDuration = 0;
68 _events.clear();
69 for (const auto& trackdata : _flux->trackDatas)
70 {
71 for (const auto& record : trackdata->records)
72 {
73 _events.insert(_totalDuration + record->startTime);
74 _events.insert(_totalDuration + record->endTime);
75 }
76
77 _totalDuration += trackdata->fluxmap->duration();
78 }
79
80 auto size = GetSize();
81 _nanosecondsPerPixel = (double)_totalDuration / (double)size.GetWidth();
82
83 UpdateScale();
84 Refresh();
85}
86
87void FluxViewerControl::UpdateScale()
88{

Callers 1

FluxViewerWindowMethod · 0.80

Calls 2

durationMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected