gui/test_menu.cpp: fix compile

This commit is contained in:
[CST] Focus
2013-04-16 12:53:54 +04:00
parent eedf2f9e49
commit 2cc3c213b5

View File

@@ -78,26 +78,26 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
printf("CTestMenu::exec: %s\n", actionKey.c_str()); printf("CTestMenu::exec: %s\n", actionKey.c_str());
if (actionKey == "vfd") if (actionKey == "vfd")
{ {
CVFD::getInstance()->Clear(); CVFD::getInstance()->Clear();
int icon = 0x00040000; int icon = 0x00040000;
while (icon > 0x2) { while (icon > 0x2) {
CVFD::getInstance()->ShowIcon((vfd_icon) icon, true); CVFD::getInstance()->ShowIcon((fp_icon) icon, true);
icon /= 2; icon /= 2;
} }
for (int i = 0x01000001; i <= 0x0C000001; i+= 0x01000000) for (int i = 0x01000001; i <= 0x0C000001; i+= 0x01000000)
{ {
CVFD::getInstance()->ShowIcon((vfd_icon) i, true); CVFD::getInstance()->ShowIcon((fp_icon) i, true);
} }
CVFD::getInstance()->ShowIcon((vfd_icon) 0x09000002, true); CVFD::getInstance()->ShowIcon((fp_icon) 0x09000002, true);
CVFD::getInstance()->ShowIcon((vfd_icon) 0x0B000002, true); CVFD::getInstance()->ShowIcon((fp_icon) 0x0B000002, true);
char text[255]; char text[255];
char buf[XML_UTF8_ENCODE_MAX]; char buf[XML_UTF8_ENCODE_MAX];
int ch = 0x2588; int ch = 0x2588;
int len = XmlUtf8Encode(ch, buf); int len = XmlUtf8Encode(ch, buf);
for (int i = 0; i < 12; i++) for (int i = 0; i < 12; i++)
{ {
memmove(&text[i*len], buf, len); memmove(&text[i*len], buf, len);
} }
@@ -109,7 +109,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
return res; return res;
} }
else if (actionKey == "network") else if (actionKey == "network")
{ {
int fd, ret; int fd, ret;
struct ifreq ifr; struct ifreq ifr;
@@ -128,7 +128,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
ret = ioctl(fd, SIOCGIFADDR, &ifr ); ret = ioctl(fd, SIOCGIFADDR, &ifr );
if (ret < 0) if (ret < 0)
perror("SIOCGIFADDR"); perror("SIOCGIFADDR");
else else
{ {
addrp = (struct sockaddr_in *)&(ifr.ifr_addr); addrp = (struct sockaddr_in *)&(ifr.ifr_addr);
ip = inet_ntoa(addrp->sin_addr); ip = inet_ntoa(addrp->sin_addr);
@@ -148,11 +148,11 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
return res; return res;
} }
else if (actionKey == "card0") else if (actionKey == "card0")
{ {
char str[255]; char str[255];
int ret = cs_test_card(0, str); int ret = cs_test_card(0, str);
switch(ret) switch(ret)
{ {
case 0: case 0:
ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, str, CMessageBox::mbrBack, CMessageBox::mbBack, "info.raw"); ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, str, CMessageBox::mbrBack, CMessageBox::mbBack, "info.raw");
@@ -171,11 +171,11 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
return res; return res;
} }
else if (actionKey == "card1") else if (actionKey == "card1")
{ {
char str[255]; char str[255];
int ret = cs_test_card(1, str); int ret = cs_test_card(1, str);
switch(ret) switch(ret)
{ {
case 0: case 0:
ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, str, CMessageBox::mbrBack, CMessageBox::mbBack, "info.raw"); ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, str, CMessageBox::mbrBack, CMessageBox::mbBack, "info.raw");
@@ -194,16 +194,16 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
return res; return res;
} }
else if (actionKey == "hdd") else if (actionKey == "hdd")
{ {
char buffer[255]; char buffer[255];
FILE *f = fopen("/proc/mounts", "r"); FILE *f = fopen("/proc/mounts", "r");
bool mounted = false; bool mounted = false;
if (f != NULL) if (f != NULL)
{ {
while (fgets (buffer, 255, f) != NULL) while (fgets (buffer, 255, f) != NULL)
{ {
if (strstr(buffer, "/dev/sda1")) if (strstr(buffer, "/dev/sda1"))
{ {
mounted = true; mounted = true;
break; break;
@@ -218,24 +218,24 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
return res; return res;
} }
else if (actionKey == "buttons") else if (actionKey == "buttons")
{ {
neutrino_msg_t msg; neutrino_msg_t msg;
neutrino_msg_data_t data; neutrino_msg_data_t data;
CHintBox * khintBox = NULL; CHintBox * khintBox = NULL;
CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, "Press button, or press EXIT to return"); CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, "Press button, or press EXIT to return");
hintBox->paint(); hintBox->paint();
while (1) while (1)
{ {
g_RCInput->getMsg(&msg, &data, 100); g_RCInput->getMsg(&msg, &data, 100);
if (msg == CRCInput::RC_home) if (msg == CRCInput::RC_home)
break; break;
if (msg != CRCInput::RC_timeout && msg <= CRCInput::RC_MaxRC) if (msg != CRCInput::RC_timeout && msg <= CRCInput::RC_MaxRC)
{ {
char keyname[50]; char keyname[50];
sprintf(keyname, "Button [%s] pressed (EXIT to return)", g_RCInput->getKeyName(msg).c_str()); sprintf(keyname, "Button [%s] pressed (EXIT to return)", g_RCInput->getKeyName(msg).c_str());
if (khintBox) if (khintBox)
{ {
delete khintBox; delete khintBox;
} }
@@ -251,55 +251,55 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
return res; return res;
} }
else if (actionKey == "22kon1" || actionKey == "22koff1") else if (actionKey == "22kon1" || actionKey == "22koff1")
{ {
CScanTs * scanTs = new CScanTs(); CScanTs * scanTs = new CScanTs();
int freq = (actionKey == "22kon1") ? 12000*1000: 11000*1000; int freq = (actionKey == "22kon1") ? 12000*1000: 11000*1000;
sprintf(scansettings.TP_freq, "%d", freq); sprintf(scansettings.sat_TP_freq, "%d", freq);
strncpy(scansettings.satName, strncpy(scansettings.satName,
CServiceManager::getInstance()->GetSatelliteName(130).c_str(), 50); CServiceManager::getInstance()->GetSatelliteName(130).c_str(), 50);
scanTs->exec(NULL, "test"); scanTs->exec(NULL, "test");
delete scanTs; delete scanTs;
return res; return res;
} }
else if (actionKey == "22kon2" || actionKey == "22koff2") else if (actionKey == "22kon2" || actionKey == "22koff2")
{ {
int freq = (actionKey == "22kon2") ? 12000*1000: 11000*1000; int freq = (actionKey == "22kon2") ? 12000*1000: 11000*1000;
sprintf(scansettings.TP_freq, "%d", freq); sprintf(scansettings.sat_TP_freq, "%d", freq);
strncpy(scansettings.satName, strncpy(scansettings.satName,
CServiceManager::getInstance()->GetSatelliteName(192).c_str(), 50); CServiceManager::getInstance()->GetSatelliteName(192).c_str(), 50);
CScanTs * scanTs = new CScanTs(); CScanTs * scanTs = new CScanTs();
scanTs->exec(NULL, "test"); scanTs->exec(NULL, "test");
delete scanTs; delete scanTs;
return res; return res;
} }
else if (actionKey == "scan1" || actionKey == "scan2") else if (actionKey == "scan1" || actionKey == "scan2")
{ {
int fnum = actionKey == "scan1" ? 0 : 1; int fnum = actionKey == "scan1" ? 0 : 1;
strncpy(scansettings.satName, actionKey == "scan1" ? strncpy(scansettings.satName, actionKey == "scan1" ?
CServiceManager::getInstance()->GetSatelliteName(130).c_str() : CServiceManager::getInstance()->GetSatelliteName(130).c_str() :
CServiceManager::getInstance()->GetSatelliteName(192).c_str(), 50); CServiceManager::getInstance()->GetSatelliteName(192).c_str(), 50);
CFrontend *frontend = CFEManager::getInstance()->getFE(fnum); CFrontend *frontend = CFEManager::getInstance()->getFE(fnum);
CServiceScan::getInstance()->SetFrontend(fnum); CServiceScan::getInstance()->SetFrontend(fnum);
int freq = 12538000; int freq = 12538000;
sprintf(scansettings.TP_freq, "%d", freq); sprintf(scansettings.sat_TP_freq, "%d", freq);
//CFrontend * frontend = CFEManager::getInstance()->getFE(0); //CFrontend * frontend = CFEManager::getInstance()->getFE(0);
switch (frontend->getInfo()->type) switch (frontend->getInfo()->type)
{ {
case FE_QPSK: case FE_QPSK:
sprintf(scansettings.TP_rate, "%d", 41250*1000); sprintf(scansettings.sat_TP_rate, "%d", 41250*1000);
scansettings.TP_fec = 1; scansettings.sat_TP_fec = 1;
scansettings.TP_pol = 1; scansettings.sat_TP_pol = 1;
break; break;
case FE_QAM: case FE_QAM:
#if 0 #if 0
sprintf(scansettings.TP_rate, "%d", tmpI->second.feparams.u.qam.symbol_rate); sprintf(scansettings.sat_TP_rate, "%d", tmpI->second.feparams.u.qam.symbol_rate);
scansettings.TP_fec = tmpI->second.feparams.u.qam.fec_inner; scansettings.sat_TP_fec = tmpI->second.feparams.u.qam.fec_inner;
scansettings.TP_mod = tmpI->second.feparams.u.qam.modulation; scansettings.TP_mod = tmpI->second.feparams.u.qam.modulation;
#endif #endif
break; break;
case FE_OFDM: case FE_OFDM:
@@ -336,7 +336,7 @@ void CTestMenu::showTestMenu()
TestMenu->addItem(new CMenuForwarderNonLocalized("HDD", true, NULL, this, "hdd")); TestMenu->addItem(new CMenuForwarderNonLocalized("HDD", true, NULL, this, "hdd"));
TestMenu->addItem(new CMenuForwarderNonLocalized("Buttons", true, NULL, this, "buttons")); TestMenu->addItem(new CMenuForwarderNonLocalized("Buttons", true, NULL, this, "buttons"));
CFEManager::getInstance()->setMode(CFEManager::FE_MODE_ALONE); //CFEManager::getInstance()->setMode(CFEManager::FE_MODE_ALONE);
CServiceManager::getInstance()->InitSatPosition(130, NULL, true); CServiceManager::getInstance()->InitSatPosition(130, NULL, true);
CServiceManager::getInstance()->InitSatPosition(192, NULL, true); CServiceManager::getInstance()->InitSatPosition(192, NULL, true);