Class TfsResultRequestImpl

  • All Implemented Interfaces:
    TfsResultRequest

    public class TfsResultRequestImpl
    extends java.lang.Object
    implements TfsResultRequest
    this class provides a way to define, what results one wants to get back from a MadX twiss - Task.
    • Constructor Detail

      • TfsResultRequestImpl

        public TfsResultRequestImpl()
    • Method Detail

      • addElementFilter

        public void addElementFilter​(java.lang.String filter)
        adds an filter (element name or wildcard) to requested elements.
        Parameters:
        filter - the element name / wildcard
      • addElementFilters

        public void addElementFilters​(java.util.Collection<java.lang.String> filters)
        adds more filters (element names or wildcards) to the requested elements.
        Parameters:
        filters - the names wildcards to add
      • addElementType

        public void addElementType​(MadxElementType madxElementType)
        adds an MadxElementType to the filters. This represents an element-class in madx
        Parameters:
        madxElementType - the element type to add to the filters
      • addElementTypes

        public void addElementTypes​(java.util.Collection<MadxElementType> madxElementTypes)
        adds more than one class filters to the request.
        Parameters:
        madxElementTypes - the MadX element types for which to request results
      • addVariable

        public void addVariable​(TwissVariable resultVariable)
        adds a variable to the list of requested variables.
        Parameters:
        resultVariable - the variable to add
      • addVariables

        public void addVariables​(java.util.List<? extends TwissVariable> variables)
        adds more variables to the Request
        Parameters:
        variables - the variables to add
      • getElementPattern

        public java.util.List<java.lang.String> getElementPattern()
        Specified by:
        getElementPattern in interface TfsResultRequest
        Returns:
        the requested element-filters.
      • getElementClasses

        public java.util.List<java.lang.String> getElementClasses()
        Specified by:
        getElementClasses in interface TfsResultRequest
        Returns:
        the requested element-classes
      • createSummaryOnlyRequest

        public static final TfsResultRequest createSummaryOnlyRequest()
        This is a static factory method for a special result request for an empty table. When this request is used for a twiss, then only the summary is returned.

        It works like this: Since madx does not know the class UNKNOWN and also not the column UNKNOWN it creates a twiss file, with only the summary table. This is useful in some cases.

        This is not very nice. Maybe there is a better way to do this?

        Returns:
        a TfsResultRequestImpl which is ready to be used for twissing, resulting in the summary table only.
      • createDefaultRequest

        public static final TfsResultRequestImpl createDefaultRequest()
        This is a static factory method for a default result request. Only Name is already appended to the list of requested variables. This way it is ensured, that the TfsResult provides access via element names. The user only needs to append the elementFilters and additional variables required.
        Returns:
        a TfsResultRequestImpl which is prepared to enable access of values via element name.
      • needsPtcTwiss

        public boolean needsPtcTwiss()
        Specified by:
        needsPtcTwiss in interface TfsResultRequest
        Returns:
        true, if it is required to run a ptc-twiss to get the variables