Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pulsatingscience
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
einsteinathome
pulsatingscience
Commits
c0e08c4f
Commit
c0e08c4f
authored
16 years ago
by
Oliver Bock
Browse files
Options
Downloads
Patches
Plain Diff
Added IYA2009 demo mode
parent
9736c7b4
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/pulsatingscience.cpp
+38
-0
38 additions, 0 deletions
src/pulsatingscience.cpp
src/pulsatingscience.h
+6
-0
6 additions, 0 deletions
src/pulsatingscience.h
with
44 additions
and
0 deletions
src/pulsatingscience.cpp
+
38
−
0
View file @
c0e08c4f
...
...
@@ -36,6 +36,7 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
m_statusBarVisible
=
ui
.
actionStatus_bar
->
isChecked
();
m_animControlVisible
=
true
;
m_animControlFloating
=
ui
.
dockAnimControl
->
isFloating
();
m_hiddenDemoModeActivated
=
false
;
// register alternate shortcuts (will be enabled when menu is hidden)
m_runShortcut
=
new
QShortcut
(
ui
.
actionRun
->
shortcut
(),
this
);
...
...
@@ -53,6 +54,9 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
m_fullscreenShortcut
=
new
QShortcut
(
ui
.
actionFullscreen
->
shortcut
(),
this
);
m_fullscreenShortcut
->
setEnabled
(
false
);
// register "hidden" demo mode shortcut for IYA2009 exhibition
m_hiddenShortcut
=
new
QShortcut
(
Qt
::
CTRL
+
Qt
::
SHIFT
+
Qt
::
ALT
+
Qt
::
Key_D
,
this
);
// establish object communications
connect
(
ui
.
pushRun
,
SIGNAL
(
clicked
()),
ui
.
pulsarGlWidget
,
SLOT
(
runAnimation
()));
...
...
@@ -95,6 +99,9 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
connect
(
ui
.
pulsarGlWidget
,
SIGNAL
(
pulseProfileUpdated
(
const
QVector
<
double
>&
)),
ui
.
pulseScopeWidget
,
SLOT
(
drawCurve
(
const
QVector
<
double
>&
)),
Qt
::
DirectConnection
);
connect
(
m_hiddenShortcut
,
SIGNAL
(
activated
()),
this
,
SLOT
(
toggleHiddenDemoMode
()));
}
PulsatingScience
::~
PulsatingScience
()
...
...
@@ -133,6 +140,21 @@ PulsatingScience::~PulsatingScience()
m_fullscreenShortcut
->
disconnect
();
delete
m_fullscreenShortcut
;
}
if
(
m_hiddenShortcut
)
{
m_hiddenShortcut
->
disconnect
();
delete
m_hiddenShortcut
;
}
}
void
PulsatingScience
::
closeEvent
(
QCloseEvent
*
event
)
{
if
(
m_hiddenDemoModeActivated
)
{
event
->
ignore
();
}
else
{
event
->
accept
();
}
}
void
PulsatingScience
::
on_pushRun_clicked
()
...
...
@@ -402,3 +424,19 @@ void PulsatingScience::updatePulsarSemiMajorAxisValue(double value)
ui
.
lcdPulsarSemiMajorAxis
->
display
(
QString
::
number
(
value
,
'f'
,
1
));
}
}
void
PulsatingScience
::
toggleHiddenDemoMode
()
{
if
(
m_hiddenDemoModeActivated
)
{
menuBarToggled
();
window
()
->
setWindowState
(
windowState
()
&
~
Qt
::
WindowFullScreen
);
ui
.
dockAnimControl
->
setFeatures
(
QDockWidget
::
DockWidgetClosable
|
QDockWidget
::
DockWidgetMovable
|
QDockWidget
::
DockWidgetFloatable
);
m_hiddenDemoModeActivated
=
false
;
}
else
{
menuBarToggled
();
window
()
->
setWindowState
(
windowState
()
|
Qt
::
WindowFullScreen
);
ui
.
dockAnimControl
->
setFeatures
(
QDockWidget
::
NoDockWidgetFeatures
);
m_hiddenDemoModeActivated
=
true
;
}
}
This diff is collapsed.
Click to expand it.
src/pulsatingscience.h
+
6
−
0
View file @
c0e08c4f
...
...
@@ -27,6 +27,7 @@
#include
"ui_pulsatingscience.h"
class
PulsatingScience
:
public
QMainWindow
{
Q_OBJECT
...
...
@@ -35,6 +36,8 @@ public:
PulsatingScience
(
QWidget
*
parent
=
0
);
~
PulsatingScience
();
void
closeEvent
(
QCloseEvent
*
event
);
public
slots
:
void
on_pushRun_clicked
();
void
on_pushPause_clicked
();
...
...
@@ -64,6 +67,7 @@ public slots:
void
on_actionAbout_activated
();
void
updatePulsarSemiMajorAxisValue
(
double
value
);
void
toggleHiddenDemoMode
();
private:
Ui
::
PulsatingScienceClass
ui
;
...
...
@@ -75,6 +79,7 @@ private:
QShortcut
*
m_rotationAxesShortcut
;
QShortcut
*
m_menuBarShortcut
;
QShortcut
*
m_fullscreenShortcut
;
QShortcut
*
m_hiddenShortcut
;
bool
m_permanentOrbits
;
bool
m_rotationAxesVisible
;
...
...
@@ -82,6 +87,7 @@ private:
bool
m_statusBarVisible
;
bool
m_animControlVisible
;
bool
m_animControlFloating
;
bool
m_hiddenDemoModeActivated
;
};
#endif // PULSATINGSCIENCE_H
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment