|
//----------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include "Barclass.h"
//--------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TBarCode* MyBarCode = new(TBarCode);
TForm1 *Form1;
//----------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//------------------------------------------------------------------------
void __fastcall TForm1::N2Click(TObject *Sender)
{
if(Form1->N2->Checked==false)
{
Form1->N2->Checked=true;
Form1->N3->Checked=false;
}
else
{
Form1->N2->Checked=false;
Form1->N3->Checked=true;
}
}
//------------------------------------------------------------------------
void __fastcall TForm1::ButtonStartClick(TObject *Sender)
{
if (Form1->N2->Checked==true)
{
// OpenDialog1->Execute();
Form1->MaskEdit1->Enabled=true;
Form1->MaskEdit1->ParentColor=false;
Form1->MaskEdit1->Color=clWhite;
Form1->Start->Enabled=false;
Form1->MaskEdit1->TabOrder=0;
Form1->ActiveControl=MaskEdit1;
}
else
{
};
}
//------------------------------------------------------------------------
void __fastcall TForm1::N4Click(TObject *Sender)
{
if (SaveDialog1->Execute()) Close();
}
//----------------------------------------------------------------------
void __fastcall TForm1::MaskEdit1Exit(TObject *Sender)
{
Form1->MaskEdit1->Enabled=false;
char *Buffer = new char[9]; //Creates Buffer dynamic variable
Form1->MaskEdit1->GetTextBuf(Buffer,8);
MyBarCode->SetUp(Buffer);
Form1->MaskEdit1->ParentColor=true;
Form1->CheckBox1->Checked=true;
Form1->ComboBoxErr->Enabled=true;
}
//------------------------------------------------------------------------
void __fastcall TForm1::ComboBoxErrExit(TObject *Sender)
{
Form1->ComboBoxErr->Enabled=false;
Form1->CheckBox2->Checked=true;
MyBarCode->SetCountErr(StrToInt(Form1->ComboBoxErr->Text));
}
//-----------------------------------------------------------------------
void __fastcall TForm1::MaskEdit1Change(TObject *Sender)
{
Form1->ComboBoxErr->Enabled=true;
}
//------------------------------------------------------------------------
void __fastcall TForm1::StopClick(TObject *Sender)
{
Form1->Timer1->Enabled=false;
Form1->Start->Enabled=true;
Form1->Chart1->Visible=false;
}
//------------------------------------------------------------------------
void __fastcall TForm1::BitBtn1Click(TObject *Sender)
{
Form1->Timer1->Enabled=true;
Form1->Chart1->Visible=true;
}
//-----------------------------------------------------------------------
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
Form1->TextTimer->Text=IntToStr(MyBarCode->Pausa);
Form1->Timer1->Enabled=false;
MyBarCode->Test();
if (MyBarCode->Pausa==0)
{
Form1->FormInfo();
MyBarCode->Info();
MyBarCode->Pausa=Form1->TrackBar1->Position*100;
}
else
{
};
MyBarCode->Pausa--;
Form1->Timer1->Enabled=true;
}
//-----------------------------------------------------------------------
void __fastcall TForm1::TrackBar1Change(TObject *Sender)
{
MyBarCode->Pausa=Position*100;
}
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
void __fastcall TForm1::FormInfo()
{
int pf,pn,pw;
pf=(MyBarCode->GetCountErr(1)*100)/MyBarCode->GetCountErr(0);
pn=(MyBarCode->GetCountErr(2)*100)/MyBarCode->GetCountErr(0);
pw=(MyBarCode->GetCountErr(3)*100)/MyBarCode->GetCountErr(0);
Form1->Chart1->Visible=true;
Series1->Clear();
Series1->ExplodeBiggest;
Series1->AddPie(pf, "% тш тыхэю", clRed);
Series1->AddPie(pn, "% тшяЁртыхэю", clBlue);
Series1->AddPie(pw, "% эх тш тыхэю", clGreen);
Form1->Edit1Gen->Text=FloatToStr(MyBarCode->GetCountErr(0));
Form1->Edit2war->Text=FloatToStr(MyBarCode->GetCountErr(3));
Form1->Edit3notfatal->Text=FloatToStr(MyBarCode->GetCountErr(2));
Form1->Edit4fatal->Text=FloatToStr(MyBarCode->GetCountErr(1));
};
void __fastcall TForm1::N5Click(TObject *Sender)
{
Form1->FormInfo();
}
//----------------------------------------------------------------------
void __fastcall TForm1::N6Click(TObject *Sender)
{
AboutBox->ShowModal();
}
//------------------------------------------------------------------------
Дата добавления: 2015-07-21; просмотров: 41 | Нарушение авторских прав
<== предыдущая страница | | | следующая страница ==> |
UNIT1.H | | | BARCLASS.CPP |