|
- #include "AutomatedTestReport.h"
- #include "GlobalDefine.h"
-
- CAutomatedTestReport::CAutomatedTestReport(QObject *parent) :
- QObject(parent)
- {
- }
-
- int CAutomatedTestReport::ClearAutomatedTestReport()
- {
- mTestPinsResult.clear();
- mPinCount = 0;
- return RET_OK;
- }
-
- int CAutomatedTestReport::SetPinCount(int Pincount)
- {
- mPinCount = Pincount;
- mTestPinsResult.clear();
- for(int i = 0; i < Pincount; i++)
- {
- mTestPinsResult.append(CPinTestResult(i+1));
- }
-
- return RET_OK;
- }
-
- int CAutomatedTestReport::SetPinResult(int PinNumber, bool ContinuityPassed, bool IsolationPassed)
- {
- int ZeroBasedPinIndex = PinNumber - 1;
- if(ZeroBasedPinIndex < 0 || ZeroBasedPinIndex >= mPinCount) //Try not to crash.
- {
- return RET_ERROR;
- }
-
- mTestPinsResult[ZeroBasedPinIndex].mIsolationTestPass = IsolationPassed;
- mTestPinsResult[ZeroBasedPinIndex].mContinuityTestPass = ContinuityPassed;
-
- return RET_OK;
- }
-
-
- int CAutomatedTestReport::SetPinContinuityResult(int PinNumber,bool ContinuityPassed)
- {
- int ZeroBasedPinIndex = PinNumber - 1;
- if(ZeroBasedPinIndex < 0 || ZeroBasedPinIndex >= mPinCount) //Try not to crash.
- {
- return RET_ERROR;
- }
-
- mTestPinsResult[ZeroBasedPinIndex].mContinuityTestPass = ContinuityPassed;
-
- return RET_OK;
- }
-
- int CAutomatedTestReport::SetPinIsolationResult(int PinNumber, bool IsolationPassed)
- {
- int ZeroBasedPinIndex = PinNumber - 1;
- if(ZeroBasedPinIndex < 0 || ZeroBasedPinIndex >= mPinCount) //Try not to crash.
- {
- return RET_ERROR;
- }
-
- mTestPinsResult[ZeroBasedPinIndex].mIsolationTestPass = IsolationPassed;
-
- return RET_OK;
- }
-
- int CAutomatedTestReport::SetPinSecondTestResult(int PinNumber, bool SecondTestPassed)
- {
- int ZeroBasedPinIndex = PinNumber - 1;
- if(ZeroBasedPinIndex < 0 || ZeroBasedPinIndex >= mPinCount) //Try not to crash.
- {
- return RET_ERROR;
- }
-
- mTestPinsResult[ZeroBasedPinIndex].mSecondTestPass = SecondTestPassed;
-
- return RET_OK;
- }
-
- CPinTestResult::CPinTestResult(int PinNumber)
- {
- mPinNumber = PinNumber;
- mContinuityTestPass = PIN_TEST_RESULT_UNKNOWN;
- mIsolationTestPass = PIN_TEST_RESULT_UNKNOWN;
- mSecondTestPass = PIN_TEST_RESULT_UNKNOWN;
- mShortedPinsList.clear();
- }
-
- CPinTestResult::~CPinTestResult()
- {
- mShortedPinsList.clear();
- }
|