private void CNCRouterCommand_Load(object sender, EventArgs e) { #if !DEBUG tcInterface.TabPages.Remove(tpGenDebug); tcInterface.TabPages.Remove(tpCommDebug); #endif // Setup the debug tab. string[] ports = CNCRTools.GetCNCRouterPorts(); cmbPorts.Items.AddRange(ports); if (cmbPorts.Items.Count > 0) { cmbPorts.SelectedIndex = 0; } cmbMsgs.SelectedIndex = 0; // Setup the Auto Tab commCmd._rtbOutputCommDbg = rtbTraffic; commCmd._rtbOutputAuto = rtbRCOutput; commCmd._displayLabel = lblQueue; // Setup the manual tab. for (int i = 0; i < distances.Length; i++) { cmbMoveDistance.Items.Add(distances[i].ToString() + " mm"); } cmbMoveDistance.SelectedIndex = 0; // Setup the Settings tab. cmbRouterPort.Items.AddRange(ports); if (cmbRouterPort.Items.Count > 0) { cmbRouterPort.SelectedIndex = 0; } }
private void button2_Click(object sender, EventArgs e) { cmbRouterPort.Items.Clear(); cmbRouterPort.Items.AddRange(CNCRTools.GetCNCRouterPorts()); cmbRouterPort.SelectedIndex = 0; }
private void btnRefreshPorts_Click(object sender, EventArgs e) { cmbPorts.Items.Clear(); cmbPorts.Items.AddRange(CNCRTools.GetCNCRouterPorts()); cmbPorts.SelectedIndex = 0; }