📄 progress.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Progress.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "JvExControls"
#pragma link "JvXPButtons"
#pragma link "JvXPCore"
#pragma link "JvLabel"
#pragma resource "*.dfm"
TProgressForm *ProgressForm;
__fastcall ProgressThread::ProgressThread(int N, double *in, double *out, fftw_plan *p)
: TThread(true)
{
plan=p;
_N=N;_in=in;_out=out;
FreeOnTerminate=false;
Priority=tpNormal;
OnTerminate=FinshedEvent;
Finished=false;
Resume();
}
void __fastcall ProgressThread::FinshedEvent(TObject* Sender)
{
Finished=true;
}
void __fastcall ProgressThread::Execute()
{
*plan=fftw_plan_r2r_1d(_N,_in,_out,FFTW_R2HC,FFTW_MEASURE);
}
//---------------------------------------------------------------------------
__fastcall TProgressForm::TProgressForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TProgressForm::Timer1Timer(TObject *Sender)
{
if(*Finished)Close();
}
//---------------------------------------------------------------------------
void __fastcall TProgressForm::FormShow(TObject *Sender)
{
Timer1->Enabled=true;
}
//---------------------------------------------------------------------------
void __fastcall TProgressForm::FormClose(TObject *Sender,
TCloseAction &Action)
{
Timer1->Enabled=false;
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -