-
Notifications
You must be signed in to change notification settings - Fork 0
/
parameters.~cp
46 lines (41 loc) · 1.27 KB
/
parameters.~cp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "parameters.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TparamForm *paramForm;
//---------------------------------------------------------------------------
__fastcall TparamForm::TparamForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TparamForm::closeBtnClick(TObject *Sender)
{
//first check if the stuff is ok
bool ok=true;
if(StrToFloat(toleranceEdit->Text)>1000000){
toleranceEdit->Text=FloatToStr(1000000);
ok=false;
}
if(StrToFloat(toleranceEdit->Text)<0.01){
toleranceEdit->Text=FloatToStr(0.01);
ok=false;
}
if(StrToFloat(tolMaxVelEdit->Text)>10){
tolMaxVelEdit->Text=FloatToStr(10);
ok=false;
}
if(StrToFloat(tolMaxVelEdit->Text)<0.001){
tolMaxVelEdit->Text=FloatToStr(0.001);
ok=false;
}
if(ok){
paramForm->Close();
}
else{
}
}
//---------------------------------------------------------------------------