Auf English ;-)
Just look within the streaminfo2.cpp or compare entrys with the Satfinder (apps/tuxbox/tools/satfind)
or even easier within (CVS: apps/dvb/zapit/lib)
There is a function: void CZapitClient::getFESignal (struct responseFESignal &f) and within this you can find how you would get it working or again have a look at the streaminfo2.cpp/h.
I do not translate everything so here is the rough deal:
infoviewer.cpp & infoviewer.h
infoviewer.h:
within the private class you add the following
Code: Alles auswählen
struct feSignal {
unsigned long sig;
unsigned long ber;
unsigned long snr;
} signal;
void showSatfind();
infoviewer.cpp:
The predefined showSatfind() has to be added the following way
Code: Alles auswählen
void CInfoViewer::showSatfind()
{
CZapitClient::responseFESignal s;
g_Zapit->getFESignal(s);
signal.sig = s.sig & 0xFFFF;
signal.snr = s.snr & 0xFFFF;
signal.ber = (s.ber <>
int sx = BoxStartX;
int sy = g_settings.screen_StartY + 150;
int ex = BoxEndX;
int ey = sy + 20;
int fromleft = sx + 137;// gap from left
int fromright = ex - 85; // gap from right
// max width per Signal
unsigned int maxbar = ((fromright - fromleft) / 3) - 20;
// maximal Sig amount
unsigned long maxs = 65000;
// maximal BER amount
unsigned long maxb = 40000;
unsigned int sigbar = ( (long) maxbar * (long) signal.sig ) / (long) maxs;
unsigned int snrbar = ( (long) maxbar * (long) signal.snr ) / (long) maxs;
unsigned int berbar = ( (long) maxbar * (long) signal.ber ) / (long) maxb;
// Sometimes the Ber Bar is larger than the Max Bar so therefore needs to be stopped hereif (berbar > maxbar)
berbar = maxbar;
}
For all 3 results you need to draw Boxes
Code: Alles auswählen
// Background
frameBuffer->paintBoxRel(fromleft , ey - 6, maxbar + 2, 8, COL_INFOBAR_PLUS_7);
frameBuffer->paintBoxRel(fromleft + maxbar + 10, ey - 6, maxbar + 2, 8, COL_INFOBAR_PLUS_7);
frameBuffer->paintBoxRel(fromleft + (maxbar * 2) + 20, ey - 6, maxbar + 2, 8, COL_INFOBAR_PLUS_7);
// Bar 100%
frameBuffer->paintBoxRel(fromleft + 1, ey - 5, maxbar, 6, COL_INFOBAR_PLUS_3);
frameBuffer->paintBoxRel(fromleft + maxbar + 11, ey - 5, maxbar, 6, COL_INFOBAR_PLUS_3);
frameBuffer->paintBoxRel(fromleft + (maxbar * 2) + 21, ey - 5, maxbar, 6, COL_INFOBAR_PLUS_3);
// Bar to show amount
frameBuffer->paintBoxRel(fromleft + 1, ey - 5, sigbar, 6, COL_BASIC_GREEN);
frameBuffer->paintBoxRel(fromleft + maxbar + 11, ey - 5, snrbar, 6, COL_BASIC_YELLOW);
frameBuffer->paintBoxRel(fromleft + (maxbar * 2) + 21, ey - 5, berbar, 6, COL_BASIC_RED);
You can call this function now and it will show the amounts from when the function was called. As the Infobar is shown for a duration of 6 seconds we also keep updating trough this duration.
For that the Function showTitle() is like made for it
Code: Alles auswählen
[else if ( ( msg == NeutrinoMessages::EVT_TIMER ) && ( data == sec_timer_id ) )
{
paintTime( show_dot, false );
showRecordIcon(show_dot);
show_dot = !show_dot;
}