home *** CD-ROM | disk | FTP | other *** search
- //---------------------------------------------------------------------------
- #include <vcl\vcl.h>
- #pragma hdrstop
-
- #include "fifomain.h"
- #include "math.h"
- //---------------------------------------------------------------------------
- #pragma link "RChart"
- #pragma resource "*.dfm"
- TForm1 *Form1;
- bool EndProg;
- double DataCnt;
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::BButExitClick(TObject *Sender)
- {
- Close();
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::BButStartClick(TObject *Sender)
- {
- const double Step = 1.0;
-
- BButExit->Enabled = false;
- BButStart->Enabled = false;
- BButStop->Enabled = true;
- EndProg = false;
- while (! EndProg)
- {
- Application->ProcessMessages();
- DataCnt = DataCnt + Step;
- RChart1->DataColor = clBlue;
- RChart1->MarkAt (DataCnt, sin(0.19*DataCnt)*cos(0.02*DataCnt), 10);
- RChart1->DataColor = clRed;
- RChart1->MoveTo (DataCnt-1, cos(0.09*(DataCnt-1)));
- RChart1->DrawTo (DataCnt, cos(0.09*DataCnt));
- if (DataCnt > 80)
- {
- RChart1->RemoveFirstItem(); // remove MarkAt }
- RChart1->RemoveFirstItem(); // remove MoveTo }
- RChart1->RemoveFirstItem(); // remove DarwTo }
- RChart1->SetRange (RChart1->RangeLoX+Step, RChart1->RangeLoY,
- RChart1->RangeHiX+Step, RChart1->RangeHiY);
- }
- RChart1->ShowGraf();
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::BButStopClick(TObject *Sender)
- {
- EndProg = true;
- BButExit->Enabled = true;
- BButStart->Enabled = true;
- BButStop->Enabled = false;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::FormMouseMove(TObject *Sender, TShiftState Shift, int X,
- int Y)
- {
- Screen->Cursor = crDefault;
- }
- //---------------------------------------------------------------------------