Пример #1
0
        private void btnMostrar_Click(object sender, EventArgs e)
        {
            if (comboBox2.SelectedIndex != -1)
            {
                PlugData.ZoomToPoint(Pis[comboBox2.SelectedIndex].Ubicacion);
                PlugData.MapWin.View.Draw.ClearDrawing(PlugData.DrPuntoInteres);
                PlugData.DrPuntoInteres = PlugData.MapWin.View.Draw.NewDrawing(MapWinGIS.tkDrawReferenceList.dlSpatiallyReferencedList);
                PlugData.MapWin.View.Draw.DrawCircle(Pis[comboBox2.SelectedIndex].Ubicacion.X, Pis[comboBox2.SelectedIndex].Ubicacion.Y, 10, Color.Green, true);

                Forms.Expediente2 exp2 = new Expediente2(Pis[comboBox2.SelectedIndex].Ubicacion.ToString());
                exp2.ShowDialog();
            }
        }
Пример #2
0
        private void Mostrar(int index)
        {
            direccion = new Direccion();

            switch (DC[index].TipoRef)
            {
            case /*Geocodificacion.*/ TipoReferencia.Altura:
                direccion.Calle1    = DC[index].Dato1;
                direccion.Comuna    = DC[index].Dato3;
                direccion.Ubicacion = DC[index].Punto1;
                direccion.Altura    = int.Parse(DC[index].Dato2);
                goto siguiente;

            case /*Geocodificacion.*/ TipoReferencia.Esquina:
                direccion.Calle1    = DC[index].Dato1;
                direccion.Calle2    = DC[index].Dato2;
                direccion.Comuna    = DC[index].Dato3;
                direccion.Ubicacion = DC[index].Punto1;
siguiente:
                PlugData.ZoomToPoint(DC[index].Punto1);
                // marcar imagen
                // dibujar
                if (PlugData.DrDireccion.HasValue)
                {
                    MapWin.View.Draw.ClearDrawing(PlugData.DrDireccion.Value);
                }
                PlugData.DrDireccion = MapWin.View.Draw.NewDrawing(MapWinGIS.tkDrawReferenceList.dlSpatiallyReferencedList);
                MapWin.View.Draw.DrawCircle(DC[index].Punto1.X, DC[index].Punto1.Y, 10, Color.Red, true);
                p1 = Convert.ToInt32(DC[index].Punto1.X);
                p2 = Convert.ToInt32(DC[index].Punto1.Y);
                c1 = DC[index].Dato1;
                c2 = DC[index].Dato2;
                break;

            case /*Geocodificacion.*/ TipoReferencia.Tramo:
                direccion.Calle1 = DC[index].Dato1 + " " + DC[index].Dato2;
                direccion.Comuna = DC[index].Dato3;

                MapWin.View.Draw.ClearDrawings();
                PlugData.ZoomToLocation(DC[index].Punto1, DC[index].Punto2);
                // seleccionar
                PlugData.SelectCalle(DC[index].Punto1, DC[index].Punto2, DC[index].Dato2, DC[index].Dato1);
                break;

            default:
                break;
            }
            PlugData.Direccion = direccion;
        }
Пример #3
0
    public PlugData GetData()
    {
        PlugData data = new PlugData();

        data.ID         = transform.GetInstanceID();
        data.position   = transform.position;
        data.rotation   = transform.rotation;
        data.scale      = transform.localScale;
        data.outputPlug = outputPlug;
        data.connected  = connected.transform.GetInstanceID();
        data.otherPlug  = otherPlug.transform.GetInstanceID();
        data.plugPath   = plugPath.ToArray();
        data.cordColor  = cordColor;

        return(data);
    }
        //####################################
        //### Código para Localización GPS ###
        //####################################
        //private void btnLocalizar_Click(object sender, EventArgs e)
        //{
        //    if (listCarros.SelectedItems.Count!=0)
        //    {
        //        //### Barra de Estado
        //        this.Cursor = Cursors.WaitCursor;
        //        toolStripProgressBar1.Style = ProgressBarStyle.Marquee;
        //        toolStripStatusLabel1.Text = "Localizando...";

        //        //### Obtiene Coordenadas y Label de Cada Carro
        //        try
        //        {
        //            LocalizacionGPS lgps = LocalizacionGPS.StartClient();
        //            Localizacion l1=Localizacion.FromString(lgps.Localizar_s(1));

        //            List<PointD> points = new List<PointD>();
        //            List<string> labels = new List<string>();
        //            for (int i = 0; i < listCarros.SelectedItems.Count; i++)
        //            {
        //                Localizacion l = Localizacion.FromString(lgps.Localizar_s((int)((DataRowView)listCarros.SelectedItems[i])["id_carro"]));
        //                PointD p = new PointD(l.Longitud, l.Latitud);
        //                p = Data.Util.TransformCoord(p);//new PointD(346145.539, 6288689.478);
        //                points.Add(p);
        //                labels.Add((string)((DataRowView)listCarros.SelectedItems[i])["nombre"]);
        //            }

        //            //### Dibujar Cada Carro
        //            PlugData.ZoomToPointsPaint(points.ToArray(), labels.ToArray());
        //        }
        //        catch (Exception ex)
        //        {
        //            Log.ShowAndLog(ex);
        //        }
        //        //### Terminar la Barra de Estado
        //        this.Cursor = Cursors.Default;
        //        toolStripProgressBar1.Style = ProgressBarStyle.Blocks;
        //        toolStripStatusLabel1.Text = "";
        //    }
        //    else
        //    {
        //        MessageBox.Show("Debe seleccionar carros para localizarlos.", "Sistema ZEUS");
        //    }
        //}



        private void btnLocalizar_Click(object sender, EventArgs e)
        {
            if (listCarros.SelectedItems.Count != 0)
            {
                //### Barra de Estado
                this.Cursor = Cursors.WaitCursor;
                toolStripProgressBar1.Style = ProgressBarStyle.Marquee;
                toolStripStatusLabel1.Text  = "Localizando...";

                //### Obtiene Coordenadas y Label de Cada Carro
                try
                {
                    LocalizacionGPS lgps = LocalizacionGPS.StartClient();
                    Localizacion    l1   = Localizacion.FromString(lgps.Localizar_s(1));

                    List <PointD> points = new List <PointD>();
                    List <string> labels = new List <string>();
                    for (int i = 0; i < listCarros.SelectedItems.Count; i++)
                    {
                        Localizacion l = Localizacion.FromString(lgps.Localizar_s((int)((DataRowView)listCarros.SelectedItems[i])["id_carro"]));
                        PointD       p = new PointD(l.Longitud, l.Latitud);

                        //### LatLong 2 UTM
                        //p = Data.Util.TransformCoord(p);//new PointD(346145.539, 6288689.478);

                        points.Add(p);
                        labels.Add((string)((DataRowView)listCarros.SelectedItems[i])["nombre"]);
                    }

                    //### Dibujar Cada Carro
                    PlugData.ZoomToPointsPaint(points.ToArray(), labels.ToArray());
                }
                catch (Exception ex)
                {
                    Log.ShowAndLog(ex);
                }
                //### Terminar la Barra de Estado
                this.Cursor = Cursors.Default;
                toolStripProgressBar1.Style = ProgressBarStyle.Blocks;
                toolStripStatusLabel1.Text  = "";
            }
            else
            {
                MessageBox.Show("Debe seleccionar carros para localizarlos.", "Sistema ZEUS");
            }
        }
Пример #5
0
        static void Main()
        {
            BuildConfig();
            BuildTestDataSets();
            BuildDeviceClient();

            Console.WriteLine("Data sets ready, select action:");
            Console.WriteLine($"- 'PANI' = Transfer 'Panic'-data. (Max: {PanicData.Count()})");
            Console.WriteLine($"- 'DOOR' = Transfer 'Door'-data. (Max: {DoorData.Count()})");
            Console.WriteLine($"- 'FRID' = Transfer 'Fridge'-data. (Max: {FridgeData.Count()})");
            Console.WriteLine($"- 'PLUG' = Transfer 'Smart Plug'-data. (Max: {PlugData.Count()})");
            Console.WriteLine("- 'EXIT' = To exit console.");
            Console.WriteLine("");

            do
            {
                Input = Console.ReadLine()?.ToUpper();

                switch (Input)
                {
                case "PANI":
                    Task.Run(async() => await TransferData(PanicData));
                    break;

                case "DOOR":
                    Task.Run(async() => await TransferData(DoorData));
                    break;

                case "FRID":
                    Task.Run(async() => await TransferData(FridgeData));
                    break;

                case "PLUG":
                    Task.Run(async() => await TransferData(PlugData));
                    break;

                default:
                    Console.WriteLine($"Input could not be processed.");
                    Console.WriteLine($"Select a new keyword:");
                    break;
                }
            } while (Input != "EXIT");
        }
Пример #6
0
 private void btnMapa_Click(object sender, EventArgs e)
 {
     if (dgExpedientes.SelectedRows.Count != 0)
     {
         PointD p = new PointD((double)(dgExpedientes["puntoX", dgExpedientes.SelectedRows[0].Index].Value), (double)(dgExpedientes["puntoY", dgExpedientes.SelectedRows[0].Index].Value));
         PlugData.ZoomToPoint(p);
         // dibujar
         if (PlugData.DrDireccion.HasValue)
         {
             PlugData.MapWin.View.Draw.ClearDrawing(PlugData.DrDireccion.Value);
         }
         PlugData.DrDireccion = PlugData.MapWin.View.Draw.NewDrawing(MapWinGIS.tkDrawReferenceList.dlSpatiallyReferencedList);
         PlugData.MapWin.View.Draw.DrawCircle(p.X, p.Y, 10, Color.Red, true);
     }
     else
     {
         MessageBox.Show("Seleccione un expediente", "Mensaje de ZEUS", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }