Beispiel #1
0
        public void changeGroupControls()
        {
            /*
             * TODO - build control groups
             *     clear point list
             *     set polling button state
             * */

            SuspendLayout();

            if (_cgs != null)
            {
                foreach (var cpd in _cgs)
                {
                    if (flowLayoutPanel1.Controls.Contains(cpd))
                    {
                        flowLayoutPanel1.Controls.Remove(cpd);
                        cpd.Dispose();
                    }
                }
            }

            if ((scada == null) || (scada.Dnp.Control_points == null))
            {
                // change to popup -
                Console.WriteLine("a device type must be selected!");
                return;
            }

            this._cgs = new List <ControlPointGroup>(scada.Dnp.Control_points.Count);

            // create radio controls
            foreach (var cp in scada.Dnp.Control_points)
            {
                ControlPointGroup cg = new ControlPointGroup(cp.Name);
                cg.PName = cp.Name;

                cg.CommandIndex = cp.Pindex;
                cg.Device_mrid  = scada.Mrid;
                _cgs.Add(cg);
                flowLayoutPanel1.Controls.Add(cg);
            }

            ResumeLayout();

            Invalidate();
        }
        public void changeGroupControls()
        {
            /*
            TODO - build control groups
             *     clear point list
             *     set polling button state
             * */

            SuspendLayout();

            if (_cgs != null)
            {
                foreach (var cpd in _cgs)
                {
                    if (flowLayoutPanel1.Controls.Contains(cpd))
                    {
                        flowLayoutPanel1.Controls.Remove(cpd);
                        cpd.Dispose();
                    }
                }
            }

            if ((scada == null) || (scada.Dnp.Control_points == null))
            {
                // change to popup -
                Console.WriteLine("a device type must be selected!");
                return;
            }

            this._cgs = new List<ControlPointGroup>(scada.Dnp.Control_points.Count);

            // create radio controls
            foreach (var cp in scada.Dnp.Control_points)
            {
                ControlPointGroup cg = new ControlPointGroup(cp.Name);
                cg.PName = cp.Name;

                cg.CommandIndex = cp.Pindex;
                cg.Device_mrid = scada.Mrid;
                _cgs.Add(cg);
                flowLayoutPanel1.Controls.Add(cg);
            }

            ResumeLayout();

            Invalidate();
        }