/** ********************************************************************* * @fn<ResumeArchive_btn_Click> * @brief<This part will be used to resume archive.> * * @param[in] * none * @param[out] * none * @retval * none * @return <void> ********************************************************************* */ private void ResumeArchive_btn_Click(object sender, EventArgs e) { cameramask = 0; if (FilePath_txt.Text == "") { MessageBox.Show("File Path fail"); return; } else if (LastBlockID_txt.Text == "") { MessageBox.Show("Last Block ID"); return; } if (!getArchiveType()) { return; } ulFileSize = Convert.ToUInt32(tbFileSize.Text); if (ulFileSize < 512 || ulFileSize > 2048) { MessageBox.Show("File Size should be between 512MB to 2GB"); return; } txtPath = FilePath_txt.Text.ToString(); ulBlockID = Convert.ToUInt32(LastBlockID_txt.Text); AsyncArchiveStart asyArchiveStart = new AsyncArchiveStart(AsyncArchive); asyArchiveStart.BeginInvoke(null, null); }
/** ********************************************************************* * @fn<ArchiveStartbtn_Click> * @brief<This part will be used to start archive. In this function,We will new a save file dialog and an archive thread> * * @param[in] * none * @param[out] * none * @retval * none * @return <void> ********************************************************************* */ private void ArchiveStartbtn_Click(object sender, EventArgs e) { Console.WriteLine("(Archive test) ArchiveStartbtn pressed"); //int result = 0; ArchiveBar.Value = 0; ResumeArchive_btn.Enabled = false; completeflag = false; SaveFileDialog path = new SaveFileDialog(); path.Filter = "avr files(*.avr)|*.avr|All files (*.*)|*.*"; ulFileSize = Convert.ToUInt32(tbFileSize.Text); if (ulFileSize < 512 || ulFileSize > 2048) { MessageBox.Show("File Size should be between 512MB to 2GB"); return; } cameramask = 0; if (!getArchiveType()) { return; } if (path.ShowDialog() == DialogResult.OK) { ArchiveStartbtn.Enabled = false; txtPath = path.FileName.ToString(); //class_callback = new CallbackClass(); //CallbackType _SeleCallbackType = CallbackType.STATUS_ARCHIVE; //class_callback.StatusCallback_assign(_SeleCallbackType, ptr); //class_callback.m_StatusCallback.UploadData += new EventHandler(Update_ArchiveProgress); AsyncArchiveStart asyArchiveStart = new AsyncArchiveStart(AsyncArchive); asyArchiveStart.BeginInvoke(null, null); //ThreadStart asyncArchiveStart = new ThreadStart(AsyncArchive); //Thread asyncArchiveThread = new Thread(asyncArchiveStart); //asyncArchiveThread.Start(); } else { return; } path.Dispose(); Console.WriteLine("(Archive test) ArchiveStartbtn End"); }