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


C++ MODEL_RESET函数代码示例

本文整理汇总了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);
}
开发者ID:alissoncasagrande,项目名称:opentx,代码行数:29,代码来源:switches.cpp

示例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);
}
开发者ID:cody82,项目名称:opentx,代码行数:31,代码来源:switches.cpp

示例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);
}
开发者ID:BenZoFly,项目名称:opentx,代码行数:7,代码来源:mixer.cpp

示例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);
}
开发者ID:bellth,项目名称:opentx,代码行数:28,代码来源:frsky.cpp

示例5: TEST

TEST(Trims, CopySticksToOffset)
{
  MODEL_RESET();
  modelDefault(0);
  anaInValues[ELE_STICK] = -100;
  perMain();
  copySticksToOffset(1);
  EXPECT_EQ(g_model.limitData[1].offset, -97);
}
开发者ID:CoyotteDundee,项目名称:opentx,代码行数:9,代码来源:mixer.cpp

示例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);
}
开发者ID:3drobotics,项目名称:3drtx,代码行数:9,代码来源:gtests.cpp


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