Dev
This commit is contained in:
@@ -10,6 +10,7 @@ int CAutomatedTestReport::ClearAutomatedTestReport()
|
||||
{
|
||||
mTestPinsResult.clear();
|
||||
mPinCount = 0;
|
||||
mPreTestResult = AUTO_TEST_RESULT_UNKNOWN;
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
@@ -39,6 +40,20 @@ int CAutomatedTestReport::SetPinResult(int PinNumber, bool ContinuityPassed, boo
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
int CAutomatedTestReport::SetPinTestAllPassed(int PinNumber)
|
||||
{
|
||||
int ZeroBasedPinIndex = PinNumber - 1;
|
||||
if(ZeroBasedPinIndex < 0 || ZeroBasedPinIndex >= mPinCount) //Try not to crash.
|
||||
{
|
||||
return RET_ERROR;
|
||||
}
|
||||
|
||||
mTestPinsResult[ZeroBasedPinIndex].mIsolationTestPass = true;
|
||||
mTestPinsResult[ZeroBasedPinIndex].mContinuityTestPass = true;
|
||||
mTestPinsResult[ZeroBasedPinIndex].mPinAssignationTestPass = true;
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
|
||||
int CAutomatedTestReport::SetPinContinuityResult(int PinNumber,bool ContinuityPassed)
|
||||
{
|
||||
@@ -66,6 +81,23 @@ int CAutomatedTestReport::SetPinIsolationResult(int PinNumber, bool IsolationPas
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
int CAutomatedTestReport::SetPinConcordanceTestResult(int PinNumber, bool AssignationTestPassed, int WrongPinNbr)
|
||||
{
|
||||
int ZeroBasedPinIndex = PinNumber - 1;
|
||||
if(ZeroBasedPinIndex < 0 || ZeroBasedPinIndex >= mPinCount) //Try not to crash.
|
||||
{
|
||||
return RET_ERROR;
|
||||
}
|
||||
|
||||
mTestPinsResult[ZeroBasedPinIndex].mPinAssignationTestPass = AssignationTestPassed;
|
||||
if(AssignationTestPassed == false)
|
||||
{
|
||||
mTestPinsResult[ZeroBasedPinIndex].mWrongAssignationPinNbr = WrongPinNbr;
|
||||
}
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
int CAutomatedTestReport::SetPinSecondTestResult(int PinNumber, bool SecondTestPassed)
|
||||
{
|
||||
int ZeroBasedPinIndex = PinNumber - 1;
|
||||
@@ -79,16 +111,172 @@ int CAutomatedTestReport::SetPinSecondTestResult(int PinNumber, bool SecondTestP
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
int CAutomatedTestReport::AddShortedPinToPinTest(int PinNumber, int ShortedPinNumber)
|
||||
{
|
||||
int ZeroBasedPinIndex = PinNumber - 1;
|
||||
if(ZeroBasedPinIndex < 0 || ZeroBasedPinIndex >= mPinCount) //Try not to crash.
|
||||
{
|
||||
return RET_ERROR;
|
||||
}
|
||||
|
||||
mTestPinsResult[ZeroBasedPinIndex].mShortedPinsList.append(ShortedPinNumber);
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
int CAutomatedTestReport::SetPreTestResult(bool PreTestPassed)
|
||||
{
|
||||
mPreTestResult = PreTestPassed;
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
CPinTestResult::CPinTestResult(int PinNumber)
|
||||
{
|
||||
mPinNumber = PinNumber;
|
||||
mContinuityTestPass = PIN_TEST_RESULT_UNKNOWN;
|
||||
mIsolationTestPass = PIN_TEST_RESULT_UNKNOWN;
|
||||
mSecondTestPass = PIN_TEST_RESULT_UNKNOWN;
|
||||
mContinuityTestPass = AUTO_TEST_RESULT_UNKNOWN;
|
||||
mIsolationTestPass = AUTO_TEST_RESULT_UNKNOWN;
|
||||
mPinAssignationTestPass = AUTO_TEST_RESULT_UNKNOWN;
|
||||
mSecondTestPass = AUTO_TEST_RESULT_UNKNOWN;
|
||||
mShortedPinsList.clear();
|
||||
mWrongAssignationPinNbr = 0;
|
||||
|
||||
}
|
||||
|
||||
CPinTestResult::~CPinTestResult()
|
||||
{
|
||||
mShortedPinsList.clear();
|
||||
}
|
||||
|
||||
bool CPinTestResult::IsPinTestSuccess()
|
||||
{
|
||||
if(mPinNumber > 0 &&
|
||||
mContinuityTestPass == AUTO_TEST_SUCCESS &&
|
||||
mIsolationTestPass == AUTO_TEST_SUCCESS &&
|
||||
mPinAssignationTestPass == AUTO_TEST_SUCCESS) //TODO: Add 2nd pass result.
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
QString CAutomatedTestReport::GetPinIsolationResult(int PinNumber)
|
||||
{
|
||||
int ZeroBasedPinIndex = PinNumber - 1;
|
||||
if(ZeroBasedPinIndex < 0 || ZeroBasedPinIndex >= mPinCount) //Try not to crash.
|
||||
{
|
||||
return QString("?");
|
||||
}
|
||||
|
||||
if(mTestPinsResult[ZeroBasedPinIndex].mIsolationTestPass == AUTO_TEST_RESULT_UNKNOWN)
|
||||
{
|
||||
return QString("N/A");
|
||||
}
|
||||
else if(mTestPinsResult[ZeroBasedPinIndex].mIsolationTestPass == AUTO_TEST_SUCCESS)
|
||||
{
|
||||
return QString("Succès");
|
||||
}
|
||||
else if(mTestPinsResult[ZeroBasedPinIndex].mIsolationTestPass == AUTO_TEST_FAILED)
|
||||
{
|
||||
QString Result("Échec[");
|
||||
for(int i = 0; i < mTestPinsResult[ZeroBasedPinIndex].mShortedPinsList.size(); i++)
|
||||
{
|
||||
Result.append(QString("%1").arg(mTestPinsResult[ZeroBasedPinIndex].mShortedPinsList.at(i)));
|
||||
if(i != mTestPinsResult[ZeroBasedPinIndex].mShortedPinsList.size() - 1)
|
||||
{
|
||||
Result.append(",");
|
||||
}
|
||||
}
|
||||
Result.append("]");
|
||||
return Result;
|
||||
}
|
||||
return QString("?");
|
||||
}
|
||||
|
||||
QString CAutomatedTestReport::GetPinContinuityResult(int PinNumber)
|
||||
{
|
||||
int ZeroBasedPinIndex = PinNumber - 1;
|
||||
if(ZeroBasedPinIndex < 0 || ZeroBasedPinIndex >= mPinCount) //Try not to crash.
|
||||
{
|
||||
return QString("?");
|
||||
}
|
||||
|
||||
if(mTestPinsResult[ZeroBasedPinIndex].mContinuityTestPass == AUTO_TEST_RESULT_UNKNOWN)
|
||||
{
|
||||
return QString("N/A");
|
||||
}
|
||||
else if(mTestPinsResult[ZeroBasedPinIndex].mContinuityTestPass == AUTO_TEST_SUCCESS)
|
||||
{
|
||||
return QString("Succès");
|
||||
}
|
||||
else if(mTestPinsResult[ZeroBasedPinIndex].mContinuityTestPass == AUTO_TEST_FAILED)
|
||||
{
|
||||
return QString("Échec");
|
||||
}
|
||||
return QString("?");
|
||||
}
|
||||
QString CAutomatedTestReport::GetPinConcordanceResult(int PinNumber)
|
||||
{
|
||||
int ZeroBasedPinIndex = PinNumber - 1;
|
||||
if(ZeroBasedPinIndex < 0 || ZeroBasedPinIndex >= mPinCount) //Try not to crash.
|
||||
{
|
||||
return QString("?");
|
||||
}
|
||||
|
||||
if(mTestPinsResult[ZeroBasedPinIndex].mPinAssignationTestPass == AUTO_TEST_RESULT_UNKNOWN)
|
||||
{
|
||||
return QString("N/A");
|
||||
}
|
||||
else if(mTestPinsResult[ZeroBasedPinIndex].mPinAssignationTestPass == AUTO_TEST_SUCCESS)
|
||||
{
|
||||
return QString("Succès");
|
||||
}
|
||||
else if(mTestPinsResult[ZeroBasedPinIndex].mPinAssignationTestPass == AUTO_TEST_FAILED)
|
||||
{
|
||||
return QString("Échec[%1]").arg(mTestPinsResult[ZeroBasedPinIndex].mWrongAssignationPinNbr);
|
||||
}
|
||||
return QString("?");
|
||||
}
|
||||
QString CAutomatedTestReport::GetPinSecondTestResult(int PinNumber)
|
||||
{
|
||||
int ZeroBasedPinIndex = PinNumber - 1;
|
||||
if(ZeroBasedPinIndex < 0 || ZeroBasedPinIndex >= mPinCount) //Try not to crash.
|
||||
{
|
||||
return QString("?");
|
||||
}
|
||||
|
||||
if(mTestPinsResult[ZeroBasedPinIndex].mSecondTestPass == AUTO_TEST_RESULT_UNKNOWN)
|
||||
{
|
||||
return QString("N/A");
|
||||
}
|
||||
else if(mTestPinsResult[ZeroBasedPinIndex].mSecondTestPass == AUTO_TEST_SUCCESS)
|
||||
{
|
||||
return QString("Succès");
|
||||
}
|
||||
else if(mTestPinsResult[ZeroBasedPinIndex].mSecondTestPass == AUTO_TEST_FAILED)
|
||||
{
|
||||
return QString("Échec");
|
||||
}
|
||||
return QString("?");
|
||||
}
|
||||
|
||||
bool CAutomatedTestReport::IsAutomatedTestSuccess()
|
||||
{
|
||||
if(mPinCount == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for(int i = 0; i < mTestPinsResult.size(); i++)
|
||||
{
|
||||
if(mTestPinsResult[i].IsPinTestSuccess() == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,13 @@
|
||||
|
||||
class CPinTestResult;
|
||||
|
||||
enum eAutoTestResultDef
|
||||
{
|
||||
AUTO_TEST_FAILED,
|
||||
AUTO_TEST_SUCCESS,
|
||||
AUTO_TEST_RESULT_UNKNOWN
|
||||
};
|
||||
|
||||
class CAutomatedTestReport : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -14,15 +21,29 @@ public:
|
||||
|
||||
int ClearAutomatedTestReport();
|
||||
int SetPinCount(int Pincount);
|
||||
int GetPinCount(){return mPinCount;}
|
||||
|
||||
int SetPinResult(int PinNumber,bool ContinuityPassed, bool IsolationPassed);
|
||||
int SetPinTestAllPassed(int PinNumber);
|
||||
int SetPinContinuityResult(int PinNumber,bool ContinuityPassed);
|
||||
int SetPinIsolationResult(int PinNumber, bool IsolationPassed);
|
||||
int SetPinConcordanceTestResult(int PinNumber, bool AssignationTestPassed, int WrongPinNbr);
|
||||
int SetPinSecondTestResult(int PinNumber, bool SecondTestPassed);
|
||||
int AddShortedPinToPinTest(int PinNumber,int ShortedPinNumber);
|
||||
bool IsAutomatedTestSuccess();
|
||||
|
||||
QString GetPinIsolationResult(int PinNumber);
|
||||
QString GetPinContinuityResult(int PinNumber);
|
||||
QString GetPinConcordanceResult(int PinNumber);
|
||||
QString GetPinSecondTestResult(int PinNumber);
|
||||
QString GetShortedPins(int PinNumber);
|
||||
QString GetWrongPin(int PinNumber);
|
||||
|
||||
int SetPreTestResult(bool PreTestPassed);
|
||||
|
||||
private:
|
||||
QList<CPinTestResult> mTestPinsResult;
|
||||
int mPinCount;
|
||||
int mPreTestResult;
|
||||
|
||||
signals:
|
||||
|
||||
@@ -33,22 +54,26 @@ public slots:
|
||||
class CPinTestResult
|
||||
{
|
||||
public:
|
||||
enum ePinTestResultDef
|
||||
{
|
||||
PIN_TEST_FAILED,
|
||||
PIN_TEST_SUCCESS,
|
||||
PIN_TEST_RESULT_UNKNOWN
|
||||
};
|
||||
// enum ePinTestResultDef
|
||||
// {
|
||||
// PIN_TEST_FAILED,
|
||||
// PIN_TEST_SUCCESS,
|
||||
// PIN_TEST_RESULT_UNKNOWN
|
||||
// };
|
||||
|
||||
explicit CPinTestResult(int PinNumber);
|
||||
~CPinTestResult();
|
||||
|
||||
bool IsPinTestSuccess();
|
||||
|
||||
int mPinNumber;
|
||||
int mContinuityTestPass;
|
||||
int mIsolationTestPass;
|
||||
int mPinAssignationTestPass;
|
||||
int mSecondTestPass;
|
||||
|
||||
QList<int> mShortedPinsList;
|
||||
int mWrongAssignationPinNbr;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -19,9 +19,10 @@ int CCableParametersData::ResetData()
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
int CCableParametersData::SetCableParams(QString StationName, QString CableIdentification, QString CableType, QString OperatorName)
|
||||
int CCableParametersData::SetCableParams(QString StationName, QString StationCode, QString CableIdentification, QString CableType, QString OperatorName)
|
||||
{
|
||||
mStationName = StationName;
|
||||
mStationCodeName = StationCode;
|
||||
mCableIdentification = CableIdentification;
|
||||
mCableType = CableType;
|
||||
mTestOperatorName = OperatorName;
|
||||
|
||||
@@ -11,13 +11,13 @@ public:
|
||||
|
||||
int ResetData();
|
||||
|
||||
int SetCableParams(QString StationName, QString CableIdentification, QString CableType, QString OperatorName);
|
||||
int SetCableParams(QString StationName, QString StationCode, QString CableIdentification, QString CableType, QString OperatorName);
|
||||
int SetCableType(QString InputConnectortype, QString OutputConnectorType);
|
||||
|
||||
|
||||
|
||||
private:
|
||||
QString mStationName;
|
||||
QString mStationCodeName;
|
||||
QString mCableIdentification; //Cable name
|
||||
QString mCableType; //permanent or temporary
|
||||
QString mTestOperatorName;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "CableTestBench.h"
|
||||
#include <QDateTime>
|
||||
#include "CableTestBenchDefs.h"
|
||||
#include <QFileInfo>
|
||||
#include <QProcess>
|
||||
|
||||
CCableTestBench::CCableTestBench(QObject *parent) :
|
||||
QObject(parent),
|
||||
@@ -30,6 +32,7 @@ int CCableTestBench::Start()
|
||||
mIOInterface.OpenIOModules();
|
||||
|
||||
mCableTestPageHandle->mGuiRefreshTimer.start();
|
||||
connect(&mCableTestReport,SIGNAL(NewTestLogEntry(QString)),mCableTestPageHandle,SLOT(AddTestLogEntry(QString)));
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -39,6 +42,11 @@ CCable * CCableTestBench::GetActualCable()
|
||||
return &mActualCable;
|
||||
}
|
||||
|
||||
CTestReport *CCableTestBench::GetTestReportHandle()
|
||||
{
|
||||
return &mCableTestReport;
|
||||
}
|
||||
|
||||
quint8 CCableTestBench::DecToBCDByte(const quint8 byte)
|
||||
{
|
||||
quint8 out = 0;
|
||||
@@ -114,7 +122,7 @@ int CCableTestBench::StartPauseAutomaticTestRequest()
|
||||
mCableTestPageHandle->FillReportCableParametersData(mCableTestReport.GetReportCableParameters());
|
||||
mCableTestReport.GetReportCableParameters()->SetCableType(CConnectorDefs::GetConnectorDescription(mActualCable.GetInputConnector()->GetConnectorType()),
|
||||
CConnectorDefs::GetConnectorDescription(mActualCable.GetOutputConnector()->GetConnectorType()));
|
||||
mCableTestReport.GetAutomatedTestReport()->SetPinCount(mActualCable.mOutputConnector.GetPinCount());
|
||||
mCableTestReport.GetAutomatedTestReport()->SetPinCount(mActualCable.GetOutputConnector()->GetPinCount());
|
||||
|
||||
mCableTestEngine.StartAutomatedTest();
|
||||
return RET_OK;
|
||||
@@ -200,6 +208,19 @@ int CCableTestBench::CableEngineModeChanged(CCableTestEngine::eCableTestEngineMo
|
||||
case CCableTestEngine::CABLE_TEST_STBY_MODE:
|
||||
{
|
||||
mCableTestPageHandle->CableTestEnded();
|
||||
if(mCableTestReport.IsAutoTestReportReady())
|
||||
{
|
||||
SaveReportRequest();
|
||||
mCableTestPageHandle->EnableOpenReportBtn();
|
||||
if(mCableTestReport.GetGlobalAutoTestResult() == true)
|
||||
{
|
||||
mCableTestPageHandle->SetAutoTestResult("Succès!",Qt::darkGreen);
|
||||
}
|
||||
else
|
||||
{
|
||||
mCableTestPageHandle->SetAutoTestResult("Échec",Qt::red);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CCableTestEngine::CABLE_AUTO_TEST_RUNNING_MODE:
|
||||
@@ -239,3 +260,28 @@ int CCableTestBench::RefreshConnectorsStateRequest()
|
||||
mCableTestPageHandle->SetOutputConnectorState(mActualCable.GetOutputConnector()->GetOutputPinsStates());
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
int CCableTestBench::SaveReportRequest()
|
||||
{
|
||||
return mCableTestReport.SaveReportToFile();
|
||||
}
|
||||
|
||||
int CCableTestBench::OpenReportRequest()
|
||||
{
|
||||
QString ReportFile = mCableTestReport.GetLastReportFileName();
|
||||
if(ReportFile.isEmpty())
|
||||
{
|
||||
return RET_ERROR;
|
||||
}
|
||||
|
||||
QFileInfo FileInfo(ReportFile);
|
||||
QString Command =FileInfo.absoluteFilePath();
|
||||
Command.prepend("notepad.exe ");
|
||||
|
||||
|
||||
QProcess *process = new QProcess;
|
||||
process->start(Command);
|
||||
//QProcess::execute(Command);
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ public:
|
||||
CCable mActualCable;
|
||||
CCableTestEngine mCableTestEngine;
|
||||
|
||||
|
||||
CIOModulesInterface mIOInterface;
|
||||
|
||||
int ExecVisualInspectionRequest();
|
||||
@@ -42,11 +43,17 @@ public:
|
||||
int StartStopManualTestRequest();
|
||||
int ManualPinToggleRequest(int ConnectorPinNbr);
|
||||
int RefreshConnectorsStateRequest();
|
||||
int SaveReportRequest();
|
||||
int OpenReportRequest();
|
||||
|
||||
|
||||
|
||||
|
||||
CCable *SetSelectedConnector(CConnectorDefs::eConnectorType ConType);
|
||||
CCable *GetActualCable();
|
||||
|
||||
CTestReport* GetTestReportHandle();
|
||||
|
||||
int CableEngineModeChanged(CCableTestEngine::eCableTestEngineMode Mode);
|
||||
|
||||
|
||||
|
||||
@@ -20,14 +20,14 @@ const int CConnectorDefs::ConnPinCount[NB_CONNECTOR_TYPE] = {0, 6, 14, 24, 72, 9
|
||||
|
||||
const char* CConnectorDefs::ConnectorDescription[NB_CONNECTOR_TYPE] = {"Connecteur inconnu ou invalide",
|
||||
"Connecteur circulaire 6 contacts",
|
||||
"Connecteur circulair 14 contacts",
|
||||
"Connecteur circulaire 14 contacts",
|
||||
"Connecteur Amphenol rectangulaire 24 contacts",
|
||||
"Connecteur Amphenol rectangulaire 72 contacts",
|
||||
"Connecteur Souriau rectangulaire 90 contacts",
|
||||
"Connecteur Amphenol rectangulaire 108 contacts",
|
||||
"Connecteur Souriau rectangulaire 120 contacts",
|
||||
"Connecteur circulaire 6 contacts",
|
||||
"Connecteur circulair 14 contacts",
|
||||
"Connecteur circulaire 14 contacts",
|
||||
"Connecteur Amphenol rectangulaire 24 contacts",
|
||||
"Connecteur Amphenol rectangulaire 72 contacts",
|
||||
"Connecteur Amphenol rectangulaire 108 contacts"};
|
||||
@@ -83,3 +83,4 @@ const char * CConnectorDefs::GetConnectorDescription(eConnectorType type)
|
||||
|
||||
return ConnectorDescription[type];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#ifndef CABLETESTBENCHDEFS_H
|
||||
#define CABLETESTBENCHDEFS_H
|
||||
#include <QString>
|
||||
|
||||
|
||||
class CConnectorDefs
|
||||
|
||||
+71
-17
@@ -18,6 +18,9 @@ int CCableTestEngine::InitCableTestEngine(CCableTestBench *ProgramHandle)
|
||||
mTestCable = ProgramHandle->GetActualCable();
|
||||
mTestInputConnectorHandle = mTestCable->GetInputConnector();
|
||||
mTestOutputConnectorHandle = mTestCable->GetOutputConnector();
|
||||
mTestReportHandle = ProgramHandle->GetTestReportHandle();
|
||||
mAutoTestReportHandle = mTestReportHandle->GetAutomatedTestReport();
|
||||
|
||||
|
||||
|
||||
mCableTestSMTimer = new QTimer();
|
||||
@@ -27,7 +30,7 @@ int CCableTestEngine::InitCableTestEngine(CCableTestBench *ProgramHandle)
|
||||
connect(mCableTestSMTimer,SIGNAL(timeout()),this,SLOT(SMTimerExpired()));
|
||||
|
||||
//TODO: Get this from the options page...
|
||||
mPinHoldTime = 500; //ms
|
||||
mPinHoldTime = 300; //ms
|
||||
|
||||
CableTestEngineStateMachine(CABLE_TEST_TICK_SM_EVENT);
|
||||
|
||||
@@ -76,7 +79,8 @@ void CCableTestEngine::CableTestEngineStateMachine(int Event)
|
||||
|
||||
mCableTestGPTimer.start();
|
||||
|
||||
qDebug("Test automatique démarré...");
|
||||
//qDebug("Test automatique démarré...");
|
||||
mTestReportHandle->AddLogEntry(QString("Démarrage du test automatique."));
|
||||
break;
|
||||
}//case CABLE_TEST_START_AUTOMATED_TEST_STATE
|
||||
|
||||
@@ -88,15 +92,33 @@ void CCableTestEngine::CableTestEngineStateMachine(int Event)
|
||||
}
|
||||
else
|
||||
{
|
||||
if(mTestOutputConnectorHandle->GetOutputPinsStates().count(true) != 0)
|
||||
QBitArray Out = mTestOutputConnectorHandle->GetOutputPinsStates();
|
||||
if(Out.count(true) != 0)
|
||||
{
|
||||
//TODO: Manage this failure mode
|
||||
qDebug("Échec de l'auto test des modules de sortie");
|
||||
mAutoTestReportHandle->SetPreTestResult(false);
|
||||
// qDebug("Échec de l'auto test des modules d'I/O");
|
||||
QString LogString = QString("Échec de l'auto test des modules de sortie. %1 contacts sont activés : ");
|
||||
|
||||
for(int pin = 0; pin < Out.count(); pin++)
|
||||
{
|
||||
if(Out.at(pin))
|
||||
{
|
||||
mAutoTestReportHandle->AddShortedPinToPinTest(mCurPinUnderTest,pin+1);
|
||||
LogString.append(QString("[%1], "));
|
||||
}
|
||||
}
|
||||
|
||||
mTestReportHandle->AddLogEntry(LogString);
|
||||
mCableTestSMState = CABLE_AUTO_TEST_END_TEST_STATE;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
mCurPinUnderTest = 1;
|
||||
mTestOutputConnectorHandle->SetSinglePin(mCurPinUnderTest);
|
||||
mAutoTestReportHandle->SetPreTestResult(true);
|
||||
mTestReportHandle->AddLogEntry(QString("Succès de l'auto test des modules d'I/O"));
|
||||
//OK
|
||||
}
|
||||
|
||||
@@ -125,27 +147,52 @@ void CCableTestEngine::CableTestEngineStateMachine(int Event)
|
||||
|
||||
if(In.count(true) != 1) //check if only 1 input pin is active
|
||||
{
|
||||
//TODO: Manage this failure mode
|
||||
|
||||
if(In.count(true) == 0) //Check if no input pin is active
|
||||
{
|
||||
qDebug("Échec du test du contact %d : aucune pin activée en entrée",mCurPinUnderTest);
|
||||
mAutoTestReportHandle->SetPinContinuityResult(mCurPinUnderTest,false);
|
||||
// qDebug("Échec du test du contact %d : aucune pin activée en entrée",mCurPinUnderTest);
|
||||
mTestReportHandle->AddLogEntry(QString("Échec du test du contact %1 : aucun contact activé en entrée").arg(mCurPinUnderTest));
|
||||
}
|
||||
else //If here, many input pins are active...
|
||||
{
|
||||
qDebug("Échec du test du contact %d : plusieurs (%d) pins activées en entrée",mCurPinUnderTest,In.count(true));
|
||||
QString LogString = QString("Échec du test d'isolation du contact %1 : (%2) contacts activés en entrée : ").arg(mCurPinUnderTest).arg(In.count(true));
|
||||
mAutoTestReportHandle->SetPinIsolationResult(mCurPinUnderTest,false);
|
||||
for(int pin = 0; pin < In.count(); pin++)
|
||||
{
|
||||
if(In.at(pin))
|
||||
{
|
||||
mAutoTestReportHandle->AddShortedPinToPinTest(mCurPinUnderTest,pin+1);
|
||||
LogString.append(QString("[%1]").arg(pin+1));
|
||||
}
|
||||
}
|
||||
// qDebug("Échec du test d'isolation du contact %d : (%d) contacts activés en entrée",mCurPinUnderTest,In.count(true));
|
||||
mTestReportHandle->AddLogEntry(LogString);
|
||||
}
|
||||
}
|
||||
else if(In.at(mCurPinUnderTest-1) == false)
|
||||
{
|
||||
//TODO: Manage this failure mode
|
||||
//the output pin isn't set...
|
||||
qDebug("Échec du test du contact %d: mauvais contact activé en entrée",mCurPinUnderTest);
|
||||
//the wrong pin is set on the input... find which
|
||||
|
||||
int WrongPin = 0;
|
||||
for(int pin = 0; pin < In.count(); pin++)
|
||||
{
|
||||
if(In.at(pin))
|
||||
{
|
||||
WrongPin = pin+1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
mAutoTestReportHandle->SetPinConcordanceTestResult(mCurPinUnderTest,false,WrongPin);
|
||||
mTestReportHandle->AddLogEntry(QString("Échec du test d'assignation du contact %1: le contact %2 est activé.").arg(mCurPinUnderTest).arg(WrongPin));
|
||||
// qDebug("Échec du test d'assignation du contact %d: le contact %d est activé.",mCurPinUnderTest);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Pin test passed. Test the next one
|
||||
qDebug("Succès du test du contact %d", mCurPinUnderTest);
|
||||
mAutoTestReportHandle->SetPinTestAllPassed(mCurPinUnderTest);
|
||||
// qDebug("Succès du test du contact %d", mCurPinUnderTest);
|
||||
mTestReportHandle->AddLogEntry(QString("Succès du test du contact %1").arg(mCurPinUnderTest));
|
||||
}
|
||||
mCurPinUnderTest++;
|
||||
if(mCurPinUnderTest > (mTestOutputConnectorHandle->GetPinCount()))
|
||||
@@ -166,13 +213,15 @@ void CCableTestEngine::CableTestEngineStateMachine(int Event)
|
||||
{
|
||||
mCableTestSMState = CABLE_AUTO_TEST_PAUSE_STATE;
|
||||
mProgramHandle->CableEngineModeChanged(GetTestEngineCurrentMode());
|
||||
qDebug("Test mis en pause...");
|
||||
// qDebug("Test mis en pause...");
|
||||
mTestReportHandle->AddLogEntry(QString("Test mis en pause"));
|
||||
break;
|
||||
}
|
||||
case CABLE_TEST_CANCEL_AUTO_TEST_SM_EVENT:
|
||||
{
|
||||
mCableTestSMState = CABLE_AUTO_TEST_END_TEST_STATE;
|
||||
qDebug("Test annulé...");
|
||||
// qDebug("Test annulé...");
|
||||
mTestReportHandle->AddLogEntry(QString("Test annulé par l'utilisateur"));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -193,13 +242,15 @@ void CCableTestEngine::CableTestEngineStateMachine(int Event)
|
||||
{
|
||||
mCableTestSMState = CABLE_AUTO_TEST_PINS_STATE;
|
||||
mProgramHandle->CableEngineModeChanged(GetTestEngineCurrentMode());
|
||||
qDebug("Test redémarré...");
|
||||
// qDebug("Test redémarré...");
|
||||
mTestReportHandle->AddLogEntry(QString("Test redémarré..."));
|
||||
break;
|
||||
}
|
||||
case CABLE_TEST_CANCEL_AUTO_TEST_SM_EVENT:
|
||||
{
|
||||
mCableTestSMState = CABLE_AUTO_TEST_END_TEST_STATE;
|
||||
qDebug("Test annulé...");
|
||||
// qDebug("Test annulé...");
|
||||
mTestReportHandle->AddLogEntry(QString("Test annulé par l'utilisateur"));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -213,7 +264,8 @@ void CCableTestEngine::CableTestEngineStateMachine(int Event)
|
||||
|
||||
case CABLE_AUTO_TEST_END_TEST_STATE:
|
||||
{
|
||||
qDebug("Test automatique terminé...");
|
||||
// qDebug("Test automatique terminé...");
|
||||
mTestReportHandle->AddLogEntry(QString("Test automatique terminé"));
|
||||
mTestOutputConnectorHandle->ClearAllPins();
|
||||
mCableTestSMState = CABLE_TEST_STBY_STATE;
|
||||
mProgramHandle->CableEngineModeChanged(GetTestEngineCurrentMode());
|
||||
@@ -223,7 +275,8 @@ void CCableTestEngine::CableTestEngineStateMachine(int Event)
|
||||
case CABLE_TEST_START_MANUAL_TEST_STATE:
|
||||
{
|
||||
mTestOutputConnectorHandle->ClearAllPins();
|
||||
qDebug("Entrée en mode test manuel");
|
||||
// qDebug("Entrée en mode test manuel");
|
||||
mTestReportHandle->AddLogEntry(QString("Entrée en mode test manuel"));
|
||||
mCableTestSMState = CABLE_MANUAL_TEST_PINS_STATE;
|
||||
mProgramHandle->CableEngineModeChanged(GetTestEngineCurrentMode());
|
||||
break;
|
||||
@@ -252,6 +305,7 @@ void CCableTestEngine::CableTestEngineStateMachine(int Event)
|
||||
mTestOutputConnectorHandle->ClearAllPins();
|
||||
mCableTestSMState = CABLE_TEST_STBY_STATE;
|
||||
mProgramHandle->CableEngineModeChanged(GetTestEngineCurrentMode());
|
||||
mTestReportHandle->AddLogEntry(QString("Fin du test manuel"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,6 +79,8 @@ private:
|
||||
|
||||
QTimer *mCableTestSMTimer;
|
||||
QElapsedTimer mCableTestGPTimer;
|
||||
CAutomatedTestReport *mAutoTestReportHandle;
|
||||
CTestReport *mTestReportHandle;
|
||||
|
||||
void CableTestEngineStateMachine(int Event);
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "CableTestBench.h"
|
||||
#include <QTextCodec>
|
||||
#include "CableParametersData.h"
|
||||
#include <QScrollBar>
|
||||
|
||||
CCableTestPage::CCableTestPage(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
@@ -14,6 +15,15 @@ CCableTestPage::CCableTestPage(QWidget *parent) :
|
||||
ui->setupUi(this);
|
||||
mProgramHandle = 0;
|
||||
|
||||
ui->mStationNameCombo->insertItem(0,"Frontenac",QVariant("1S52"));
|
||||
ui->mStationNameCombo->insertItem(1,"Côte-Vertu",QVariant("2S22"));
|
||||
ui->mStationNameCombo->insertItem(2,"Angrignon",QVariant("1S18"));
|
||||
ui->mStationNameCombo->insertItem(3,"Garage Angrignon",QVariant("1G17"));
|
||||
ui->mStationNameCombo->insertItem(4,"Atwater",QVariant("1S34"));
|
||||
ui->mStationNameCombo->insertItem(5,"Lionel-Groulx",QVariant("1S32"));
|
||||
ui->mStationNameCombo->insertItem(6,"Viau",QVariant("1S60"));
|
||||
|
||||
|
||||
mInspectionNotDonePixmap = QPixmap("./images/todo.png").scaled(ui->mInspectionDoneIcon->geometry().width(),ui->mInspectionDoneIcon->geometry().height());
|
||||
mInspectionDonePixmap = QPixmap("./images/done1.png").scaled(ui->mInspectionDoneIcon->geometry().width(),ui->mInspectionDoneIcon->geometry().height());
|
||||
ui->mInspectionDoneIcon->setPixmap(mInspectionNotDonePixmap);
|
||||
@@ -35,6 +45,8 @@ CCableTestPage::CCableTestPage(QWidget *parent) :
|
||||
connect(ui->mStartManualTestBtn,SIGNAL(clicked()),this,SLOT(StartManualTestBtnClicked()));
|
||||
connect(ui->mOutputTestVisualisationWidget,SIGNAL(PinClicked(int)),this,SLOT(OutputConnectorPinClicked(int)));
|
||||
connect(&mGuiRefreshTimer,SIGNAL(timeout()),this,SLOT(GuiRefreshTimerExpired()));
|
||||
connect(ui->mSaveReportBtn,SIGNAL(clicked()),this,SLOT(SaveReportBtnClicked()));
|
||||
connect(ui->mOpenReportBtn,SIGNAL(clicked()),this,SLOT(OpenReportBtnClicked()));
|
||||
|
||||
|
||||
|
||||
@@ -44,6 +56,8 @@ CCableTestPage::CCableTestPage(QWidget *parent) :
|
||||
ui->mStartTestBtn->setEnabled(false);
|
||||
ui->mStartManualTestBtn->setEnabled(false);
|
||||
ui->mOutputTestVisualisationWidget->DisablePinClicks();
|
||||
// ui->mOpenReportBtn->setEnabled(false);
|
||||
|
||||
|
||||
|
||||
ResetCable();
|
||||
@@ -127,6 +141,12 @@ int CCableTestPage::ResetCable()
|
||||
//Clear connector selection zone
|
||||
ui->mConnectorSelectWidget->ClearAllConnectorsSelections();
|
||||
|
||||
ui->mTestLogTextBox->clear();
|
||||
|
||||
ui->mSaveReportBtn->setEnabled(false);
|
||||
ui->mOpenReportBtn->setEnabled(false);
|
||||
SetAutoTestResult("");
|
||||
|
||||
return RET_OK;
|
||||
|
||||
}
|
||||
@@ -149,7 +169,8 @@ int CCableTestPage::CableAutomaticTestStarted()
|
||||
{
|
||||
ui->mStartManualTestBtn->setEnabled(false);
|
||||
DisableGuiForTest();
|
||||
ui->mStartTestBtn->setText("Pauser Test");
|
||||
ui->mStartTestBtn->setText("Interrompre Test");
|
||||
SetAutoTestResult("En Cours...",Qt::black);
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
@@ -168,6 +189,8 @@ int CCableTestPage::CableTestEnded()
|
||||
ui->mStartTestBtn->setText("Démarrer Test");
|
||||
ui->mStartManualTestBtn->setText("Démarrer");
|
||||
ui->mReinitTestBtn->setEnabled(true);
|
||||
ui->mSaveReportBtn->setEnabled(true);
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
@@ -178,6 +201,7 @@ int CCableTestPage::CableManualTestStarted()
|
||||
DisableGuiForTest();
|
||||
ui->mStartManualTestBtn->setText("Terminer");
|
||||
ui->mReinitTestBtn->setEnabled(false);
|
||||
ui->mSaveReportBtn->setEnabled(false);
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
@@ -241,6 +265,42 @@ void CCableTestPage::hideEvent(QHideEvent *event)
|
||||
|
||||
int CCableTestPage::FillReportCableParametersData(CCableParametersData *ReportPtr)
|
||||
{
|
||||
ReportPtr->SetCableParams(ui->mStationNameCombo->currentText(),ui->mIdentCableEditBox->text(),ui->mTypeCableCombo->currentText(),ui->mNomTesteurEditBox->text());
|
||||
ReportPtr->SetCableParams(ui->mStationNameCombo->currentText(),
|
||||
ui->mStationNameCombo->itemData(ui->mStationNameCombo->currentIndex()).toString(),
|
||||
ui->mIdentCableEditBox->text(),
|
||||
ui->mTypeCableCombo->currentText(),
|
||||
ui->mNomTesteurEditBox->text());
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
void CCableTestPage::AddTestLogEntry(QString Entry)
|
||||
{
|
||||
ui->mTestLogTextBox->insertPlainText(Entry);
|
||||
ui->mTestLogTextBox->verticalScrollBar()->setValue(ui->mTestLogTextBox->verticalScrollBar()->maximum());
|
||||
}
|
||||
|
||||
void CCableTestPage::SaveReportBtnClicked()
|
||||
{
|
||||
mProgramHandle->SaveReportRequest();
|
||||
}
|
||||
|
||||
void CCableTestPage::OpenReportBtnClicked()
|
||||
{
|
||||
mProgramHandle->OpenReportRequest();
|
||||
}
|
||||
|
||||
int CCableTestPage::EnableOpenReportBtn()
|
||||
{
|
||||
ui->mOpenReportBtn->setEnabled(true);
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
int CCableTestPage::SetAutoTestResult(QString Result, QColor color)
|
||||
{
|
||||
QPalette pal;
|
||||
pal.setColor(QPalette::WindowText,color);
|
||||
ui->mAutoTestResultLabel->setPalette(pal);
|
||||
ui->mAutoTestResultLabel->setText(Result);
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,9 @@ public:
|
||||
int CableTestEnded();
|
||||
int CableManualTestStarted();
|
||||
|
||||
int SetAutoTestResult(QString Result, QColor color = Qt::black);
|
||||
int EnableOpenReportBtn();
|
||||
|
||||
int SetInputConnectorState(QBitArray PinStates);
|
||||
int SetOutputConnectorState(QBitArray PinStates);
|
||||
|
||||
@@ -66,6 +69,9 @@ public slots:
|
||||
void StartManualTestBtnClicked();
|
||||
void OutputConnectorPinClicked(int PinNbr);
|
||||
void GuiRefreshTimerExpired();
|
||||
void AddTestLogEntry(QString Entry);
|
||||
void SaveReportBtnClicked();
|
||||
void OpenReportBtnClicked();
|
||||
};
|
||||
|
||||
#endif // CABLETESTPAGE_H
|
||||
|
||||
+61
-37
@@ -82,43 +82,7 @@
|
||||
<widget class="QLineEdit" name="mIdentCableEditBox"/>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="mStationNameCombo">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Frontenac</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Côte-Vertu</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Angrignon</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Garage Angrignon</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Atwater</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Lionel-Groulx</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Viau</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
<widget class="QComboBox" name="mStationNameCombo"/>
|
||||
</item>
|
||||
<item row="0" column="0" alignment="Qt::AlignRight">
|
||||
<widget class="QLabel" name="StationNameLabel">
|
||||
@@ -478,6 +442,19 @@
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="mSaveReportBtn">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>360</x>
|
||||
<y>100</y>
|
||||
<width>121</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Sauvegarder Rapport</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QLabel" name="mInspVisuelleLabel_2">
|
||||
<property name="geometry">
|
||||
@@ -513,6 +490,53 @@
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>600</x>
|
||||
<y>220</y>
|
||||
<width>231</width>
|
||||
<height>131</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Résultat du test</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="mAutoTestResultLabel">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>40</y>
|
||||
<width>181</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>26</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>En cours...</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="mOpenReportBtn">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>70</x>
|
||||
<y>100</y>
|
||||
<width>101</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Ouvrir Rapport</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
#include "TestReport.h"
|
||||
#include <QDateTime>
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
#include <QMessageBox>
|
||||
#include <QTextCodec>
|
||||
|
||||
CTestReport::CTestReport()
|
||||
{
|
||||
mSoftwareVersion = QString(TEST_BENCH_VERSION);
|
||||
CreateNewTestReport();
|
||||
mReportFileDirectory = "./Rapports/";
|
||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
}
|
||||
|
||||
CVisualInspectionResult * CTestReport::GetInspectionResult()
|
||||
@@ -21,6 +28,147 @@ int CTestReport::CreateNewTestReport()
|
||||
mVisualInspectionResultReport.ClearResults();
|
||||
mCableParameters.ResetData();
|
||||
mAutomatedTestReport.ClearAutomatedTestReport();
|
||||
mTestLog.clear();
|
||||
mLastReportName.clear();
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
int CTestReport::AddLogEntry(QString NewEntry, bool IncludeTime, bool Propagate)
|
||||
{
|
||||
if(NewEntry.isEmpty())
|
||||
{
|
||||
return RET_ERROR;
|
||||
}
|
||||
|
||||
if(IncludeTime)
|
||||
{
|
||||
QString Time = QDateTime::currentDateTime().toString("hh:mm:ss.zzz - ");
|
||||
NewEntry.prepend(Time);
|
||||
}
|
||||
|
||||
qDebug(NewEntry.toAscii().data());
|
||||
|
||||
if(NewEntry.endsWith(QChar('\n')) == false)
|
||||
{
|
||||
NewEntry.append(QChar('\n'));
|
||||
}
|
||||
|
||||
if(Propagate)
|
||||
{
|
||||
emit NewTestLogEntry(NewEntry);
|
||||
}
|
||||
|
||||
mTestLog.append(NewEntry);
|
||||
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
CAutomatedTestReport *CTestReport::GetAutomatedTestReport()
|
||||
{
|
||||
return &mAutomatedTestReport;
|
||||
}
|
||||
|
||||
int CTestReport::SaveReportToFile()
|
||||
{
|
||||
QFile *ReportFile;
|
||||
//QTextStream ReportStream;
|
||||
|
||||
|
||||
QString Filename = QDateTime::currentDateTime().toString("yyMMdd_hhmmss_");
|
||||
Filename.append(mCableParameters.mStationCodeName);
|
||||
Filename.append(mCableParameters.mCableIdentification);
|
||||
Filename.append(".txt");
|
||||
Filename.prepend(mReportFileDirectory);
|
||||
|
||||
|
||||
ReportFile = new QFile(Filename);
|
||||
|
||||
if (!ReportFile->open(QIODevice::ReadWrite |QIODevice::Truncate | QIODevice::Text))
|
||||
{
|
||||
AddLogEntry(QString("Impossible de sauvegarder le rapport %1").arg(Filename),false);
|
||||
QMessageBox::critical(NULL,"Erreur de sauvegarde",QString("Impossible de sauvegarder le fichier rapport \n%1").arg(Filename));
|
||||
|
||||
return RET_ERROR;
|
||||
}
|
||||
|
||||
mLastReportName = Filename;
|
||||
|
||||
QTextStream ReportStream(ReportFile);
|
||||
ReportStream.setCodec(QTextCodec::codecForName("UTF-8"));
|
||||
|
||||
ReportStream << QString("Rapport de test - Câble SEI\n");
|
||||
ReportStream << QString("Date de l'essai: ") << QDateTime::currentDateTime().toString("yyyy-MM-dd") << "\n";
|
||||
ReportStream << "Version du logiciel de test: " << mSoftwareVersion << "\n\n";
|
||||
ReportStream << "-----------------------------------------\n";
|
||||
ReportStream << QString("Paramètres du câble: \n");
|
||||
ReportStream << QString("Identification du câble: ") << mCableParameters.mCableIdentification << "\n";
|
||||
ReportStream << "Station: " << mCableParameters.mStationCodeName << " - "<< mCableParameters.mStationName << "\n";
|
||||
ReportStream << "Type: " << mCableParameters.mCableType << "\n";
|
||||
ReportStream << QString("Opérateur du test: ") << mCableParameters.mTestOperatorName << "\n";
|
||||
ReportStream << QString("Connecteur d'entrée: ") << mCableParameters.mInputConnectorType << "\n";
|
||||
ReportStream << "Connecteur de sortie: " << mCableParameters.mOutputConnectorType << "\n\n";
|
||||
ReportStream << "-----------------------------------------\n";
|
||||
ReportStream << QString("Résultats de l'inspection visuelle:\n");
|
||||
ReportStream << QString("Section 5.2 exécutée: ") << mVisualInspectionResultReport.mVerif52ExecResultText << "\n";
|
||||
ReportStream << QString("Section 5.3 exécutée: ") << mVisualInspectionResultReport.mVerif53ExecResultText << "\n";
|
||||
ReportStream << QString("Section 5.4 exécutée: ") << mVisualInspectionResultReport.mVerif54ExecResultText << "\n";
|
||||
ReportStream << QString("Section 5.5 exécutée: ") << mVisualInspectionResultReport.mVerif55ExecResultText << "\n";
|
||||
ReportStream << QString("Section 5.6 exécutée: ") << mVisualInspectionResultReport.mVerif56ExecResultText << "\n\n";
|
||||
ReportStream << "Notes d'inspection:\n\n";
|
||||
ReportStream << mVisualInspectionResultReport.mVerifNotesText << "\n\n";
|
||||
ReportStream << "-----------------------------------------\n";
|
||||
ReportStream << QString("Résultats du test automatique du câble:\n");
|
||||
ReportStream << QString("Lorsqu'applicable, les valeurs entre crochets [] correspondent aux contacts en défaut.\n\n");
|
||||
ReportStream.setFieldWidth(15);
|
||||
ReportStream.setFieldAlignment(QTextStream::AlignCenter);
|
||||
ReportStream << "No. Contact" << QString("Continuité") << "Isolation" << "Assignation" << QString("2è test") << qSetFieldWidth(0) << "\n";
|
||||
|
||||
|
||||
|
||||
for(int pin = 1; pin <= mAutomatedTestReport.mPinCount; pin++)
|
||||
{
|
||||
ReportStream.setFieldWidth(15);
|
||||
ReportStream.setFieldAlignment(QTextStream::AlignCenter);
|
||||
|
||||
ReportStream << QString("%1").arg(pin) <<
|
||||
mAutomatedTestReport.GetPinContinuityResult(pin) <<
|
||||
mAutomatedTestReport.GetPinIsolationResult(pin) <<
|
||||
mAutomatedTestReport.GetPinConcordanceResult(pin) <<
|
||||
mAutomatedTestReport.GetPinSecondTestResult(pin) << qSetFieldWidth(0) <<
|
||||
" \n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
ReportStream << QString("\n\n\n Signature de l'opérateur de test: _________________________________________\n\n");
|
||||
ReportStream << "-----------------------------------------\n";
|
||||
ReportStream << "Log du test:\n";
|
||||
ReportStream << mTestLog;
|
||||
|
||||
ReportFile->close();
|
||||
delete ReportFile;
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
bool CTestReport::IsAutoTestReportReady()
|
||||
{
|
||||
if(mAutomatedTestReport.GetPinCount() == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CTestReport::GetGlobalAutoTestResult()
|
||||
{
|
||||
return mAutomatedTestReport.IsAutomatedTestSuccess();
|
||||
}
|
||||
|
||||
QString CTestReport::GetLastReportFileName()
|
||||
{
|
||||
return mLastReportName;
|
||||
}
|
||||
|
||||
+16
-1
@@ -6,9 +6,11 @@
|
||||
#include "CableParametersData.h"
|
||||
#include "TestBenchVersion.h"
|
||||
#include "AutomatedTestReport.h"
|
||||
#include <QObject>
|
||||
|
||||
class CTestReport
|
||||
class CTestReport : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CTestReport();
|
||||
|
||||
@@ -17,12 +19,25 @@ public:
|
||||
CAutomatedTestReport *GetAutomatedTestReport();
|
||||
|
||||
int CreateNewTestReport();
|
||||
int AddLogEntry(QString NewEntry,bool IncludeTime = true,bool Propagate = true);
|
||||
bool IsAutoTestReportReady();
|
||||
bool GetGlobalAutoTestResult();
|
||||
|
||||
int SaveReportToFile();
|
||||
|
||||
QString GetLastReportFileName();
|
||||
|
||||
private:
|
||||
CVisualInspectionResult mVisualInspectionResultReport;
|
||||
CCableParametersData mCableParameters;
|
||||
CAutomatedTestReport mAutomatedTestReport;
|
||||
QString mSoftwareVersion;
|
||||
QString mTestLog;
|
||||
QString mReportFileDirectory;
|
||||
QString mLastReportName;
|
||||
|
||||
signals:
|
||||
void NewTestLogEntry(QString NewEntry);
|
||||
};
|
||||
|
||||
#endif // TESTREPORT_H
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "VisualInspectionResult.h"
|
||||
#include <QString>
|
||||
|
||||
const char * CVisualInspectionResult::mTextualResults[3] = {"N/A","Oui","Non"};
|
||||
|
||||
CVisualInspectionResult::CVisualInspectionResult()
|
||||
{
|
||||
ClearResults();
|
||||
@@ -9,6 +11,7 @@ CVisualInspectionResult::CVisualInspectionResult()
|
||||
int CVisualInspectionResult::ClearResults()
|
||||
{
|
||||
mVerif52ExecResult = mVerif53ExecResult = mVerif54ExecResult = mVerif55ExecResult = mVerif56ExecResult = VERIF_UNKNOWN_RESULT;
|
||||
mVerif52ExecResultText = mVerif53ExecResultText = mVerif54ExecResultText = mVerif55ExecResultText = mVerif56ExecResultText = "Non";
|
||||
mVerifNotesText.clear();
|
||||
|
||||
return RET_OK;
|
||||
@@ -17,10 +20,10 @@ int CVisualInspectionResult::ClearResults()
|
||||
bool CVisualInspectionResult::IsVisualInspectionResultComplete()
|
||||
{
|
||||
if(mVerif52ExecResult != VERIF_UNKNOWN_RESULT &&
|
||||
mVerif53ExecResult != VERIF_UNKNOWN_RESULT &&
|
||||
mVerif54ExecResult != VERIF_UNKNOWN_RESULT &&
|
||||
mVerif55ExecResult != VERIF_UNKNOWN_RESULT &&
|
||||
mVerif56ExecResult != VERIF_UNKNOWN_RESULT )
|
||||
mVerif53ExecResult != VERIF_UNKNOWN_RESULT &&
|
||||
mVerif54ExecResult != VERIF_UNKNOWN_RESULT &&
|
||||
mVerif55ExecResult != VERIF_UNKNOWN_RESULT &&
|
||||
mVerif56ExecResult != VERIF_UNKNOWN_RESULT )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -31,10 +34,20 @@ bool CVisualInspectionResult::IsVisualInspectionResultComplete()
|
||||
int CVisualInspectionResult::SetVisualInspectionResult(eVerifExecResult Verif52, eVerifExecResult Verif53, eVerifExecResult Verif54, eVerifExecResult Verif55, eVerifExecResult Verif56, QString Notes)
|
||||
{
|
||||
mVerif52ExecResult = Verif52;
|
||||
mVerif52ExecResultText = mTextualResults[Verif52];
|
||||
|
||||
mVerif53ExecResult = Verif53;
|
||||
mVerif53ExecResultText = mTextualResults[Verif53];
|
||||
|
||||
mVerif54ExecResult = Verif54;
|
||||
mVerif54ExecResultText = mTextualResults[Verif54];
|
||||
|
||||
mVerif55ExecResult = Verif55;
|
||||
mVerif55ExecResultText = mTextualResults[Verif55];
|
||||
|
||||
mVerif56ExecResult = Verif56;
|
||||
mVerif56ExecResultText = mTextualResults[Verif56];
|
||||
|
||||
mVerifNotesText = Notes;
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
@@ -15,10 +15,12 @@ public:
|
||||
VERIF_NOT_DONE_RESULT
|
||||
};
|
||||
|
||||
static const char* mTextualResults[3];
|
||||
|
||||
CVisualInspectionResult();
|
||||
|
||||
eVerifExecResult mVerif52ExecResult, mVerif53ExecResult, mVerif54ExecResult, mVerif55ExecResult, mVerif56ExecResult;
|
||||
QString mVerif52ExecResultText, mVerif53ExecResultText, mVerif54ExecResultText, mVerif55ExecResultText, mVerif56ExecResultText;
|
||||
QString mVerifNotesText;
|
||||
|
||||
int ClearResults();
|
||||
|
||||
Reference in New Issue
Block a user