Previous Next        Current Page: NeXtMidas Training / File Handlers / Lab 1 / File Format
Start Here   
Background   
Common Midas Concepts   
Getting Started - Part 1   
Getting Started - Part 2   
Working with Files   
Option Trees   
Macros - Part 1 (Basics)   
Macros - Part 2 (Graphics)   
NetBeans - Part 1 (Setup)   
NetBeans - Part 2 (GUIs)   
NetBeans - Part 3 (Profiler)   
Eclipse - Part 1 (Setup)   
Eclipse - Part 2 (GUIs)   
Primitives   
Applets & WebStart   
Maps & Imagery   
X-Midas Interoperability   
RMIF & Remoting   
Installing NeXtMidas   
Support & Maintenance   
File Handlers   
   + Introduction   
   - Lab 1   
      - File Format   
      - Part 1   
      - Part 1 (ctd.)   
      - Part 1 (ctd.)   
      - Part 2   
      - Part 3   
      - Part 4   
      - Solution   
   + Lab 2   


  • Objective:
    • For this lab you will be creating a file handler for a simple file type. At the end of this lab it will be possible to STATUS the new file type and read/write it.
  • File format:
    • The file format we will be supporting with be the ORANGE file format (.orange). ORANGE files hold linearly-sampled data similar to a Type 1000 BLUE file.
    • ORANGE files have a 24 byte header followed by the data. All data in the file is either ScalarLong (SL) or SclarFloat (SF).
    • The file header containd the following fields:
      Byte OffsetType Name Default Value Description
      0 char[6]Version"ORANGE" File version always "ORANGE".
      7 char[2]Format "SL" Data format ("SL" or "SF").
      8 double XStart 0.0 X-axis start value.
      16 double XDelta 1.0 X-axis delta value.
      Note that char[6] and char[2] reference Strings of length 6 and 2 respectively.
    • The data porition immediately follows the header (i.e. starting at byte offset 24). The data portion extends to the end of the file (unlike a BLUE file there is no "extended header" at the end of the file).
    • All information in the header, and all of the data is stored using little-endian byte order (EEEI). (For those unfamilar with byte ordering, think of it as defining whether you write left-to-right or right-to-left.)
  • continued on next page