Changeset View
Changeset View
Standalone View
Standalone View
src/backends/octave/octavesession.h
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 41 | public: | |||
---|---|---|---|---|---|
43 | ~OctaveSession() override = default; | 43 | ~OctaveSession() override = default; | ||
44 | void interrupt() override; | 44 | void interrupt() override; | ||
45 | Cantor::Expression* evaluateExpression(const QString& command, Cantor::Expression::FinishingBehavior finishingBehavior = Cantor::Expression::FinishingBehavior::DoNotDelete, bool internal = false) override; | 45 | Cantor::Expression* evaluateExpression(const QString& command, Cantor::Expression::FinishingBehavior finishingBehavior = Cantor::Expression::FinishingBehavior::DoNotDelete, bool internal = false) override; | ||
46 | void logout() override; | 46 | void logout() override; | ||
47 | void login() override; | 47 | void login() override; | ||
48 | Cantor::CompletionObject* completionFor(const QString& cmd, int index=-1) override; | 48 | Cantor::CompletionObject* completionFor(const QString& cmd, int index=-1) override; | ||
49 | Cantor::SyntaxHelpObject* syntaxHelpFor(const QString& cmd) override; | 49 | Cantor::SyntaxHelpObject* syntaxHelpFor(const QString& cmd) override; | ||
50 | QSyntaxHighlighter* syntaxHighlighter(QObject* parent) override; | 50 | QSyntaxHighlighter* syntaxHighlighter(QObject* parent) override; | ||
51 | QAbstractItemModel* variableModel() override; | | |||
52 | void runFirstExpression() override; | 51 | void runFirstExpression() override; | ||
53 | 52 | | |||
54 | Q_SIGNALS: | | |||
55 | void variablesChanged(); | | |||
56 | | ||||
57 | private: | 53 | private: | ||
58 | const static QRegExp PROMPT_UNCHANGEABLE_COMMAND; | 54 | const static QRegExp PROMPT_UNCHANGEABLE_COMMAND; | ||
59 | 55 | | |||
60 | private: | 56 | private: | ||
61 | KProcess* m_process; | 57 | KProcess* m_process; | ||
62 | QTextStream m_stream; | 58 | QTextStream m_stream; | ||
63 | QRegExp m_prompt; | 59 | QRegExp m_prompt; | ||
64 | QRegExp m_subprompt; | 60 | QRegExp m_subprompt; | ||
65 | int m_previousPromptNumber; | 61 | int m_previousPromptNumber; | ||
66 | 62 | | |||
67 | KDirWatch* m_watch; | 63 | KDirWatch* m_watch; | ||
68 | QString m_tempDir; | 64 | QString m_tempDir; | ||
69 | bool m_syntaxError; | 65 | bool m_syntaxError; | ||
70 | 66 | | |||
71 | QString m_output; | 67 | QString m_output; | ||
72 | 68 | | |||
73 | Cantor::DefaultVariableModel* m_variableModel; | | |||
74 | | ||||
75 | private: | 69 | private: | ||
76 | void readFromOctave(QByteArray data); | 70 | void readFromOctave(QByteArray data); | ||
77 | bool isDoNothingCommand(const QString& command); | 71 | bool isDoNothingCommand(const QString& command); | ||
78 | bool isSpecialOctaveCommand(const QString& command); | 72 | bool isSpecialOctaveCommand(const QString& command); | ||
79 | 73 | | |||
80 | private Q_SLOTS: | 74 | private Q_SLOTS: | ||
81 | void readOutput(); | 75 | void readOutput(); | ||
82 | void readError(); | 76 | void readError(); | ||
83 | void currentExpressionStatusChanged(Cantor::Expression::Status status); | 77 | void currentExpressionStatusChanged(Cantor::Expression::Status status); | ||
84 | void processError(); | 78 | void processError(); | ||
85 | void plotFileChanged(const QString& filename); | 79 | void plotFileChanged(const QString& filename); | ||
86 | void runSpecificCommands(); | 80 | void runSpecificCommands(); | ||
87 | }; | 81 | }; | ||
88 | 82 | | |||
89 | #endif // OCTAVESESSION_H | 83 | #endif // OCTAVESESSION_H |