-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathmain.qml
151 lines (129 loc) · 4.59 KB
/
main.qml
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
// Copyright 2021 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// This file is part of eProsima Fast DDS Monitor.
//
// eProsima Fast DDS Monitor 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 3 of the License, or
// (at your option) any later version.
//
// eProsima Fast DDS Monitor 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 eProsima Fast DDS Monitor. If not, see <https://www.gnu.org/licenses/>.
import QtQuick 2.15
import QtQuick.Layouts 1.1
import QtQuick.Window 2.2
import QtQuick.Controls 2.15
import QtGraphicalEffects 1.15
import QtQuick.Dialogs 1.2
import Theme 1.0
ApplicationWindow {
id: mainApplicationView
visible: true
width: 1600
height: 900
title: qsTr("Fast DDS Monitor")
signal startMonitoring
// This property holds the current number of initialized monitors
property int monitors: 0
onStartMonitoring: {
mainStartView.visible = false
monitorMenuBar.visible = true
toolBar.isVisible = true
panels.visible = true
dialogInitMonitor.open()
}
MainStartView {
id: mainStartView
visible: true
}
menuBar: MonitorMenuBar {
id: monitorMenuBar
visible: false
onToolBarHidden: toolBar.isVisible = !toolBar.isVisible
onDispDataButtonHidden: toolBar.isVisibleDispData = !toolBar.isVisibleDispData
onDispDynDataButtonHidden: toolBar.isVisibleDispDynData = !toolBar.isVisibleDispDynData
onRefreshButtonHidden: toolBar.isVisibleRefresh = !toolBar.isVisibleRefresh
onClearLogButtonHidden: toolBar.isVisibleClearLog = !toolBar.isVisibleClearLog
onDashboardLayoutButtonHidden: toolBar.isVisibleDashboardLayout = !toolBar.isVisibleDashboardLayout
onClearIssuesButtonHidden: toolBar.isVisibleClearIssues = !toolBar.isVisibleClearIssues
onLeftSidebarHidden: panels.openCloseLeftSideBar()
onChangeChartboxLayout: {
panels.changeChartboxLayout(chartsPerRow)
toolBar.changeChartboxLayoutIcon(chartsPerRow)
}
onSaveAllCSV: {
panels.saveAllCSV()
}
onExplorerDDSEntitiesChanged: panels.changeExplorerDDSEntities(status)
onExplorerPhysicalChanged: panels.changeExplorerPhysical(status)
onExplorerLogicalChanged: panels.changeExplorerLogical(status)
onExplorerEntityInfoChanged: panels.changeExplorerEntityInfo(status)
}
header: MonitorToolBar {
id: toolBar
onChangeChartboxLayout: monitorMenuBar.changeChartboxLayoutViewMenu(chartsPerRow)
}
Panels {
id: panels
visible: false
onExplorerDDSEntitiesChanged: monitorMenuBar.changeExplorerDDSEntities(status)
onExplorerPhysicalChanged: monitorMenuBar.changeExplorerPhysical(status)
onExplorerLogicalChanged: monitorMenuBar.changeExplorerLogical(status)
onExplorerEntityInfoChanged: monitorMenuBar.changeExplorerEntityInfo(status)
}
InitMonitorDialog {
id: dialogInitMonitor
}
InitDSMonitorDialog {
id: dialogDSInitMonitor
}
DumpFileDialog {
id: dumpDialog
clear: false
}
DumpFileDialog {
id: dumpDialogClear
clear: true
}
HistoricDataKindDialog {
id: dataKindDialog
onCreateChart: panels.createHistoricChart(dataKind)
}
DynamicDataKindDialog {
id: dynamicDataKindDialog
onCreateChart: panels.createDynamicChart(dataKind, timeWindowSeconds, updatePeriod, maxPoints)
}
ScheduleClearDialog {
id: scheduleClear
}
AboutDialog {
id: aboutDialog
}
ErrorDialog {
id: errorDialog
}
SeriesSetMaxPointsDialog {
id: seriesSetMaxPointsDialog
}
// Creates a connection between Controller::error(QString, int) signal and ErrorDialog
Connections {
target: controller
function onError(errorMsg, errorType) {
errorDialog.text = errorMsg
errorDialog.errorType = errorType
errorDialog.open()
}
}
// Creates a connection between Controller::monitorInitialized() signal and qml
Connections {
target: controller
function onMonitorInitialized() {
monitors++
}
}
}