26#ifndef TROUBLESHOOTINGRUNNER_H
27#define TROUBLESHOOTINGRUNNER_H
31#include <wx/process.h>
113 std::function<
void ()> onFinished = {});
127 bool IsFinished()
const {
return m_stage == Stage::finished; }
130 static const std::set<wxm::TroubleshootingCheck> &
Checks();
135 friend class Process;
152 const wxString &details,
const wxString &hint = wxEmptyString);
154 void SkipRemainingMaximaChecks(
const wxString &reason);
160 void ProcessEnded(Process *process,
int status);
170 void SendQuestions();
172 void EvaluateAnswers(
bool timedOut);
178 void StartGnuplot(
const wxString &terminal);
182 wxString FindGnuplot();
184 void EnterStage(Stage stage);
186 long StageAge()
const;
188 wxString MaximaOutputTail()
const;
190 void SendToMaxima(
const wxString &text);
193 ResultCallback m_onResult;
194 std::function<void ()> m_onFinished;
196 std::set<wxm::TroubleshootingCheck> m_reported;
197 Stage m_stage = Stage::notStarted;
199 wxLongLong m_stageStart;
203 std::unique_ptr<wxSocketServer> m_server;
207 std::unique_ptr<wxSocketBase> m_socket;
211 wxString m_fromMaxima;
213 std::string m_undecoded;
215 std::string m_toMaxima;
217 bool m_gotPrompt =
false;
219 bool m_authenticated =
false;
222 Process *m_maxima =
nullptr;
223 long m_maximaPid = 0;
224 bool m_maximaEnded =
false;
225 int m_maximaExitCode = 0;
227 bool m_killedMaxima =
false;
229 wxString m_maximaConsole;
232 Process *m_gnuplot =
nullptr;
233 bool m_gnuplotEnded =
false;
234 int m_gnuplotExitCode = 0;
235 wxString m_gnuplotErrors;
236 wxString m_gnuplotTerminal;
237 wxString m_gnuplotScript;
238 wxString m_gnuplotOutput;
240 wxString m_gnuplotBinary;
244 wxString m_gnuplotFromMaxima;
The checks the troubleshooting dialog runs (GH #2559), their results, and the pure helpers that inter...
TroubleshootingCheck
One thing the troubleshooting dialog checks. The order is the display order.
Definition: TroubleshootingChecks.h:42
TroubleshootingStatus
What a check found.
Definition: TroubleshootingChecks.h:71
Runs the troubleshooting checks that need a Maxima or a gnuplot process.
Definition: TroubleshootingRunner.h:69
~TroubleshootingRunner() override
Stops Maxima and gnuplot if they still run.
Definition: TroubleshootingRunner.cpp:184
static const std::set< wxm::TroubleshootingCheck > & Checks()
The checks this runner runs, and only these.
Definition: TroubleshootingRunner.cpp:163
void Start()
Starts the checks; from now on a timer calls Poll()
Definition: TroubleshootingRunner.cpp:210
void Poll()
Does whatever can be done now, without waiting.
Definition: TroubleshootingRunner.cpp:394
bool IsFinished() const
True once every check this runner runs has been reported.
Definition: TroubleshootingRunner.h:127
What the runner needs to know to start Maxima and gnuplot.
Definition: TroubleshootingRunner.h:72
wxString setupCheckFunction
A Lisp function wxMathML.lisp defines near its end.
Definition: TroubleshootingRunner.h:89
long stopTimeoutMs
How long a killed Maxima may take to end.
Definition: TroubleshootingRunner.h:105
long connectTimeoutMs
How long Maxima may take to connect to us.
Definition: TroubleshootingRunner.h:97
wxEnvVariableHashMap environment
The environment Maxima is started with, minus MAXIMA_AUTH_CODE.
Definition: TroubleshootingRunner.h:80
wxString setupCommand
What wxMaxima sends Maxima once it is connected: wxMathML.lisp.
Definition: TroubleshootingRunner.h:82
wxString maximaConfigured
The Maxima program as configured, before it was looked for.
Definition: TroubleshootingRunner.h:76
wxString maximaExecutable
The Maxima program, resolved to a path, as MaximaProcessManager would run it.
Definition: TroubleshootingRunner.h:74
wxString maximaCommand
The whole command line Maxima is started with, minus the "-s <port>".
Definition: TroubleshootingRunner.h:78
long queryTimeoutMs
How long Maxima may take to answer all questions, loading draw included.
Definition: TroubleshootingRunner.h:103
wxString gnuplotCommand
The gnuplot the worksheet's Maxima session found.
Definition: TroubleshootingRunner.h:95
long setupTimeoutMs
How long Maxima may take to load wxMathML.lisp and authenticate.
Definition: TroubleshootingRunner.h:101
long promptTimeoutMs
How long Maxima may take from connecting to its first prompt.
Definition: TroubleshootingRunner.h:99
long gnuplotTimeoutMs
How long gnuplot may take to draw one plot.
Definition: TroubleshootingRunner.h:107
The result of one check.
Definition: TroubleshootingChecks.h:95