Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ITAPropagationModels
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Institute of Technical Acoustics (ITA)
ITAPropagationModels
Commits
7238a84d
Commit
7238a84d
authored
6 years ago
by
Armin Erraji
Browse files
Options
Downloads
Patches
Plain Diff
Added functions GetNumSensorChannels and HasSameSensorAnchor().
parent
28dc2dc5
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
include/ITAPropagationModels/FilterEngine.h
+6
-1
6 additions, 1 deletion
include/ITAPropagationModels/FilterEngine.h
src/ITAPropagationModels/FilterEngine.cpp
+29
-8
29 additions, 8 deletions
src/ITAPropagationModels/FilterEngine.cpp
with
35 additions
and
9 deletions
include/ITAPropagationModels/FilterEngine.h
+
6
−
1
View file @
7238a84d
...
@@ -92,7 +92,12 @@ namespace ITAPropagationModels
...
@@ -92,7 +92,12 @@ namespace ITAPropagationModels
unique_ptr
<
ITABase
::
CHDFTSpectra
>
m_pAccumulatedSpectra
;
//!< Gathered propagation paths from list
unique_ptr
<
ITABase
::
CHDFTSpectra
>
m_pAccumulatedSpectra
;
//!< Gathered propagation paths from list
unique_ptr
<
ITABase
::
CHDFTSpectra
>
m_pTempPropPathSpectra
;
//!< Single prop-path spectra
unique_ptr
<
ITABase
::
CHDFTSpectra
>
m_pTempPropPathSpectra
;
//!< Single prop-path spectra
static
struct
m_DefaultValues
static
struct
m_DefaultReflectionModel
//!< Default values for reflections
{
int
iModel
=
1
;
};
static
struct
m_DefaultDiffractionModel
//!< Default values for diffractions
{
{
int
iModel
=
1
;
int
iModel
=
1
;
};
};
...
...
This diff is collapsed.
Click to expand it.
src/ITAPropagationModels/FilterEngine.cpp
+
29
−
8
View file @
7238a84d
...
@@ -24,18 +24,39 @@ CFilterEngine::~CFilterEngine()
...
@@ -24,18 +24,39 @@ CFilterEngine::~CFilterEngine()
int
CFilterEngine
::
GetNumSensorChannels
(
const
ITAGeo
::
CPropagationPathList
&
oPathList
)
int
CFilterEngine
::
GetNumSensorChannels
(
const
ITAGeo
::
CPropagationPathList
&
oPathList
)
{
{
//Check for correct structur of oPathList
if
(
!
HasSameSensorAnchor
(
oPathList
))
if
(
!
HasSameSensorAnchor
(
oPathList
))
ITA_EXCEPT1
(
INVALID_PARAMETER
,
"The propagation path list has more than multiple sensor anchors."
);
ITA_EXCEPT1
(
INVALID_PARAMETER
,
"The propagation path list has more than multiple sensor anchors
or last anchor of paths is not a sensor
."
);
int
iNumChannels
;
//Cast the sensor that is always the last propagation anchor of a path
auto
pPath
=
oPathList
[
0
];
auto
pSensor
=
std
::
dynamic_pointer_cast
<
ITAGeo
::
CSensor
>
(
oPathList
[
0
][
oPathList
[
0
].
size
()
-
1
]);
return
0
;
return
pSensor
->
iNumChannels
;
}
}
bool
CFilterEngine
::
HasSameSensorAnchor
(
const
ITAGeo
::
CPropagationPathList
&
oPathList
)
bool
CFilterEngine
::
HasSameSensorAnchor
(
const
ITAGeo
::
CPropagationPathList
&
oPathList
)
{
{
ITA_EXCEPT_NOT_IMPLEMENTED
;
return
false
;
shared_ptr
<
ITAGeo
::
CSensor
>
pSensor
=
nullptr
;
//Last anchor of the paths must be a sensor and always the same sensor
for
(
auto
&
oPath
:
oPathList
)
{
if
(
oPath
[
oPath
.
size
()
-
1
]
->
iAnchorType
==
ITAGeo
::
CPropagationAnchor
::
ACOUSTIC_SENSOR
)
{
if
(
pSensor
=
nullptr
)
pSensor
=
std
::
dynamic_pointer_cast
<
ITAGeo
::
CSensor
>
(
oPath
[
oPath
.
size
()
-
1
]);
else
if
(
pSensor
!=
oPath
[
oPath
.
size
()
-
1
])
return
false
;
// not the same sensor
}
else
{
return
false
;
// last element not a sensor
}
}
//All paths end with the same sensor anchor
return
true
;
}
}
void
CFilterEngine
::
ApplyAcousticModels
(
ITAGeo
::
CPropagationPathList
&
oPathList
)
void
CFilterEngine
::
ApplyAcousticModels
(
ITAGeo
::
CPropagationPathList
&
oPathList
)
...
...
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