Commit 7238a84d authored by Armin Erraji's avatar Armin Erraji

Added functions GetNumSensorChannels and HasSameSensorAnchor().

parent 28dc2dc5
......@@ -92,7 +92,12 @@ namespace ITAPropagationModels
unique_ptr<ITABase::CHDFTSpectra> m_pAccumulatedSpectra; //!< Gathered propagation paths from list
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;
};
......
......@@ -22,20 +22,41 @@ 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))
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;
auto pPath = oPathList[0];
return 0;
//Cast the sensor that is always the last propagation anchor of a path
auto pSensor = std::dynamic_pointer_cast<ITAGeo::CSensor>(oPathList[0][oPathList[0].size() - 1]);
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment