10#include <unordered_map>
73 static const size_t HEADER_LEN =
sizeof(U16) +
sizeof(U16) +
sizeof(U16) +
DATE_LEN +
sizeof(U8);
115 std::vector<sPwPhysicalInformation*> pPhysInfoList;
118 typedef std::vector<sPwPhysicalInformation*>::size_type
size_type;
122 for (std::vector<sPwPhysicalInformation*>::iterator it = pPhysInfoList.begin(); it != pPhysInfoList.end(); it++)
123 (*it)->~sPwPhysicalInformation();
127 pPhysInfoList.push_back(pPwPhysInfo);
131 return pPhysInfoList.size();
135 assert(Index < pPhysInfoList.size());
136 return *(pPhysInfoList[Index]);
140 assert(Index < pPhysInfoList.size());
141 return *(pPhysInfoList[Index]);
205 #define HEAD_DEF_SIZE 2
246 :
B0X(32768),
B0Y(32768),
B0Z(32768),
G0X(1),
G0Y(1),
G0Z(1),
T0(0),
CT0X(0),
CT0Y(0),
CT0Z(0),
CTGX(0),
CTGY(0),
CTGZ(0)
249 static F32
RawBtoB(
const U16 & rRawB,
const U16 & rRawT,
const U16 & rB0,
const F32 & rG0,
const U16 & rT0,
const F32 & rCT0,
const F32 & rCTG)
251 I32 l_BOffsetless = (I32)rRawB - (I32)rB0;
252 I32 l_TOffsetless = (I32)rRawT - (I32)rT0;
253 F32 l_TOffsetCorrected = l_TOffsetless * rCT0;
254 F32 l_TGainCorrected = l_TOffsetless * rCTG;
255 F32 l_Gain = rG0 + l_TGainCorrected;
256 F32 l_BCorrected_T = (l_BOffsetless - l_TOffsetCorrected) * l_Gain;
257 return l_BCorrected_T;
260 static F32
Norm(
const F32 & rBx,
const F32 & rBy,
const F32 & rBz)
262 return sqrt(rBx*rBx + rBy * rBy + rBz * rBz);
265 void Calibrate(
const U16 & rRawBx,
const U16 & rRawBy,
const U16 & rRawBz,
const U16 & rRawT,
266 F32 & rBx_T, F32 & rBy_T, F32 & rBz_T, F32 & rNorm_T)
271 rNorm_T =
Norm(Bx_T, By_T, Bz_T);
316 const std::vector<U8>::const_iterator m_beg, m_end;
326 bool l_ParseIdentification(
sIdentification & rId, std::vector<U8>::const_iterator Id_beg, std::vector<U8>::const_iterator Id_end);
327 bool l_HeaderVersion(U16 & rVersion);
330 bool l_ParseParmInfo(
size_t HeaderLen,
CParmInfoMap & rParmInfoMap);
336 Parser(std::vector<U8>::const_iterator beg, std::vector<U8>::const_iterator end)
337 : m_beg(beg), m_end(end)
377 static std::vector<U8> l_Raw(
const CParmInfoMap & rParmInfo);
379 template <
typename HeaderType>
380 static std::vector<U8> l_BuildROM(HeaderType Header,
const tParmContentInfo & rParmContent);
Platform Dependent Definitions.
std::vector< sHeadDefinition > tHeadDefList
@ kPwCamPhysicalInformation
@ kPwPhysicalInformationSet
@ kManufactureInformation
std::vector< F32 > tNormalizationTable
std::vector< U8 > tHeadList
std::vector< sTransmissionTimes > tTransmissionTimeList
static const size_t IDENTIFICATION_LEN
static const size_t SN_LEN
std::string ManufacturingDate
static const size_t HEADER_LEN
static const size_t DATE_LEN
char ROMProgrammingDate[DATE_LEN]
sIdentification Identification
static const size_t HEADER_LEN
static const size_t DATE_LEN
char ROMProgrammingDate[DATE_LEN]
static const size_t PARM_INFO_LEN
std::vector< U16 > FreqStepCurve
static const U32 MAX_CURVE_SIZE
std::vector< U16 > MatchingCurve
static const U16 HANDLED_PWP_PHYSICAL_INFORMATION_VERSION
std::vector< U16 > TuningCurve
std::vector< U16 > PulseWidthCurve
std::vector< U16 > NoiseLevelCurve
std::vector< sPwPhysicalInformation * >::size_type size_type
size_type size(void) const
sPwPhysicalInformation & operator[](const size_type Index)
virtual ~sPwPhysicalInformationSet(void)
void Attach(sPwPhysicalInformation *pPwPhysInfo)
sTransmissionTimes(U32 Short_us, U32 Extended_us)
static const U16 HANDLED_PW_FCA_PHYSICAL_INFORMATION_VERSION
static const U16 STRUCT_VERSION
std::vector< sHeadInfo > MultiHeadInfo
sHeadDefinition(U8 HeadNum, U8 PhysInfInd)
static const U16 HANDLED_PW_CAM_PHYSICAL_INFORMATION_VERSION
tNormalizationTable NormalizationTable
std::string NormalizationDate
struct MTL::CPT2026PeripheralROM::sHallInformation::sCalibration Calibration
static const U16 STRUCT_VERSION
void Calibrate(const U16 &rRawBx, const U16 &rRawBy, const U16 &rRawBz, const U16 &rRawT, F32 &rBx_T, F32 &rBy_T, F32 &rBz_T, F32 &rNorm_T)
static F32 RawBtoB(const U16 &rRawB, const U16 &rRawT, const U16 &rB0, const F32 &rG0, const U16 &rT0, const F32 &rCT0, const F32 &rCTG)
static F32 Norm(const F32 &rBx, const F32 &rBy, const F32 &rBz)
bool ParsePwCamPhysInfo(size_t ParmAddress, sPwCamPhysicalInfo &rPhysInfo)
bool ParseHeadList(size_t ParmAddress, tHeadList &rHeadList)
bool ParsePwFcaPhysInfo(size_t ParmAddress, sPwFCAPhysInfo &rPhysInfo)
bool ParsePwPhysicalInfo(size_t ParmAddress, sPwPhysicalInformation &rPhysInfo, std::vector< U8 >::const_iterator &rpBuffer)
bool ParseHallInfo(size_t ParmAddress, sHallInformation &rHallInfo)
bool ParseManufactureInformation(size_t ParmAddress, sManufactureInformation &rManuInfo)
bool ParseMultiHeadInfo(size_t ParmAddress, sMultiHeadInfo &rMultiHeadInfo)
bool ParmAddress(U8 ParmNo, U16 &rParmAddress)
sStandaloneStaticHeader Header(const sStandaloneStaticHeader &rHeader)
bool ParsePwPhysInfoSet(size_t ParmAddress, sPwPhysicalInformationSet &rPwPhysInfoSet)
Parser(std::vector< U8 >::const_iterator beg, std::vector< U8 >::const_iterator end)
bool HasIdentification(sIdentification &rID)
static void Build9046ROM(std::vector< U8 > &rOutputROM, const CPT2026PeripheralROM::sIdentification &rIdentification, const CPT2026PeripheralROM::sManufactureInformation &rManInfo, const CPT2026PeripheralROM::sMultiHeadInfo &rMultiHeadInfo, const CPT2026PeripheralROM::tHeadList &rSearchHeadList, const CPT2026PeripheralROM::tHeadList &rMeasHeadList, const CPT2026PeripheralROM::sPwCamPhysicalInfo &rPwCamPhysInfo, const CPT2026PeripheralROM::sPwPhysicalInformationSet &rPwPhysInfoSet)
static std::vector< U8 > Raw(const CPT2026PeripheralROM::sHallInformation &rHallInfo)
static void Build1226ROM(std::vector< U8 > &rOutputROM, const CPT2026PeripheralROM::sManufactureInformation &rManInfo, const CPT2026PeripheralROM::sPwPhysicalInformation &rPwPhysInfo, const CPT2026PeripheralROM::sHallInformation &rHallInfo)
static std::vector< U8 > BuildROM(sStandaloneStaticHeader Header, const tParmContentInfo &rParmContent)
std::vector< sParmContent > tParmContentInfo
const std::vector< U8 > & rParmData