forked from werneazc/gsysc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgsysHierarchyWindow.h
166 lines (136 loc) · 4.21 KB
/
gsysHierarchyWindow.h
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/*
** This file is part of gSysC.
**
** gSysC is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** gSysC is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with gSysC with the file ``LICENSE''; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*****************************************************************************
Author: Christian J. Eibl
last modified: 2005-01-31
*****************************************************************************
Content:
This class is used for visualization of the structure graphics
of the underlying SystemC project.
It is one of the main elements of gSysC.
*****************************************************************************/
#ifndef GSYS_HIERWIN_H
#define GSYS_HIERWIN_H
#include "systemc.h"
#include <vector>
#include <cmath>
#include <stdio.h>
#include <string>
#include <Qt/qvariant.h>
#include <QtCore/qrect.h>
#include <QtGui/qdialog.h>
#include <QtGui/qpushbutton.h>
#include <QtGui/qtooltip.h>
#include <QtGui/qwhatsthis.h>
#include <QtGui/qlayout.h>
#include <QtGui/QHBoxLayout>
#include <QtGui/qlineedit.h>
#include <QtGui/qlabel.h>
#include <QtGui/qgroupbox.h>
#include <Qt3Support/q3canvas.h>
#include <Qt3Support/Q3GroupBox>
class gsysSignalViewer;
class gsysPort;
class gsysHierarchy;
class gsysConnection;
class gsysCanvasView;
// sectors for direction classification defined
#define N 1
#define NNW 2
#define NW 3
#define WNW 4
#define W 5
#define WSW 6
#define SW 7
#define SSW 8
#define S 9
#define SSE 10
#define SE 11
#define ESE 12
#define E 13
#define ENE 14
#define NE 15
#define NNE 16
using namespace std;
class gsysHierarchyWindow : public QDialog
{
friend class gsysHierarchyTree;
friend class gsysCanvasView;
friend class gsysConnection;
friend class gsysPort;
Q_OBJECT
private:
vector<gsysHierarchy*> hierarchyList;
vector<gsysConnection*> connList; // Connections inside of this level
vector<gsysConnection*> sideConnList; // Connections to outer elements
gsysHierarchyWindow( QWidget* parent, const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0 );
gsysHierarchy* parent;
gsysHierarchy* ownHierarchy;
int dimFactor;
short getSector(QPoint *source, QPoint *dest);
QPoint* normalize(QPoint *p);
void drawSidePort(gsysPort* port, bool left, int nr, int abstand, int portHeight=21);
void drawNetConns(gsysHierarchy* hier);
void drawConnections();
bool drawConnStep(gsysConnection* connection,QPoint *p1, QPoint *p2,int lfdNr);
bool thisLevel(gsysHierarchy* hier);
// values to be read from file 'gsysHViewer.conf'
int sideMargin;
int topMargin;
int horizontalSpace;
int verticalSpace;
int moduleWidth;
int moduleHeight;
char* backgroundColor;
char* moduleColor;
char* moduleWithChild;
char* textColor;
char* inPort;
char* outPort;
char* inoutPort;
char* mmHierConnColor;
bool mmHierConnShow;
bool mmSigPortShow;
void readConfig();
QPushButton *saveButton;
Q3GroupBox* moveInfos;
QLabel* labelKoordinaten;
QLineEdit* coord;
QLabel* labelTyp;
QLineEdit* lineEditTyp;
QLabel* labelWert;
QLineEdit* lineEditWert;
QHBoxLayout* moveInfosLayout;
char* normalSignal;
char* normalNode;
char* activeSignal;
char* changedSignal;
char* activeChangedSig;
~gsysHierarchyWindow();
gsysCanvasView *canvasView;
bool isInitialized();
void initializeWdw(gsysHierarchy* ownHier, vector<gsysHierarchy*> allHierarchies, vector<gsysConnection*> allConnections, bool toShow = true);
gsysHierarchy* getOwnHier();
public slots:
void saveButton_clicked();
protected:
QVBoxLayout *hierWinLayout;
protected slots:
void languageChange();
};
#endif