Firmware for Arduino | PLEN Project Company Inc.
PLEN2::Interpreter Class Reference

Management class of interpreter. More...

#include <Interpreter.h>

Classes

struct  Code
 Code struct. More...
 

Public Types

enum  { QUEUE_SIZE = 32 }
 Size of code queue. More...
 

Public Member Functions

 Interpreter (MotionController &motion_ctrl)
 Constructor. More...
 
bool pushCode (const Code &code)
 Reserve to run a code. More...
 
bool popCode ()
 Run a code in heading of the queue. More...
 
bool ready ()
 Decide if there are codes which are reserved to run. More...
 
void reset ()
 Reset the interpreter. More...
 

Detailed Description

Management class of interpreter.

Attention
The class gives private members (of a motion controller) an effect, so you might get an unexpected result when running the methods, with a complex sequence structure.

Member Enumeration Documentation

anonymous enum

Size of code queue.

Attention
It should be defined as 2^N length for processing the class with high speed.
Enumerator
QUEUE_SIZE 

Constructor & Destructor Documentation

PLEN2::Interpreter::Interpreter ( MotionController motion_ctrl)

Constructor.

Parameters
[in,out]motion_ctrlInstance of a motion controller.

Member Function Documentation

bool PLEN2::Interpreter::popCode ( )

Run a code in heading of the queue.

Returns
Result
Return values
trueSucceeded to pop a code from the queue. (However, running a code might not be successful.)
falseThe queue is empty.
Attention
The order of internal processing is "play a motion.", "Rewrite the header.", so you might get an unexpected result when running the method along with playing a motion.
bool PLEN2::Interpreter::pushCode ( const Code code)

Reserve to run a code.

Parameters
[in]codeInstance of a code.
Returns
Result
Return values
trueSucceeded to push a code to the queue.
falseThe queue is overflowed.
bool PLEN2::Interpreter::ready ( )

Decide if there are codes which are reserved to run.

Returns
Result
void PLEN2::Interpreter::reset ( )

Reset the interpreter.


The documentation for this class was generated from the following file: