Example #1
0
        private void botonConectar_Click(object sender, EventArgs e)
        {
            if (gps.EsConectado)
            {
                gps.Stop();
                botonConectar.Text = "Conectar";
            }
            else
            {
                try
                {
                    var coordinateSystemFactory         = new CoordinateSystemFactory();
                    var coordinateTransformationFactory = new CoordinateTransformationFactory();

                    transformación = coordinateTransformationFactory.CreateFrom3DCoordinateSystems(
                        CoordinateSystemAuthorityFactory.CreateGeographicCoordinateSystem(4979),
                        coordinateSystemFactory.CreateFromWkt(Digi21.DigiNG.DigiNG.Wkt),
                        SelectTransformationHelper.DialogSelectTransformation,
                        CreateVerticalTransformationHelper.DialogCreateVerticalTransformation);
                }
                catch (Exception ex)
                {
                    MessageBox.Show($"Se detectó el error: {ex.Message} al intentar crear una transformación entre el sistema de referencia de coordenadas del GPS y el de la ventana de dibujo");
                    return;
                }

                botonConectar.Enabled = false;
                gps.Start();
            }
        }