当前位置: 首页>>代码示例>>C++>>正文


C++ Channels::size方法代码示例

本文整理汇总了C++中Channels::size方法的典型用法代码示例。如果您正苦于以下问题:C++ Channels::size方法的具体用法?C++ Channels::size怎么用?C++ Channels::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Channels的用法示例。


在下文中一共展示了Channels::size方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: unifiedLength

unsigned unifiedLength(Channels &a)
{
	unsigned len=0;

	for(unsigned c=0;c<a.size();c++)
		if(a[c].size()>len)
			len=a[c].size();

	for(unsigned c=0;c<a.size();c++)
		if(a[c].size()<len)
			a[c]=a[c].resizeTo(len);

	return len;
}
开发者ID:sritterbusch,项目名称:ospac,代码行数:14,代码来源:Channel.cpp

示例2: unifiedSamplerate

unsigned unifiedSamplerate(Channels &a)
{
	unsigned samplerate=0;

	for(unsigned c=0;c<a.size();c++)
		if(a[c].samplerate()>samplerate)
			samplerate=a[c].samplerate();

	for(unsigned c=0;c<a.size();c++)
		if(a[c].samplerate()<samplerate)
			a[c]=a[c].resampleTo(samplerate);

	return samplerate;
}
开发者ID:sritterbusch,项目名称:ospac,代码行数:14,代码来源:Channel.cpp

示例3: ServosToControls

// Step through list of controls reading the servo channel, calculating new position 
// and setting either a surface or engine(s) to the value
void ServosToControls(void)
{
	int   iIndex = 0;
	int   iSize = ControlSurfaces.size();
	int   iServoChannel;
	intbb ServoValue;
	float ControlSetting;
	ChannelSetup* pScanSetup;

	for (iIndex = 0; iIndex < iSize; iIndex++)
	{
		pScanSetup = &ControlSurfaces[iIndex];

		iServoChannel = pScanSetup->mServoChannel;
		ServoValue._.B1 = SERVO_IN[2*iServoChannel];
		ServoValue._.B0 = SERVO_IN[(2*iServoChannel)+1];

		ControlSetting = pScanSetup->GetControlDeflection(ServoValue.BB);
		
		if (pScanSetup->mControlType == CONTROL_TYPE_SURFACE)
		{
			XPLMSetDataf(pScanSetup->mControlSurfaceRef, ControlSetting);
		}
		else if (pScanSetup->mControlType == CONTROL_TYPE_ENGINE)
		{
			unsigned int Mask = pScanSetup->mEngineMask;

			for (int Engine = 0; Engine < 8; Engine++)
			{
				if ((Mask & 0x01) != 0)
				{
					ThrottleSettings[Engine] = ControlSetting;
				}
				Mask >>= 1;
			}
			if (ControlSetting > PARKBRAKE_THROTTLE_THRESHOLD)  // if engine is throttled-up above threshold..
			{
				BrakeSetting = PARKBRAKE_OFF;   // remove parkbrake
			}
			else
			{
				BrakeSetting = PARKBRAKE_ON;    // apply parkbrake
			}
		}
	}
开发者ID:Inspirati,项目名称:MatrixPilot,代码行数:47,代码来源:HILSIM.cpp

示例4: ServosToControls

// Step through list of controls reading the servo channel, calculating new position 
// and setting either a surface or engine(s) to the value
void ServosToControls()
{
	int		iIndex = 0;
	int		iSize = ControlSurfaces.size();
	
	int		iServoChannel;
	intbb	ServoValue;

	int		Value;

	float	ControlSetting;

	ChannelSetup* pScanSetup;

	for(iIndex = 0; iIndex < iSize; iIndex++)
	{
		pScanSetup = &ControlSurfaces[iIndex];

		iServoChannel = pScanSetup->mServoChannel;
		ServoValue._.B1 = SERVO_IN[2*iServoChannel];
		ServoValue._.B0 = SERVO_IN[(2*iServoChannel)+1];

		ControlSetting = pScanSetup->GetControlDeflection(ServoValue.BB);
		
		if(pScanSetup->mControlType == CONTROL_TYPE_SURFACE)
		{
			XPLMSetDataf(pScanSetup->mControlSurfaceRef, ControlSetting);
		}
		else if(pScanSetup->mControlType == CONTROL_TYPE_ENGINE)
		{
			unsigned int Mask = pScanSetup->mEngineMask;

			for (int Engine = 0; Engine < 8; Engine++)
			{
				if( (Mask & 0x01) != 0 )
				{
					ThrottleSettings[Engine] = ControlSetting;
				}
				Mask >>= 1;
			}
		}
	}
开发者ID:cglusky,项目名称:MatrixPilot-VTOL,代码行数:44,代码来源:HILSIM.cpp


注:本文中的Channels::size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。