Beispiel #1
0
        public string[][] startAnalysis(Geolocator sender, PositionChangedEventArgs args)
        {
            firstFourBuildingsInfo = new String[4][];

            double[] geoPoint1;
            double[] geoPoint2;
            double[] geoPoint3;
            double[] geoPoint4;

            double[][] four_geoPoints;
            four_geoPoints = new double[4][];

            geoPoint1 = new double[2];
            geoPoint2 = new double[2];
            geoPoint3 = new double[2];
            geoPoint4 = new double[2];

            // 4 points algorithm usage
            double[][] geoCoordinateCode;
            geoCoordinateCode = new double[2][];

            AudioSet setSong = new AudioSet();
            getAudioGeoPosition getAudioGeoPoint = new getAudioGeoPosition();

            int songNumber = 1;
            int exitLoop = 0; //depends if the song starting playing in checkCoordinates function

               // firstFourBuildingsInfo[0][0] = "firstLoop";

            while ((songNumber < 2) && (firstFourBuildingsInfo[0] == null)) // check location for each songNumber
            {
                four_geoPoints = getAudioGeoPoint.getFourGeoPoints(songNumber); // for each song (represented in songNumber) read its coordinates

                geoPoint1 = four_geoPoints[0]; // takes 4 geoPoints with (lati,longi) coordinates
                geoPoint2 = four_geoPoints[1];
                geoPoint3 = four_geoPoints[2];
                geoPoint4 = four_geoPoints[3];

                // getting particular variables, which will give criteria of geoLocation comparison
                geoCoordinateCode = setSong.setLocationSquareFormula(geoPoint1, geoPoint2, geoPoint3, geoPoint4);

                CheckGeoToPlayMusic checkUser = new CheckGeoToPlayMusic();
                firstFourBuildingsInfo = checkUser.checkCoordinates(sender, args, geoCoordinateCode, songNumber);

                songNumber++;
            }
            return firstFourBuildingsInfo;
        }
Beispiel #2
0
        // from getAudioGeoPosition
        private double[][] arrayOfDistances(Geolocator sender, PositionChangedEventArgs args)
        {
            double[][] four_geoPoints;

            double[] order_distance;

            four_geoPoints = new double[4][];

            getAudioGeoPosition getAudioPosition = new getAudioGeoPosition();

            for (int songNumber = 0; songNumber < 5; songNumber++)
            {
                four_geoPoints = getAudioPosition.getFourGeoPoints(songNumber+1);
                order_distance = new double[2];
                order_distance[0] = songNumber;
                order_distance[1] = findDistance(sender, args, findMidPoint(four_geoPoints));

                order_distance_array[songNumber] = order_distance;
            }

            return order_distance_array;
        }