本文整理汇总了C++中MODEL_RESET函数的典型用法代码示例。如果您正苦于以下问题:C++ MODEL_RESET函数的具体用法?C++ MODEL_RESET怎么用?C++ MODEL_RESET使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MODEL_RESET函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TEST
TEST(getSwitch, OldTypeStickyCSW)
{
MODEL_RESET();
MIXER_RESET();
g_model.logicalSw[0] = { SWSRC_SA0, 0, 0, LS_FUNC_AND };
g_model.logicalSw[1] = { SWSRC_SW1, SWSRC_SW2, 0, LS_FUNC_OR };
evalLogicalSwitches();
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
// now trigger SA0, both switches should become true
simuSetSwitch(0, -1);
evalLogicalSwitches();
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
EXPECT_EQ(getSwitch(SWSRC_SW2), true);
// now release SA0 and SW2 should stay true
simuSetSwitch(0, 0);
evalLogicalSwitches();
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
EXPECT_EQ(getSwitch(SWSRC_SW2), true);
// now reset logical switches
logicalSwitchesReset();
evalLogicalSwitches();
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
}
示例2: TEST
TEST(getSwitch, OldTypeStickyCSW)
{
RADIO_RESET();
MODEL_RESET();
MIXER_RESET();
SET_LOGICAL_SWITCH(0, LS_FUNC_AND, SWSRC_SA0, SWSRC_NONE);
SET_LOGICAL_SWITCH(1, LS_FUNC_OR, SWSRC_SW1, SWSRC_SW2);
evalLogicalSwitches();
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
// now trigger SA0, both switches should become true
simuSetSwitch(0, -1);
evalLogicalSwitches();
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
EXPECT_EQ(getSwitch(SWSRC_SW2), true);
// now release SA0 and SW2 should stay true
simuSetSwitch(0, 0);
evalLogicalSwitches();
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
EXPECT_EQ(getSwitch(SWSRC_SW2), true);
// now reset logical switches
logicalSwitchesReset();
evalLogicalSwitches();
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
}
示例3: TEST
TEST(Trims, greaterTrimLink)
{
MODEL_RESET();
setTrimValue(1, RUD_STICK, TRIM_EXTENDED_MAX+3); // link to FP3 trim
setTrimValue(3, RUD_STICK, 32);
EXPECT_EQ(getRawTrimValue(getTrimFlightPhase(1, RUD_STICK), RUD_STICK), 32);
}
示例4: TEST
TEST(FrSkySPORT, frskyVfas)
{
uint8_t packet[FRSKY_SPORT_PACKET_SIZE];
MODEL_RESET();
TELEMETRY_RESET();
// tests for Vfas
generateSportFasVoltagePacket(packet, 5000); processSportPacket(packet);
EXPECT_EQ(telemetryItems[0].value, 5000);
EXPECT_EQ(telemetryItems[0].valueMin, 5000);
EXPECT_EQ(telemetryItems[0].valueMax, 5000);
generateSportFasVoltagePacket(packet, 6524); processSportPacket(packet);
EXPECT_EQ(telemetryItems[0].value, 6524);
EXPECT_EQ(telemetryItems[0].valueMin, 6524); // the batt was changed (val > old max)
EXPECT_EQ(telemetryItems[0].valueMax, 6524);
generateSportFasVoltagePacket(packet, 1248); processSportPacket(packet);
EXPECT_EQ(telemetryItems[0].value, 1248);
EXPECT_EQ(telemetryItems[0].valueMin, 1248);
EXPECT_EQ(telemetryItems[0].valueMax, 6524);
generateSportFasVoltagePacket(packet, 2248); processSportPacket(packet);
EXPECT_EQ(telemetryItems[0].value, 2248);
EXPECT_EQ(telemetryItems[0].valueMin, 1248);
EXPECT_EQ(telemetryItems[0].valueMax, 6524);
}
示例5: TEST
TEST(Trims, CopySticksToOffset)
{
MODEL_RESET();
modelDefault(0);
anaInValues[ELE_STICK] = -100;
perMain();
copySticksToOffset(1);
EXPECT_EQ(g_model.limitData[1].offset, -97);
}
示例6: TEST
TEST(Trims, infiniteChainedTrims)
{
MODEL_RESET();
setTrimValue(0, 0, 32);
setTrimValue(1, 0, TRIM_EXTENDED_MAX+3); // link to FP3 trim
setTrimValue(2, 0, TRIM_EXTENDED_MAX+2); // link to FP1 trim
setTrimValue(3, 0, TRIM_EXTENDED_MAX+3); // link to FP2 trim
EXPECT_EQ(getRawTrimValue(getTrimFlightPhase(0, 2), 0), 32);
}