Start getTransmissionData.
This commit is contained in:
@@ -24,6 +24,7 @@ namespace Recon
|
||||
std::vector<Aurora::Matrix> receiverNormals;
|
||||
std::vector<Aurora::Matrix> senderPositions;
|
||||
std::vector<Aurora::Matrix> receiverPositions;
|
||||
std::vector<Aurora::Matrix> sensData;
|
||||
};
|
||||
|
||||
GeometryInfo getGeometryInfo(const Aurora::Matrix& aMotorPos, const Aurora::Matrix& aTransformationMatrices,
|
||||
|
||||
66
src/common/temperatureCalculation/extractTasTemperature.cpp
Normal file
66
src/common/temperatureCalculation/extractTasTemperature.cpp
Normal file
@@ -0,0 +1,66 @@
|
||||
#include "extractTasTemperature.h"
|
||||
#include "Function2D.h"
|
||||
#include "Function.h"
|
||||
|
||||
using namespace Aurora;
|
||||
|
||||
namespace
|
||||
{
|
||||
double getTemperatureForTas(const Matrix& aTasTemperature, double aTasNum, double aMotorPos, const Matrix& aReferenceTemps,
|
||||
double aMinTemperature, double aMaxTemperature)
|
||||
{
|
||||
double result = NAN;
|
||||
if(aMotorPos == 1)
|
||||
{
|
||||
for(int i=0; i<aTasTemperature.getDimSize(1); ++i)
|
||||
{
|
||||
if(aTasNum == aTasTemperature[2*i + 1])
|
||||
{
|
||||
result = aTasTemperature[2*i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(result != result)
|
||||
{
|
||||
if(aReferenceTemps.getDimSize(1) >= aMotorPos)
|
||||
{
|
||||
result = mean(aReferenceTemps($,aMotorPos).toMatrix(), FunctionDirection::All, false)[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
result = mean(aReferenceTemps, FunctionDirection::All, false)[0];
|
||||
}
|
||||
}
|
||||
|
||||
if (result < aMinTemperature)
|
||||
{
|
||||
return aMinTemperature;
|
||||
}
|
||||
|
||||
if (result > aMaxTemperature)
|
||||
{
|
||||
return aMaxTemperature;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Matrix Recon::extractTasTemperature(const Matrix& aTasTemperature, const Matrix& aTasList, const Matrix& aMotorPosList, const Matrix& aDefaultTemps,
|
||||
double aMinTemperature, double aMaxTemperature)
|
||||
{
|
||||
size_t resultSize = aTasList.getDataSize() * aMotorPosList.getDataSize();
|
||||
double* resultData = Aurora::malloc(resultSize);
|
||||
for(int i=0; i<aMotorPosList.getDataSize(); ++i)
|
||||
{
|
||||
for(int j=0; j<aTasList.getDataSize(); ++j)
|
||||
{
|
||||
resultData[i*aTasList.getDataSize() + j] = getTemperatureForTas(aTasTemperature, aTasList[j], aMotorPosList[i], aDefaultTemps, aMinTemperature, aMaxTemperature);
|
||||
}
|
||||
}
|
||||
Matrix result = Matrix::New(resultData, aTasList.getDataSize(), aMotorPosList.getDataSize());
|
||||
result.printf();
|
||||
return result;
|
||||
}
|
||||
20
src/common/temperatureCalculation/extractTasTemperature.h
Normal file
20
src/common/temperatureCalculation/extractTasTemperature.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef EXTRACT_TAS_TEMPERATURE_H
|
||||
#define EXTRACT_TAS_TEMPERATURE_H
|
||||
|
||||
#include "Matrix.h"
|
||||
|
||||
namespace Recon
|
||||
{
|
||||
struct TasTemps
|
||||
{
|
||||
Aurora::Matrix waterTempPreCalc_rl;
|
||||
Aurora::Matrix waterTempPreCalc_sl;
|
||||
Aurora::Matrix waterTempRefPreCalc_rl;
|
||||
Aurora::Matrix waterTempRefPreCalc_sl;
|
||||
};
|
||||
|
||||
Aurora::Matrix extractTasTemperature(const Aurora::Matrix& aTasTemperature, const Aurora::Matrix& aTasList, const Aurora::Matrix& aMotorPosList,
|
||||
const Aurora::Matrix& aDefaultTemps,double aMinTemperature, double aMaxTemperature);
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user