├── pics
├── main-view.png
├── qml-example.png
├── real-time.gif
└── qml-real-time.gif
├── Anvedi
├── anvedi.qrc
├── qml-lib
│ ├── RegisterAll.h
│ ├── qmlLegend.cpp
│ ├── qmlLegend.h
│ ├── qmlLabel.cpp
│ ├── qmlPen.h
│ ├── qmlPen.cpp
│ ├── qmlLabel.h
│ ├── qmlAxis.cpp
│ ├── qmlAxis.h
│ ├── qmlTick.h
│ ├── qmlScatterStyle.h
│ ├── qmlScatterStyle.cpp
│ ├── RegisterAll.cpp
│ ├── qmlGraph.cpp
│ ├── qmlTick.cpp
│ ├── qmlGraph.h
│ ├── qmlPlotPaintedItem.h
│ ├── README.md
│ └── qmlPlotPaintedItem.cpp
├── ScriptManager.h
├── RTUtils.h
├── SignalInfoPresenter.h
├── Signal.cpp
├── WorkspaceSerializer.h
├── RTSocketPlayer.h
├── RTInteractiveSender.h
├── Anvedi.pro
├── RTInteractiveFileSender.h
├── RectZoomer.h
├── Signal.h
├── RTInteractiveFileSender.cpp
├── RTSender.h
├── RTUtils.cpp
├── Utils.h
├── PlotHandle.h
├── PlotInfo.h
├── RealTimePresenter.h
├── PlotCursor.h
├── Anvedi.vcxproj.user
├── anvedi.h
├── Utils.cpp
├── RealTimePlayer.h
├── SignalListPresenter.h
├── RTSender.cpp
├── SignalHandle.h
├── PlotHandle.cpp
├── RTInteractiveSender.cpp
├── Anvedi.pri
├── PlotInfo.cpp
├── RealTimePlayer.cpp
├── GraphPresenter.h
├── qml
│ └── main.qml
├── SignalInfoPresenter.cpp
├── SignalHandle.cpp
├── SignalData.h
├── RTSocketPlayer.cpp
├── RealTimePresenter.cpp
├── PlotCursor.cpp
├── anvedi.cpp
├── signalInfo.ui
├── rtConfig.ui
├── ScriptManager.cpp
├── RectZoomer.cpp
└── WorkspaceSerializer.cpp
├── AnvediCheExe
├── mario.jpg
├── AnvediCheExe.pri
├── AnvediCheExe.vcxproj.filters
├── main.cpp
├── AnvediCheExe.vcxproj.user
├── AnvediCheExe.pro
└── anvedicheexe.ui
├── AnvediCheTests
├── anvedichetests.qrc
├── main.cpp
├── WorkspaceSerializerTests.h
├── GraphPresenterTests.h
├── AnvediCheTests.pri
├── AnvediCheTests.pro
├── PerformanceTests.h
├── SignalDataTests.h
├── test-data
│ └── cubic.json
├── SignalListPresenterTests.h
├── TestRunner.h
├── WorkspaceSerializerTests.cpp
├── TestRunner.cpp
├── PerformanceTests.cpp
├── SignalListPresenterTests.cpp
├── GraphPresenterTests.cpp
├── AnvediCheTests.vcxproj.filters
└── SignalDataTests.cpp
├── QShell
├── ClearConsole.cpp
├── qshell_global.h
├── QShellEngineResult.h
├── DefaultKeyHandler.h
├── KeyPressHandler.h
├── DefaultKeyHandler.cpp
├── MiscKeyHandler.h
├── QShellEngineResult_qt.h
├── resource.h
├── HistoryKeyHandler.h
├── QShellContextMenuBuilder.h
├── QShellScriptUtilis.h
├── QShellEngineResult_qt.cpp
├── ClearConsole.h
├── QShellEngine.h
├── QShellCompleter.h
├── QShell.vcxproj.user
├── QShell.pro
├── ScriptEvaluatorKeyHandler.h
├── KeyHandlersManager.h
├── HistoryKeyHandler.cpp
├── QShellEngine_Qt.h
├── Forms
│ └── ShellWidget.ui
├── CompleterKeyHandler.h
├── QShellUtils.h
├── QShellSyntaxHighlighter.h
├── CommandProvider.h
├── QShellContextMenuBuilder.cpp
├── QShellCompleter.cpp
├── qshell.h
├── HistoryRecorder.h
├── ScriptEvaluatorKeyHandler.cpp
├── README.md
├── QShell.pri
├── QShellScriptUtilis.cpp
├── qshell.cpp
├── QShellEngine_Qt.cpp
├── QShellUtils.cpp
├── KeyHandlersManager.cpp
├── QShellSyntaxHighlighter.cpp
├── CommandProvider.cpp
├── MiscKeyHandler.cpp
└── CompleterKeyHandler.cpp
├── AnvediCheQml
├── main.cpp
└── AnvediCheQml.vcxproj.filters
├── Anvedi.pro
├── .gitignore
├── HelloQCustomPlot
├── main.cpp
└── HelloQCustomPlot.vcxproj.filters
├── README.md
└── Anvedi.sln
/pics/main-view.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ilpropheta/anvedi/HEAD/pics/main-view.png
--------------------------------------------------------------------------------
/pics/qml-example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ilpropheta/anvedi/HEAD/pics/qml-example.png
--------------------------------------------------------------------------------
/pics/real-time.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ilpropheta/anvedi/HEAD/pics/real-time.gif
--------------------------------------------------------------------------------
/Anvedi/anvedi.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/AnvediCheExe/mario.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ilpropheta/anvedi/HEAD/AnvediCheExe/mario.jpg
--------------------------------------------------------------------------------
/pics/qml-real-time.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ilpropheta/anvedi/HEAD/pics/qml-real-time.gif
--------------------------------------------------------------------------------
/Anvedi/qml-lib/RegisterAll.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | struct QmlModulesInstaller
4 | {
5 | static void Install();
6 | };
--------------------------------------------------------------------------------
/AnvediCheTests/anvedichetests.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | test-data/cubic.json
4 |
5 |
6 |
--------------------------------------------------------------------------------
/QShell/ClearConsole.cpp:
--------------------------------------------------------------------------------
1 | #include "ClearConsole.h"
2 |
3 | QString ClearConsole::toString()
4 | {
5 | emit ClcCalled(); // -> will be received to clear the console
6 | return QString();
7 | }
8 |
9 |
--------------------------------------------------------------------------------
/AnvediCheTests/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include "TestRunner.h"
3 |
4 | int main(int argc, char *argv[])
5 | {
6 | QApplication a(argc, argv);
7 | return RUN_ALL_TESTS_COLOR(argc, argv);
8 | }
9 |
--------------------------------------------------------------------------------
/Anvedi/ScriptManager.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class SignalData;
4 | class QShell;
5 | class PlotInfo;
6 |
7 | class ScriptManager
8 | {
9 | public:
10 | static void InitWorkspace(SignalData& data, PlotInfo& plot, QShell& shell);
11 | };
12 |
13 |
--------------------------------------------------------------------------------
/Anvedi/RTUtils.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 | #include
5 |
6 | class SignalData;
7 |
8 | using DataToReplay = std::vector>>;
9 |
10 | DataToReplay PrepareReplay(const QString& file, SignalData& data);
--------------------------------------------------------------------------------
/QShell/qshell_global.h:
--------------------------------------------------------------------------------
1 | #ifndef QSHELL_GLOBAL_H
2 | #define QSHELL_GLOBAL_H
3 |
4 | #include
5 |
6 | #ifdef QSHELL_LIB
7 | # define QSHELL_EXPORT Q_DECL_EXPORT
8 | #else
9 | # define QSHELL_EXPORT Q_DECL_IMPORT
10 | #endif
11 |
12 | #endif // QSHELL_GLOBAL_H
13 |
--------------------------------------------------------------------------------
/QShell/QShellEngineResult.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class QString;
4 |
5 | class QShellEngineResult
6 | {
7 | public:
8 | virtual ~QShellEngineResult() = default;
9 | virtual QString ToQString() const = 0;
10 | virtual bool IsPrintable() const = 0;
11 | virtual bool IsError() const = 0;
12 | };
13 |
14 |
--------------------------------------------------------------------------------
/QShell/DefaultKeyHandler.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "KeyPressHandler.h"
3 |
4 | class DefaultKeyHandler : public IKeyPressHandler
5 | {
6 | Q_OBJECT
7 | public:
8 | virtual bool onKeyPressed( QShell& shell, QKeyEvent* e );
9 | signals:
10 | void UnknownKeyProcessed(QShell&, QKeyEvent*);
11 | };
12 |
13 |
--------------------------------------------------------------------------------
/QShell/KeyPressHandler.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "qobjectdefs.h"
3 | #include "qobject.h"
4 |
5 | class QKeyEvent;
6 | class QShell;
7 |
8 | class IKeyPressHandler : public QObject
9 | {
10 | Q_OBJECT
11 | public:
12 | ~IKeyPressHandler() {}
13 | virtual bool onKeyPressed(QShell& shell, QKeyEvent* e) = 0;
14 | };
--------------------------------------------------------------------------------
/Anvedi/qml-lib/qmlLegend.cpp:
--------------------------------------------------------------------------------
1 | #include "qmlLegend.h"
2 |
3 | QString qmlLegend::getFontString() const
4 | {
5 | return font.toString();
6 | }
7 |
8 | void qmlLegend::setFontString(const QString& f)
9 | {
10 | font.fromString(f);
11 | }
12 |
13 | const QFont& qmlLegend::getFont() const
14 | {
15 | return font;
16 | }
17 |
--------------------------------------------------------------------------------
/QShell/DefaultKeyHandler.cpp:
--------------------------------------------------------------------------------
1 | #include "DefaultKeyHandler.h"
2 | #include "QShellUtils.h"
3 | #include "qtextcursor.h"
4 | #include "qshell.h"
5 |
6 | bool DefaultKeyHandler::onKeyPressed( QShell& shell, QKeyEvent* e )
7 | {
8 | MoveCursorAtEndIfBadPosition(shell);
9 | shell.processKeyEvent(e);
10 | emit UnknownKeyProcessed(shell, e);
11 | return true;
12 | }
13 |
--------------------------------------------------------------------------------
/QShell/MiscKeyHandler.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "KeyPressHandler.h"
3 |
4 | class MiscKeyHandler : public IKeyPressHandler
5 | {
6 | public:
7 | virtual bool onKeyPressed( QShell& shell, QKeyEvent* e );
8 | };
9 |
10 | class CursorDependantKeyHandler : public IKeyPressHandler
11 | {
12 | public:
13 | virtual bool onKeyPressed( QShell& shell, QKeyEvent* e );
14 | };
--------------------------------------------------------------------------------
/Anvedi/qml-lib/qmlLegend.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include "qcustomplot.h"
4 |
5 | class qmlLegend : public QObject
6 | {
7 | Q_OBJECT
8 | Q_PROPERTY(QString font READ getFontString WRITE setFontString)
9 | public:
10 | QString getFontString() const;
11 | void setFontString(const QString& f);
12 |
13 | const QFont& getFont() const;
14 | private:
15 | QFont font;
16 | };
--------------------------------------------------------------------------------
/QShell/QShellEngineResult_qt.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "qscriptvalue.h"
3 | #include "QShellEngineResult.h"
4 |
5 | class QString;
6 |
7 | class QShellEngineResult_Qt : public QShellEngineResult
8 | {
9 | public:
10 | QShellEngineResult_Qt(QScriptValue value);
11 | QString ToQString() const ;
12 | bool IsPrintable() const ;
13 | bool IsError() const ;
14 |
15 | QScriptValue m_value;
16 | };
--------------------------------------------------------------------------------
/Anvedi/SignalInfoPresenter.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include "ui_signalInfo.h"
4 |
5 | class SignalData;
6 |
7 | class SignalInfoPresenter : public QObject
8 | {
9 | Q_OBJECT
10 | public:
11 | SignalInfoPresenter(SignalData& data);
12 | void Config(const QString& signalName);
13 | private:
14 | Ui::SignalInfoDlg ui;
15 | QDialog configDialog;
16 | SignalData& data;
17 | };
18 |
19 |
--------------------------------------------------------------------------------
/AnvediCheExe/AnvediCheExe.pri:
--------------------------------------------------------------------------------
1 | # ----------------------------------------------------
2 | # This file is generated by the Qt Visual Studio Add-in.
3 | # ------------------------------------------------------
4 |
5 | # This is a reminder that you are using a generated .pro file.
6 | # Remove it when you are finished editing this file.
7 | message("You are running qmake on a generated .pro file. This may not work!")
8 |
9 |
10 | SOURCES += ./main.cpp
11 |
--------------------------------------------------------------------------------
/QShell/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by QShell.rc
4 |
5 | // Next default values for new objects
6 | //
7 | #ifdef APSTUDIO_INVOKED
8 | #ifndef APSTUDIO_READONLY_SYMBOLS
9 | #define _APS_NEXT_RESOURCE_VALUE 101
10 | #define _APS_NEXT_COMMAND_VALUE 40001
11 | #define _APS_NEXT_CONTROL_VALUE 1001
12 | #define _APS_NEXT_SYMED_VALUE 101
13 | #endif
14 | #endif
15 |
--------------------------------------------------------------------------------
/QShell/HistoryKeyHandler.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "KeyPressHandler.h"
3 | #include "HistoryRecorder.h"
4 | #include "qshell.h"
5 |
6 | class QShellEngineResult;
7 |
8 | class HistoryKeyHandler : public IKeyPressHandler
9 | {
10 | Q_OBJECT
11 | public:
12 | virtual bool onKeyPressed( QShell& shell, QKeyEvent* e );
13 | public slots:
14 | void onTextEvaluated(const QString& text, QShellEngineResult& res);
15 | private:
16 | HistoryRecorder history;
17 | };
18 |
19 |
--------------------------------------------------------------------------------
/AnvediCheQml/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include "../Anvedi/qml-lib/RegisterAll.h"
4 |
5 | int main(int argc, char *argv[])
6 | {
7 | QApplication a(argc, argv);
8 | QmlModulesInstaller::Install();
9 | QQuickView view(QUrl("file:///C:/Users/Marco/Source/Repos/anvedi/Anvedi/qml/main.qml"));
10 | view.setResizeMode(QQuickView::SizeRootObjectToView);
11 | view.resize(800, 600);
12 | view.show();
13 | return a.exec();
14 | }
15 |
--------------------------------------------------------------------------------
/AnvediCheTests/WorkspaceSerializerTests.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include "TestRunner.h"
4 | #include "..\SignalData.h"
5 |
6 | class WorkspaceSerializerTests : public QObject
7 | {
8 | Q_OBJECT
9 | private slots:
10 | void ReadTest();
11 | void WriteTest();
12 | private:
13 | void VerifyActualDataAndPersistedFile(const QString& file, const DataMap& expectedDataMap, const QString& expectedDomain, const QColor& expectedBackground);
14 | };
15 |
16 | DECLARE_TEST(WorkspaceSerializerTests)
--------------------------------------------------------------------------------
/QShell/QShellContextMenuBuilder.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "QtWidgets\qmenu.h"
3 | #include
4 |
5 | class QShell;
6 |
7 | class QShellContextMenuBuilder : public QObject
8 | {
9 | Q_OBJECT
10 | public:
11 | QShellContextMenuBuilder(QShell& shell);
12 |
13 | std::unique_ptr CreateMenu();
14 |
15 | signals:
16 | void ClearActionTriggered();
17 | void LoadScriptActionTriggered();
18 | private:
19 | QAction* m_ClearAction;
20 | QAction* m_LoadScriptAction;
21 | QShell& shell;
22 | };
23 |
24 |
--------------------------------------------------------------------------------
/QShell/QShellScriptUtilis.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class QPlainTextEdit;
4 | class QScriptEngine;
5 | class QScriptValue;
6 | class QScriptContext;
7 |
8 | namespace QtShellScriptUtils
9 | {
10 | void RegisterPrintFunctionTo(QPlainTextEdit& edit, QScriptEngine& engine);
11 |
12 | QScriptValue ConsolePrintFunction(QScriptContext *context, QScriptEngine *engine);
13 | QScriptValue ExitFunction(QScriptContext *context, QScriptEngine *engine);
14 | QScriptValue LoadScript(QScriptContext *context, QScriptEngine *engine);
15 | }
16 |
--------------------------------------------------------------------------------
/Anvedi/qml-lib/qmlLabel.cpp:
--------------------------------------------------------------------------------
1 | #include "qmlLabel.h"
2 |
3 | const QString& qmlLabel::getText() const
4 | {
5 | return text;
6 | }
7 |
8 | void qmlLabel::setText(const QString& txt)
9 | {
10 | text = txt;
11 | }
12 |
13 | const QString& qmlLabel::getFont() const
14 | {
15 | return font;
16 | }
17 |
18 | void qmlLabel::setFont(const QString& f)
19 | {
20 | font = f;
21 | }
22 |
23 | const QColor& qmlLabel::getColor() const
24 | {
25 | return color;
26 | }
27 |
28 | void qmlLabel::setColor(const QColor& c)
29 | {
30 | color = c;
31 | }
32 |
--------------------------------------------------------------------------------
/AnvediCheExe/AnvediCheExe.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;cxx;c;def
7 |
8 |
9 |
10 |
11 | Source Files
12 |
13 |
14 |
--------------------------------------------------------------------------------
/QShell/QShellEngineResult_qt.cpp:
--------------------------------------------------------------------------------
1 | #include "QShellEngineResult_Qt.h"
2 | #include
3 |
4 | QShellEngineResult_Qt::QShellEngineResult_Qt( QScriptValue value ) : m_value(value)
5 | {
6 |
7 | }
8 |
9 | QString QShellEngineResult_Qt::ToQString() const
10 | {
11 | return m_value.toString();
12 | }
13 |
14 | bool QShellEngineResult_Qt::IsPrintable() const
15 | {
16 | return false == (m_value.isNull() || m_value.isUndefined());
17 | }
18 |
19 | bool QShellEngineResult_Qt::IsError() const
20 | {
21 | return m_value.isError();
22 | }
23 |
24 |
--------------------------------------------------------------------------------
/Anvedi/Signal.cpp:
--------------------------------------------------------------------------------
1 | #pragma warning (disable:4996) // due to QVector operator==
2 |
3 | #include "Signal.h"
4 |
5 | bool Signal::operator==(const Signal& other) const
6 | {
7 | return std::tie(name, y, graphic) ==
8 | std::tie(other.name, other.y, other.graphic);
9 | }
10 |
11 | bool SignalGraphic::operator==(const SignalGraphic& other) const
12 | {
13 | return std::tie(color, visible, rangeLower, rangeUpper, ticks, tickLabels) ==
14 | std::tie(other.color, other.visible, other.rangeLower, other.rangeUpper, other.ticks, other.tickLabels);
15 | }
16 |
--------------------------------------------------------------------------------
/Anvedi/WorkspaceSerializer.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 | #include "Signal.h"
5 |
6 | class SignalData;
7 | class PlotInfo;
8 |
9 | class WorkspaceSerializer
10 | {
11 | public:
12 | static void Read(const QString& fileName, SignalData& data, PlotInfo& plotInfo);
13 | static void Read(const QString& fileName, SignalData& data, PlotInfo& plotInfo, std::function onSignal);
14 | static void Write(const QString& fileName, const SignalData& data, const PlotInfo& plotInfo, bool writeValues = true);
15 | };
16 |
17 |
--------------------------------------------------------------------------------
/Anvedi.pro:
--------------------------------------------------------------------------------
1 | # ----------------------------------------------------
2 | # This file is generated by the Qt Visual Studio Add-in.
3 | # ------------------------------------------------------
4 |
5 | # This is a reminder that you are using a generated .pro file.
6 | # Remove it when you are finished editing this file.
7 | message("You are running qmake on a generated .pro file. This may not work!")
8 |
9 |
10 | TEMPLATE = subdirs
11 | SUBDIRS += QShell/QShell.pro \
12 | Anvedi/Anvedi.pro \
13 | AnvediCheTests/AnvediCheTests.pro \
14 | AnvediCheExe/AnvediCheExe.pro
15 |
--------------------------------------------------------------------------------
/Anvedi/RTSocketPlayer.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include "RTSender.h"
6 | #include
7 | #include
8 | #include
9 |
10 | class SignalData;
11 |
12 | class RTSocketPlayer : public QObject
13 | {
14 | Q_OBJECT
15 | public:
16 | RTSocketPlayer(SignalData& data);
17 | private slots:
18 | void Start();
19 | public slots :
20 | void Stop();
21 | private:
22 | SignalData& m_data;
23 | QLocalServer server;
24 | QLocalSocket* clientConnection;
25 | RTSender sender;
26 | std::vector names;
27 | };
28 |
29 |
--------------------------------------------------------------------------------
/Anvedi/qml-lib/qmlPen.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 |
5 | class qmlPen : public QObject
6 | {
7 | Q_OBJECT
8 | Q_PROPERTY(QColor color READ getColor WRITE setColor)
9 | Q_PROPERTY(QColor brush READ getBrush WRITE setBrush)
10 | Q_PROPERTY(qreal width READ getWidth WRITE setWidth)
11 | public:
12 | QColor getColor() const;
13 | void setColor(const QColor& c);
14 | QColor getBrush() const;
15 | void setBrush(const QColor& c);
16 | qreal getWidth() const;
17 | void setWidth(qreal w);
18 |
19 | const QPen& getPen() const;
20 | private:
21 | QPen pen;
22 | };
--------------------------------------------------------------------------------
/Anvedi/qml-lib/qmlPen.cpp:
--------------------------------------------------------------------------------
1 | #include "qmlPen.h"
2 |
3 | QColor qmlPen::getColor() const
4 | {
5 | return pen.color();
6 | }
7 |
8 | void qmlPen::setColor(const QColor& c)
9 | {
10 | pen.setColor(c);
11 | }
12 |
13 | QColor qmlPen::getBrush() const
14 | {
15 | return pen.brush().color();
16 | }
17 |
18 | void qmlPen::setBrush(const QColor& c)
19 | {
20 | pen.setBrush(c);
21 | }
22 |
23 | qreal qmlPen::getWidth() const
24 | {
25 | return pen.width();
26 | }
27 |
28 | void qmlPen::setWidth(qreal w)
29 | {
30 | pen.setWidthF(w);
31 | }
32 |
33 | const QPen& qmlPen::getPen() const
34 | {
35 | return pen;
36 | }
37 |
--------------------------------------------------------------------------------
/AnvediCheTests/GraphPresenterTests.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include "TestRunner.h"
4 |
5 | class GraphPresenterTests : public QObject
6 | {
7 | Q_OBJECT
8 | private slots:
9 | // model -> (signal) -> presenter
10 | void On_DataAdded_Should_CreateGraphs();
11 | void On_DomainChanged_Should_SetDataToGraphs_And_ScaleXAxis();
12 | void On_DataCleared_Should_RemoveGraphs();
13 | void On_SignalVisibilityChanged_Should_UpdateGraphVisibility();
14 | void On_SignalColorChanged_Should_UpdateGraphColor();
15 | void On_CursorValueChanged_Should_UpdateXRange();
16 | };
17 |
18 | DECLARE_TEST(GraphPresenterTests)
--------------------------------------------------------------------------------
/QShell/ClearConsole.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | /* this hack merits consideration:
6 | you know when you evaluate an object in Js, its description gets printed
7 | In QtScript this means: invoking the toString public slot (if any), or a default description.
8 | Suppose I want a "clc" Matlab-like command, which clears the console:
9 | > clc
10 | We can declare a global "clc" object such that its toString emits a signal...
11 | */
12 |
13 | class ClearConsole : public QObject
14 | {
15 | Q_OBJECT
16 | signals:
17 | void ClcCalled();
18 | public slots:
19 | QString toString();
20 | };
21 |
22 |
--------------------------------------------------------------------------------
/Anvedi/qml-lib/qmlLabel.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 |
5 | class qmlLabel : public QObject
6 | {
7 | Q_OBJECT
8 | Q_PROPERTY(QString text READ getText WRITE setText)
9 | Q_PROPERTY(QString font READ getFont WRITE setFont)
10 | Q_PROPERTY(QColor color READ getColor WRITE setColor)
11 | public:
12 | const QString& getText() const;
13 | void setText(const QString& txt);
14 | const QString& getFont() const;
15 | void setFont(const QString& f);
16 | const QColor& getColor() const;
17 | void setColor(const QColor& c);
18 | private:
19 | QString text;
20 | QString font;
21 | QColor color;
22 | };
--------------------------------------------------------------------------------
/QShell/QShellEngine.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include "QShellEngineResult.h"
5 |
6 | class QString;
7 | class QStringList;
8 | class QPlainTextEdit;
9 |
10 | class QShellEngine
11 | {
12 | public:
13 | virtual ~QShellEngine() = default;
14 | virtual void RegisterPrintFunction(QPlainTextEdit& console) = 0;
15 | virtual std::unique_ptr Evaluate(const QString& toEval) = 0;
16 | virtual std::unique_ptr MakeEmptyResult() = 0;
17 | virtual QStringList Suggest(const QString& value) = 0;
18 | virtual std::unique_ptr LoadScript(const QString& toEval) = 0;
19 | };
20 |
--------------------------------------------------------------------------------
/Anvedi/RTInteractiveSender.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "RTSender.h"
3 | #include
4 | #include
5 |
6 | class RTInteractiveSender : public QObject
7 | {
8 | Q_OBJECT
9 | Q_PROPERTY(RTSender* sender READ getSender)
10 | Q_PROPERTY(QVariantMap data READ getData WRITE setData)
11 | public:
12 | RTInteractiveSender(SignalData& data);
13 |
14 | RTSender* getSender();
15 | QVariantMap getData() const;
16 | void setData(const QVariantMap& data);
17 | public slots:
18 | void Start(const QString& domainName, QVariantList signalNames);
19 | private:
20 | SignalData& data;
21 | RTSender sender;
22 | DataToReplay currentPacket;
23 | };
24 |
--------------------------------------------------------------------------------
/AnvediCheExe/main.cpp:
--------------------------------------------------------------------------------
1 | #include "..\Anvedi\anvedi.h"
2 | #include
3 |
4 | using namespace std;
5 |
6 | int main(int argc, char *argv [])
7 | {
8 | QApplication a(argc, argv);
9 |
10 | Anvedi w;
11 | w.show();
12 |
13 | try
14 | {
15 | return a.exec();
16 | }
17 | catch (const std::exception& ex)
18 | {
19 | QMessageBox msg;
20 | msg.setWindowTitle("Unexpected error");
21 | msg.setInformativeText("Anfame!!!");
22 | msg.setFont(QFont("serif", 15));
23 | msg.setIconPixmap(QPixmap("mario.jpg"));
24 | msg.setDefaultButton(QMessageBox::Ok);
25 | msg.show();
26 | msg.exec();
27 | return -1;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/AnvediCheTests/AnvediCheTests.pri:
--------------------------------------------------------------------------------
1 | # ----------------------------------------------------
2 | # This file is generated by the Qt Visual Studio Add-in.
3 | # ------------------------------------------------------
4 |
5 | # This is a reminder that you are using a generated .pro file.
6 | # Remove it when you are finished editing this file.
7 | message("You are running qmake on a generated .pro file. This may not work!")
8 |
9 |
10 | HEADERS += ./TestRunner.h \
11 | ./SignalDataTests.h \
12 | ./SignalListPresenterTests.h
13 | SOURCES += ./main.cpp \
14 | ./TestRunner.cpp \
15 | ./SignalDataTests.cpp \
16 | ./SignalListPresenterTests.cpp
17 |
--------------------------------------------------------------------------------
/QShell/QShellCompleter.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "QtWidgets\qcompleter.h"
4 |
5 | class QShellCompleter : public QCompleter
6 | {
7 | Q_OBJECT
8 | Q_PROPERTY(QString separator READ separator WRITE setSeparator)
9 |
10 | public:
11 | explicit QShellCompleter(QWidget *parent = 0);
12 | explicit QShellCompleter(QAbstractItemModel *model, QWidget *parent = 0);
13 |
14 | QString separator() const;
15 | public slots:
16 | void setSeparator(const QString &separator);
17 | protected:
18 | QStringList splitPath(const QString &path) const;
19 | QString pathFromIndex(const QModelIndex &index) const;
20 | private:
21 | QString sep;
22 | };
23 |
24 |
25 |
--------------------------------------------------------------------------------
/QShell/QShell.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | C:\Qt-5.2\5.5\msvc2013_64
6 | PATH=$(QTDIR)\bin%3b$(PATH)
7 |
8 |
9 | C:\Qt-5.2\5.5\msvc2013_64
10 | PATH=$(QTDIR)\bin%3b$(PATH)
11 |
12 |
--------------------------------------------------------------------------------
/QShell/QShell.pro:
--------------------------------------------------------------------------------
1 | # ----------------------------------------------------
2 | # This file is generated by the Qt Visual Studio Add-in.
3 | # ------------------------------------------------------
4 |
5 | TEMPLATE = lib
6 | TARGET = QShell
7 | DESTDIR = ../Win32/Debug
8 | QT += core script widgets gui printsupport
9 | CONFIG += debug
10 | DEFINES += WIN64 QT_DLL QT_SCRIPT_LIB QT_WIDGETS_LIB QSHELL_LIB QT_PRINTSUPPORT_LIB
11 | INCLUDEPATH += ./GeneratedFiles \
12 | . \
13 | ./GeneratedFiles/Debug
14 | DEPENDPATH += .
15 | MOC_DIR += ./GeneratedFiles/debug
16 | OBJECTS_DIR += debug
17 | UI_DIR += ./GeneratedFiles
18 | RCC_DIR += ./GeneratedFiles
19 | include(QShell.pri)
20 |
--------------------------------------------------------------------------------
/AnvediCheExe/AnvediCheExe.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | C:\Qt-5.2\5.5\msvc2013_64
6 | PATH=$(QTDIR)\bin%3b$(PATH)
7 |
8 |
9 | C:\Qt-5.2\5.5\msvc2013_64
10 | PATH=$(QTDIR)\bin%3b$(PATH)
11 |
12 |
--------------------------------------------------------------------------------
/QShell/ScriptEvaluatorKeyHandler.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "KeyPressHandler.h"
3 | #include
4 | #include "QShellEngine.h"
5 | #include "QtCore\qobjectdefs.h"
6 |
7 | class QShell;
8 |
9 | class ScriptEvaluatorKeyHandler : public IKeyPressHandler
10 | {
11 | Q_OBJECT
12 | public:
13 | ScriptEvaluatorKeyHandler(QShell& s);
14 | virtual bool onKeyPressed( QShell& shell, QKeyEvent* e );
15 | public slots:
16 | void onNewEngine(std::shared_ptr);
17 | void onLoadScript(const QString& file);
18 | signals:
19 | void TextEvaluated(const QString&, QShellEngineResult&);
20 | private:
21 | std::shared_ptr engine;
22 | QShell& shell;
23 | };
24 |
25 |
--------------------------------------------------------------------------------
/QShell/KeyHandlersManager.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include