Current Page: NeXtMidas User's Guide Files Blue Files FileTypes Type 5000 Files
| #### Type 5000 Type 5000 files contain record-oriented data structures. These more complex structures typically support operations dealing with motion in three-dimensional space, such as orbital state vectors and propagation of electromagnetic energy. In a Type 5000 file one data element is one record, but now the record contains up to 14 contiguous components. Each component is associated with a name and data format, but because they are contiguous no offset is needed. Instead, the component takes on a unit value and a type value, such as spherical, Cartesian, geodetic, etc. In addition, the Type 5000 header can contain quadwords defining the frame of reference for the file. The header of Type 5000 files contains: physical abscissa units physical abscissa starting value physical abscissa increment number of components bytes per record frame of reference and other pertinent quadwords component structure, including format, type, and units #### Classes of Type 5000 Files There are several special classes of Type 5000 files, each with a specific purpose. The class for each is determined by the names of the components in the file.
Class Name | Component Names (Type) | Example
--- | --- | ---
Position | `POS (VD) NAME (1A)` | `cities.prm`
Ellipse | `POS (VD) ELPS (VD) NAME (1A)` | `ellipse5000.prm`
EllipseFlags | `POS (VD) ELPS (VD) NAME (1A) FLAG (8B)` | `ellipseflags5000.prm`
Cone | `POS (VD) POSP (VD) CONE (VD) NAME (1A)` | `cone5000.prm`
ConeFlags | `POS (VD) POSP (VD) CONE (VD) NAME (1A) FLAG (8B)` | `coneflags5000.prm`
The complete set of supported fields are listed below. Note that `ELPS` and `CONE` are mutually exclusive. The `NAME` and `POS` fields are required, the other fields are typically optional (except in the case of the defined file types listed above).
Name | Format | Description
--- | --- | ---
`NAME` | `#A or #Z` | Name of the point. (# is Data Mode)
`NOTE` | `#A or #Z` | Note to accompany point. (# is Data Mode)
`POS` | `VD` | Point position `(ALT,LAT,LON)`.
`POSP` | `VD` | Secondary position for cone `(ALT,LAT,LON)`.
`ELPS` | `VD` | Ellipse Parameters `(semiMaj,semiMin,tilt)`. semiMaj - the length of the semi-major axis in meters semiMin - the length of the semi-minor axis in meters tilt - the tilt of the ellipse (i.e. the orientation of the semi-major axis) in degrees where 0=North, 90=East, etc. Note: this should only have values in the range [0,180] since the ellipse is symmetric across the semi-minor axis
`CONE` | `VD` | Cone parameters `(radius,angle,angle)`.
`CONN` | `SB` | Draw line to previous point (1=draw or 0=no draw).
`HDG` | `SF` | Cardinal heading to use for the symbol (0..360).
`FLAG` | `8B` | Draw flags: `FLAG[0] - Length of the name (in characters). FLAG[1] - Name position. (Not Supported) FLAG[2] - The color (by index). FLAG[3] - Background color. (Not Supported) FLAG[4] - Cone/Ellipse type (0=hidden, -9=visible). FLAG[5] - Invert. (Not Supported) FLAG[6] - X-Midas Symbol ID. FLAG[7] - Symbol size.`
#### Advanced Capabilities for Type 5000 Files Newer capabilities for LayerT5 files have recently been added to NeXtMidas. An example of a LayerT5 instance using these capabilities is provided at the bottom of this section. These new capabilities include:
Name | Format | Description
--- | --- | ---
`COLOR` | `#A or #Z` | Allows users a wider range of colors compared to using the flags (see macro at the bottom for an example) (# is Data Mode) NOTE: This overrides the flags for setting the color.
`ELLIPSOID` | `6D` | Ellipsoids are drawn as a "wire cage" of ellipsoid slices. Slices are made down each axis, which form a set of ellipses. (see macro at the bottom for an example) (# is Data Mode) NOTE: Either ELLIPSOID or ELPSOID can be used.
`METADATA` | `#A or #Z` | Metadata info for each point as a String (usually formatted as a Table). (see macro at the bottom for an example) (# is Data Mode) NOTE: If the metadata provided can't be formatted into a Table, it will default to being a String. Alternate: METADATAFIELDS (see below)
`METADATAFIELDS` | `#A or #Z` | As an alternative to METADATA, LayerT5 supports metadata by providing the names of Type 5000 fields as a piped-separated list. These fields are eventually grouped together into a single Midas Table. (see macro at the bottom for an example) (# is Data Mode) NOTE: When METADATAFIELDS is provided, it applies to every point across the whole layer, and it takes precedence over METADATA.
`SYMBOL` | `#A or #Z` | Symbol or icon associated with point - Users can now provide the name of a NeXtMidas symbol or icon path for each point. (see macro at the bottom for an example) (# is Data Mode)
`TIME` | `SD` | Point time - Users can now specify the time directly for each point. (see macro at the bottom for an example) NOTE: This overrides having to set the start time and time delta as those values can be meaningless.
##### Clustering Users now have the option to display the number of points within certain regions (a.k.a. clusters). This can be applied across a single LayerT5. Zooming in will make the size of each of these regions smaller. Clustering is not supported past a certain zoom level. Please refer to test_plot_layert5_clusters_fixed.mm for an example on how to enable clustering for a single LayerT5. ##### Visibility Filtering Support for displaying tracks of data based on visibility filtering has been added. This means that only the points which pass the visibility filter will be displayed. A NeXtMidas visibility filter is made up of a Map of tests, of which all of the tests need to result in true for the filter to pass. Each test is saved in a NeXtMidas object called PredicateType, as not only the test (a Java Predicate) but also the required incoming data type need to be known. Knowing the type facilitates NeXtMidas converting the data being tested into the right form (ex: String -> Integer or Data object -> Double). ###### Predicates As mentioned above, the functional interfaces that NeXtMidas visibility filters use are Java Predicates. A Predicate is one of the predefined functional interfaces in Java. A Predicate has generic type (T) and one abstract method that takes in a single parameter of type (T) and returns a boolean value. Behind the scenes, the Predicate functional interface looks like this:
    interface Predicate<T> {
      boolean test(T t);
    }
###### NeXtMidas Visibility Filter Example with Predicates NeXtMidas uses its own class called PredicateType, which takes in a Predicate and the Type (T) associated with it. NeXtMidas visibility filters take in a Map of Strings to PredicateTypes. The String is the name of the LayerT5 component being checked, and the value of the component for a LayerT5 point is checked against the Predicate in the corresponding PredicateType. If the point component value passes the Predicate filter, then it will be visible when plotted. An example of setting up and using a NeXtMidas visibility filter in LayerT5 is shown below:
    /* This example defines a NeXtMidas visibility filter where only the points whose NAME starts with "J" are displayed. */

    // Make a Predicate whose test method checks that a given String parameter starts with "J"
    String predExpected = "J";
    String expected = predExpected;
    Predicate startsWith = s -> s.startsWith(expected);

    // Use the created Predicate to make a NeXtMidas PredicateType
    PredicateType startsWithPT = new PredicateType(startsWith, String.class, "Starts with \"J\"");

    // Create a Map for Strings to PredicateTypes

    Map<String,PredicateType> mapPT = new HashMap<>();

    // Associate the LayerT5 component "NAME" to the created PredicateType
    String predKey = "NAME";
    mapPT.put(predKey,startsWithPT);

    /* NOTE: This is an alternative way to add a PredicateType to a PredicateType Map:
             Map<String,PredicateType> mapPT = new HashMap<>();
             PredicateType.addKeyFunction(mapPT,"NAME","STARTS J");
             1. NeXtMidas only supports this with specific comparisons for specific LayerT5 components.
             2. NeXtMidas users will more commonly define their own Predicates, PredicateTypes,
                and PredicateType Maps as shown above.
    */

    // The PredicateType Map defined above will be used as the visibility filter
    layerT5.setVisibilityFilter(mapPT);

    // Get the points matching the visibility filter
    List list = layerT5.getPointsMatchingFilter();

    // Get the percentage of points matching the visibility filter
    list = layerT5.getPercentMatchingFilter();

    // Sets the visibility filter to null
    layerT5.nullVisibilityFilter()
##### Track fading Users can enable color fading on tracks of data. This is when older track points gradually fade out towards the specified fade color, which defaults to dark grey if not provided. The following LayerT5 parameters can be added to adjust track fade settings: ColorFade - Whether or not to enable track fading (true or false) ColorFadeFactor - How fast the fade occurs to the fade color (integer) FadeColor - Final fade color (Can be integer, hex, String, Data, or Color Object) Please refer to the macro at the bottom for an example. ##### SELECT/DESELECT Messages Users now have the ability to tell NeXtMidas to register a MessageHandler which will send out LayerT5 SELECT and DESELECT messages to be received by the user. To do so: Set the Layer's SELECTMESSAGES option to TRUE Please refer to the macro at the bottom for an example. ##### Ctrl-Click Pop-Up Support Users can bring up a popup menu by doing a ctrl-left-click on any point. The selected point is the point closest to the click. LayerDrawable provides a way to point select across grouped LayerT5's (please see the LayerDrawable coordination section below). ##### XYZ Data for 3DGRAPH Users can now plot XYZ data with a 3DGRAPH VIEW, which supports zooming, rotating, panning, and scaling. 3DGRAPH plots provide a grid to be plotted with the XYZ data. VIEW 3DGRAPH are rotated about 0,0,0 (as opposed to VIEW XYZ which rotates about the center of the data. To plot XYZ data for LayerT5, please do the following: Set the Layer's DATATYPE to "XYZ" Set the plot's view to 3DGRAPH Please refer to the macro at the bottom for an example. ##### LayerDrawable Coordination LayerDrawable is used to group Layers and treat them as one layer. This is used a lot with grouping LayerT5's together. Newer capabilities associated with LayerDrawable/LayerT5 coordination include: Clustering Users now have the option to display the number of points within certain regions (a.k.a. clusters). This can be applied across multiple LayerT5's grouped within a single LayerDrawable. Zooming in will make the size of each of these regions smaller. Clustering is not supported past a certain zoom level. Please refer to test_plot_layert5_clusters_drawable.mm for an example on how to enable clustering for a LayerDrawable containing LayerT5's. Point Selection Across multiple LayerT5's and Ctrl-Click Pop-Up Support Users can now bring up a popup menu by doing a ctrl-left-click on any point. The selected point is the point closest to the click. (NOTE: with multiple LayerT5's grouped within a single LayerDrawable, the point selected will be across all LayerT5's. This is because each LayerDrawable treats its grouped LayerT5's as one single layer). The popup menu will display all info associated with the selected point (will only be for one point since using LayerDrawable). Point Count Each LayerDrawable keeps track of the total number of points across all of its grouped LayerT5's. ##### LayerT5 Macro example
    !Macro Example:
    startmacro
      pipe on
        ! CSV Plot with LayerDrawable
        set ellipseColumnNames "D:ALT,D:LAT,D:LON,D:ELLIPSOIDMAJ,D:ELLIPSOIDMAJ,D:ELLIPSOIDMAJ,NAME,D:TIME,B:F1,B:F2,B:F3,B:F4,B:F5,B:F6,B:F7,B:F8,Z:NOTE"
        set ellipseLayerCSV "LT=T5,TimeOrder=TRUE,Group=t5Group,NAME=CSV,SIZE=6,AutoselectEnable=CLICK,AutoSelectMode=PIXEL,SELECTCOLOR=PINK,X=LON,Y=LAT,Z=ALT,LABEL=NAME,TIMELF=TIME,METAPOS=METADATA"
        set qualsEllipseCSV {HEADERROWS=L:1,COLUMNNAMES="^ellipseColumnNames",LAYER={^ellipseLayerCSV},TAG=CSVFILE}
        plot/id=plotCSV/msgid=main world|{LT=Drawable,NAME=t5Group,listLayers=true}|nxm.sys.test.ellipsoid5000.csv^{qualsEllipseCSV} readoutExt=+SHOW|+FEATURE|+POINTS

        ! Table for the Type 5000 Blue file to be generated
        set t:t5000 {}
        set t:t5000.0 {POS=(0,0,0),NAME="String",ELLIPSOID=(1000,10000,100,0,0,0),COLOR="ORANGE",TIME=2.22447013119E9,SYMBOL=Arrow.png,METADATA="Just a String"}
        set t:t5000.1 {POS=(0,20,20),NAME="Table",ELPSOID=(1000,10000,100,0,0,0),COLOR="PINK",TIME=2.22447013121E9,SYMBOL=Aero,METADATA={key="This is a Table"}}

        ! Generate the Type 5000 Blue file
        table t5000 getsize tblSize
        file open/n out ram:t5_tmp.tmp{COMPONENTS=(POS/VD,NAME/2A,ELLIPSOID/6D,COLOR/2A,TIME/SD,SYMBOL/2A,METADATA/9A),SIZE=tblSize}
        foreach idx INTABLE t5000
          invoke ,, out.setData(idx,t5000.^{idx})
        endfor
        file close out
        set layTmp "LT=T5,NAME=t5Tmp,LABEL=NAME,AutoselectEnable=CLICK,AutoSelectMode=PIXEL,SELECTCOLOR=BLUE"
        plot/id=plotTmp/msgid=main world|t5_tmp{Layer=^{layTmp}}

        ! Piped LayerT5 Plots with LayerDrawable
        set layerPipe1 "LT=T5,Group=t5Group2,NAME=test1,ColorFade=TRUE,ColorFadeFactor=1,FadeColor=0x200000,AutoselectEnable=CLICK,AutoSelectMode=PIXEL,SELECTCOLOR=BLUE,SELECTMESSAGES=TRUE,METADATAFIELDS=NAME|NOTE,FILTERDATAFIELDS=ALL"
        set layerPipe2 "LT=T5,Group=t5Group2,NAME=test2,ColorFade=TRUE,ColorFadeFactor=1,FadeColor=0x200000,AutoselectEnable=CLICK,AutoSelectMode=PIXEL,SELECTCOLOR=BLUE,SELECTMESSAGES=TRUE,METADATAFIELDS=NAME|NOTE,FILTERDATAFIELDS=ALL"
        plot/id=plotPipe/msgid=main world|{LT=Drawable,NAME=t5Group2,listLayers=true}|_t5pipe1{Layer={^layerPipe1}}|_t5pipe2{Layer={^layerPipe2}}

        ! Plot LayerT5 with XYZ data
        plot/id=3dgraph _t5Pipe{Layer={LT="T5",DATATYPE="XYZ",AutoselectEnable=CLICK,AutoSelectMode=PIXEL,SELECTCOLOR=BLUE,SELECTMESSAGES=TRUE}} view=3dgraph
      pipe off
    endmacro

    procedure processMessage m:msg
      if msg.name eqs "MAIN" then
        assert/text="^reg.main.name: User indicated tests" msg.data eqss "PASS"
        pipe stop
      elseif msg.name EQS "SELECT" OR msg.name EQS "DESELECT" then
       info "^msg.name MESSAGE"
       say "^msg.name ^msg.data"
      endif
    return