Пример #1
0
void CScanSettings::toSatList( CZapitClient::ScanSatelliteList& satList) const
{
	satList.clear();
	CZapitClient::commandSetScanSatelliteList sat;
	if  (TP_scan)
	{
		for (int i = 0; i < MAX_SATELLITES; i++)
		{
			if (satDiseqc[i] != -1) {
				sat.diseqc = satDiseqc[i];
				strncpy(sat.satName, satName[i], 30);
				satList.push_back(sat);
			}
		}
		if (satList.size() == 0) {
			strncpy(sat.satName, satNameNoDiseqc, 30);
			sat.diseqc = 0;
			satList.push_back(sat);
		}
	}
	else if  (diseqcMode == NO_DISEQC)
	{
		strncpy(sat.satName, satNameNoDiseqc, 30);
		sat.diseqc = 0;
		satList.push_back(sat);
	}
	else if  (diseqcMode == DISEQC_1_2)
	{
		strncpy(sat.satName, satNameNoDiseqc, 30);
		sat.diseqc = -1;
		for (int i = 0; i < MAX_SATELLITES; i++)
		{
			if (!strcmp(satName[i], satNameNoDiseqc))
			{
				if (satDiseqc[i] != -1)
					sat.diseqc = satDiseqc[i];
				break;
			}
		}
		satList.push_back(sat);
	}
	else
	{
		for( int i = 0; i < MAX_SATELLITES; i++)
		{
			if (satDiseqc[i] != -1)
			{
				strncpy(sat.satName, satName[i], 30);
				sat.diseqc = satDiseqc[i];
				satList.push_back(sat);
			}
		}
	}
}
Пример #2
0
void CScanSettings::toSatList( CZapitClient::ScanSatelliteList& satList) const
{
#if 0
	satList.clear();
	CZapitClient::commandSetScanSatelliteList sat;

	sat.diseqc = 0;
	strncpy(sat.satName, satNameNoDiseqc, 30);

	if(diseqcMode == DISEQC_1_2)
		sat.diseqc = -1;

	if((scan_mode == 2) || (diseqcMode == DISEQC_1_2)) {
		for (int i = 0; i < MAX_SATELLITES; i++) {
			if (!strcmp(satName[i], satNameNoDiseqc)) {
				if (satDiseqc[i] != -1)
					sat.diseqc = satDiseqc[i];
				break;
			}
		}
	}
	satList.push_back(sat);
#endif
#if 0
	if  (scan_mode == 2) {
		strncpy(sat.satName, satNameNoDiseqc, 30);
		sat.diseqc = 0;
		for (int i = 0; i < MAX_SATELLITES; i++) {
			if (!strcmp(satName[i], satNameNoDiseqc)) {
				if (satDiseqc[i] != -1)
					sat.diseqc = satDiseqc[i];
				break;
			}
		}
		satList.push_back(sat);
	}
	else if  (diseqcMode == NO_DISEQC) {
		strncpy(sat.satName, satNameNoDiseqc, 30);
		sat.diseqc = 0;
		satList.push_back(sat);
	}
	else if  (diseqcMode == DISEQC_1_2) {
		strncpy(sat.satName, satNameNoDiseqc, 30);
		sat.diseqc = -1;
		for (int i = 0; i < MAX_SATELLITES; i++) {
			if (!strcmp(satName[i], satNameNoDiseqc)) {
				if (satDiseqc[i] != -1)
					sat.diseqc = satDiseqc[i];
				break;
			}
		}
		satList.push_back(sat);
	} else { // scan all sats with configured diseqc
		for( int i = 0; i < MAX_SATELLITES; i++) {
			if (satDiseqc[i] != -1) {
				strncpy(sat.satName, satName[i], 30);
				sat.diseqc = satDiseqc[i];
				satList.push_back(sat);
			}
		}
	}
#endif
}