Exemplo n.º 1
0
        public void addDivision(SubZona d)
        {
            lock (this.sync)
            {
                if (this.SubZonas.Exists(x => x.Id == d.Id))
                {
                    //Ya existe, hay que modificarla
                    this.SubZonas.Where(x => x.Id == d.Id).First().Nombre = d.Nombre;
                    this.SubZonas.Where(x => x.Id == d.Id).First().addCoordinates(new Point(d.Inicio.X, d.Inicio.Y),
                                                                                  new Point(d.Fin.X, d.Fin.Y));
                    this.SubZonas.Where(x => x.Id == d.Id).First().Filas    = d.Filas;
                    this.SubZonas.Where(x => x.Id == d.Id).First().Columnas = d.Columnas;

                    //Trigger event that indicates that a division has been modified
                    if (DivisionesChanged != null)
                    {
                        DivisionesChanged(this, null);
                    }
                }
                else
                {
                    //No existe dicha división, se crea.
                    this.SubZonas.Add(d);

                    //Trigger event that indicates that a division has been added
                    if (DivisionesChanged != null)
                    {
                        DivisionesChanged(this, null);
                    }

                    //this.DivisionesChanged += ThermoCam_DivisionesChanged;
                }
            }
        }
Exemplo n.º 2
0
        public void addChildren(SubZona child)
        {
            this._children.Add(child);

            if (!this._hasChildren)
                this._hasChildren = true;
        }
Exemplo n.º 3
0
        public void removeChildren(SubZona child)
        {
            this._children.Remove(child);

            if (this._children.Count == 0)
            {
                this._hasChildren = false;
            }
        }
Exemplo n.º 4
0
        public void addChildren(SubZona child)
        {
            this._children.Add(child);

            if (!this._hasChildren)
            {
                this._hasChildren = true;
            }
        }
Exemplo n.º 5
0
        private void updateDivision(object sender, EventArgs e)
        {
            if (this.listBoxZonas.SelectedIndex != -1)
            {

                SubZona div = new SubZona();

                div.Id = this.listBoxZonas.SelectedIndex;
                div.Nombre = this.textBoxDivName.Text;
                div.Filas = int.Parse(this.numericTextBoxFilas.Texto);
                div.Columnas = int.Parse(this.numericTextBoxCol.Texto);
                div.addCoordinates(new Point(int.Parse(this.numericTextBoxXinit.Texto), int.Parse(this.numericTextBoxYinit.Texto)),
                                   new Point(int.Parse(this.numericTextBoxXfin.Texto) , int.Parse(this.numericTextBoxYfin.Texto)));

                camara.addDivision(div);
            }
        }
Exemplo n.º 6
0
        private void buttonAddZone_Click(object sender, EventArgs e)
        {
            unSuscribeEvents();

            SubZona d  = new SubZona();
            d.Id = this.camara.SubZonas.Count;
            d.Nombre    = "Division";
            d.addCoordinates(new Point(0, 0), new Point(0, 0));
            d.Filas     = 0;
            d.Columnas  = 0;

            this.selectedIndex = d.Id;
            this.camara.addDivision(d);

            suscribeEvents();
        }
Exemplo n.º 7
0
        public void removeChildren(SubZona child)
        {
            this._children.Remove(child);

            if (this._children.Count == 0)
                this._hasChildren = false;
        }
Exemplo n.º 8
0
        public void addDivision(SubZona d)
        {
            lock (this.sync)
            {
                if (this.SubZonas.Exists(x => x.Id == d.Id))
                {
                    //Ya existe, hay que modificarla
                    this.SubZonas.Where(x => x.Id == d.Id).First().Nombre = d.Nombre;
                    this.SubZonas.Where(x => x.Id == d.Id).First().addCoordinates(new Point(d.Inicio.X, d.Inicio.Y),
                        new Point(d.Fin.X, d.Fin.Y));
                    this.SubZonas.Where(x => x.Id == d.Id).First().Filas = d.Filas;
                    this.SubZonas.Where(x => x.Id == d.Id).First().Columnas = d.Columnas;

                    //Trigger event that indicates that a division has been modified
                    if (DivisionesChanged != null)
                    {
                        DivisionesChanged(this, null);
                    }
                }
                else
                {
                    //No existe dicha división, se crea.
                    this.SubZonas.Add(d);

                    //Trigger event that indicates that a division has been added
                    if (DivisionesChanged != null)
                    {
                        DivisionesChanged(this, null);
                    }

                    //this.DivisionesChanged += ThermoCam_DivisionesChanged;
                }
            }
        }