// $Header: https://oberon.oapd.inaf.it/shins/trunk/shins/src/tiptilt_ctrl/bcu/Interface/Sharknir/Bcu/SharknirBcuSlopeDiagnosticRecord.cpp 1145 2019-01-22 17:42:46Z depa $
#include "tiptilt_ctrl/bcu/Interface/Sharknir/Bcu/SharknirBcuSlopeDiagnosticRecord.h"

#define createStringFromFixedSizeSlopeRecordArray(BUFFER, ARRAY_NAME)         \
    std::string(                                                              \
            reinterpret_cast<char *>(&recordCast((BUFFER))-> ARRAY_NAME[0]), \
            sizeof(SharknirBcuSlopeDiagnosticRecord:: ARRAY_NAME));

namespace Sharknir { namespace Bcu {


std::string SharknirBcuSlopeDiagnosticRecord::getRawTTSlopesAsString(
        const Basda::Microgate::ByteBufferPtr& b)
{
    return createStringFromFixedSizeSlopeRecordArray(b, sc_TTSlopesVector);
}

// std::string SharknirBcuSlopeDiagnosticRecord::getRawMeanVoltageFloatsAsString(
//            const Basda::Microgate::ByteBufferPtr& b)
// {
//     return createStringFromFixedSizeSlopeRecordArray(b, sc_HVCMeanVoltage);
// }

// std::string SharknirBcuSlopeDiagnosticRecord::getRawMeanPositionFloatsAsString(
//            const Basda::Microgate::ByteBufferPtr& b)
// {
//     return createStringFromFixedSizeSlopeRecordArray(b, sc_HVCMeanPosition);
// }

std::string SharknirBcuSlopeDiagnosticRecord::getRawFCVectorAsString(
           const Basda::Microgate::ByteBufferPtr& b)
{
    return std::string(reinterpret_cast<char*>(&recordCast(b)->sc_FCVector),
            sizeof(SharknirBcuSlopeDiagnosticRecord::sc_FCVector));
}

}
}
