-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMainWindow.h
More file actions
138 lines (126 loc) · 4.61 KB
/
MainWindow.h
File metadata and controls
138 lines (126 loc) · 4.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QStandardItemModel>
#include <QItemDelegate>
#include "GenerateDialog.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow *ui;
QStringList iregs;
QStringList fregs;
QStandardItemModel* generalModel;
QStandardItemModel* constModel;
QStandardItemModel* int1Model;
QStandardItemModel* int2Model;
QStandardItemModel* floatModel;
QStandardItemModel* ifconvModel;
QStandardItemModel* memoryModel;
QStandardItemModel* branchModel;
QStandardItemModel* ioModel;
QStringList generalOptions;
QStringList int1Expalains;
QStringList int2Expalains;
QStringList floatExpalains;
QStringList ifconvExpalains;
QStringList memoryExpalains;
QStringList branchExpalains;
QStringList ioExpalains;
// GeneralTableViewのデータ取得用
static const int ARCHITECTURE = 0;
static const int ENDIAN = 1;
static const int ROM_SIZE = 2;
static const int ROM_ADDRESSING = 3;
static const int RAM_SIZE = 4;
static const int RAM_ADDRESSING = 5;
static const int COMMENTOUT = 6;
static const int IREG_PREFIX = 7;
static const int FREG_PREFIX = 8;
static const int IREG_NUM = 9;
static const int FREG_NUM = 10;
static const int CACHE_NUM = 11;
static const int ZR = 12;
static const int FR = 13;
static const int HR = 14;
static const int LR = 15;
static const int P1R = 16;
static const int M1R = 17;
static const int BINARY_LENGTH = 6;
//
int ADD_ROW;
int SUB_ROW;
int NOR_ROW;
int ADDI_ROW;
int FSETLO_ROW;
int FSETHI_ROW;
//
int LOW_CALL;
int HIGH_CALL;
GenerateDialog genDlg;
void UpdateRegisters();
void AddRow(QStandardItemModel*, int, QString, bool, QString, QString, QString, QString, QString, bool);
void InitGeneralTV();
void InitInstTVs();
void ChangeRegName(int, int, QStringList&);
int GetRegIndex(QString);
QString GetInstTag(QStandardItemModel*, int, QString, bool, bool);
QString GetInstTag(QStandardItemModel*, int, QString, bool);
bool ValidString(QString);
bool ValidBinary(QString, int);
bool IsConstBinaryName(QString);
QString GetConstBinaryValue(QString);
bool ErrorMsg(QString);
void CheckModel(QStandardItemModel*, QString, QStringList, QHash<QString,QString>&, bool&, QString&);
bool CheckSettings();
bool WriteXML(QString);
QString ReformBinaryValue(QString, int);
bool WriteTVsToCSV(QStandardItemModel*, QStringList&, QTextStream&);
bool WriteCSV(QString);
private slots:
void CreateArchitecture();
void ChangeRegNames(QStandardItem* item);
void ChangeAsmForm(QStandardItem* item);
void ToggleCallMode(QStandardItem* item);
};
class ComboBoxDelegate : public QItemDelegate
{
Q_OBJECT//マクロ
public:
QStringList itemList;
explicit ComboBoxDelegate(QObject *parent = 0);//コンストラクタ
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
void setEditorData(QWidget *editor, const QModelIndex &index) const;
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const;
};
class SpinBoxDelegate : public QItemDelegate
{
Q_OBJECT//マクロ
public:
int Max, Min;
explicit SpinBoxDelegate(QObject *parent = 0);//コンストラクタ
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
void setEditorData(QWidget *editor, const QModelIndex &index) const;
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const;
};
class DoubleSpinBoxDelegate : public QItemDelegate
{
Q_OBJECT//マクロ
public:
double Max, Min;
explicit DoubleSpinBoxDelegate(QObject *parent = 0);//コンストラクタ
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
void setEditorData(QWidget *editor, const QModelIndex &index) const;
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const;
};
#endif // MAINWINDOW_H