scale fixes

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@676 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Branch: ni/coolstream
Commit: 98450fa609
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2010-07-17 (Sat, 17 Jul 2010)



------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2010-07-17 13:54:51 +00:00
parent 90576ffbad
commit d16989d4cf
2 changed files with 29 additions and 26 deletions

View File

@@ -106,11 +106,13 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();
mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
width = w_max(550, 0); fw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getWidth();
printf("####################################%i######%i######\n",mheight,fw);
width = w_max(fw * 42, 0);
height = h_max(hheight + (10 * mheight), 0); //9 lines height = h_max(hheight + (10 * mheight), 0); //9 lines
x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2;
y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - height) / 2; y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - height) / 2;
xpos_radar = x + 470; xpos_radar = x + 36 * fw;
ypos_radar = y + hheight + (mheight >> 1); ypos_radar = y + hheight + (mheight >> 1);
xpos1 = x + 10; xpos1 = x + 10;
@@ -201,10 +203,10 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
char * f, *s, *m; char * f, *s, *m;
if(frontend->getInfo()->type == FE_QPSK) { if(frontend->getInfo()->type == FE_QPSK) {
frontend->getDelSys(get_set.TP_fec, dvbs_get_modulation((fe_code_rate_t)get_set.TP_fec), f, s, m); frontend->getDelSys(get_set.TP_fec, dvbs_get_modulation((fe_code_rate_t)get_set.TP_fec), f, s, m);
sprintf(buffer, "%u %c %d %s %s %s", atoi(get_set.TP_freq)/1000, get_set.TP_pol == 0 ? 'H' : 'V', atoi(get_set.TP_rate)/1000, f, s, m); snprintf(buffer,sizeof(buffer), "%u %c %d %s %s %s", atoi(get_set.TP_freq)/1000, get_set.TP_pol == 0 ? 'H' : 'V', atoi(get_set.TP_rate)/1000, f, s, m);
} else if(frontend->getInfo()->type == FE_QAM) { } else if(frontend->getInfo()->type == FE_QAM) {
frontend->getDelSys(get_set.TP_fec, get_set.TP_mod, f, s, m); frontend->getDelSys(get_set.TP_fec, get_set.TP_mod, f, s, m);
sprintf(buffer, "%u %d %s %s %s", atoi(get_set.TP_freq)/1000, atoi(get_set.TP_rate)/1000, f, s, m); snprintf(buffer,sizeof(buffer), "%u %d %s %s %s", atoi(get_set.TP_freq)/1000, atoi(get_set.TP_rate)/1000, f, s, m);
} }
paintLine(xpos2, ypos_cur_satellite, w - 95, get_set.satNameNoDiseqc); paintLine(xpos2, ypos_cur_satellite, w - 95, get_set.satNameNoDiseqc);
paintLine(xpos2, ypos_frequency, w, buffer); paintLine(xpos2, ypos_frequency, w, buffer);
@@ -285,14 +287,14 @@ int CScanTs::handleMsg(neutrino_msg_t msg, neutrino_msg_data_t data)
char str[256]; char str[256];
switch (msg) { switch (msg) {
case NeutrinoMessages::EVT_SCAN_SATELLITE: case NeutrinoMessages::EVT_SCAN_SATELLITE:
paintLine(xpos2, ypos_cur_satellite, w - 95, (char *)data); paintLine(xpos2, ypos_cur_satellite, w - (8*fw), (char *)data);
break; break;
case NeutrinoMessages::EVT_SCAN_NUM_TRANSPONDERS: case NeutrinoMessages::EVT_SCAN_NUM_TRANSPONDERS:
sprintf(buffer, "%d", data); sprintf(buffer, "%d", data);
paintLine(xpos2, ypos_transponder, w - 95, buffer); paintLine(xpos2, ypos_transponder, w - (8*fw), buffer);
total = data; total = data;
snprintf(str, 255, "scan: %d/%d", done, total); snprintf(str, sizeof(buffer), "scan: %d/%d", done, total);
CVFD::getInstance()->showMenuText(0, str, -1, true); CVFD::getInstance()->showMenuText(0, str, -1, true);
break; break;
@@ -300,8 +302,8 @@ int CScanTs::handleMsg(neutrino_msg_t msg, neutrino_msg_data_t data)
if (total == 0) data = 0; if (total == 0) data = 0;
done = data; done = data;
sprintf(buffer, "%d/%d", done, total); sprintf(buffer, "%d/%d", done, total);
paintLine(xpos2, ypos_transponder, w - 95, buffer); paintLine(xpos2, ypos_transponder, w - (8*fw), buffer);
snprintf(str, 255, "scan %d/%d", done, total); snprintf(str, sizeof(buffer), "scan %d/%d", done, total);
CVFD::getInstance()->showMenuText(0, str, -1, true); CVFD::getInstance()->showMenuText(0, str, -1, true);
break; break;
@@ -320,9 +322,9 @@ int CScanTs::handleMsg(neutrino_msg_t msg, neutrino_msg_data_t data)
int rate = data >> 16; int rate = data >> 16;
char * f, *s, *m; char * f, *s, *m;
frontend->getDelSys(fec, (fe_modulation_t)0, f, s, m); // FIXME frontend->getDelSys(fec, (fe_modulation_t)0, f, s, m); // FIXME
sprintf(buffer, " %c %d %s %s %s", pol == 0 ? 'H' : 'V', rate, f, s, m); snprintf(buffer,sizeof(buffer), " %c %d %s %s %s", pol == 0 ? 'H' : 'V', rate, f, s, m);
//(pol == 0) ? sprintf(buffer, "-H") : sprintf(buffer, "-V"); //(pol == 0) ? sprintf(buffer, "-H") : sprintf(buffer, "-V");
paintLine(xpos2 + xpos_frequency, ypos_frequency, w - xpos_frequency - 80, buffer); paintLine(xpos2 + xpos_frequency, ypos_frequency, w - xpos_frequency - (7*fw), buffer);
} }
break; break;
@@ -336,22 +338,22 @@ int CScanTs::handleMsg(neutrino_msg_t msg, neutrino_msg_data_t data)
case NeutrinoMessages::EVT_SCAN_NUM_CHANNELS: case NeutrinoMessages::EVT_SCAN_NUM_CHANNELS:
sprintf(buffer, " = %d", data); sprintf(buffer, " = %d", data);
paintLine(xpos1 + 3 * 72, ypos_service_numbers + mheight, width - 3 * 72 - 10, buffer); paintLine(xpos1 + 3 * (6*fw), ypos_service_numbers + mheight, width - 3 * (6*fw) - 10, buffer);
break; break;
case NeutrinoMessages::EVT_SCAN_FOUND_TV_CHAN: case NeutrinoMessages::EVT_SCAN_FOUND_TV_CHAN:
sprintf(buffer, "%d", data); sprintf(buffer, "%d", data);
paintLine(xpos1, ypos_service_numbers + mheight, 72, buffer); paintLine(xpos1, ypos_service_numbers + mheight, (6*fw), buffer);
break; break;
case NeutrinoMessages::EVT_SCAN_FOUND_RADIO_CHAN: case NeutrinoMessages::EVT_SCAN_FOUND_RADIO_CHAN:
sprintf(buffer, "%d", data); sprintf(buffer, "%d", data);
paintLine(xpos1 + 72, ypos_service_numbers + mheight, 72, buffer); paintLine(xpos1 + (6*fw), ypos_service_numbers + mheight, (6*fw), buffer);
break; break;
case NeutrinoMessages::EVT_SCAN_FOUND_DATA_CHAN: case NeutrinoMessages::EVT_SCAN_FOUND_DATA_CHAN:
sprintf(buffer, "%d", data); sprintf(buffer, "%d", data);
paintLine(xpos1 + 2 * 72, ypos_service_numbers + mheight, 72, buffer); paintLine(xpos1 + 2 * (6*fw), ypos_service_numbers + mheight, (6*fw), buffer);
break; break;
case NeutrinoMessages::EVT_SCAN_COMPLETE: case NeutrinoMessages::EVT_SCAN_COMPLETE:
@@ -383,7 +385,7 @@ void CScanTs::paintRadar(void)
frameBuffer->loadPal(tuned ? "radar.pal" : "radar_red.pal", 18, 38); frameBuffer->loadPal(tuned ? "radar.pal" : "radar_red.pal", 18, 38);
} }
sprintf(filename, "radar%d.raw", radar); snprintf(filename,sizeof(filename), "radar%d.raw", radar);
radar = (radar + 1) % 10; radar = (radar + 1) % 10;
frameBuffer->paintIcon8(filename, xpos_radar, ypos_radar, 18); frameBuffer->paintIcon8(filename, xpos_radar, ypos_radar, 18);
} }
@@ -459,10 +461,10 @@ void CScanTs::paint(bool fortest)
ypos += mheight >> 1; // 1/2 blank line ypos += mheight >> 1; // 1/2 blank line
ypos_service_numbers = ypos; paintLineLocale(xpos1 , &ypos, 72 , LOCALE_SCANTS_NUMBEROFTVSERVICES ); ypos_service_numbers = ypos; paintLineLocale(xpos1 ,&ypos, (6*fw) , LOCALE_SCANTS_NUMBEROFTVSERVICES );
ypos = ypos_service_numbers; paintLineLocale(xpos1 + 72, &ypos, 72 , LOCALE_SCANTS_NUMBEROFRADIOSERVICES); ypos = ypos_service_numbers; paintLineLocale(xpos1 + (6*fw), &ypos, (6*fw) , LOCALE_SCANTS_NUMBEROFRADIOSERVICES);
ypos = ypos_service_numbers; paintLineLocale(xpos1 + 2 * 72, &ypos, 72 , LOCALE_SCANTS_NUMBEROFDATASERVICES ); ypos = ypos_service_numbers; paintLineLocale(xpos1 + 2 * (6*fw), &ypos, (6*fw) , LOCALE_SCANTS_NUMBEROFDATASERVICES );
ypos = ypos_service_numbers; paintLineLocale(xpos1 + 3 * 72, &ypos, width - 3 * 72 - 10, LOCALE_SCANTS_NUMBEROFTOTALSERVICES); ypos = ypos_service_numbers; paintLineLocale(xpos1 + 3 * (6*fw), &ypos, width - 3 * (6*fw) - 10 , LOCALE_SCANTS_NUMBEROFTOTALSERVICES);
} }
int CScanTs::greater_xpos(int xpos, const neutrino_locale_t txt) int CScanTs::greater_xpos(int xpos, const neutrino_locale_t txt)
@@ -493,26 +495,26 @@ void CScanTs::showSNR ()
if (lastsig != sig) { if (lastsig != sig) {
lastsig = sig; lastsig = sig;
posx = x + 20; posx = x + 20;
sprintf(percent, "%d%% SIG", sig); snprintf(percent,sizeof(percent), "%d%% SIG", sig);
sw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth ("100% SIG"); sw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth ("100% SIG");
sigscale->paintProgressBar2(posx - 1, posy+2, sig); sigscale->paintProgressBar2(posx - 1, posy+2, sig);
posx = posx + barwidth + 3; posx = posx + barwidth + 3;
sw = x + 247 - posx; sw = x + 21 * fw - posx;
frameBuffer->paintBoxRel(posx, posy - 2, sw, mheight, COL_MENUCONTENT_PLUS_0); frameBuffer->paintBoxRel(posx, posy - 2, sw, mheight, COL_MENUCONTENT_PLUS_0);
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString (posx+2, posy + mheight, sw, percent, COL_MENUCONTENT); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString (posx+2, posy + mheight-(mheight-BAR_HEIGHT)/4, sw, percent, COL_MENUCONTENT);
} }
if (lastsnr != snr) { if (lastsnr != snr) {
lastsnr = snr; lastsnr = snr;
posx = x + 20 + 260; posx = x + 20 + (20 * fw);
sprintf(percent, "%d%% SNR", snr); snprintf(percent,sizeof(percent), "%d%% SNR", snr);
sw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth ("100% SNR"); sw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth ("100% SNR");
snrscale->paintProgressBar2(posx - 1, posy+2, snr); snrscale->paintProgressBar2(posx - 1, posy+2, snr);
posx = posx + barwidth + 3; posx = posx + barwidth + 3;
sw = x + width - posx; sw = x + width - posx;
frameBuffer->paintBoxRel(posx, posy - 2, sw, mheight, COL_MENUCONTENT_PLUS_0); frameBuffer->paintBoxRel(posx, posy - 2, sw, mheight, COL_MENUCONTENT_PLUS_0);
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString (posx+2, posy + mheight, sw, percent, COL_MENUCONTENT); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString (posx+2, posy + mheight-(mheight-BAR_HEIGHT)/4, sw, percent, COL_MENUCONTENT);
} }
} }

View File

@@ -48,6 +48,7 @@ class CScanTs : public CMenuTarget
int width; int width;
int height; int height;
int hheight, mheight; // head/menu font height int hheight, mheight; // head/menu font height
int fw;
int xpos1; //x position for first column int xpos1; //x position for first column
int xpos2; //x position for second column int xpos2; //x position for second column
int radar; int radar;