Пример #1
0
const char * CNClient::getClientParameters(void)
{
	if (s_sClientParameters.empty())
	{
		s_sClientParameters = "";
		// client-version
		s_sClientParameters.append("client-version=").append(getVersion());
		
		// screen
		CCSize size = getScreenSize();
		CCFloat scale = getScreenScale();
		char szScreen[32];
		memset(szScreen, 0, 32);
		snprintf(szScreen, 32, "%.0fx%.0f@%.1f", size.width, size.height, scale);
		s_sClientParameters.append("&screen=").append(szScreen);
		
		// os
		std::string sOS = std::string(getSystemName()).append("/").append(getSystemVersion());
		s_sClientParameters.append("&os=").append(sOS);
		
		// device
		std::string sDevice = std::string(getDeviceModel()).append("/").append(getHardware());
		s_sClientParameters.append("&device=").append(sDevice);
		
		// imei
		s_sClientParameters.append("&imei=").append(getDeviceIdentifier());
	}
	
	return s_sClientParameters.c_str();
}
Пример #2
0
PortGroupList::PortGroupList()
    : mPortGroupListModel(this), 
      mStreamListModel(this),
      mPortStatsModel(this, this),
      mDeviceGroupModel(this),
      mDeviceModel(this)
{
#ifdef QT_NO_DEBUG
    streamModelTester_ = NULL;
    portModelTester_ = NULL;
    portStatsModelTester_ = NULL;
    deviceGroupModelTester_ = NULL;
    deviceModelTester_ = NULL;
#else
    streamModelTester_ = new ModelTest(getStreamModel());
    portModelTester_ = new ModelTest(getPortModel());
    portStatsModelTester_ = new ModelTest(getPortStatsModel());
    deviceGroupModelTester_ = new ModelTest(getDeviceGroupModel());
    deviceModelTester_ = new ModelTest(getDeviceModel());
#endif 

    // Add the "Local" Port Group
    if (appParams.optLocalDrone()) {
        PortGroup *pg = new PortGroup;
        addPortGroup(*pg);
    }
}
Пример #3
0
void Client::updateClientParameters(void)
{
	std::string string = "";
	// client-version
	string.append("client-version=").append(getVersion());
	
	// screen
	char screen[32];
	memset(screen, 0, 32);
	snprintf(screen, 32, "%dx%d", getScreenWidth(), getScreenHeight());
	string.append("&screen=").append(screen);
	
	// os
	std::string os = std::string(getSystemName()).append("/").append(getSystemVersion());
	UrlUtils::escape(os);
	string.append("&os=").append(os);
	
	// device
	std::string device = std::string(getDeviceModel()).append("/").append(getHardware());
	UrlUtils::escape(device);
	string.append("&device=").append(device);
	
	// imei
	string.append("&imei=").append(getDeviceIdentifier());
	
	m_sClientParameters = string;
}