private async void EdgeInsideLoop(BleModel b1, BleModel b2, BleModel b3)
        {
            /*
             *  yaklaşılmakta olan  ble'yi b1 varsıyorum. ortadaki ble b2 en uzaktaki b3
             */
            DateTime start = DateTime.Now;

// Do some work
            Debug.WriteLine("EdgeInsideLoop");
            while (true)
            {
                TimeSpan timeDiff = DateTime.Now - start;
                CulculateCurrentPositions();

                if (b1.IsNear && b2.IsFar && timeDiff.Seconds > 8)
                {
                    GoToRow(BLE1_POSITION);
                    CenterInsideLoop(b2, b1, b3);
                    return;
                }

                GoNext(BLE1_POSITION);

                await Task.Delay(INVERVAL);
            }
        }
 public Algorithm(Grid grid, BoxView dot, BleModel ble1, BleModel ble2, BleModel ble3)
 {
     _grid      = grid;
     _dot       = dot;
     _ble1      = ble1;
     _ble2      = ble2;
     _ble3      = ble3;
     _maxRow    = _grid.RowDefinitions.Count;
     _maxColumn = _grid.ColumnDefinitions.Count;
 }
        private async void EdgeOutLoop(BleModel b1)
        {
            DateTime start = DateTime.Now;

            Debug.WriteLine("EdgeOutLoop");
            while (true)
            {
                b1.CalculateCurrentPosition();
                TimeSpan timeDiff = DateTime.Now - start;
                if (b1.IsUnknown && timeDiff.Seconds > 8)
                {
                    GoToRow(END_POSITION);
                    return;
                }

                GoNext(END_POSITION);

                await Task.Delay(INVERVAL);
            }
        }
        private async void CenterOutLoop(BleModel b1, BleModel b2)
        {
            /*
             *  yaklaşılmakta olan  ble'yi b1 varsıyorum. bir arkadaki ble b2
             */
            DateTime start = DateTime.Now;

            Debug.WriteLine("CenterOutLoop");
            while (true)
            {
                CulculateCurrentPositions();
                TimeSpan timeDiff = DateTime.Now - start;
                if (b1.IsNear && timeDiff.Seconds > 8)
                {
                    GoToRow(BLE3_POSITION);
                    EdgeOutLoop(b1);
                    return;
                }

                GoNext(BLE3_POSITION);

                await Task.Delay(INVERVAL);
            }
        }