private void BUTTON_ConfigureReader_Click(object sender, EventArgs e) { LakeChabotReader reader = MainForm.ActiveReader; if (reader != null) { using (ConfigureForm frm = new ConfigureForm(reader)) { frm.ShowDialog(); } } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); ConfigureForm parent = this.TopLevelControl as ConfigureForm; view.AutoGenerateColumns = false; view.AllowUserToResizeRows = false; view.AllowUserToResizeColumns = false; view.AllowUserToOrderColumns = false; view.AllowUserToAddRows = false; view.AllowUserToDeleteRows = false; view.MultiSelect = false; view.SelectionMode = DataGridViewSelectionMode.FullRowSelect; view.Columns.Clear( ); view.Columns.AddRange ( editColumn, channelColumn, stateColumn, frequencyColumn, multiplierColumn, dividerColumn, minColumn, affinityColumn, maxColumn, guardColumn ); view.CellContentClick += new DataGridViewCellEventHandler(CellContentClick); view.CellFormatting += new DataGridViewCellFormattingEventHandler(CellFormatting); //this.channelList.load( LakeChabotReader.MANAGED_ACCESS, this.reader.ReaderHandle ); //this.bindingSource.DataSource = this.channelList; //this.view.DataSource = this.bindingSource; }
private void BUTTON_ConfigureReader_Click(object sender, EventArgs e) { LakeChabotReader reader = MainForm.ActiveReader; if (reader != null) { using (ConfigureForm frm = new ConfigureForm(reader)) { frm.ShowDialog(); } } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); ConfigureForm parent = this.TopLevelControl as ConfigureForm; if (null == parent) { System.Diagnostics.Debug.Assert(false, String.Format("Unknown parent form: {0}", this.TopLevelControl.GetType( ))); } else { parent.DialogClose += new DialogCloseDelegate(OnDialogClose); } view.AutoGenerateColumns = false; view.AllowUserToResizeRows = false; view.AllowUserToResizeColumns = false; view.AllowUserToOrderColumns = false; view.AllowUserToAddRows = false; view.AllowUserToDeleteRows = false; view.MultiSelect = false; view.RowHeadersVisible = false; view.SelectionMode = DataGridViewSelectionMode.FullRowSelect; view.CellContentClick += new DataGridViewCellEventHandler(CellContentClick); view.CellFormatting += new DataGridViewCellFormattingEventHandler(CellFormatting); view.Columns.Clear( ); // editColumn editColumn.HeaderText = ""; editColumn.Text = "Edit"; editColumn.UseColumnTextForButtonValue = true; editColumn.MinimumWidth = 50; editColumn.Resizable = DataGridViewTriState.False; editColumn.Width = 50; editColumn.Frozen = true; view.Columns.Add(editColumn); // portColumn portColumn.HeaderText = " #"; portColumn.MinimumWidth = 50; portColumn.Name = "portColumn"; portColumn.ReadOnly = true; portColumn.Resizable = DataGridViewTriState.False; portColumn.Width = 50; portColumn.DataPropertyName = "Port"; portColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; portColumn.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; portColumn.Frozen = true; view.Columns.Add(portColumn); // txPortColumn //Clark 2011.2.10 Cpoied from R1000 Tracer //txPortColumn.HeaderText = "Physical Tx Port"; PortColumn.HeaderText = "Physical Port"; PortColumn.MinimumWidth = 100; PortColumn.Name = "PortColumn"; PortColumn.ReadOnly = true; PortColumn.Resizable = DataGridViewTriState.False; PortColumn.Width = 100; PortColumn.DataPropertyName = "PhysicalPort"; PortColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; PortColumn.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; view.Columns.Add(PortColumn); // powerColumn //Clark 2011.2.10 Cpoied from R1000 Tracer //powerColumn.HeaderText = "Power Level (dBm)"; powerColumn.HeaderText = "Power Level 1/10 dBm"; powerColumn.MinimumWidth = 100; powerColumn.Name = "powerColumn"; powerColumn.ReadOnly = true; powerColumn.Resizable = DataGridViewTriState.False; powerColumn.Width = 100; powerColumn.DataPropertyName = "PowerLevel"; powerColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; powerColumn.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; view.Columns.Add(powerColumn); // dwellColumn dwellColumn.HeaderText = "Dwell Time (milliseconds)"; dwellColumn.MinimumWidth = 100; dwellColumn.Name = "dwellColumn"; dwellColumn.ReadOnly = true; dwellColumn.Resizable = DataGridViewTriState.False; dwellColumn.Width = 100; dwellColumn.DataPropertyName = "DwellTime"; dwellColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; dwellColumn.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; view.Columns.Add(dwellColumn); // roundsColumn roundsColumn.HeaderText = "Inventory Rounds"; roundsColumn.MinimumWidth = 100; roundsColumn.Name = "roundsColumn"; roundsColumn.ReadOnly = true; roundsColumn.Resizable = DataGridViewTriState.False; roundsColumn.Width = 100; roundsColumn.DataPropertyName = "NumberInventoryCycles"; roundsColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; roundsColumn.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; view.Columns.Add(roundsColumn); // antennaSenseValueColumn antennaSenseValueColumn.HeaderText = "Antenna Sense Value (Ohms)"; antennaSenseValueColumn.MinimumWidth = 100; antennaSenseValueColumn.Name = "antennaSenseValueColumn"; antennaSenseValueColumn.ReadOnly = true; antennaSenseValueColumn.Resizable = DataGridViewTriState.False; antennaSenseValueColumn.Width = 100; antennaSenseValueColumn.DataPropertyName = "AntennaSenseValue"; antennaSenseValueColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; antennaSenseValueColumn.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; view.Columns.Add(antennaSenseValueColumn); //clark not sure. Wait firmware support this function. //Hide MTI Item //Global Antenna Sense Threshold label_PowerThreshold.Visible = false; globalSenseThreshold.Visible = false; editGlobalSenseThreshold.Visible = false; //RF Reverse Power Threshold label_GlobalThreshold.Visible = false; numericUpDownRfPowerThreshold.Visible = false; Btn_SetRfPowerThreshold.Visible = false; this.antennaList.load(LakeChabotReader.MANAGED_ACCESS, this.reader.ReaderHandle); this.bindingSource.DataSource = this.antennaList; this.view.DataSource = this.bindingSource; this.updateThreshold( ); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); ConfigureForm parent = this.TopLevelControl as ConfigureForm; if (null == parent) { System.Diagnostics.Debug.Assert(false, String.Format("Unknown parent form: {0}", this.TopLevelControl.GetType( ))); } else { //@@ parent.DialogClose += new DialogCloseDelegate( OnDialogClose ); } //Button this.buttonColumn.HeaderText = ""; this.buttonColumn.MinimumWidth = 90; this.buttonColumn.UseColumnTextForButtonValue = true; this.buttonColumn.Text = "APPLY"; this.buttonColumn.Name = "Buttons"; this.buttonColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; this.view.Columns.Add(buttonColumn); //Pin Number this.nameColumn.HeaderText = "Name"; this.nameColumn.MinimumWidth = 70; this.nameColumn.DataPropertyName = "Pin"; this.nameColumn.DefaultCellStyle.Padding = new Padding(5, 0, 0, 0); this.nameColumn.ReadOnly = true; this.nameColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; this.view.Columns.Add(nameColumn); //Access Type (Set or Get) this.accessColumn.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; this.accessColumn.HeaderText = "Access"; this.accessColumn.MinimumWidth = 98; this.accessColumn.DataPropertyName = "Access"; this.accessColumn.Name = "Access"; foreach (Source_GPIO.OpAccess item in Enum.GetValues(typeof(Source_GPIO.OpAccess))) { this.accessColumn.Items.Add(item); } this.accessColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; this.view.Columns.Add(accessColumn); //Pin State(High or Low) this.stateColumn.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; this.stateColumn.HeaderText = "State"; this.stateColumn.MinimumWidth = 98; this.stateColumn.DataPropertyName = "State"; this.stateColumn.Name = "State"; foreach (Source_GPIO.OpState item in Enum.GetValues(typeof(Source_GPIO.OpState))) { this.stateColumn.Items.Add(item); } //Clark 2011.2.22 If pin was disable or got state failure,it will return UNKNOWN. Need to supply this item. //this.stateColumn.Items.Remove(Source_GPIO.OpState.FAILURE); this.stateColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; this.view.Columns.Add(stateColumn); //Access Pin result(Success or Failure) this.statusColumn.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; this.statusColumn.HeaderText = "Status"; this.statusColumn.MinimumWidth = 98; this.statusColumn.DataPropertyName = "Status"; this.statusColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; this.statusColumn.ReadOnly = true; this.stateColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; this.view.Columns.Add(statusColumn); gpioList.load(LakeChabotReader.MANAGED_ACCESS, _reader.ReaderHandle); this.bindingSource.DataSource = gpioList; this.view.DataSource = this.bindingSource; // The following so the combo boxes activate immediately // instead of requiring a 2x click operation... this.view.EditMode = DataGridViewEditMode.EditOnEnter; }