//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit6.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "instrument"
#pragma link "lablebox"
#pragma link "progbar"
#pragma link "scale"
#pragma link "switch"
#pragma link "rollbox"
#pragma link "rollscale"
#pragma link "custom"
#pragma link "lednum"
#pragma link "led"
#pragma resource "*.dfm"
TForm6 *Form6;
LARGE_INTEGER BeginTime,EndTime,Frequency;
long long LocalPCFreq;
double tTime[1024];
double avTime[1024];
double b,e,sum;
//---------------------------------------------------------------------------
__fastcall TForm6::TForm6(TComponent* Owner)
: TForm(Owner)
{
QueryPerformanceFrequency(&Frequency);
LocalPCFreq=Frequency.QuadPart;
}
//---------------------------------------------------------------------------
void __fastcall TForm6::Timer1Timer(TObject *Sender)
{
static int i=0,j=0,k=0;
static bool tag=true,tag1=true;;
int t,tmp;
static unsigned short pres=0;
// QueryPerformanceCounter(&BeginTime);
Scale1->Value=i;
LableBox1->Value=i;
Scale2->Value=i;
LableBox3->Value=i;
// RollScale1->RollAngle=random(30);
if(tag)
{
if(j<40) j++;
else tag=false;
}
else
{
if(j>-40) j--;
else tag=true;
}
if(tag1)
{
if(k<360) k++;
else tag1=false;
}
else
{
if(k>0) k--;
else tag1=true;
}
Scale3->Value=k;
LableBox4->Value=k;
RollBox1->RollAngle=j;
RollScale1->RollAngle=j;
RollScale1->Value=j*0.2;
Instrument25->Value=j;
LableBox2->Value=j;
Scale4->Value=j;
if(j>0) tmp=50;
else tmp=-50;
Custom1->apos(0,0,-5+random(10));
Custom1->vpos(0,j,-80+random(160));
Custom6->PolyStytle=!Custom6->PolyStytle;
Instrument1->Value=k/10.0;
//Custom1->Left=RollBox1->Left+RollBox1->Width/2 - Custom1->Width/2+random(20)-10+tmp;
//Custom1->Top=RollBox1->Top+RollBox1->Height/2 - Custom1->Height/2+random(20)-10;
//Custom2->Left=RollBox1->Left+RollBox1->Width/2 - Custom2->Width/2+random(10)-5;
//Custom2->Top=RollBox1->Top+RollBox1->Height/2 - Custom2->Height/2+random(10)-5;
// QueryPerformanceCounter(&EndTime);
// b=BeginTime.QuadPart;
// e=EndTime.QuadPart;
// tTime[i%1024]=(double)(e-b)*1000/LocalPCFreq;
// if((i%1024)==0) sum=0;
// sum+=tTime[i%1024];
// if((i%1024)==1023)
// {
// avTime[k]=sum/1024;
// this->Caption=k;
// k++;
// }
i++;
//Scale5->Value=i;
SYSTEMTIME sysTime;
GetLocalTime(&sysTime);
LedNum4->Value=sysTime.wHour /10;
LedNum2->Value=sysTime.wHour %10;
LedNum5->Value=sysTime.wMinute /10;
LedNum6->Value=sysTime.wMinute %10;
LedNum7->Value=sysTime.wSecond /10;
LedNum8->Value=sysTime.wSecond %10;
if((i%20)<10)
{
LedNum3->Value=11;
LedNum9->Value=11;
}
else
{
LedNum3->Value=12;
LedNum9->Value=12;
}
pres=sysTime.wSecond;
}
//---------------------------------------------------------------------------
void __fastcall TForm6::Timer2Timer(TObject *Sender)
{
static int i=0;
// Instrument25->Value=-180+random(360);
// LableBox2->Value=Instrument25->Value;
// RollBox1->RollAngle=Instrument25->Value;
// i+=1;
Led1->status=!Led1->status;
LedNum1->Value = i % 10;
i++;
}
//---------------------------------------------------------------------------
void __fastcall TForm6::FormCreate(TObject *Sender)
{
// Custom1->DrawRound(Custom1->Width/2,Custom1->Height/2,10);
// Custom1->DrawLine(0,Custom1->Height/2,Custom1->Width/2-10,Custom1->Height/2);
// Custom1->DrawLine(Custom1->Width/2+10,Custom1->Height/2,Custom1->Width,Custom1->Height/2);
// Custom1->DrawLine(Custom1->Width/2,Custom1->Height/2-10,Custom1->Width/2,0);
//
// Custom2->DrawLine(0,8,9,8);
// Custom2->DrawLine(8,8,(8+Custom1->Width/2)/2,30);
// Custom2->DrawLine((8+Custom1->Width/2)/2,30,Custom1->Width/2,8);
// Custom2->DrawLine(Custom1->Width/2,8,(Custom1->Width-8+Custom1->Width/2)/2,30);
// Custom2->DrawLine((Custom1->Width-8+Custom1->Width/2)/2,30,Custom1->Width-8,8);
// Custom2->DrawLine(Custom1->Width-9,8,Custom1->Width,8);
//
// Custom1->BringToFront();
// Custom2->BringToFront();
Instrument1->SetLabel(0,"N");
Instrument1->SetLabel(3,"E");
Instrument1->SetLabel(6,"S");
Instrument1->SetLabel(9,"W");
LableBox5->Factor=0;
}
//---------------------------------------------------------------------------
void __fastcall TForm6::Switch2Click(TObject *Sender)
{
Timer1->Enabled=!Timer1->Enabled;
}
//---------------------------------------------------------------------------
void __fastcall TForm6::Switch1Click(TObject *Sender)
{
RollBox1->RollAngle=Edit1->Text.ToIntDef(0);
RollScale1->RollAngle=Edit1->Text.ToIntDef(0);
RollScale1->Value=Edit1->Text.ToIntDef(0)*0.2;
Instrument25->Value=Edit1->Text.ToIntDef(0);
LableBox2->Value=Edit1->Text.ToIntDef(0);
Scale4->Value=Edit1->Text.ToIntDef(0);
}
//---------------------------------------------------------------------------
虚拟仪器仪表VCL控件包
需积分: 9 72 浏览量
2014-10-21
20:34:59
上传
评论
收藏 329KB RAR 举报
wuliangcaihao
- 粉丝: 0
- 资源: 7
最新资源
- 直接插入排序,冒泡排序,直接选择排序.zip
- 在排序2的基础上,再次对快排进行优化,其次增加快排非递归,归并排序,归并排序非递归版.zip
- 实现了7种排序算法.三种复杂度排序.三种nlogn复杂度排序(堆排序,归并排序,快速排序)一种线性复杂度的排序.zip
- 冒泡排序 直接选择排序 直接插入排序 随机快速排序 归并排序 堆排序.zip
- 课设-内部排序算法比较 包括冒泡排序、直接插入排序、简单选择排序、快速排序、希尔排序、归并排序和堆排序.zip
- Python排序算法.zip
- C语言实现直接插入排序、希尔排序、选择排序、冒泡排序、堆排序、快速排序、归并排序、计数排序,并带图详解.zip
- 常用工具集参考用于图像等数据处理
- 音乐展示网页、基于Stenography的图像数字水印添加与提取,以及基于颜色矩和Tamura算法的图像相似度评估算法py源码
- 基于EmguCV(OpenCV .net封装),图像数字水印加解密算法的实现,其中包含最低有效位算法,离散傅里叶变换算法+文档书
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈