本文整理汇总了C++中ModelData::setDefaultInputs方法的典型用法代码示例。如果您正苦于以下问题:C++ ModelData::setDefaultInputs方法的具体用法?C++ ModelData::setDefaultInputs怎么用?C++ ModelData::setDefaultInputs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelData
的用法示例。
在下文中一共展示了ModelData::setDefaultInputs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ModelData
WizMix::operator ModelData()
{
int throttleChannel = -1;
bool isTaranis = IS_TARANIS(GetEepromInterface()->getBoard());
ModelData model;
model.used = true;
model.modelId = modelId;
model.setDefaultInputs(settings);
int mixIndex = 0;
int switchIndex = 0;
int timerIndex = 0;
// Safe copy model name
strncpy(model.name, name, WIZ_MODEL_NAME_LENGTH);
model.name[WIZ_MODEL_NAME_LENGTH] = 0;
// Add the channel mixes
for (int i=0; i<WIZ_MAX_CHANNELS; i++ )
{
Channel ch = channel[i];
if (ch.input1 == THROTTLE_INPUT || ch.input2 == THROTTLE_INPUT)
throttleChannel = i;
addMix(model, ch.input1, ch.weight1, i, mixIndex);
addMix(model, ch.input2, ch.weight2, i, mixIndex);
}
// Add the Throttle Cut option
if( options[THROTTLE_CUT_OPTION] && throttleChannel >=0 ) {
model.funcSw[switchIndex].swtch.type = SWITCH_TYPE_SWITCH;
model.funcSw[switchIndex].swtch.index = isTaranis ? SWITCH_SF0 : SWITCH_THR;
model.funcSw[switchIndex].enabled = 1;
model.funcSw[switchIndex].func = (AssignFunc)throttleChannel;
model.funcSw[switchIndex].param = -100;
}
// Add the Flight Timer option
if (options[FLIGHT_TIMER_OPTION] ) {
model.timers[timerIndex].mode.type = SWITCH_TYPE_TIMER_MODE;
model.timers[timerIndex].mode.index = TMRMODE_THR_TRG;
timerIndex++;
}
// Add the Throttle Timer option
if (options[THROTTLE_TIMER_OPTION] && throttleChannel >=0) {
model.timers[timerIndex].mode.type = SWITCH_TYPE_TIMER_MODE;
model.timers[timerIndex].mode.index = TMRMODE_THR;
timerIndex++;
}
return model;
}