CableTestBench/Sources/CableTestBenchDefs.cpp
2019-05-03 13:46:54 -04:00

62 lines
2.6 KiB
C++

#include "CableTestBenchDefs.h"
const int CConnectorDefs::ConnIOMapping[CConnectorDefs::NB_CONNECTOR_TYPE][2] = {
{0,0}, //Unknown
{97,102}, //in 6 pins
{91,104}, //in 14 pins
{73,96}, //in 24 pins
{1,72}, //in 72 pins
{1,90}, //in 90 pins
{1,108}, //in 108 pins
{1,108}, //in 120 pins
{97,102}, //out 6 pins
{91,104}, //out 14 pins
{73,96}, //out 24 pins
{1,72}, //out 72 pins
{1,108}, //out 108 pins
};
const int CConnectorDefs::ConnPinCount[NB_CONNECTOR_TYPE] = {0, 6, 14, 24, 72, 90, 108, 120, 6, 14, 24, 72, 108};
const int CConnectorDefs::GetPinCount(eConnectorType type)
{
if(type < 0 || type >= NB_CONNECTOR_TYPE)
{
return 0;
}
return ConnPinCount[type];
}
const int CConnectorDefs::GetConnectorIOMappingStart(eConnectorType type)
{
if(type < 0 || type >= NB_CONNECTOR_TYPE)
{
return ConnIOMapping[UNKNOWN_CONNECTOR_TYPE][IO_MAPPING_START_INDEX];
}
return ConnIOMapping[type][IO_MAPPING_START_INDEX];
}
const int CConnectorDefs::GetConnectorIOMappingEnd(eConnectorType type)
{
if(type < 0 || type >= NB_CONNECTOR_TYPE)
{
return ConnIOMapping[UNKNOWN_CONNECTOR_TYPE][IO_MAPPING_END_INDEX];
}
return ConnIOMapping[type][IO_MAPPING_END_INDEX];
}
const int * CConnectorDefs::GetConnectorIOMapping(eConnectorType type)
{
if(type < 0 || type >= NB_CONNECTOR_TYPE)
{
return ConnIOMapping[UNKNOWN_CONNECTOR_TYPE];
}
return ConnIOMapping[type];
}