From 5db817edef50d9a3bf92c594d419dd9a17255a5e Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 7 Aug 2015 14:04:28 +0200 Subject: Set flag in FIG0_9, add new FIC allocation helper --- src/fig/FIG0.cpp | 1 + src/fig/FIGCarousel.cpp | 39 ++++++++++++++++++++++++++------------- src/fig/FIGCarousel.h | 11 +++++++++++ 3 files changed, 38 insertions(+), 13 deletions(-) (limited to 'src/fig') diff --git a/src/fig/FIG0.cpp b/src/fig/FIG0.cpp index b09771b..f8297ae 100644 --- a/src/fig/FIG0.cpp +++ b/src/fig/FIG0.cpp @@ -610,6 +610,7 @@ FillStatus FIG0_9::fill(uint8_t *buf, size_t max_size) remaining -= 5; fs.num_bytes_written = max_size - remaining; + fs.complete_fig_transmitted = true; return fs; } diff --git a/src/fig/FIGCarousel.cpp b/src/fig/FIGCarousel.cpp index 99fb73a..3ae5738 100644 --- a/src/fig/FIGCarousel.cpp +++ b/src/fig/FIGCarousel.cpp @@ -64,20 +64,33 @@ FIGCarousel::FIGCarousel(boost::shared_ptr ensemble) : m_fig0_1(&m_rti), m_fig0_2(&m_rti), m_fig0_3(&m_rti), - m_fig0_17(&m_rti) + m_fig0_17(&m_rti), + m_fig0_8(&m_rti), + m_fig1_0(&m_rti), + m_fig0_13(&m_rti), + m_fig0_10(&m_rti), + m_fig0_9(&m_rti) { - m_figs_available[std::make_pair(0, 0)] = &m_fig0_0; - m_figs_available[std::make_pair(0, 1)] = &m_fig0_1; - m_figs_available[std::make_pair(0, 2)] = &m_fig0_2; - m_figs_available[std::make_pair(0, 3)] = &m_fig0_3; - m_figs_available[std::make_pair(0, 17)] = &m_fig0_17; - - const int fib0 = 0; - allocate_fig_to_fib(0, 0, fib0); - allocate_fig_to_fib(0, 1, fib0); - allocate_fig_to_fib(0, 2, fib0); - allocate_fig_to_fib(0, 3, fib0); - allocate_fig_to_fib(0, 17, fib0); + load_and_allocate(m_fig0_0, 0); + load_and_allocate(m_fig0_1, 0); + load_and_allocate(m_fig0_2, 0); + load_and_allocate(m_fig0_3, 0); + load_and_allocate(m_fig0_17, 0); + + load_and_allocate(m_fig0_8, 1); + load_and_allocate(m_fig1_0, 1); + load_and_allocate(m_fig0_13, 1); + load_and_allocate(m_fig0_10, 1); + load_and_allocate(m_fig0_9, 1); +} + +void FIGCarousel::load_and_allocate(IFIG& fig, int fib) +{ + int type = fig.figtype(); + int extension = fig.figextension(); + + m_figs_available[std::make_pair(type, extension)] = &fig; + allocate_fig_to_fib(type, extension, fib); } void FIGCarousel::update(unsigned long currentFrame, time_t dabTime) diff --git a/src/fig/FIGCarousel.h b/src/fig/FIGCarousel.h index 5f90c98..d43e33e 100644 --- a/src/fig/FIGCarousel.h +++ b/src/fig/FIGCarousel.h @@ -31,6 +31,7 @@ #include "fig/FIG.h" #include "fig/FIG0.h" +#include "fig/FIG1.h" #include #include #include @@ -58,17 +59,27 @@ class FIGCarousel { size_t carousel(size_t fib, uint8_t *buf, size_t bufsize, int framephase); private: + void load_and_allocate(IFIG& fig, int fib); + FIGRuntimeInformation m_rti; std::map, IFIG*> m_figs_available; // Each FIB contains a list of carousel elements std::map > m_fibs; + // FIB 0 figs FIG0_0 m_fig0_0; FIG0_1 m_fig0_1; FIG0_2 m_fig0_2; FIG0_3 m_fig0_3; FIG0_17 m_fig0_17; + + // FIG 1 figs + FIG0_8 m_fig0_8; + FIG1_0 m_fig1_0; + FIG0_13 m_fig0_13; + FIG0_10 m_fig0_10; + FIG0_9 m_fig0_9; }; } // namespace FIC -- cgit v1.2.3