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


C# Counter.Get方法代码示例

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


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

示例1: TestCounterReset

        public void TestCounterReset()
        {
            using (Counter c = new Counter())
            {
                GetCounterData()[0].Count = 5;
                Assert.AreEqual(5, c.Get());
                Assert.IsFalse(GetCounterData()[0].Reset);

                c.Reset();

                Assert.AreEqual(0, GetCounterData()[0].Count);
                Assert.AreEqual(0, c.Get());
                Assert.IsTrue(GetCounterData()[0].Reset);
            }
        }
开发者ID:chopshop-166,项目名称:WPILib,代码行数:15,代码来源:TestCounter.cs

示例2: TestCounterGet

        public void TestCounterGet()
        {
            using (Counter c = new Counter())
            {
                GetCounterData()[0].Count = 5;
                Assert.AreEqual(5, c.Get());

                GetCounterData()[0].Count = 258;
                Assert.AreEqual(258, c.Get());
            }
        }
开发者ID:chopshop-166,项目名称:WPILib,代码行数:11,代码来源:TestCounter.cs

示例3: TestCounterReset

        public void TestCounterReset()
        {
            using (Counter c = new Counter())
            {
                HalData()["counter"][0]["count"] = 5;
                Assert.AreEqual(5, c.Get());
                Assert.IsFalse(HalData()["counter"][0]["reset"]);

                c.Reset();

                Assert.AreEqual(0, HalData()["counter"][0]["count"]);
                Assert.AreEqual(0, c.Get());
                Assert.IsTrue(HalData()["counter"][0]["reset"]);
            }
        }
开发者ID:ThadHouse,项目名称:robotdotnet-wpilib,代码行数:15,代码来源:TestCounter.cs

示例4: TestCounterGet

        public void TestCounterGet()
        {
            using (Counter c = new Counter())
            {
                HalData()["counter"][0]["count"] = 5;
                Assert.AreEqual(5, c.Get());

                HalData()["counter"][0]["count"] = 258;
                Assert.AreEqual(258, c.Get());
            }
        }
开发者ID:ThadHouse,项目名称:robotdotnet-wpilib,代码行数:11,代码来源:TestCounter.cs

示例5: Main

 static void Main(string[] args)
 {
     for (var c = new Counter(); c.Get() < 10; c.Inc(1))
         Console.WriteLine(c.Get());
     Console.ReadLine();
 }
开发者ID:atombender,项目名称:learning,代码行数:6,代码来源:Program.cs

示例6: TestAnalogTriggerCounter

        public void TestAnalogTriggerCounter()
        {
            AnalogTrigger trigger = new AnalogTrigger(s_analogIo.GetInput());
            trigger.SetLimitsVoltage(2.0f, 3.0f);
            Counter counter = new Counter(trigger);

            for (int i = 0; i < 50; i++)
            {
                s_analogIo.GetOutput().SetVoltage(1.0);
                Timer.Delay(DelayTime);
                s_analogIo.GetOutput().SetVoltage(4.0);
                Timer.Delay(DelayTime);
            }

            Assert.AreEqual(50, counter.Get(), "Analog trigger counter did not count 50 ticks");

            counter.Dispose();
            trigger.Dispose();
        }
开发者ID:chopshop-166,项目名称:WPILib,代码行数:19,代码来源:AnalogCrossConnectTest.cs


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