private void refreshButtonEnable() { if (this.InvokeRequired) { delVoidNoParam del = new delVoidNoParam(refreshButtonEnable); this.Invoke(del); } else { if (this.Status == RunningStatus.Stop) { btnRun.Enabled = mainForm.ConnectedDevices.Count > 0 && !processOnStarting && !toolInstalling; btnStop.Enabled = false; } else { btnRun.Enabled = false; btnStop.Enabled = mainForm.ConnectedDevices.Count > 0 && !toolInstalling; } } }
private void updateDeviceConnection() { if (this.InvokeRequired) { delVoidNoParam del = new delVoidNoParam(updateDeviceConnection); this.Invoke(del); } else { if (deviceList.Count == 0) { this.txtDeviceConnetion.Text = "Disconnected"; this.txtDeviceConnetion.BackColor = Color.Crimson; } else if (IsDeviceOffline) { this.txtDeviceConnetion.Text = "Offline"; this.txtDeviceConnetion.BackColor = Color.Gray; } else if (deviceList.Count == 1 && !IsDeviceOffline) { this.txtDeviceConnetion.Text = "Conncted"; this.txtDeviceConnetion.BackColor = Color.Green; } else { this.txtDeviceConnetion.Text = "More than 1 devices"; this.txtDeviceConnetion.BackColor = Color.Orange; } txtIPAddress.Visible = device_IPAddress.Length > 0; if (txtIPAddress.Visible) { txtIPAddress.Text = device_IPAddress; } } }
private void deviceStatusChanged() { if (this.InvokeRequired) { delVoidNoParam del = new delVoidNoParam(deviceStatusChanged); this.Invoke(del); } else { dutAutoSelecting = true; cmbDUT1.Items.Clear(); cmbDUT2.Items.Clear(); foreach (AdbDeviceInfomation dev in devList) { cmbDUT1.Items.Add(dev.ID); cmbDUT2.Items.Add(dev.ID); } if (dev1 != null) { cmbDUT1.SelectedItem = dev1.ID; if (dev1.ConnectingStatus.Equals("Connected")) { txtDut1ConnectStatus.BackColor = System.Drawing.Color.LightCoral; txtDut1ConnectStatus.ForeColor = System.Drawing.Color.White; } else if (dev1.ConnectingStatus.Equals("Ready")) { txtDut1ConnectStatus.BackColor = System.Drawing.Color.Green; txtDut1ConnectStatus.ForeColor = System.Drawing.Color.White; } else if (dev1.ConnectingStatus.Equals("Initializing")) { txtDut1ConnectStatus.BackColor = System.Drawing.Color.YellowGreen; txtDut1ConnectStatus.ForeColor = System.Drawing.Color.White; } } if (cmbDUT1.SelectedItem == null) { dev1 = null; txtDut1ConnectStatus.BackColor = System.Drawing.SystemColors.Control; txtDut1ConnectStatus.Text = ""; } if (dev2 != null) { cmbDUT2.SelectedItem = dev2.ID; if (dev2.ConnectingStatus.Equals("Connected")) { txtDut2ConnectStatus.BackColor = System.Drawing.Color.LightCoral; txtDut2ConnectStatus.ForeColor = System.Drawing.Color.White; } else if (dev2.ConnectingStatus.Equals("Ready")) { txtDut2ConnectStatus.BackColor = System.Drawing.Color.Green; txtDut2ConnectStatus.ForeColor = System.Drawing.Color.White; } else if (dev2.ConnectingStatus.Equals("Initializing")) { txtDut2ConnectStatus.BackColor = System.Drawing.Color.YellowGreen; txtDut2ConnectStatus.ForeColor = System.Drawing.Color.White; } } if (cmbDUT2.SelectedItem == null) { dev2 = null; txtDut2ConnectStatus.BackColor = System.Drawing.SystemColors.Control; txtDut2ConnectStatus.Text = ""; } dutAutoSelecting = false; } }