59 lines
1.3 KiB
C++
59 lines
1.3 KiB
C++
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include <eismultiplexer.h>
|
|
#include <QMainWindow>
|
|
#include <memory>
|
|
#include <QCodeEditor>
|
|
#include <QPythonCompleter>
|
|
#include <QPythonHighlighter>
|
|
#include <QProgressBar>
|
|
#include "channelwidget.h"
|
|
#include "triggerwidget.h"
|
|
#include "pythonrunner.h"
|
|
|
|
namespace Ui
|
|
{
|
|
class MainWindow;
|
|
}
|
|
|
|
class MainWindow : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
std::vector<std::shared_ptr<TriggerWidget>> triggers;
|
|
std::vector<std::shared_ptr<ChannelWidget>> channels;
|
|
std::vector<std::pair<uint16_t, std::shared_ptr<struct eismultiplexer>>> multiplexers;
|
|
Ui::MainWindow *ui;
|
|
QCodeEditor codeEditor;
|
|
QPythonHighlighter highligter;
|
|
QPythonCompleter completer;
|
|
QTextEdit pythonOutput;
|
|
PythonRunner pythonRunner;
|
|
|
|
signals:
|
|
void channelStateChanged(uint16_t device, uint16_t channel);
|
|
|
|
public:
|
|
explicit MainWindow(QWidget *parent = nullptr);
|
|
~MainWindow();
|
|
|
|
private slots:
|
|
void onActionOpenTriggered();
|
|
void onActionSaveTriggered();
|
|
void onActionSaveAsTriggered();
|
|
void runScript();
|
|
void stopScript();
|
|
void readState();
|
|
|
|
private:
|
|
void enumerateDevices();
|
|
void generateExample();
|
|
void updateStatus();
|
|
void disconnectDevices();
|
|
QString currentFilePath;
|
|
bool isFileModified;
|
|
};
|
|
|
|
#endif // MAINWINDOW_H
|
|
|