private void FProjectBrowseBtn_Click(object sender, EventArgs e) { FOpenDialog.FileName = DelphiProjectFile; FOpenDialog.Filter = FDelphiProjectFilters; if (FOpenDialog.ShowDialog() == DialogResult.OK) { DelphiProjectFile = FOpenDialog.FileName; } }
private void button3_Click(object sender, EventArgs e) { long flen = 0; string fname = ""; string tmpFilter = FOpenDialog.Filter; string title = FOpenDialog.Title; FOpenDialog.Title = "Select the file to send"; FOpenDialog.Filter = "bin files (*.bin)|*.bin|All files (*.*) | *.*"; if (FOpenDialog.ShowDialog() == DialogResult.OK) //selecting bitstream { fname = FOpenDialog.FileName; Refresh(); rtConsole.AppendText("Bitstream File Selected\n"); StatLabel1.Text = "NEXT STEP: Use Configure button to start Configuration "; } else { FOpenDialog.Filter = tmpFilter; FOpenDialog.Title = title; return; } FOpenDialog.FileName = ""; FOpenDialog.Filter = tmpFilter; FOpenDialog.Title = title; FileStream file = new FileStream(fname, FileMode.Open, FileAccess.Read); flen = file.Length; //file_bytes = (int)flen; file_bytes = (int)flen; file_buffer = new byte[file_bytes]; file.Read(file_buffer, 0, file_bytes); file.Close(); rtConsole.AppendText(fname); rtConsole.AppendText("\n"); button2.Enabled = true; button3.Enabled = false; }
private void button1_Click(object sender, EventArgs e) { CyFX3Device fx = myFX3Device as CyFX3Device; string tmpFilter = FOpenDialog.Filter; FOpenDialog.Filter = "Firmware Image files (*.img) | *.img"; if ((fx != null) && (FOpenDialog.ShowDialog() == DialogResult.OK)) { FX3_FWDWNLOAD_ERROR_CODE enmResult = FX3_FWDWNLOAD_ERROR_CODE.SUCCESS; rtConsole.AppendText("Programming RAM of "); rtConsole.AppendText(fx.FriendlyName); rtConsole.AppendText("........\n"); string filename = FOpenDialog.FileName; Refresh(); enmResult = fx.DownloadFw(filename, FX3_FWDWNLOAD_MEDIA_TYPE.RAM); rtConsole.AppendText("Programming"); rtConsole.AppendText(fx.GetFwErrorString(enmResult)); rtConsole.AppendText("\n"); Refresh(); firmwaredownloaded = true; button1.Enabled = false; } else if (myDevice != null) { rtConsole.AppendText("FX3 firmware is already downloaded\n"); StatLabel1.Text = "NEXT STEP: Use Select Bitstream to select the FPGA .bin file "; } FOpenDialog.FileName = ""; FOpenDialog.Filter = tmpFilter; }