private void layoutGroupChannelSelectors()
        {
            this.groupChannelSelectorPanel.Controls.Clear();
            foreach (GpibGroupChannelSelection sel in groupChannelSelectors)
            {
                sel.Dispose();
            }
            groupChannelSelectors.Clear();

            List <int> channelIDs = gpibChannelCollection.getSortedChannelIDList();

            foreach (int id in channelIDs)
            {
                groupChannelSelectors.Add(new GpibGroupChannelSelection(gpibChannelCollection.Channels[id], gpibGroup.getChannelData(id)));
            }

            for (int i = 0; i < groupChannelSelectors.Count; i++)
            {
                groupChannelSelectors[i].Visible = true;
                if (gpibGroup == null)
                {
                    groupChannelSelectors[i].Enabled = false;
                }
                else
                {
                    groupChannelSelectors[i].Enabled = true;
                }
                this.groupChannelSelectorPanel.Controls.Add(groupChannelSelectors[i]);
                groupChannelSelectors[i].Show();
                groupChannelSelectors[i].updateGUI += new EventHandler(groupChannnelSelector_updateGUI);
            }
            this.groupChannelSelectorPanel.Invalidate();
        }
        private void layoutGroupChannelSelectors()
        {
            selectorsUpdating = true;
            foreach (GroupChannelSelection sel in groupChannelSelectors)
            {
                this.groupChannelSelectorPanel.Controls.Remove(sel);
                sel.Dispose();
            }
            groupChannelSelectors.Clear();

            List <int> channelIDs = analogChannelCollection.getSortedChannelIDList();

            foreach (int id in channelIDs)
            {
                groupChannelSelectors.Add(new GroupChannelSelection(analogChannelCollection.Channels[id], analogGroup.getChannelData(id), id));
            }

            for (int i = 0; i < groupChannelSelectors.Count; i++)
            {
                Point location = new Point(0, i * groupChannelSelectorPlaceholder.Size.Height);
                groupChannelSelectors[i].Location = location;
                groupChannelSelectors[i].Visible  = true;
                if (analogGroup == null)
                {
                    groupChannelSelectors[i].Enabled = false;
                }
                else
                {
                    groupChannelSelectors[i].Enabled = true;
                }
                this.groupChannelSelectorPanel.Controls.Add(groupChannelSelectors[i]);
                groupChannelSelectors[i].Show();
                groupChannelSelectors[i].updateGUI += new EventHandler(groupChannnelSelector_updateGUI);
            }

            //updateRunOrderPanel();

            this.groupChannelSelectorPanel.Invalidate();
            selectorsUpdating = false;
        }