예제 #1
0
        public Setup(int channelCount, K8055Data data)
        {
            InitializeComponent();
            ForeColor = ThemeColorTable.ForeColor;
            BackColor = ThemeColorTable.BackgroundColor;
            ThemeUpdateControls.UpdateControls(this);
            _data = data;
            int numberofChannels = 0;

            if (channelCount > 7)
            {
                numberofChannels = channelCount - 7;
            }
            else
            {
                numberofChannels = 32;
            }

            numericUpDownDev0.Maximum = numericUpDownDev1.Maximum = numericUpDownDev2.Maximum = numericUpDownDev3.Maximum = numberofChannels;

            _modules = data.Modules;

            if (_modules != null)
            {
                checkBoxDev0.Checked = _modules[0].Enabled;
                if (checkBoxDev0.Checked)
                {
                    numericUpDownDev0.Value = Math.Min(_modules[0].StartChannel + 1, numberofChannels);
                    UpdateRange(numericUpDownDev0, labelDev0);
                }
                checkBoxDev1.Checked = _modules[1].Enabled;
                if (checkBoxDev1.Checked)
                {
                    numericUpDownDev1.Value = Math.Min(_modules[1].StartChannel + 1, numberofChannels);
                    UpdateRange(numericUpDownDev1, labelDev1);
                }
                checkBoxDev2.Checked = _modules[2].Enabled;
                if (checkBoxDev2.Checked)
                {
                    numericUpDownDev2.Value = Math.Min(_modules[2].StartChannel + 1, numberofChannels);
                    UpdateRange(numericUpDownDev2, labelDev2);
                }
                checkBoxDev3.Checked = _modules[3].Enabled;
                if (checkBoxDev3.Checked)
                {
                    numericUpDownDev3.Value = Math.Min(_modules[3].StartChannel + 1, numberofChannels);
                    UpdateRange(numericUpDownDev3, labelDev3);
                }
            }

            SearchDevices();
        }
예제 #2
0
파일: Setup.cs 프로젝트: stewmc/vixen
		public Setup(int channelCount, K8055Data data)
		{
			InitializeComponent();
			ForeColor = ThemeColorTable.ForeColor;
			BackColor = ThemeColorTable.BackgroundColor;
			ThemeUpdateControls.UpdateControls(this);
			_data = data;
			int numberofChannels = 0;
			
			if (channelCount > 7)
			{
				numberofChannels = channelCount - 7;
			}
			else
			{
				numberofChannels =  32;
			}

			numericUpDownDev0.Maximum = numericUpDownDev1.Maximum = numericUpDownDev2.Maximum = numericUpDownDev3.Maximum = numberofChannels;

			_modules = data.Modules;

			if (_modules != null)
			{
				checkBoxDev0.Checked = _modules[0].Enabled;
				if (checkBoxDev0.Checked)
				{
					numericUpDownDev0.Value = Math.Min(_modules[0].StartChannel + 1, numberofChannels);
					UpdateRange(numericUpDownDev0, labelDev0);
				}
				checkBoxDev1.Checked = _modules[1].Enabled;
				if (checkBoxDev1.Checked)
				{
					numericUpDownDev1.Value = Math.Min(_modules[1].StartChannel + 1, numberofChannels);
					UpdateRange(numericUpDownDev1, labelDev1);
				}
				checkBoxDev2.Checked = _modules[2].Enabled;
				if (checkBoxDev2.Checked)
				{
					numericUpDownDev2.Value = Math.Min(_modules[2].StartChannel + 1, numberofChannels);
					UpdateRange(numericUpDownDev2, labelDev2);
				}
				checkBoxDev3.Checked = _modules[3].Enabled;
				if (checkBoxDev3.Checked)
				{
					numericUpDownDev3.Value = Math.Min(_modules[3].StartChannel + 1, numberofChannels);
					UpdateRange(numericUpDownDev3, labelDev3);
				}
			}

			SearchDevices();
		}