summaryrefslogtreecommitdiffstats
path: root/src/fig
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-08-07 14:04:28 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-08-07 14:04:37 +0200
commit5db817edef50d9a3bf92c594d419dd9a17255a5e (patch)
tree3582111e99c7cda581a0f34900493d337e02dd1a /src/fig
parent8ea5c5bf03335f0c95a292f400699ba98e6cf821 (diff)
downloaddabmux-5db817edef50d9a3bf92c594d419dd9a17255a5e.tar.gz
dabmux-5db817edef50d9a3bf92c594d419dd9a17255a5e.tar.bz2
dabmux-5db817edef50d9a3bf92c594d419dd9a17255a5e.zip
Set flag in FIG0_9, add new FIC allocation helper
Diffstat (limited to 'src/fig')
-rw-r--r--src/fig/FIG0.cpp1
-rw-r--r--src/fig/FIGCarousel.cpp39
-rw-r--r--src/fig/FIGCarousel.h11
3 files changed, 38 insertions, 13 deletions
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<dabEnsemble> 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 <list>
#include <map>
#include <boost/shared_ptr.hpp>
@@ -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<std::pair<int, int>, IFIG*> m_figs_available;
// Each FIB contains a list of carousel elements
std::map<int, std::list<FIGCarouselElement> > 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