-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAngle.cpp
100 lines (79 loc) · 2.54 KB
/
Angle.cpp
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Angle.h"
#include "GlobalData.h"
#include "GatePairDose.h"
#include "doseshell.h"
#include <string>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "RzButton"
#pragma link "RzEdit"
#pragma link "RzLabel"
#pragma link "RzPanel"
#pragma resource "*.dfm"
using namespace std;
TFormAngle *FormAngle;
//---------------------------------------------------------------------------
__fastcall TFormAngle::TFormAngle(TComponent* Owner,FILETYPE fileType)
: TForm(Owner)
{
this->fileType = fileType;
}
//---------------------------------------------------------------------------
void __fastcall TFormAngle::FormClose(TObject *Sender,
TCloseAction &Action)
{
Action = caFree;
}
//---------------------------------------------------------------------------
void __fastcall TFormAngle::RzBitBtnCancelClick(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
void __fastcall TFormAngle::FormCreate(TObject *Sender)
{
GlobalMembers *globalMem = NULL;
GatePairDose *gatePairDose = NULL;
globalMem = GlobalMembers::getInstance();
if(NULL == globalMem){
RunningLog::writeLog("The globalInstance is NULL;",__LINE__);
return;
}
if(NULL == globalMem->getGatePairDose()){
globalMem->allocateGatePairDose();
}
gatePairDose = globalMem->getGatePairDose();
this->RzEditAngle->Text = gatePairDose->copyAngle().c_str();
globalMem = NULL;
gatePairDose = NULL;
}
//---------------------------------------------------------------------------
void __fastcall TFormAngle::PersistVar(TObject *Sender){
GlobalMembers *globalMem = NULL;
GatePairDose *gatePairDose = NULL;
string angle;
globalMem = GlobalMembers::getInstance();
if(NULL == globalMem){
RunningLog::writeLog("The globalInstance is NULL;");
return;
}
if(NULL == globalMem->getGatePairDose()){
globalMem->allocateGatePairDose();
}
gatePairDose = globalMem->getGatePairDose();
if(RzEditAngle->Text.IsEmpty()){
MessageBox(this->Handle,"The angle cannot be NULL","Warning!",MB_OK);
RzEditAngle->Text = "0";
return;
}
angle = RzEditAngle->Text.c_str();
gatePairDose->setAngle(angle);
globalMem = NULL;
gatePairDose = NULL;
Hide();
FormMain->caxSetting(this->fileType);
Close();
}