Exemple #1
0
        private void toolStripMenuItem_aiDevice_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            easyButton_stop_Click(null, null);
            dgv_ChannelsConfig.DataSource = null;
            dgv_mathEngine.DataSource     = null;

            userDialog dialog = new userDialog(e.ClickedItem.ToString(), "Please Select the Board Number");

            dialog.ShowDialog();

            _instrType = (HardwareFactory.InstrumentsType)Enum.Parse(typeof(HardwareFactory.InstrumentsType), e.ClickedItem.ToString());
            _brdNum    = dialog.BoardNumber;
            this.Text  = string.Format("JYTEK - Soft Front Panel ({0}, Board Number={1})", _instrType, _brdNum);

            foreach (ToolStripMenuItem item in toolStripMenuItem_aiDevice.DropDownItems)
            {
                item.CheckState = CheckState.Unchecked;
            }

            device = HardwareFactory.Create(_brdNum, _instrType);
            _hwGUIHandler.BindingSource(dgv_ChannelsConfig, device.GetChannelMap());
            MathEngineHandler = new MathEngine(dgv_mathEngine, contextMenuStrip1, device.SelectedChannels);
            propertyGrid_trigProp.SelectedObject = device.TriggerSetting;

            GUIConfig(device);

            toolStripMenuItem_aiDevice.Invalidate();
        }
Exemple #2
0
        public void Form1_Load(object sender, EventArgs e)
        {
            this.Text = string.Format("JYTEK - Soft Front Panel ({0}, Board Number={1})", _instrType, _brdNum);
            device    = HardwareFactory.Create(_brdNum, _instrType);

            _hwGUIHandler = new DGVGUIHandler();
            _hwGUIHandler.CellValueChangedEvent += _hwGUIHandler_CellValueChangedEvent;
            _hwGUIHandler.BindingSource(dgv_ChannelsConfig, device.GetChannelMap());
            MathEngineHandler = new MathEngine(dgv_mathEngine, contextMenuStrip1, device.SelectedChannels);
            propertyGrid_trigProp.SelectedObject = device.TriggerSetting;

            GUIConfig(device);

            comboBox_attRatio.SelectedIndex = 0;

            for (int i = 0; i < _seriesDefaultNames.Length; i++)
            {
                _seriesDefaultNames[i] = "Series " + i.ToString();
            }
            string[] text = Enum.GetNames(typeof(HardwareFactory.InstrumentsType));
            for (int i = 0; i < text.Length; i++)
            {
                ToolStripMenuItem digitizerMenus = new ToolStripMenuItem(text[i])
                {
                    CheckOnClick = true,
                };
                toolStripMenuItem_aiDevice.DropDownItems.Add(digitizerMenus);
            }
            foreach (ToolStripMenuItem item in toolStripMenuItem_graphs.DropDownItems)
            {
                item.CheckOnClick = true;
                item.Checked      = false;
            }
            toolStripMenuItem_time.Checked = true;

            contextMenuStrip1.Items.Clear();
            contextMenuStrip1.Items.Add(new ToolStripMenuItem("Add Measure Item"));
            contextMenuStrip1.Items.Add(new ToolStripMenuItem("Remove Measure Item"));
        }