private void BUT_FW_Update_Click(object sender, EventArgs e) { // Cleanup temp files if already exists. RemoveTemporaries(); FW_Uploader_log.Clear(); using (var fd = new OpenFileDialog { Filter = "Firmware (*.zip)|*.zip;" }) { fd.ShowDialog(); UnzipArchive(fd.FileName); // Upload firmware on PX4 if (PX4_Serial_Port.Length != 0) { add_LogText("Uploading PX Firmware. Please Wait..."); if (!upload_PX4_Firmware("firmware_temp.px4", PX4_Serial_Port)) { add_LogText("Unable to upload PX Firmware."); } } //upload a GD Firmware if (GD_Serial_Port.Length != 0) { add_LogText("Uploading GD Firmware. Please Wait..."); if (!upload_PGD_Firmware("firmware_temp.hex", GD_Serial_Port)) { add_LogText("Unable to upload GD Firmware."); } } } RemoveTemporaries(); add_LogText("Done!"); }
private void add_LogText(string text) { FW_Uploader_log.AppendText(text + Environment.NewLine); }