blob: 97b2ef3ce706d57fd656ed961d2bb90c12f5c262 (
plain)
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
|
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Controls
import QtQuick3D.Particles3D
Frame {
id: root
required property list<ParticleSystem3D> particleSystems
readonly property bool loggingEnabled: AppSettings.showLoggingView
property bool intervalInstant: false
property real itemWidth: (width - loggingButton.width - intervalButton.width) / 7
width: parent.width
height: tableContent.height + 30
Component.onCompleted: {
for (const psystem of particleSystems)
psystem.logging = AppSettings.showLoggingView;
}
// Background
background: Rectangle {
color: "#80000000"
visible: root.loggingEnabled
}
Button {
id: loggingButton
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: 10
opacity: root.loggingEnabled ? 1.0 : 0.4
icon.source: "qrc:/images/icon_logging.png"
icon.width: 32
icon.height: 32
icon.color: "transparent"
background: Rectangle {
color: "transparent"
}
onClicked: {
AppSettings.showLoggingView = !AppSettings.showLoggingView
for (const psystem of root.particleSystems) {
psystem.logging = AppSettings.showLoggingView;
}
}
}
Button {
id: intervalButton
anchors.verticalCenter: parent.verticalCenter
anchors.right: loggingButton.left
anchors.rightMargin: 0
visible: root.loggingEnabled
opacity: root.intervalInstant ? 1.0 : 0.2
icon.source: "qrc:/images/icon_interval.png"
icon.width: 32
icon.height: 32
icon.color: "transparent"
background: Rectangle {
color: "transparent"
}
onClicked: {
root.intervalInstant = !root.intervalInstant;
var interval = root.intervalInstant ? 0 : 1000;
for (const psystem of root.particleSystems)
psystem.loggingData.loggingInterval = interval;
}
}
Component {
id: systemComponent
Row {
id: systemItem
required property ParticleSystem3D modelData
Text {
width: root.itemWidth
horizontalAlignment: Text.AlignHCenter
color: "#ffffff"
font.pointSize: AppSettings.fontSizeSmall
text: systemItem.modelData.seed
}
Text {
width: root.itemWidth
horizontalAlignment: Text.AlignHCenter
color: "#ffffff"
font.pointSize: AppSettings.fontSizeSmall
text: systemItem.modelData.loggingData.updates
}
Text {
width: root.itemWidth
horizontalAlignment: Text.AlignHCenter
color: "#ffffff"
font.pointSize: AppSettings.fontSizeSmall
text: systemItem.modelData.loggingData.particlesMax
}
Text {
width: root.itemWidth
horizontalAlignment: Text.AlignHCenter
color: "#ffffff"
font.pointSize: AppSettings.fontSizeSmall
text: systemItem.modelData.loggingData.particlesUsed
}
Text {
width: root.itemWidth
horizontalAlignment: Text.AlignHCenter
color: "#ffffff"
font.pointSize: AppSettings.fontSizeSmall
text: systemItem.modelData.loggingData.time.toFixed(4)
}
Text {
width: root.itemWidth
horizontalAlignment: Text.AlignHCenter
color: "#ffffff"
font.pointSize: AppSettings.fontSizeSmall
text: systemItem.modelData.loggingData.timeAverage.toFixed(4)
}
Text {
width: root.itemWidth
horizontalAlignment: Text.AlignHCenter
color: "#ffffff"
font.pointSize: AppSettings.fontSizeSmall
text: systemItem.modelData.loggingData.timeDeviation.toFixed(4)
}
}
}
Column {
id: tableContent
width: parent.width
anchors.verticalCenter: parent.verticalCenter
visible: root.loggingEnabled
Row {
Text {
width: root.itemWidth
horizontalAlignment: Text.AlignHCenter
color: "#ffffff"
font.pointSize: AppSettings.fontSizeSmall
text: qsTr("SEED")
}
Text {
width: root.itemWidth
horizontalAlignment: Text.AlignHCenter
color: "#ffffff"
font.pointSize: AppSettings.fontSizeSmall
text: qsTr("UPDATES")
}
Text {
width: root.itemWidth
horizontalAlignment: Text.AlignHCenter
color: "#ffffff"
font.pointSize: AppSettings.fontSizeSmall
text: qsTr("P. MAX")
}
Text {
width: root.itemWidth
horizontalAlignment: Text.AlignHCenter
color: "#ffffff"
font.pointSize: AppSettings.fontSizeSmall
text: qsTr("P. USED")
}
Text {
width: root.itemWidth
horizontalAlignment: Text.AlignHCenter
color: "#ffffff"
font.pointSize: AppSettings.fontSizeSmall
text: qsTr("TIME")
}
Text {
width: root.itemWidth
horizontalAlignment: Text.AlignHCenter
color: "#ffffff"
font.pointSize: AppSettings.fontSizeSmall
text: qsTr("TIME AVG.")
}
Text {
width: root.itemWidth
horizontalAlignment: Text.AlignHCenter
color: "#ffffff"
font.pointSize: AppSettings.fontSizeSmall
text: qsTr("TIME DEV.")
}
}
Repeater {
model: root.particleSystems
delegate: systemComponent
}
}
}
|