newrpl/mainwindow.h

117 lines
2.3 KiB
C
Raw Normal View History

2015-08-28 14:34:26 +02:00
/*
* Copyright (c) 2014-2015, Claudio Lapilli and the newRPL Team
* All rights reserved.
* This file is released under the 3-clause BSD license.
* See the file LICENSE.txt that shipped with this distribution.
*/
2015-03-05 20:35:35 +01:00
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QFile>
2015-03-05 20:35:35 +01:00
#include "rplthread.h"
namespace Ui {
class MainWindow;
}
class USBThread : public QThread
{
Q_OBJECT
public:
void run();
USBThread(QObject *parent);
~USBThread();
};
2015-03-05 20:35:35 +01:00
class MainWindow : public QMainWindow
{
Q_OBJECT
QTimer *screentmr;
QFile sdcard;
QString currentfile;
2017-12-14 19:12:35 +01:00
QString currentusb,currentusbpath;
2015-03-05 20:35:35 +01:00
RPLThread rpl;
USBThread usbdriver;
2015-03-05 20:35:35 +01:00
public:
QFile *fileptr;
2017-12-11 15:14:08 +01:00
static int WriteWord(unsigned int word);
static unsigned int ReadWord();
2015-03-05 20:35:35 +01:00
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
protected:
virtual void keyPressEvent(QKeyEvent *ev);
virtual void keyReleaseEvent(QKeyEvent *ev);
void closeEvent(QCloseEvent *event);
2018-02-17 00:45:43 +01:00
bool eventFilter(QObject *obj, QEvent *ev);
2018-09-13 01:01:39 +02:00
void resizeEvent(QResizeEvent *event);
void contextMenuEvent(QContextMenuEvent *event);
2015-03-05 20:35:35 +01:00
2018-09-15 00:31:56 +02:00
public slots:
2015-03-05 20:35:35 +01:00
void on_EmuScreen_destroyed();
void on_actionExit_triggered();
void on_actionSave_triggered();
void on_actionOpen_triggered();
void on_actionSaveAs_triggered();
void on_actionNew_triggered();
void on_actionInsert_SD_Card_Image_triggered();
void on_actionEject_SD_Card_Image_triggered();
void on_actionPower_ON_triggered();
void on_actionSimulate_Alarm_triggered();
void on_actionTake_Screenshot_triggered();
void on_actionCopy_Level_1_triggered();
void on_actionPaste_to_Level_1_triggered();
void on_actionCut_Level_1_triggered();
void on_actionSave_Level_1_As_triggered();
void on_actionOpen_file_to_Level_1_triggered();
2017-11-23 17:03:49 +01:00
void on_actionConnect_to_calc_triggered();
2017-12-14 19:12:35 +01:00
void on_usbconnectButton_clicked();
void on_actionUSB_Remote_ARCHIVE_to_file_triggered();
void on_actionRemote_USBRESTORE_from_file_triggered();
void on_actionShow_LCD_grid_toggled(bool arg1);
2018-02-17 00:45:43 +01:00
2015-03-05 20:35:35 +01:00
public slots:
2017-11-30 19:23:09 +01:00
void usbupdate();
private slots:
void on_actionPaste_and_compile_triggered();
2015-03-05 20:35:35 +01:00
private:
int OpenFile(QString fname);
void SaveFile(QString fname);
2015-03-05 20:35:35 +01:00
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H