void findfirmware(Utilities.Firmware.software fwtoupload) { DialogResult dr = CustomMessageBox.Show("Are you sure you want to upload " + fwtoupload.name + "?", "Continue", MessageBoxButtons.YesNo); if (dr == System.Windows.Forms.DialogResult.Yes) { try { MainV2.comPort.BaseStream.Close(); } catch { } fw.Progress -= fw_Progress; fw.Progress += fw_Progress1; string history = (CMB_history.SelectedValue == null) ? "" : CMB_history.SelectedValue.ToString(); bool updated = fw.update(MainV2.comPortName, fwtoupload, history); if (updated) { if (fwtoupload.url2560_2 != null && fwtoupload.url2560_2.ToLower().Contains("copter")) { CustomMessageBox.Show("Warning, as of AC 3.1 motors will spin when armed, configurable through the MOT_SPIN_ARMED parameter", "Warning"); } } else { CustomMessageBox.Show("Error uploading firmware", "Error"); } } }
void updateDisplayNameInvoke(Utilities.Firmware.software temp) { this.Invoke((MethodInvoker) delegate { updateDisplayName(temp); }); }
void findfirmware(Utilities.Firmware.software fwtoupload) { DialogResult dr = CustomMessageBox.Show("Are you sure you want to upload " + fwtoupload.name + "?", "Continue", MessageBoxButtons.YesNo); if (dr == System.Windows.Forms.DialogResult.Yes) { try { MainV2.comPort.BaseStream.Close(); } catch { } fw.Progress -= fw_Progress; fw.Progress += fw_Progress1; bool updated = fw.update(MainV2.comPortName, fwtoupload); if (updated) { if (fwtoupload.url2560_2 != null && fwtoupload.url2560_2.ToLower().Contains("copter")) { CustomMessageBox.Show("Please ensure you do a live compass calibration after installing arducopter V 3.x", "Compass"); } } else { CustomMessageBox.Show("Error uploading firmware", "Error"); } } }
void findfirmware(Utilities.Firmware.software fwtoupload) { DialogResult dr = CustomMessageBox.Show("Are you sure you want to upload " + fwtoupload.name + "?", "Continue", MessageBoxButtons.YesNo); if (dr == System.Windows.Forms.DialogResult.Yes) { try { MainV2.comPort.BaseStream.Close(); } catch { } fw.Progress -= fw_Progress; fw.Progress += fw_Progress1; string history = (CMB_history.SelectedValue == null) ? "" : CMB_history.SelectedValue.ToString(); bool updated = fw.update(MainV2.comPortName, fwtoupload, history); if (updated) { if (fwtoupload.url2560_2 != null && fwtoupload.url2560_2.ToLower().Contains("copter") && fwtoupload.name.ToLower().Contains("3.1")) { CustomMessageBox.Show(Strings.WarningAC31, Strings.Warning); } if (fwtoupload.url2560_2 != null && fwtoupload.url2560_2.ToLower().Contains("copter") && fwtoupload.name.ToLower().Contains("3.2")) { CustomMessageBox.Show(Strings.WarningAC32, Strings.Warning); } } else { CustomMessageBox.Show("Error uploading firmware", Strings.ERROR); } } }
void updateDisplayName(Utilities.Firmware.software temp) { if (temp.url2560.ToLower().Contains("AR2".ToLower()) || temp.url2560.ToLower().Contains("apm1/APMRover".ToLower())) { pictureBoxRover.Text = temp.name; pictureBoxRover.Tag = temp; } else if (temp.url2560.ToLower().Contains("AP-".ToLower()) || temp.url2560.ToLower().Contains("apm1/ArduPlane".ToLower())) { pictureBoxAPM.Text = temp.name; pictureBoxAPM.Tag = temp; } else if (temp.url2560.ToLower().Contains("APHIL-".ToLower()) || temp.url2560.ToLower().Contains("apm1-hilsensors/ArduPlane".ToLower())) { pictureBoxAPHil.Text = temp.name; pictureBoxAPHil.Tag = temp; } else if (temp.url2560.ToLower().Contains("ac2-quad-".ToLower()) || temp.url2560.ToLower().Contains("1-quad/ArduCopter".ToLower())) { pictureBoxQuad.Text = temp.name + " Quad"; pictureBoxQuad.Tag = temp; } else if (temp.url2560.ToLower().Contains("ac2-tri".ToLower()) || temp.url2560.ToLower().Contains("-tri/ArduCopter".ToLower())) { pictureBoxTri.Text = temp.name + " Tri"; pictureBoxTri.Tag = temp; } else if (temp.url2560.ToLower().Contains("ac2-hexa".ToLower()) || temp.url2560.ToLower().Contains("-hexa/ArduCopter".ToLower())) { pictureBoxHexa.Text = temp.name + " Hexa"; pictureBoxHexa.Tag = temp; } else if (temp.url2560.ToLower().Contains("ac2-y6".ToLower()) || temp.url2560.ToLower().Contains("-y6/ArduCopter".ToLower())) { pictureBoxY6.Text = temp.name + " Y6"; pictureBoxY6.Tag = temp; } else if (temp.url2560.ToLower().Contains("ac2-heli-".ToLower()) || temp.url2560.ToLower().Contains("-heli/ArduCopter".ToLower())) { pictureBoxHeli.Text = temp.name; pictureBoxHeli.Tag = temp; } else if (temp.url2560.ToLower().Contains("ac2-helhil".ToLower()) || temp.url2560.ToLower().Contains("-heli-hil/ArduCopter".ToLower())) { pictureBoxACHHil.Text = temp.name; pictureBoxACHHil.Tag = temp; } else if (temp.url2560.ToLower().Contains("ac2-quadhil".ToLower()) || temp.url2560.ToLower().Contains("-quad-hil/ArduCopter".ToLower())) { pictureBoxACHil.Text = temp.name; pictureBoxACHil.Tag = temp; } else if (temp.url2560.ToLower().Contains("ac2-octaquad-".ToLower()) || temp.url2560.ToLower().Contains("-octa-quad/ArduCopter".ToLower())) { pictureBoxOctaQuad.Text = temp.name + " Octa Quad"; pictureBoxOctaQuad.Tag = temp; } else if (temp.url2560.ToLower().Contains("ac2-octa-".ToLower()) || temp.url2560.ToLower().Contains("-octa/ArduCopter".ToLower())) { pictureBoxOcta.Text = temp.name + " Octa"; pictureBoxOcta.Tag = temp; } else { log.Info("No Home " + temp.name + " " + temp.url2560); } }