wxMaxima
Loading...
Searching...
No Matches
Public Member Functions
MaximaEvaluator Class Reference

The evaluation-queue driver / command protocol extracted from wxMaxima. More...

#include <MaximaEvaluator.h>

Public Member Functions

 MaximaEvaluator (wxMaxima &wxm)
 
void SendMaxima (wxString s, bool addToHistory=false, bool background=false)
 Sends a string to the Maxima process (optionally adding it to the history and/or marking it a background command that must not change the busy state).
 
void FirstOutput ()
 Prepares the worksheet once Maxima's first prompt has been seen.
 
bool AbortOnError ()
 Reacts to a Maxima error: decides whether to keep evaluating the queue.
 
bool QueryVariableValue ()
 Queries the value of the next variable wxMaxima wants to know about.
 
void EvaluateEvent (wxCommandEvent &event)
 The "evaluate" menu/hotkey handler: queues the active/selected cells and starts evaluation (or sends an answer to a pending question).
 
void TriggerEvaluation ()
 If Maxima is idle and the queue is non-empty, sends the next command; otherwise settles the UI into its idle state. The core queue pump.
 
void SetupVariables ()
 Sends Maxima the one-time startup configuration.
 
void StartCommand (long start)
 Remembers where in its cell the command that is being sent starts.
 
void AddCommandOutput (const wxString &text)
 Collects what Maxima printed in reply to the current command.
 
void MarkErrorStatement (GroupCell *cell)
 Marks the statement the current command came from as the one that caused an error, in the cell cell (GH #289).
 
void MarkSyntaxErrorSpot ()
 If Maxima reported a syntax error for the current command, marks where in its statement it is, and puts the cursor there.
 

Detailed Description

The evaluation-queue driver / command protocol extracted from wxMaxima.

Owned by value by the wxMaxima frame. Holds a reference back to that frame for the services it needs (the worksheet, the socket, the status bar).

Member Function Documentation

◆ AbortOnError()

bool MaximaEvaluator::AbortOnError ( )

Reacts to a Maxima error: decides whether to keep evaluating the queue.

Returns
true if the evaluation queue was cleared (do not send more).

◆ AddCommandOutput()

void MaximaEvaluator::AddCommandOutput ( const wxString &  text)

Collects what Maxima printed in reply to the current command.

Only plain text (the kind an error message is) is collected: a syntax error report can arrive in several pieces, and only all of it together tells where the error is.

◆ MarkErrorStatement()

void MaximaEvaluator::MarkErrorStatement ( GroupCell *  cell)

Marks the statement the current command came from as the one that caused an error, in the cell cell (GH #289).

Does nothing if the cell isn't the one that is being evaluated: an error can also arrive when nothing is, and there is no statement to blame then. Marks the statement only once per command, however many pieces the error message arrives in. If the error is a syntax error, also marks where in the statement it is, as soon as Maxima's output tells.

◆ MarkSyntaxErrorSpot()

void MaximaEvaluator::MarkSyntaxErrorSpot ( )

If Maxima reported a syntax error for the current command, marks where in its statement it is, and puts the cursor there.

Called whenever more of Maxima's output arrived, as the part that tells where the error is may come after the part that tells that there is one.

◆ QueryVariableValue()

bool MaximaEvaluator::QueryVariableValue ( )

Queries the value of the next variable wxMaxima wants to know about.

Returns
true if a query was sent.

◆ SendMaxima()

void MaximaEvaluator::SendMaxima ( wxString  s,
bool  addToHistory = false,
bool  background = false 
)

Sends a string to the Maxima process (optionally adding it to the history and/or marking it a background command that must not change the busy state).

Check for function/variable definitions

Create a template from the input

◆ SetupVariables()

void MaximaEvaluator::SetupVariables ( )

Sends Maxima the one-time startup configuration.

Runs once when Maxima connects: loads wxmathml.lisp and sets the option variables (help format, prompts, gnuplot binary, version handshake).

◆ StartCommand()

void MaximaEvaluator::StartCommand ( long  start)

Remembers where in its cell the command that is being sent starts.

Also forgets everything about the previous command's output. The end of the command is wxMaxima::m_commandIndex.


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