Previous Next        Current Page: NeXtMidas Training / Macros - Part 1 (Basics) / Messages in a Macro / Message Structure
back
Start Here   
Background   
Common Midas Concepts   
Getting Started - Part 1   
Getting Started - Part 2   
Working with Files   
Option Trees   
Macros - Part 1 (Basics)   
   + Macro Basics   
   + Loops and Control Structures   
   + Procedures and Subroutines   
   + Pipes in a Macro   
   - Messages in a Macro   
      - Message Queue   
      - Message Structure   
      - Sending Messages   
      - Receiving Messages   
      - Processing Messages   
      - Lab 1 - Macro Messages   
         - Instructions   
         - Solution   
      - Lab 2 - Macro Messages   
         - Instructions   
         - Solution   
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   
WebStart   
Maps & Imagery   
X-Midas Interoperability   
RMIF & Remoting   
Installing NeXtMidas   
Support & Maintenance   
File Handlers   


  • The structure of a message:
    • All NeXtMidas messages are instances of the Message class.
    • Messages have the following attributes:
      name The name of the message (e.g. "ZOOM").
      info Message information (this is just an integer).
      data The data associated with the message (can be a table).
      fid Identifies the sender ID (e.g. "PLOT")
      from Identifies the sender (Object)
      to Identifies the intended receiver of the message.
      quals (Since 2.7.2) Additional information or object to pass (usually a Table).
      (Note that the info field is included for historical purposes and is rarely used by newer applications.)
    • The data and quals fields can hold any type of Java Object.
      • Tables are by far the most common Java Object.
X-Midas Users Take Note:
In X-Midas all messages are packed into an array of bytes that can be said to be configured (the bytes follow a pre-defined structure) or unconfigured (message comes with a field telling how to interpret the bytes). This is not the case in NeXtMidas. In NeXtMidas all messages have a fixed set of fields (see above) in addition to a "free-form" data field that can hold any Java Object.
Note:
Certain message names are reserved and have special uses. These names should be avoided when composing messages. Also, since command id's become the message name when interacting with the macro, users should not assign any commands an id with one of these reserved names:
   EXIT
   ERROR
   EXEC
   MACRO

back