PIPE

From ICE Enterprises
Jump to navigation Jump to search

Changes the macro piping mode

<FUNC> - Pipe mode (ON|INIT|RUN|PAUSE|WAIT|WAITFOR|STOP|OFF)
<P1>   - Only for FUNC=WAITFOR, name of command to wait for

PIPE is an intrinsic for setting the pipe mode within a macro.

  Mode = INIT - Begin piped section parsing
         ON   - Same as INIT (X-Midas syntax)
         RUN  - End piped section parsing and start data flow
         WAIT - Wait here in macro until control STOPs piped mode
         WAITFOR - Wait here in macro until named primitive <P1> exits
         OFF  - Same as RUN and WAIT (X-Midas syntax)
         PAUSE - stop dataflow of pipe section for debug, continue with RUN
         STOP - Stop piped mode and continue macro execution after piped section

When PIPE ON|INIT occurs in a macro, the ensuing statements up to the  next PIPE
RUN|WAIT are treated as a piped section.  Pipeable commands  (not Intrinsics) in
this section are run concurrently in separate threads. Primitives may pipe data,
pass messages, set or get properties, etc.  GUI interaction is usually
coordinated by the macro language.

The PIPE STOP command should be executed from the macro's message handler
procedure to exit the piped mode.  If their are no message handlers or GUI
controls, the WAITFOR function can be used to exit the piped mode automatically
when the data flow completes.

Each piped primitive will have an entry (/ID=name) in the registry table. If no
/ID=name switch is present, it will equal the primitive name.  If more than one
instance of the primitive appears in the macro, and _# instance  number will be
appended.

Real-time controls are implemented using the public setXXX and getXXX methods in
each primitive.  The KeyObject class allows these methods to be accessed from
the macro language.  For example:

  set reg.waveform.shape "SQUARE"
  set reg.waveform.freq 3*1e6

These properties can be read by simply using them as any other results
parameter.

  say "The new amplitude is ^reg.waveform.amp "

Graphical setup in NeXtMidas macros are usually handled by the PANEL primitive.
See EXPLAIN PANEL for details.  There may be any number of panels in a macro.

Examples:

Switches:
  /PANEL        - Runs the standard PANEL primitive for graphical macros. This
                  is the same as including a PANEL/MSGID=MAIN/SETUP command as
                  the next statement in the macro.  This mimics the X-Midas
                  XPIPE function.
  /CONTROLS=res - If /PANEL has been specified, then this switch is passed on to
                  the panel primitive to name the table of controls.
                  (See EXPLAIN PANEL).
  /SETUP=opt    - If /PANEL has been specified, then this switch is passed on to
                  the panel primitive to specify the setup file.
                  (See EXPLAIN PANEL).