Class FileBasedElementMapping
The default element mapping implemented as singleton.
The convention is to name the mapping definition file ModelConfig.modconfig and place it in the same directory as the Open XAL master configuration file main.xal. A entry reference to the mapping definition is made within the main configuration file.
CKA NOTES - Dec 3, 2014
· The class no longer appears to be a singleton. You may create multiple instances using the same or difference mapping definition files.- Since:
- Jan 27, 2014
- Author:
- Ivo List
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Class<? extends IComponent>
class type of the modeling element used whenever there is no map entryprotected Class<? extends IComposite>
class type of the modeling element used whenever there is no map entry for a hardware sequenceprotected Class<? extends IComponent>
class type of the general drift spaces created on demandprotected Class<? extends IComponent>
class type of the RF cavity drift spaced created on demandstatic final String
Model Configuration schemaprotected static ElementMapping
Deprecated.CKA - never usedFields inherited from class xal.sim.scenario.ElementMapping
bolDebug, bolDivMags, bolSubsectionCtrOrigin, elementMap
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Constructor for the singletonFileBasedElementMapping
.FileBasedElementMapping
(ElementMapping elementMapping) -
Method Summary
Modifier and TypeMethodDescriptioncreateDefaultDrift
(String name, double len) Creates a general drift space.createRfCavityDrift
(String name, double len, double freq, double mode) Creates a new drift space within a coupled-cavity RF tank.Class<? extends IComponent>
Returns the modeling element type for a hardware node used whenever no specific (hardware,model) association has been defined.Class<? extends IComposite>
Returns the modeling element type for a hardware sequence used whenever no specific (hardware,model) association has been defined.Class<? extends IComponent>
Class<? extends IComponent>
static ElementMapping
Creates a new element mapping objects from the given definition file and its provided schema.void
void
setDefaultElement
(String stringValue) void
setDefaultSequence
(String strClassType) void
void
setRfCavityDrift
(String strClsName) Methods inherited from class xal.sim.scenario.ElementMapping
getModelElementType, getModelSequenceType, isDebugging, isMagnetDivided, isSubsectionAxisOriginCentered, putMap, removeMap, setDebug, setDivideMagnetFlag
-
Field Details
-
ELEMENT_MAPPING_SCHEMA
Model Configuration schema- See Also:
-
instance
Deprecated.CKA - never usedThe class singleton instance -
clsDefaultElem
class type of the modeling element used whenever there is no map entry -
clsDefaultSeq
class type of the modeling element used whenever there is no map entry for a hardware sequence -
clsDriftElem
class type of the general drift spaces created on demand -
clsRfCavDriftElem
class type of the RF cavity drift spaced created on demand
-
-
Constructor Details
-
FileBasedElementMapping
protected FileBasedElementMapping()Constructor for the singletonFileBasedElementMapping
.- Since:
- Dec 3, 2014
-
FileBasedElementMapping
-
-
Method Details
-
loadFrom
Creates a new element mapping objects from the given definition file and its provided schema. This file should contain a set of (hardware type id, model class type) pairs arranged according to the given schema. It is usually named ModelConfig.modconfig
Current the default element type is set to
and the default sequence type is set toMarker
Sector
- Parameters:
urlModelConfig
- location of the element mapping definition fileschemaUrl
- location of the schema definition file (i.e., xsd file)- Returns:
- a new element mapping object defined according to the given file
- Since:
- Dec 3, 2014
-
saveTo
- Since:
- Feb 25, 2021
-
getDefaultElementType
Returns the modeling element type for a hardware node used whenever no specific (hardware,model) association has been defined.
This value is initialized in global method
.loadFrom(String, String)
- Specified by:
getDefaultElementType
in classElementMapping
- Returns:
- default class type used when none is defined
- Since:
- Dec 5, 2014 @author Christopher K. Allen
- See Also:
-
getDefaultSequenceType
Returns the modeling element type for a hardware sequence used whenever no specific (hardware,model) association has been defined.
This value is initialized in global method
.loadFrom(String, String)
- Specified by:
getDefaultSequenceType
in classElementMapping
- Returns:
- default class type used to model hardware sequences
- Since:
- Dec 5, 2014 @author Christopher K. Allen
- See Also:
-
createDefaultDrift
Creates a general drift space.- Specified by:
createDefaultDrift
in classElementMapping
- Returns:
- drift model element
- Throws:
ModelException
- Since:
- Dec 3, 2014
- See Also:
-
createRfCavityDrift
public IComponent createRfCavityDrift(String name, double len, double freq, double mode) throws ModelException Creates a new drift space within a coupled-cavity RF tank.- Specified by:
createRfCavityDrift
in classElementMapping
- Parameters:
name
- string identifier of the drift spacelen
- length of drift space (meters)freq
- design frequency of the enclosing RF cavitymode
- structure mode coupling the cavities within the tank- Returns:
- a new RF cavity drift space
- Throws:
ModelException
- an exception occurred while constructing the element- Since:
- Dec 3, 2014
- See Also:
-
setDefaultElement
- Throws:
ClassNotFoundException
-
setDefaultSequence
- Throws:
ClassNotFoundException
-
setDrift
- Throws:
ClassNotFoundException
-
getDriftType
- Specified by:
getDriftType
in classElementMapping
-
setRfCavityDrift
- Throws:
ClassNotFoundException
-
getRfCavityDriftType
- Specified by:
getRfCavityDriftType
in classElementMapping
-