Esempio n. 1
0
 void worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     txtBox_Text = (string)e.Result;
     textBox.Rtf = txtBox_Text;
     if (frmPixSettings.MavpixelVersion != null)
     {
         textBox.Rtf    = txtBox_Text.Trim('}') + UpdateWorker.horizontalBarRtf + @"\par Checking for updates to Mavpixel firmware (v" + frmPixSettings.MavpixelVersion.ToString() + @")..\par}";
         firmwareWorker = new FirmwareDownloader();
         firmwareWorker.worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(firmwareWorkerCompleted);
         string url = "https://raw.githubusercontent.com/prickle/Mavpixel/master/versions.xml";
         firmwareWorker.getVersions(url);
     }
     else
     {
         textBox.Rtf = txtBox_Text.Trim('}') + UpdateWorker.horizontalBarRtf + @"\par Please connect to Mavpixel to also check for firmware updates.\par}";
     }
 }
Esempio n. 2
0
 private void frmFlasher_Load(object sender, EventArgs e)
 {
     cbxFlashFile.Text      = Properties.Settings.Default.pgmFlash;
     chkEraseEeprom.Checked = Properties.Settings.Default.pgmEraseEeprom;
     cbxFlashFile_updateList(cbxFlashFile.Text);
     form1      = (Form1)Application.OpenForms["Form1"];
     downloader = new FirmwareDownloader();
     txtConsole.AppendText("Looking for AVRDude..");
     txtConsole.AppendText(avrDude.checkAvrDude());
     if (avrDude.AVRdudeOK)
     {
         txtConsole.AppendText("found.");
         avrDude.getAvrdudeVersion(new AVRDude.GotAVRdudeVersionEventHandler(avrDude_GotAVRdudeVersionEvent));
     }
     else
     {
         txtConsole.AppendText("not found!\r\nChoose a working avrdude.exe in Program Options.");
     }
     downloader.worker.RunWorkerCompleted   += new RunWorkerCompletedEventHandler(downloader_GotVersionsEvent);
     downloader.web.DownloadProgressChanged += new System.Net.DownloadProgressChangedEventHandler(web_DownloadProgressChanged);
     downloader.web.DownloadFileCompleted   += new AsyncCompletedEventHandler(web_DownloadFileCompleted);
     getVersions();
 }