| 60 | } |
| 61 | |
| 62 | void 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 | |
| 87 | void FluxViewerControl::UpdateScale() |
| 88 | { |
no test coverage detected