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>
|
2015-08-19 21:58:24 +02:00
|
|
|
#include <QFile>
|
2015-03-05 20:35:35 +01:00
|
|
|
#include "rplthread.h"
|
|
|
|
namespace Ui {
|
|
|
|
class MainWindow;
|
|
|
|
}
|
|
|
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
QTimer *screentmr,*maintmr;
|
2016-07-13 15:37:20 +02:00
|
|
|
QFile sdcard;
|
2015-08-24 20:05:37 +02:00
|
|
|
QString currentfile;
|
2017-12-14 19:12:35 +01:00
|
|
|
QString currentusb,currentusbpath;
|
2015-03-05 20:35:35 +01:00
|
|
|
RPLThread rpl;
|
2015-08-19 21:58:24 +02:00
|
|
|
|
2015-03-05 20:35:35 +01:00
|
|
|
public:
|
2015-08-19 21:58:24 +02:00
|
|
|
QFile *fileptr;
|
|
|
|
|
2017-12-11 15:14:08 +01:00
|
|
|
static int WriteWord(unsigned int word);
|
2015-08-24 06:13:11 +02:00
|
|
|
static unsigned int ReadWord();
|
2015-08-19 21:58:24 +02:00
|
|
|
|
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);
|
2015-08-18 16:02:33 +02:00
|
|
|
void closeEvent(QCloseEvent *event);
|
2018-02-17 00:45:43 +01:00
|
|
|
bool eventFilter(QObject *obj, QEvent *ev);
|
2015-03-05 20:35:35 +01:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void on_EmuScreen_destroyed();
|
2015-08-18 16:02:33 +02:00
|
|
|
void on_actionExit_triggered();
|
|
|
|
|
|
|
|
void on_actionSave_triggered();
|
|
|
|
|
2015-08-24 06:13:11 +02:00
|
|
|
void on_actionOpen_triggered();
|
|
|
|
|
2015-08-24 20:05:37 +02:00
|
|
|
void on_actionSaveAs_triggered();
|
|
|
|
|
|
|
|
void on_actionNew_triggered();
|
|
|
|
|
2016-07-11 20:13:57 +02:00
|
|
|
void on_actionInsert_SD_Card_Image_triggered();
|
|
|
|
|
|
|
|
void on_actionEject_SD_Card_Image_triggered();
|
|
|
|
|
2016-11-22 19:08:23 +01:00
|
|
|
void on_actionPower_ON_triggered();
|
|
|
|
|
2016-12-07 00:21:53 +01:00
|
|
|
void on_actionSimulate_Alarm_triggered();
|
|
|
|
|
2017-04-13 23:32:06 +02:00
|
|
|
void on_actionTake_Screenshot_triggered();
|
|
|
|
|
2017-08-05 20:42:48 +02:00
|
|
|
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();
|
|
|
|
|
2018-01-30 23:47:52 +01:00
|
|
|
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();
|
2015-03-05 20:35:35 +01:00
|
|
|
void domaintimer();
|
|
|
|
private:
|
2018-01-13 01:03:33 +01:00
|
|
|
int OpenFile(QString fname);
|
|
|
|
void SaveFile(QString fname);
|
|
|
|
|
2015-03-05 20:35:35 +01:00
|
|
|
Ui::MainWindow *ui;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAINWINDOW_H
|