Previous Next        Current Page: NeXtMidas Training / Primitives / Lab 1 / Instructions
back
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   
   + Overview   
   + Open, Process, Close   
   + Building   
   + The NeXtMidas API   
   - Lab 1   
      - Instructions   
      - Solution   
   + Special Variables   
   + Lab 2   
   + Lab 3*   
   + Files in a Primitive   
   + Lab 4   
   + Lab 5*   
   + Test Macros   
   + Lab 6   
   + Real Time Controls   
   + Lab 7   
   + Working with Messages   
   + Lab 8   
   + Primitive Restarts   
   + Introduction to DSP   
   + Lab 9   
WebStart   
Maps & Imagery   
X-Midas Interoperability   
RMIF & Remoting   
Installing NeXtMidas   
Support & Maintenance   
File Handlers   


  • Lab 1:
    • Create a new primitive called primlab1.
    • Copy the skeleton of the primitive and paste it into your file.
      • Code skeleton: primlab1.java
      • Be sure to save the above file as primlab1.java (all lower-case)! Put it in the prim area of your option tree.
      • On the first line of the file you will need to change the package to match your option tree.
    • Fill in the missing code:
      • This is a primitive that will count from 1 to 20 and then stop.
        nM> primlab1
        INFO: inside open() [PRIMLAB1]
        INFO: inside process() count = 1 [PRIMLAB1]
        INFO: inside process() count = 2 [PRIMLAB1]
        ...
        INFO: inside process() count = 20 [PRIMLAB1]
        INFO: inside close() [PRIMLAB1]
      • You will need to initialize count.
      • You will need to increment count as appropriate.
      • You will need to add appropriate return statements to open(), process(), and close() so that it will count to 20 and then stop.
    • Use UPDATE to update the command dictionary.
    • Use BUILD or BLD to build the primitive.
    • Once you are done, give it a try. The output should match the example given above.

back