Exemplo n.º 1
0
        public async Task <bool> RunGetGPSAndConvertNxNyAndWriteAddr(string url, string urlParameters, string address)
        {
            GoogleMapsResult gmr = await GetGPSLocationAsync(url, urlParameters + address);

            NxNyManager nnm  = new NxNyManager();
            Coords      nxny = nnm.Dfs_xy_conv("toXY", gmr.results[0].geometry.location.lat, gmr.results[0].geometry.location.lng);

            Console.WriteLine("Address:" + address +
                              ", LatLng:(" + gmr.results[0].geometry.location.lat + ", " + gmr.results[0].geometry.location.lng + ")" +
                              ", NxNy:(" + nxny.x + ", " + nxny.y + ")"
                              );
            AddressIniManager aiManager = new AddressIniManager();

            aiManager.WriteAddress(address, nxny.x, nxny.y);

            return(true);
        }
Exemplo n.º 2
0
        public async Task <bool> RunGetGPSAndConvertNxNyAndWriteFI(string url, string urlParameters, List <string> addresses)
        {
            foreach (var address in addresses)
            {
                // https://docs.microsoft.com/ko-kr/dotnet/csharp/programming-guide/concepts/async/
                GoogleMapsResult gmr = await GetGPSLocationAsync(url, urlParameters + address);

                NxNyManager nnm  = new NxNyManager();
                Coords      nxny = nnm.Dfs_xy_conv("toXY", gmr.results[0].geometry.location.lat, gmr.results[0].geometry.location.lng);
                Console.WriteLine("Address:" + address +
                                  ", LatLng:(" + gmr.results[0].geometry.location.lat + ", " + gmr.results[0].geometry.location.lng + ")" +
                                  ", NxNy:(" + nxny.x + ", " + nxny.y + ")"
                                  );

                FwjournalIniManager fiManager = new FwjournalIniManager();
                fiManager.WriteAddress(address, nxny.x, nxny.y);
            }

            return(true);
        }