Previous Next        Current Page: NeXtMidas Training / Primitives / Commands executing commands
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   
   + 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   
   - Commands executing commands   
WebStart   
Maps & Imagery   
X-Midas Interoperability   
RMIF & Remoting   
Installing NeXtMidas   
Support & Maintenance   
File Handlers   


  • Primitives calling other primitives or intrinsics
    • There are times when it is helpful to launch another command from within a primitive.
      • One option is using Shell.runCommand(...).
      • An example from plot.java:
          plotCmd = "PLOT/NICE=0/ID="+cutPlotID+"/BG/READOUT=\"+OnAxis\" "+outFile ;
          Shell.runCommand(M, plotCmd);
        
      • Another option, added in 3.9.1, is Shell.execBackgroundCommand(...).
        • The execBackgroundCommand(...) returns the command instance
        • This allows the calling primitive further access to the commands methods/fields
        • The '/BG' is automatically added to allow the command to run in the background
        • An example from plot.java:
            plotPrescaler = (prescaler)Shell.execBackgroundCommand(M,prescalerCmd);
            scaleTable = plotPrescaler.table;
          
      • Intrinsics can also run other intrinsics.
        • An example from Edit.java:
            if (build) Shell.runCommand(M,"BLD,"+name+","+area+","+option);
          

back