Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Redstart
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
Redstart
Commits
c1c89622
Commit
c1c89622
authored
Dec 05, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Circulating sound source test is now running
parent
e5887009
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
17 deletions
+52
-17
src/RedstartRunCirculatingSourceDialog.cpp
src/RedstartRunCirculatingSourceDialog.cpp
+44
-13
src/RedstartRunCirculatingSourceDialog.h
src/RedstartRunCirculatingSourceDialog.h
+1
-1
src/RedstartWindow.cpp
src/RedstartWindow.cpp
+7
-3
No files found.
src/RedstartRunCirculatingSourceDialog.cpp
View file @
c1c89622
...
...
@@ -38,11 +38,13 @@ RedstartRunCirculatingSourceDialog::RedstartRunCirculatingSourceDialog( QWidget
if
(
QDir
(
sLastBrowseFolder
).
exists
()
)
m_oLastBasePath
.
setCurrent
(
sLastBrowseFolder
);
m_dAzimuth
=
0.0
f
;
m_dElevation
=
0.0
f
;
connect
(
&
m_qVAUpdateTimer
,
SIGNAL
(
timeout
()
),
this
,
SLOT
(
UpdateScene
()
)
);
m_qVAUpdateTimer
=
new
QTimer
(
this
);
connect
(
m_qVAUpdateTimer
,
SIGNAL
(
timeout
()
),
this
,
SLOT
(
UpdateScene
()
)
);
}
RedstartRunCirculatingSourceDialog
::~
RedstartRunCirculatingSourceDialog
()
...
...
@@ -50,6 +52,7 @@ RedstartRunCirculatingSourceDialog::~RedstartRunCirculatingSourceDialog()
if
(
m_oLastBasePath
.
exists
()
)
m_qSettings
.
setValue
(
"Redstart/last_browse_folder"
,
m_oLastBasePath
.
absolutePath
()
);
delete
ui
;
delete
m_qVAUpdateTimer
;
}
void
RedstartRunCirculatingSourceDialog
::
SetVAInterface
(
IVAInterface
*
pVA
)
...
...
@@ -63,10 +66,12 @@ void RedstartRunCirculatingSourceDialog::Start()
try
{
CreateScene
();
StartUpdateTimer
();
ui
->
pushButton_start
->
setEnabled
(
false
);
ui
->
pushButton_stop
->
setEnabled
(
true
);
ui
->
pushButton_run
->
setEnabled
(
false
);
StartUpdateTimer
();
}
catch
(
CVAException
&
e
)
{
...
...
@@ -80,6 +85,7 @@ void RedstartRunCirculatingSourceDialog::Start()
void
RedstartRunCirculatingSourceDialog
::
Stop
()
{
StopUpdateTimer
();
ui
->
pushButton_start
->
setEnabled
(
true
);
ui
->
pushButton_stop
->
setEnabled
(
false
);
ui
->
pushButton_run
->
setEnabled
(
true
);
...
...
@@ -90,15 +96,18 @@ void RedstartRunCirculatingSourceDialog::Run()
try
{
CreateScene
();
StartUpdateTimer
();
}
catch
(
CVAException
&
e
)
{
QString
sErrorMessage
=
QString
(
"Could not run scene: %1"
).
arg
(
QString
::
fromStdString
(
e
.
ToString
()
)
);
QString
sErrorMessage
=
QString
(
"Could not
create and
run scene: %1"
).
arg
(
QString
::
fromStdString
(
e
.
ToString
()
)
);
QErrorMessage
oErrMsg
;
oErrMsg
.
showMessage
(
sErrorMessage
);
oErrMsg
.
exec
();
return
;
}
StartUpdateTimer
();
}
void
RedstartRunCirculatingSourceDialog
::
on_pushButton_run_clicked
()
...
...
@@ -140,16 +149,27 @@ void RedstartRunCirculatingSourceDialog::CreateScene()
void
RedstartRunCirculatingSourceDialog
::
DeleteScene
()
{
m_pVAInterface
->
SetSoundSourceSignalSource
(
m_iSourceID
,
""
);
m_pVAInterface
->
DeleteSoundSource
(
m_iSourceID
);
m_pVAInterface
->
DeleteSoundReceiver
(
m_iReceiverID
);
m_pVAInterface
->
DeleteDirectivity
(
m_iHRIRID
);
m_pVAInterface
->
DeleteSignalSource
(
m_sSignalID
.
toStdString
()
);
}
void
RedstartRunCirculatingSourceDialog
::
UpdateScene
()
{
VAVec3
v3Pos
;
v3Pos
.
x
=
-
std
::
sin
(
grad2rad
(
m_dAzimuth
)
)
*
ui
->
doubleSpinBox_radius
->
value
();
v3Pos
.
y
=
std
::
cos
(
grad2rad
(
m_dElevation
)
)
*
ui
->
doubleSpinBox_radius
->
value
();
v3Pos
.
y
=
std
::
sin
(
grad2rad
(
m_dElevation
)
)
*
ui
->
doubleSpinBox_radius
->
value
();
v3Pos
.
z
=
-
std
::
cos
(
grad2rad
(
m_dAzimuth
)
)
*
ui
->
doubleSpinBox_radius
->
value
();
m_pVAInterface
->
SetSoundSourcePosition
(
m_iSourceID
,
v3Pos
);
try
{
m_pVAInterface
->
SetSoundSourcePosition
(
m_iSourceID
,
v3Pos
);
}
catch
(
CVAException
&
e
)
{
Stop
();
}
m_dAzimuth
+=
ui
->
doubleSpinBox_azi_inc
->
value
();
m_dElevation
+=
ui
->
doubleSpinBox_ele_inc
->
value
();
...
...
@@ -161,20 +181,31 @@ void RedstartRunCirculatingSourceDialog::UpdateScene()
void
RedstartRunCirculatingSourceDialog
::
StartUpdateTimer
()
{
double
dTimeout
=
ui
->
doubleSpinBox_timeout
->
value
();
m_qVAUpdateTimer
.
setTimerType
(
Qt
::
TimerType
::
PreciseTimer
);
m_qVAUpdateTimer
.
setInterval
(
ceil
(
dTimeout
*
1000.0
f
)
);
const
double
dTimeout
=
ui
->
doubleSpinBox_timeout
->
value
();
const
int
iIntervalMS
=
ceil
(
dTimeout
*
1000.0
f
);
m_qVAUpdateTimer
->
setInterval
(
iIntervalMS
);
m_qVAUpdateTimer
->
start
();
m_dRuntime
=
0.0
f
;
}
void
RedstartRunCirculatingSourceDialog
::
StopUpdateTimer
()
{
m_qVAUpdateTimer
.
stop
();
m_qVAUpdateTimer
->
stop
();
m_dRuntime
=
0.0
f
;
m_dAzimuth
=
0.0
f
;
m_dElevation
=
0.0
f
;
DeleteScene
();
try
{
DeleteScene
();
}
catch
(
CVAException
&
e
)
{
QString
sErrorMessage
=
QString
(
"Could not delete scene: %1"
).
arg
(
QString
::
fromStdString
(
e
.
ToString
()
)
);
QErrorMessage
oErrMsg
;
oErrMsg
.
showMessage
(
sErrorMessage
);
oErrMsg
.
exec
();
}
}
void
RedstartRunCirculatingSourceDialog
::
on_pushButton_BrowseDemoSound_clicked
()
...
...
src/RedstartRunCirculatingSourceDialog.h
View file @
c1c89622
...
...
@@ -56,7 +56,7 @@ private:
QString
m_sFileBaseName
;
QSettings
m_qSettings
;
IVAInterface
*
m_pVAInterface
;
QTimer
m_qVAUpdateTimer
;
QTimer
*
m_qVAUpdateTimer
;
int
m_iSourceID
,
m_iReceiverID
,
m_iHRIRID
;
QString
m_sSignalID
;
...
...
src/RedstartWindow.cpp
View file @
c1c89622
...
...
@@ -155,8 +155,10 @@ void RedstartWindow::LoadConfiguration()
ui
->
checkBox_redstart_network_connect_as_client
->
setChecked
(
m_qSettings
.
value
(
"Redstart/network/client_mode"
).
toBool
()
);
if
(
m_qSettings
.
contains
(
"Redstart/autostart"
)
)
ui
->
checkBox_redstart_auto_start
->
setChecked
(
m_qSettings
.
value
(
"Redstart/autostart"
).
toBool
()
);
{
bool
bAutostart
=
m_qSettings
.
value
(
"Redstart/autostart"
).
toBool
();
ui
->
checkBox_redstart_auto_start
->
setChecked
(
bAutostart
);
}
m_iPortaudioDefaultDevice
=
m_qSettings
.
value
(
"Redstart/audio/portaudio_default_device"
,
-
1
).
toInt
();
...
...
@@ -204,7 +206,9 @@ void RedstartWindow::StoreConfiguration()
m_qSettings
.
setValue
(
"Redstart/network/port"
,
iPort
);
m_qSettings
.
setValue
(
"Redstart/network/client_mode"
,
ui
->
checkBox_redstart_network_connect_as_client
->
isChecked
()
);
m_qSettings
.
setValue
(
"Redstart/autostart"
,
ui
->
checkBox_redstart_auto_start
->
isChecked
()
);
bool
bAutostart
=
ui
->
checkBox_redstart_auto_start
->
isChecked
();
m_qSettings
.
setValue
(
"Redstart/autostart"
,
bAutostart
);
m_qSettings
.
setValue
(
"Redstart/audio/portaudio_default_device"
,
m_iPortaudioDefaultDevice
);
int
iLastDevice
=
ui
->
comboBox_audio_iface_device
->
currentIndex
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment