Ejemplo n.º 1
0
    private static void assertFuzzy(string s, double exp)
    {
        Console.WriteLine("Testing " + s);
        bool   inrange;
        double merr   = 1e-9;
        double actual = PositionAverage.PosAverage(s);

        inrange = Math.Abs(actual - exp) <= merr;
        if (inrange == false)
        {
            Console.WriteLine("Expected mean must be near " + exp + ", got " + actual);
        }

        Assert.AreEqual(true, inrange);
    }
Ejemplo n.º 2
0
        public async Task Start()
        {
            m_Cancelled = false;
            m_Average   = new PositionAverage();

            for (int i = 0; i < m_DesiredPositionCount; i++)
            {
                GeoPoint point = await m_Location.GetLocation();

                m_Average.Add(point);

                var updated = PositionUpdated;
                if (updated != null)
                {
                    updated(m_Average.GetAverage());
                }

                await Task.Delay(250);
            }
        }