forked from radiasoft/rshellweg
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOptimizerUnit.h
More file actions
131 lines (120 loc) · 3.47 KB
/
OptimizerUnit.h
File metadata and controls
131 lines (120 loc) · 3.47 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
//---------------------------------------------------------------------------
#ifndef OptimizerUnitH
#define OptimizerUnitH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.ExtCtrls.hpp>
#include <Vcl.ComCtrls.hpp>
#include <Vcl.Buttons.hpp>
#include "BeamSolver.h"
#include "Optimizer.h"
#include "OptimizerResults.h"
#include "Spin.hpp"
#include "cspin.h"
const int sDLS=0;
const int m90=0;
const int m60=1;
const int fA=0;
const int fL=1;
const int fE=2;
const int pCapture=0;
const int pESpec=1;
const int pFSpec=2;
//---------------------------------------------------------------------------
class TOptimizerForm : public TForm
{
__published: // IDE-managed Components
TPanel *MainPanel;
TPanel *BottomPanel;
TPanel *BuncherPanel;
TPanel *AccelPanel;
TPanel *ProgressPanel;
TPanel *ButtonsPanel;
TButton *ResultsButton;
TButton *CloseButton;
TButton *LoadButton;
TGroupBox *BuncherGroup;
TCheckBox *BuncherCheck;
TComboBox *TypeCombo;
TLabel *TypeLabel;
TLabel *ModeLabel;
TComboBox *ModeCombo;
TLabel *FrequencyLabel;
TEdit *FrequencyEdit;
TLabel *PowerLabel;
TEdit *PowerEdit;
TLabel *FrequencyDim;
TLabel *PowerDim;
TLabel *FieldTypeLabel;
TComboBox *FieldCombo;
TLabel *LimitLabel1;
TEdit *LimitEdit1;
TLabel *LimitLabel2;
TEdit *LimitEdit2;
TGroupBox *bInputGroup;
TGroupBox *bLimitGroup;
TGroupBox *bObjectGroup;
TRadioButton *SweepRadio;
TRadioButton *OptimumRadio;
TLabel *ParameterLabel;
TComboBox *ParameterCombo;
TButton *StartButton;
TButton *AbortButton;
TLabel *SamplesLabel;
TSpinEdit *SamplesSpin;
TProgressBar *OptimizerProgress;
TCheckBox *SaveGraphCheck;
TGroupBox *AccelGroup;
TCheckBox *AccelCheck;
TGroupBox *StructureGroup;
TRadioButton *ImpedanceRadio;
TRadioButton *GradientRadio;
TGroupBox *TargetGroup;
TLabel *EnergyLabel;
TEdit *EnergyEdit;
TLabel *EnergyDim;
TCheckBox *ExactCheck;
TCheckBox *StartCellCheck;
TCSpinEdit *StartCellSpin;
void __fastcall FormShow(TObject *Sender);
void __fastcall CloseButtonClick(TObject *Sender);
void __fastcall FormResize(TObject *Sender);
void __fastcall SweepRadioClick(TObject *Sender);
void __fastcall OptimumRadioClick(TObject *Sender);
void __fastcall ParameterComboChange(TObject *Sender);
void __fastcall FormCanResize(TObject *Sender, int &NewWidth, int &NewHeight,
bool &Resize);
void __fastcall StartButtonClick(TObject *Sender);
void __fastcall AbortButtonClick(TObject *Sender);
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
void __fastcall ResultsButtonClick(TObject *Sender);
void __fastcall StartCellCheckClick(TObject *Sender);
private: // User declarations
bool Abort;
double E1,E2;
double W;
int counter;
void ChangeSweep();
void ChangeStart();
void RefreshStart();
bool PrepareCell(TCell& Cell);
bool BuncherInput(TCell& Cell);
double GetValue(TOptResult& Structure);
double GetEnergy(TOptResult& Structure);
TOptResult Solve(bool Save=true);
void Sweep();
void OptimizeBuncher();
void OptimizeImpedance();
void OptimizeGradient();
void OptimizeCurrent(TOptResult& Structure);
public: // User declarations
TBeamSolver *Solver;
__fastcall TOptimizerForm(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TOptimizerForm *OptimizerForm;
//---------------------------------------------------------------------------
#endif