CableTestBench/Sources/Connector.cpp
2019-05-08 14:17:31 -04:00

46 lines
886 B
C++

#include "Connector.h"
#include "GlobalDefine.h"
CConnector::CConnector()
{
mPinCount = 0;
mIOModuleRangeBegin = mIOModuleRangeEnd = 0;
mIOInterfaceHandle = 0;
}
int CConnector::SetIOInterface(CIOModulesInterface *IFHandle)
{
mIOInterfaceHandle = IFHandle;
return RET_OK;
}
int CConnector::GetPinCount()
{
return mPinCount;
}
int CConnector::SetConnectorType(CConnectorDefs::eConnectorType type)
{
mConnectorType = type;
mPinCount = CConnectorDefs::GetPinCount(type);
mIOModuleRangeBegin = CConnectorDefs::GetConnectorIOMappingStart(type);
mIOModuleRangeEnd = CConnectorDefs::GetConnectorIOMappingEnd(type);
return RET_OK;
}
bool CConnector::IsConnectorDefined()
{
if(mPinCount == 0)
{
return false;
}
return true;
}
CConnectorDefs::eConnectorType CConnector::GetConnectorType()
{
return mConnectorType;
}