Ejemplo n.º 1
0
        private void layout()
        {
            spsFlowLayoutPanel.Controls.Clear();
            if (groupChannelData.Enabled)
            {
                enabledButton.BackColor  = Color.Green;
                enabledButton.Text       = "Enabled";
                dataTypeSelector.Enabled = true;

                if (groupChannelData.DataType == GPIBGroupChannelData.GpibChannelDataType.raw_string)
                {
                    rawStringTextBox.Enabled   = true;
                    rawStringTextBox.Visible   = true;
                    spsFlowLayoutPanel.Visible = false;
                    spsFlowLayoutPanel.Controls.Clear();
                }
                else if (groupChannelData.DataType == GPIBGroupChannelData.GpibChannelDataType.voltage_frequency_waveform)
                {
                    rawStringTextBox.Enabled   = false;
                    rawStringTextBox.Visible   = false;
                    spsFlowLayoutPanel.Visible = false;
                    spsFlowLayoutPanel.Controls.Clear();
                }
                else if (groupChannelData.DataType == GPIBGroupChannelData.GpibChannelDataType.string_param_string)
                {
                    rawStringTextBox.Enabled   = false;
                    rawStringTextBox.Visible   = false;
                    spsFlowLayoutPanel.Visible = true;

                    if (groupChannelData.StringParameterStrings == null)
                    {
                        groupChannelData.StringParameterStrings = new List <StringParameterString>();
                        groupChannelData.StringParameterStrings.Add(new StringParameterString());
                    }

                    foreach (StringParameterString sps in groupChannelData.StringParameterStrings)
                    {
                        StringParameterStringEditor spse = new StringParameterStringEditor(sps);

                        spse.insertAbove += new Action <StringParameterString>(spse_insertAbove);
                        spse.insertBelow += new Action <StringParameterString>(spse_insertBelow);
                        spse.delete      += new Action <StringParameterString>(spse_delete);

                        spsFlowLayoutPanel.Controls.Add(spse);
                    }
                }
            }
            else
            {
                enabledButton.BackColor  = Color.Red;
                enabledButton.Text       = "Continue";
                dataTypeSelector.Enabled = false;
                rawStringTextBox.Enabled = false;
                rawStringTextBox.Visible = true;
            }
            enabledButton.Invalidate();
        }
        private void layout()
        {
            if (groupChannelData.Enabled)
            {
                enabledButton.BackColor = Color.Green;
                enabledButton.Text = "Enabled";
                dataTypeSelector.Enabled = true;
                if (groupChannelData.DataType == RS232GroupChannelData.RS232DataType.Raw)
                {
                    rawStringTextBox.Enabled = true;
                    rawStringTextBox.Visible = true;
                    spsFlowPanel.Visible = false;
                }
                else if (groupChannelData.DataType == RS232GroupChannelData.RS232DataType.Parameter)
                {
                    rawStringTextBox.Enabled = false;
                    rawStringTextBox.Visible = false;
                    spsFlowPanel.Visible = true;
                    if (groupChannelData.StringParameterStrings == null)
                    {
                        groupChannelData.StringParameterStrings = new List<StringParameterString>();
                    }
                    if (groupChannelData.StringParameterStrings.Count == 0)
                    {
                        groupChannelData.StringParameterStrings.Add(new StringParameterString());
                    }

                    spsFlowPanel.Controls.Clear();

                    foreach (StringParameterString sps in groupChannelData.StringParameterStrings)
                    {
                        StringParameterStringEditor spse = new StringParameterStringEditor(sps);
                        spsFlowPanel.Controls.Add(spse);

                        spse.delete += new StringParameterStringEditor.spsEvent(spse_delete);
                        spse.insertAbove += new StringParameterStringEditor.spsEvent(spse_insertAbove);
                        spse.insertBelow += new StringParameterStringEditor.spsEvent(spse_insertBelow);
                    }

                }

            }
            else
            {
                enabledButton.BackColor = Color.Red;
                enabledButton.Text = "Continue";
                dataTypeSelector.Enabled = false;
                rawStringTextBox.Enabled = false;
            }
            enabledButton.Invalidate();
        }
        private void layout()
        {
            spsFlowLayoutPanel.Controls.Clear();
            if (groupChannelData.Enabled)
            {
                enabledButton.BackColor = Color.Green;
                enabledButton.Text = "Enabled";
                dataTypeSelector.Enabled = true;

                if (groupChannelData.DataType == GPIBGroupChannelData.GpibChannelDataType.raw_string)
                {
                    rawStringTextBox.Enabled = true;
                    rawStringTextBox.Visible = true;
                    spsFlowLayoutPanel.Visible = false;
                    spsFlowLayoutPanel.Controls.Clear();

                }
                else if (groupChannelData.DataType == GPIBGroupChannelData.GpibChannelDataType.voltage_frequency_waveform)
                {
                    rawStringTextBox.Enabled = false;
                    rawStringTextBox.Visible = false;
                    spsFlowLayoutPanel.Visible = false;
                    spsFlowLayoutPanel.Controls.Clear();

                }
                else if (groupChannelData.DataType == GPIBGroupChannelData.GpibChannelDataType.string_param_string)
                {
                    rawStringTextBox.Enabled = false;
                    rawStringTextBox.Visible = false;
                    spsFlowLayoutPanel.Visible = true;

                    if (groupChannelData.StringParameterStrings == null)
                    {
                        groupChannelData.StringParameterStrings = new List<StringParameterString>();
                        groupChannelData.StringParameterStrings.Add(new StringParameterString());
                    }

                    foreach (StringParameterString sps in groupChannelData.StringParameterStrings)
                    {
                        StringParameterStringEditor spse = new StringParameterStringEditor(sps);

                        spse.insertAbove += new Action<StringParameterString>(spse_insertAbove);
                        spse.insertBelow += new Action<StringParameterString>(spse_insertBelow);
                        spse.delete += new Action<StringParameterString>(spse_delete);

                        spsFlowLayoutPanel.Controls.Add(spse);
                    }

                }
            }
            else
            {
                enabledButton.BackColor = Color.Red;
                enabledButton.Text = "Continue";
                dataTypeSelector.Enabled = false;
                rawStringTextBox.Enabled = false;
                rawStringTextBox.Visible = true;

            }
            enabledButton.Invalidate();
        }