Configure.cpp 9.9 KB
Newer Older
gsell's avatar
gsell committed
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
// ------------------------------------------------------------------------
// $RCSfile: Configure.cpp,v $
// ------------------------------------------------------------------------
// $Revision: 1.3 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Namespace: Configure
//   Contains methods for configuring the OPAL-9 program.
//
// ------------------------------------------------------------------------
//
// $Date: 2000/05/03 12:40:49 $
// $Author: opal $
//
// JMJ & JP adding Aperture and Split 18/4/2000
// ------------------------------------------------------------------------

#include "OpalConfigure/Configure.h"
#include "AbstractObjects/OpalData.h"

#include "Distribution/Distribution.h"

// Basic action commands.
#include "BasicActions/Call.h"
#include "BasicActions/Dump.h"
28
#include "BasicActions/DumpFields.h"
29
#include "BasicActions/DumpEMFields.h"
gsell's avatar
gsell committed
30 31 32 33 34 35 36 37 38 39
#include "BasicActions/Echo.h"
#include "BasicActions/Help.h"
#include "BasicActions/Option.h"
#include "BasicActions/Save.h"
#include "BasicActions/Select.h"
#include "BasicActions/Show.h"
#include "BasicActions/Stop.h"
#include "BasicActions/Quit.h"
#include "BasicActions/What.h"
#include "BasicActions/System.h"
40
#include "BasicActions/PSystem.h"
gsell's avatar
gsell committed
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
#include "BasicActions/Title.h"
#include "BasicActions/Value.h"

// Macro command.
#include "OpalParser/MacroCmd.h"

// Commands introducing a special mode.
#include "Editor/EditCmd.h"
#include "Match/MatchCmd.h"
#include "Track/TrackCmd.h"

// Table-related commands.
#include "Structure/Beam.h"
#include "Structure/FieldSolver.h"
#include "Structure/BoundaryGeometry.h"
#include "Structure/OpalWake.h"
57
#include "Structure/ParticleMatterInteraction.h"
gsell's avatar
gsell committed
58
#include "Utilities/OpalFilter.h"
frey_m's avatar
frey_m committed
59
#include "TrimCoils/OpalTrimCoil.h"
gsell's avatar
gsell committed
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
#include "Tables/AttList.h"
#include "Tables/Eigen.h"
#include "Tables/Envelope.h"
#include "Tables/Insertion.h"
#include "Tables/List.h"
#include "Tables/MatrixCmd.h"
#include "Tables/Micado.h"
#include "Tables/Period.h"
#include "Tables/Survey.h"
#include "Tables/ThreadAll.h"
#include "Tables/ThreadBpm.h"
#include "Tables/Twiss3.h"
#include "Aperture/Aperture.h"
#include "Aperture/Split.h"


// Value definitions commands.
#include "ValueDefinitions/BoolConstant.h"
#include "ValueDefinitions/RealConstant.h"
#include "ValueDefinitions/RealVariable.h"
#include "ValueDefinitions/RealVector.h"
#include "ValueDefinitions/StringConstant.h"

// Element commands.
84
#include "Elements/OpalBeamStripping.h"
gsell's avatar
gsell committed
85 86 87 88 89
#include "Elements/OpalCavity.h"
#include "Elements/OpalCCollimator.h"
#include "Elements/OpalCyclotron.h"
#include "Elements/OpalDrift.h"
#include "Elements/OpalECollimator.h"
90
#include "Elements/OpalFlexibleCollimator.h"
adelmann's avatar
adelmann committed
91
#include "Elements/OpalDegrader.h"
gsell's avatar
gsell committed
92 93 94 95 96 97 98
#include "Elements/OpalHKicker.h"
#include "Elements/OpalHMonitor.h"
#include "Elements/OpalInstrument.h"
#include "Elements/OpalKicker.h"
#include "Elements/OpalMarker.h"
#include "Elements/OpalMonitor.h"
#include "Elements/OpalMultipole.h"
99 100 101 102
#include "Elements/OpalMultipoleT.h"
#include "Elements/OpalMultipoleTStraight.h"
#include "Elements/OpalMultipoleTCurvedConstRadius.h"
#include "Elements/OpalMultipoleTCurvedVarRadius.h"
gsell's avatar
gsell committed
103
#include "Elements/OpalOctupole.h"
104 105 106 107
#include "Elements/OpalOffset/OpalLocalCartesianOffset.h"
#include "Elements/OpalOffset/OpalLocalCylindricalOffset.h"
#include "Elements/OpalOffset/OpalGlobalCartesianOffset.h"
#include "Elements/OpalOffset/OpalGlobalCylindricalOffset.h"
gsell's avatar
gsell committed
108 109 110 111
#include "Elements/OpalPepperPot.h"
#include "Elements/OpalPatch.h"
#include "Elements/OpalProbe.h"
#include "Elements/OpalQuadrupole.h"
112
#include "Elements/OpalPolynomialTimeDependence.h"
gsell's avatar
gsell committed
113
#include "Elements/OpalRBend.h"
114
#include "Elements/OpalRBend3D.h"
gsell's avatar
gsell committed
115 116
#include "Elements/OpalRCollimator.h"
#include "Elements/OpalSBend.h"
117
#include "Elements/OpalSBend3D.h"
ext-rogers_c's avatar
ext-rogers_c committed
118
#include "Elements/OpalScalingFFAMagnet.h"
gsell's avatar
gsell committed
119 120 121 122 123
#include "Elements/OpalSeparator.h"
#include "Elements/OpalSeptum.h"
#include "Elements/OpalSextupole.h"
#include "Elements/OpalSlit.h"
#include "Elements/OpalSolenoid.h"
124
#include "Elements/OpalSource.h"
gsell's avatar
gsell committed
125 126 127 128
#include "Elements/OpalSRot.h"
#include "Elements/OpalTravelingWave.h"
#include "Elements/OpalVKicker.h"
#include "Elements/OpalVMonitor.h"
129
//#include "Elements/OpalWire.h"
gsell's avatar
gsell committed
130 131 132
#include "Elements/OpalYRot.h"
#include "Elements/OpalParallelPlate.h"
#include "Elements/OpalStripper.h"
133
#include "Elements/OpalRingDefinition.h"
134
#include "Elements/OpalVariableRFCavity.h"
135
#include "Elements/OpalVariableRFCavityFringeField.h"
136
#include "Elements/OpalVerticalFFAMagnet.h"
gsell's avatar
gsell committed
137 138 139 140 141

// Structure-related commands.
#include "Lines/Line.h"
#include "Lines/Sequence.h"

142 143 144 145 146 147
// Optimize command
#include "Optimize/OptimizeCmd.h"
#include "Optimize/DVar.h"
#include "Optimize/Objective.h"
#include "Optimize/Constraint.h"

frey_m's avatar
frey_m committed
148 149
// Sample command
#include "Sample/SampleCmd.h"
frey_m's avatar
frey_m committed
150
#include "Sample/OpalSample.h"
frey_m's avatar
frey_m committed
151

152
#include "changes.h"
gsell's avatar
gsell committed
153 154 155 156

// Modify these methods to add new commands.
// ------------------------------------------------------------------------

157
namespace {
gsell's avatar
gsell committed
158 159

    void makeActions() {
160 161 162
        OpalData *opal = OpalData::getInstance();
        opal->create(new Call());
        opal->create(new Dump());
163 164
        opal->create(new DumpFields());
        opal->create(new DumpEMFields());
165 166 167 168 169 170 171 172 173 174
        opal->create(new Echo());
        opal->create(new Eigen());
        opal->create(new Envelope());
        opal->create(new Help());
        opal->create(new EditCmd());
        opal->create(new List());
        opal->create(new MatchCmd());
        opal->create(new MatrixCmd());
        opal->create(new Micado());
        opal->create(new Option());
175
        opal->create(new OptimizeCmd());
frey_m's avatar
frey_m committed
176
        opal->create(new SampleCmd());
177 178 179 180 181
        opal->create(new Save());
        opal->create(new Select());
        opal->create(new Show());
        opal->create(new Stop());
        opal->create(new Quit());
182
        opal->create(new PSystem());
183 184 185 186 187 188 189 190 191 192
        opal->create(new System());
        opal->create(new ThreadAll());
        opal->create(new ThreadBpm());
        opal->create(new Title());
        opal->create(new TrackCmd());
        opal->create(new Twiss3());
        opal->create(new Aperture());
        opal->create(new MSplit());
        opal->create(new Value());
        opal->create(new What());
gsell's avatar
gsell committed
193 194 195 196
    }


    void makeDefinitions() {
197
        OpalData *opal = OpalData::getInstance();
gsell's avatar
gsell committed
198
        // Must create the value definitions first.
199 200 201 202 203
        opal->create(new BoolConstant());
        opal->create(new RealConstant());
        opal->create(new RealVariable());
        opal->create(new RealVector());
        opal->create(new StringConstant());
gsell's avatar
gsell committed
204

205 206 207 208 209
        opal->create(new AttList());
        opal->create(new Beam());
        opal->create(new FieldSolver());
        opal->create(new BoundaryGeometry());
        opal->create(new OpalWake());
210
        opal->create(new ParticleMatterInteraction());
gsell's avatar
gsell committed
211

212
        opal->create(new OpalFilter());
frey_m's avatar
frey_m committed
213
        opal->create(new OpalTrimCoil());
gsell's avatar
gsell committed
214

215
        opal->create(new Distribution());
gsell's avatar
gsell committed
216

217 218 219 220
        opal->create(new MacroCmd());
        opal->create(new Period());
        opal->create(new Insertion());
        opal->create(new Survey());
221 222 223 224

        opal->create(new DVar());
        opal->create(new Objective());
        opal->create(new Constraint());
kraus's avatar
kraus committed
225

frey_m's avatar
frey_m committed
226
        opal->create(new OpalSample());
gsell's avatar
gsell committed
227 228 229 230
    }


    void makeElements() {
231
        OpalData *opal = OpalData::getInstance();
232
        opal->create(new OpalBeamStripping());
233 234 235 236 237
        opal->create(new OpalCavity());
        opal->create(new OpalCCollimator());
        opal->create(new OpalCyclotron());
        opal->create(new OpalDrift());
        opal->create(new OpalECollimator());
238
        opal->create(new OpalFlexibleCollimator());
239 240 241 242 243 244 245 246
        opal->create(new OpalDegrader());
        opal->create(new OpalHKicker());
        opal->create(new OpalHMonitor());
        opal->create(new OpalInstrument());
        opal->create(new OpalKicker());
        opal->create(new OpalMarker());
        opal->create(new OpalMonitor());
        opal->create(new OpalMultipole());
247 248 249 250
        opal->create(new OpalMultipoleT());
        opal->create(new OpalMultipoleTStraight());
        opal->create(new OpalMultipoleTCurvedConstRadius());
        opal->create(new OpalMultipoleTCurvedVarRadius());
251 252 253 254 255 256 257 258 259 260 261
        opal->create(new OpalOctupole());
        opal->create(new OpalOffset::OpalLocalCartesianOffset());
//        opal->create(new OpalOffset::OpalLocalCylindricalOffset());
//        opal->create(new OpalOffset::OpalGlobalCartesianOffset());
//        opal->create(new OpalOffset::OpalGlobalCylindricalOffset());
        opal->create(new OpalPatch());
        opal->create(new OpalProbe());
        opal->create(new OpalPepperPot());
        opal->create(new OpalPolynomialTimeDependence());
        opal->create(new OpalQuadrupole());
        opal->create(new OpalRBend());
262
        opal->create(new OpalRBend3D());
263 264 265
        opal->create(new OpalRCollimator());
        opal->create(new OpalSBend());
        opal->create(new OpalSBend3D());
ext-rogers_c's avatar
ext-rogers_c committed
266
        opal->create(new OpalScalingFFAMagnet());
267 268 269 270 271
        opal->create(new OpalSeparator());
        opal->create(new OpalSeptum());
        opal->create(new OpalSextupole());
        opal->create(new OpalSlit());
        opal->create(new OpalSolenoid());
272
        opal->create(new OpalSource());
273 274 275
        opal->create(new OpalSRot());
        opal->create(new OpalTravelingWave());
        opal->create(new OpalVariableRFCavity());
276
        opal->create(new OpalVariableRFCavityFringeField());
277
        opal->create(new OpalVerticalFFAMagnet());
278 279
        opal->create(new OpalVKicker());
        opal->create(new OpalVMonitor());
280
        // opal->create(new OpalWire());
281 282 283 284 285 286
        opal->create(new OpalYRot());
        opal->create(new OpalParallelPlate());
        opal->create(new OpalStripper());
        opal->create(new Line());
        opal->create(new Sequence());
        opal->create(new OpalRingDefinition());
gsell's avatar
gsell committed
287
    }
288
};
gsell's avatar
gsell committed
289

290
namespace Configure {
gsell's avatar
gsell committed
291 292 293 294
    void configure() {
        makeDefinitions();
        makeElements();
        makeActions();
295
        Versions::fillChanges();
gsell's avatar
gsell committed
296
    }
297
};