V1.0. Premier release

This commit is contained in:
JF
2019-05-14 11:47:17 -04:00
parent 8342f88720
commit 90f0f33252
18 changed files with 224 additions and 71 deletions
+2 -1
View File
@@ -152,7 +152,8 @@ bool CPinTestResult::IsPinTestSuccess()
if(mPinNumber > 0 &&
mContinuityTestPass == AUTO_TEST_SUCCESS &&
mIsolationTestPass == AUTO_TEST_SUCCESS &&
mPinAssignationTestPass == AUTO_TEST_SUCCESS) //TODO: Add 2nd pass result.
mPinAssignationTestPass == AUTO_TEST_SUCCESS &&
mSecondTestPass != AUTO_TEST_FAILED)
{
return true;
}
+1 -3
View File
@@ -38,7 +38,7 @@ int CCableTestBench::Start()
mOptionsPageHandle->GetCurrentOptions(&mTestBenchOptions);
}
mCableTestEngine.InitCableTestEngine(this,mTestBenchOptions.mPinHoldTime);
mCableTestEngine.InitCableTestEngine(this,&mTestBenchOptions);
if(mIOInterface.OpenIOModules(mTestBenchOptions.mIOModuleIPAddress) == RET_ERROR)
{
@@ -336,8 +336,6 @@ int CCableTestBench::TestBenchOptionsChanged()
mOptionsPageHandle->GetCurrentOptions(&mTestBenchOptions);
mTestBenchOptions.SaveSettingsToFile();
mCableTestEngine.SetPinHoldTime(mTestBenchOptions.mPinHoldTime);
return RET_OK;
+91 -33
View File
@@ -12,7 +12,7 @@ CCableTestEngine::~CCableTestEngine()
delete mCableTestSMTimer;
}
int CCableTestEngine::InitCableTestEngine(CCableTestBench *ProgramHandle, int PinHoldTime)
int CCableTestEngine::InitCableTestEngine(CCableTestBench *ProgramHandle, CTestBenchSettings *SettingsHandle)
{
mProgramHandle = ProgramHandle;
mTestCable = ProgramHandle->GetActualCable();
@@ -30,26 +30,25 @@ int CCableTestEngine::InitCableTestEngine(CCableTestBench *ProgramHandle, int Pi
connect(mCableTestSMTimer,SIGNAL(timeout()),this,SLOT(SMTimerExpired()));
mPinHoldTime = PinHoldTime; //ms
mTestSettingsHandle = SettingsHandle;
mIsSecondPass = false;
CableTestEngineStateMachine(CABLE_TEST_TICK_SM_EVENT);
return RET_OK;
}
int CCableTestEngine::SetPinHoldTime(int HoldTime)
{
mPinHoldTime = HoldTime;
return RET_OK;
}
void CCableTestEngine::CableTestEngineStateMachine(int Event)
{
switch(mCableTestSMState)
{
case CABLE_TEST_INIT_STATE:
{
mCableTestSMState = CABLE_TEST_STBY_STATE;
mIsSecondPass = false;
mCableTestSMTimer->start();
break;
}//case CABLE_TEST_INIT_STATE
@@ -92,7 +91,7 @@ void CCableTestEngine::CableTestEngineStateMachine(int Event)
case CABLE_AUTO_TEST_SELF_TEST_STATE:
{
if(mCableTestGPTimer.elapsed() < mPinHoldTime)
if(mCableTestGPTimer.elapsed() < mTestSettingsHandle->mPinHoldTime)
{
break;
}
@@ -140,7 +139,7 @@ void CCableTestEngine::CableTestEngineStateMachine(int Event)
{
case CABLE_TEST_TICK_SM_EVENT:
{
if(mCableTestGPTimer.elapsed() < mPinHoldTime)
if(mCableTestGPTimer.elapsed() < mTestSettingsHandle->mPinHoldTime)
{
break;
}
@@ -155,24 +154,41 @@ void CCableTestEngine::CableTestEngineStateMachine(int Event)
{
if(In.count(true) == 0) //Check if no input pin is active
{
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));
if(mIsSecondPass == false)
{
mAutoTestReportHandle->SetPinContinuityResult(mCurPinUnderTest,false);
mTestReportHandle->AddLogEntry(QString("Échec du test du contact %1 : aucun contact activé en entrée").arg(mCurPinUnderTest));
}
else
{
mAutoTestReportHandle->SetPinSecondTestResult(mCurPinUnderTest,false);
mTestReportHandle->AddLogEntry(QString("2è passe: échec du test du contact %1 : aucun contact activé en entrée").arg(mCurPinUnderTest));
}
}
else //If here, many input pins are active...
{
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(mIsSecondPass == false)
{
if(In.at(pin))
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++)
{
mAutoTestReportHandle->AddShortedPinToPinTest(mCurPinUnderTest,pin+1);
LogString.append(QString("[%1]").arg(pin+1));
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
{
mAutoTestReportHandle->SetPinSecondTestResult(mCurPinUnderTest,false);
QString LogString = QString("2è passe: chec du test d'isolation du contact %1 : (%2) contacts activés en entrée : ").arg(mCurPinUnderTest).arg(In.count(true));
mTestReportHandle->AddLogEntry(LogString);
}
// 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)
@@ -189,22 +205,52 @@ void CCableTestEngine::CableTestEngineStateMachine(int Event)
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);
if(mIsSecondPass == false)
{
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));
}
else
{
mAutoTestReportHandle->SetPinSecondTestResult(mCurPinUnderTest,false);
mTestReportHandle->AddLogEntry(QString("2è passe: échec du test d'assignation du contact %1: le contact %2 est activé.").arg(mCurPinUnderTest).arg(WrongPin));
}
}
else
{
//Pin test passed. Test the next one
mAutoTestReportHandle->SetPinTestAllPassed(mCurPinUnderTest);
// qDebug("Succès du test du contact %d", mCurPinUnderTest);
mTestReportHandle->AddLogEntry(QString("Succès du test du contact %1").arg(mCurPinUnderTest));
if(mIsSecondPass == false)
{
mAutoTestReportHandle->SetPinTestAllPassed(mCurPinUnderTest);
mTestReportHandle->AddLogEntry(QString("Succès du test du contact %1").arg(mCurPinUnderTest));
}
else
{
mAutoTestReportHandle->SetPinSecondTestResult(mCurPinUnderTest,true);
mTestReportHandle->AddLogEntry(QString("2è passe: succès du test du contact %1").arg(mCurPinUnderTest));
}
}
mCurPinUnderTest++;
if(mCurPinUnderTest > (mTestOutputConnectorHandle->GetPinCount()))
{
//Test finished.
mCableTestSMState = CABLE_AUTO_TEST_END_TEST_STATE;
if(mTestSettingsHandle->mExecSecondPass == true) //Check if we need to execute the test twice
{
if(mIsSecondPass == true) //Check if this was the second pass.
{
mCableTestSMState = CABLE_AUTO_TEST_END_TEST_STATE; //test finished
}
else
{
mCableTestSMState = CABLE_AUTO_TEST_START_SECOND_PASS_STATE; //start the 2nd test
}
}
else
{
mCableTestSMState = CABLE_AUTO_TEST_END_TEST_STATE; //test finished
}
}
else
{
@@ -219,14 +265,14 @@ 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;
}
@@ -248,14 +294,14 @@ 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;
}
@@ -267,10 +313,22 @@ void CCableTestEngine::CableTestEngineStateMachine(int Event)
break;
}//case CABLE_AUTO_TEST_PAUSE_STATE
case CABLE_AUTO_TEST_START_SECOND_PASS_STATE:
{
//restart test but skip module self-test...
mIsSecondPass = true;
mCurPinUnderTest = 1;
mTestOutputConnectorHandle->SetSinglePin(mCurPinUnderTest);
mCableTestGPTimer.start();
mCableTestSMState = CABLE_AUTO_TEST_PINS_STATE;
mTestReportHandle->AddLogEntry(QString("Démarrage du deuxième test"));
break;
}//case CABLE_AUTO_TEST_START_SECOND_PASS_STATE
case CABLE_AUTO_TEST_END_TEST_STATE:
{
// qDebug("Test automatique terminé...");
// qDebug("Test automatique terminé...");
mIsSecondPass = false;
mTestReportHandle->AddLogEntry(QString("Test automatique terminé"));
mTestOutputConnectorHandle->ClearAllPins();
mCableTestSMState = CABLE_TEST_STBY_STATE;
@@ -281,7 +339,7 @@ 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());
+6 -4
View File
@@ -8,6 +8,7 @@
#include "TestReport.h"
class CCableTestBench;
class CTestBenchSettings;
#define TEST_ENGINE_SM_STANDBY_TIMEOUT 300 //ms
#define TEST_ENGINE_SM_TIMEOUT 100 //ms
@@ -27,7 +28,7 @@ public:
CCableTestEngine();
~CCableTestEngine();
int InitCableTestEngine(CCableTestBench *ProgramHandle, int PinHoldTime);
int InitCableTestEngine(CCableTestBench *ProgramHandle, CTestBenchSettings *SettingsHandle);
int StartAutomatedTest();
int PauseAutomatedTest();
@@ -37,8 +38,6 @@ public:
int StopManualTest();
int ManualPinToggle(int ConnectorPinNbr);
int SetPinHoldTime(int HoldTime);
bool IsAutomaticTestRunning();
eCableTestEngineMode GetTestEngineCurrentMode();
@@ -54,6 +53,7 @@ private:
CABLE_AUTO_TEST_PINS_STATE,
CABLE_AUTO_TEST_PAUSE_STATE,
CABLE_AUTO_TEST_END_TEST_STATE,
CABLE_AUTO_TEST_START_SECOND_PASS_STATE,
CABLE_TEST_START_MANUAL_TEST_STATE,
CABLE_MANUAL_TEST_PINS_STATE,
CABLE_MANUAL_TEST_END_TEST_STATE
@@ -77,7 +77,9 @@ private:
CInputConnector *mTestInputConnectorHandle;
COutputConnector *mTestOutputConnectorHandle;
int mCurPinUnderTest;
int mPinHoldTime;
bool mExecSecondTest;
bool mIsSecondPass;
CTestBenchSettings *mTestSettingsHandle;
QTimer *mCableTestSMTimer;
QElapsedTimer mCableTestGPTimer;
+5
View File
@@ -27,6 +27,7 @@ int COptionsPage::GetCurrentOptions(CTestBenchSettings *Settings)
Settings->mIgnoreVisualInspection = ui->mIgnoreVisualInspChkBx->isChecked();
Settings->mIOModuleIPAddress = QString("%1.%2.%3.%4").arg(ui->mIPAdd1SpinBox->value()).arg(ui->mIPAdd2SpinBox->value()).arg(ui->mIPAdd3SpinBox->value()).arg(ui->mIPAdd4SpinBox->value());
Settings->mIncludeLogInReport = ui->mIncludeLogInReportChkBx->isChecked();
Settings->mExecSecondPass = ui->mExecSecondTestChkBx->isChecked();
@@ -39,6 +40,9 @@ int COptionsPage::SetCurrentOptions(CTestBenchSettings *Settings)
ui->mTestHoldTimeHighSpinBx->setValue(Settings->mPinHoldTime);
ui->mIgnoreVisualInspChkBx->setChecked(Settings->mIgnoreVisualInspection);
ui->mIncludeLogInReportChkBx->setChecked(Settings->mIncludeLogInReport);
ui->mExecSecondTestChkBx->setChecked(Settings->mExecSecondPass);
QHostAddress IPAddres(Settings->mIOModuleIPAddress);
int IPV4 = IPAddres.toIPv4Address();
@@ -51,6 +55,7 @@ int COptionsPage::SetCurrentOptions(CTestBenchSettings *Settings)
IPV4 >>= 8;
ui->mIPAdd1SpinBox->setValue(IPV4 & 0x000000FF);
return RET_OK;
}
void COptionsPage::OptionChanged()
+18 -5
View File
@@ -72,7 +72,7 @@
<property name="geometry">
<rect>
<x>140</x>
<y>311</y>
<y>361</y>
<width>42</width>
<height>22</height>
</rect>
@@ -88,7 +88,7 @@
<property name="geometry">
<rect>
<x>190</x>
<y>311</y>
<y>361</y>
<width>42</width>
<height>22</height>
</rect>
@@ -104,7 +104,7 @@
<property name="geometry">
<rect>
<x>240</x>
<y>311</y>
<y>361</y>
<width>42</width>
<height>22</height>
</rect>
@@ -117,7 +117,7 @@
<property name="geometry">
<rect>
<x>290</x>
<y>311</y>
<y>361</y>
<width>42</width>
<height>22</height>
</rect>
@@ -133,7 +133,7 @@
<property name="geometry">
<rect>
<x>140</x>
<y>270</y>
<y>320</y>
<width>351</width>
<height>31</height>
</rect>
@@ -187,6 +187,19 @@
<string>Inclure LOG dans le rapport</string>
</property>
</widget>
<widget class="QCheckBox" name="mExecSecondTestChkBx">
<property name="geometry">
<rect>
<x>140</x>
<y>240</y>
<width>221</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Exécuter 2è passe de tests</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
+4 -2
View File
@@ -26,7 +26,8 @@ int CTestBenchSettings::SaveSettingsToFile()
<< mPinHoldTime
<< mIgnoreVisualInspection
<< mIOModuleIPAddress
<< mIncludeLogInReport;
<< mIncludeLogInReport
<< mExecSecondPass;
SettingFile->close();
delete SettingFile;
@@ -59,7 +60,8 @@ int CTestBenchSettings::LoadSettingFromFile()
Strm >> mPinHoldTime
>> mIgnoreVisualInspection
>> mIOModuleIPAddress
>> mIncludeLogInReport;
>> mIncludeLogInReport
>> mExecSecondPass;
SettingFile->close();
delete SettingFile;
+1
View File
@@ -15,6 +15,7 @@ public:
bool mIgnoreVisualInspection;
QString mIOModuleIPAddress;
bool mIncludeLogInReport;
bool mExecSecondPass;
+1 -1
View File
@@ -2,7 +2,7 @@
#define TESTBENCHVERSION_H
#define TEST_BENCH_VERSION "V0.10_ING_DEV"
#define TEST_BENCH_VERSION "V1.0"
//LOG DES CHANGEMENTS
+8
View File
@@ -113,6 +113,14 @@ int CTestReport::SaveReportToFile(CTestBenchSettings *BenchSettings)
{
ReportStream << QString("Ignorer inspection visuelle: NON\n");
}
if(BenchSettings->mExecSecondPass)
{
ReportStream << QString("2è test exécuté: OUI\n");
}
else
{
ReportStream << QString("2è test exécuté: NON\n");
}
ReportStream << QString("Adresse IP des modules d'I/O : %1\n\n").arg(BenchSettings->mIOModuleIPAddress);
ReportStream << "-----------------------------------------\n";
ReportStream << QString("Paramètres du câble: \n");