

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <memory>
#include <QCodeEditor>
#include <QPythonCompleter>
#include <QPythonHighlighter>

#include "channelwidget.h"
#include "triggerwidget.h"
#include "pythonrunner.h"

namespace Ui
{
class MainWindow;
}

class MainWindow : public QMainWindow
{
        Q_OBJECT
        std::vector<std::shared_ptr<ChannelWidget>> channels;
        std::vector<std::shared_ptr<TriggerWidget>> triggers;
        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 onPushButtonRunClicked();
        void onPushButtonStopClicked();

private:
        void enumerateDevices();
        void generateExample();
        void updateStatus();
        QString currentFilePath;
        bool isFileModified;
};

#endif // MAINWINDOW_H

