Browse Source

Ajout des stations du projet Berri L1 L2 et le connecteur 10 pts.

master
JF 1 year ago
parent
commit
e16f27b983
11 changed files with 58 additions and 42 deletions
  1. +1
    -0
      Sources/Cable.cpp
  2. +15
    -13
      Sources/CableTestBenchDefs.cpp
  3. +1
    -0
      Sources/CableTestBenchDefs.h
  4. +10
    -7
      Sources/CableTestPage.cpp
  5. +27
    -18
      Sources/Widgets/ConnectorSelectWidget.cpp
  6. BIN
      images/connecteurs - Copy.png
  7. BIN
      images/connecteurs.png
  8. +1
    -1
      ui_CMainPage.h
  9. +1
    -1
      ui_CableTestPage.h
  10. +1
    -1
      ui_OptionsPage.h
  11. +1
    -1
      ui_VisualInspectionPage.h

+ 1
- 0
Sources/Cable.cpp View File

@@ -29,6 +29,7 @@ int CCable::DefineCableByInputConnector(CConnectorDefs::eConnectorType InputConn
mOutputConnector.SetConnectorType(CConnectorDefs::OUTPUT_14_PINS_CONNECTOR_TYPE); mOutputConnector.SetConnectorType(CConnectorDefs::OUTPUT_14_PINS_CONNECTOR_TYPE);
break; break;
} }
case CConnectorDefs::INPUT_10_PINS_CONNECTOR_TYPE:
case CConnectorDefs::INPUT_24_PINS_CONNECTOR_TYPE: case CConnectorDefs::INPUT_24_PINS_CONNECTOR_TYPE:
{ {
mInputConnector.SetConnectorType(InputConnectorType); mInputConnector.SetConnectorType(InputConnectorType);


+ 15
- 13
Sources/CableTestBenchDefs.cpp View File

@@ -3,23 +3,25 @@
const int CConnectorDefs::ConnIOMapping[CConnectorDefs::NB_CONNECTOR_TYPE][2] = { //Connectors pins mapping (zero based index) const int CConnectorDefs::ConnIOMapping[CConnectorDefs::NB_CONNECTOR_TYPE][2] = { //Connectors pins mapping (zero based index)
{0,0}, //Unknown {0,0}, //Unknown
{96,101}, //in 6 pins {96,101}, //in 6 pins
{90,103}, //in 14 pins
{72,95}, //in 24 pins
{0,71}, //in 72 pins
{0,89}, //in 90 pins
{0,107}, //in 108 pins
{0,107}, //in 120 pins
{96,101}, //out 6 pins
{90,103}, //out 14 pins
{72,95}, //out 24 pins
{0,71}, //out 72 pins
{0,107}, //out 108 pins
{72,81}, //in 10 pins
{90,103}, //in 14 pins
{72,95}, //in 24 pins
{0,71}, //in 72 pins
{0,89}, //in 90 pins
{0,107}, //in 108 pins
{0,107}, //in 120 pins
{96,101}, //out 6 pins
{90,103}, //out 14 pins
{72,95}, //out 24 pins
{0,71}, //out 72 pins
{0,107}, //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::ConnPinCount[CConnectorDefs::NB_CONNECTOR_TYPE] = {0, 6, 10, 14, 24, 72, 90, 108, 120, 6, 14, 24, 72, 108};


const char* CConnectorDefs::ConnectorDescription[NB_CONNECTOR_TYPE] = {"Connecteur inconnu ou invalide",
const char* CConnectorDefs::ConnectorDescription[CConnectorDefs::NB_CONNECTOR_TYPE] = {"Connecteur inconnu ou invalide",
"Connecteur circulaire 6 contacts", "Connecteur circulaire 6 contacts",
"Connecteur Entrelec 10 contacts",
"Connecteur circulaire 14 contacts", "Connecteur circulaire 14 contacts",
"Connecteur Amphenol rectangulaire 24 contacts", "Connecteur Amphenol rectangulaire 24 contacts",
"Connecteur Amphenol rectangulaire 72 contacts", "Connecteur Amphenol rectangulaire 72 contacts",


+ 1
- 0
Sources/CableTestBenchDefs.h View File

@@ -14,6 +14,7 @@ public:
{ {
UNKNOWN_CONNECTOR_TYPE, UNKNOWN_CONNECTOR_TYPE,
INPUT_6_PINS_CONNECTOR_TYPE, INPUT_6_PINS_CONNECTOR_TYPE,
INPUT_10_PINS_CONNECTOR_TYPE,
INPUT_14_PINS_CONNECTOR_TYPE, INPUT_14_PINS_CONNECTOR_TYPE,
INPUT_24_PINS_CONNECTOR_TYPE, INPUT_24_PINS_CONNECTOR_TYPE,
INPUT_72_PINS_CONNECTOR_TYPE, INPUT_72_PINS_CONNECTOR_TYPE,


+ 10
- 7
Sources/CableTestPage.cpp View File

@@ -23,13 +23,16 @@ CCableTestPage::CCableTestPage(QWidget *parent) :
ui->mStationNameCombo->insertItem(5,"Lionel-Groulx",QVariant("1S32")); ui->mStationNameCombo->insertItem(5,"Lionel-Groulx",QVariant("1S32"));
ui->mStationNameCombo->insertItem(6,"Viau",QVariant("1S60")); ui->mStationNameCombo->insertItem(6,"Viau",QVariant("1S60"));


ui->mStationNameCombo->insertItem(6,"Terminus Beaugrand",QVariant("1S70"));
ui->mStationNameCombo->insertItem(6,"Bonaventure",QVariant("2S53"));
ui->mStationNameCombo->insertItem(6,"Lionel-Groulx L2",QVariant("2S46"));
ui->mStationNameCombo->insertItem(6,"Garage Bourassa",QVariant("2G81"));
ui->mStationNameCombo->insertItem(6,"Garage Beaugrand",QVariant("1G71"));
ui->mStationNameCombo->insertItem(6,"Longueuil",QVariant("4S54"));
ui->mStationNameCombo->insertItem(6,"Berri L4 et L2-L4",QVariant("4S50"));
ui->mStationNameCombo->insertItem(7,"Terminus Beaugrand",QVariant("1S70"));
ui->mStationNameCombo->insertItem(8,"Bonaventure",QVariant("2S53"));
ui->mStationNameCombo->insertItem(9,"Lionel-Groulx L2",QVariant("2S46"));
ui->mStationNameCombo->insertItem(10,"Garage Bourassa",QVariant("2G81"));
ui->mStationNameCombo->insertItem(11,"Garage Beaugrand",QVariant("1G71"));
ui->mStationNameCombo->insertItem(12,"Longueuil",QVariant("4S54"));
ui->mStationNameCombo->insertItem(13,"Berri L4 et L2-L4",QVariant("4S50"));

ui->mStationNameCombo->insertItem(14,"Projet L1-L2 - Berri L1",QVariant("1S46"));
ui->mStationNameCombo->insertItem(15,"Projet L1-L2 - Berri L2",QVariant("2S60"));




mInspectionNotDonePixmap = QPixmap("./images/todo.png").scaled(ui->mInspectionDoneIcon->geometry().width(),ui->mInspectionDoneIcon->geometry().height()); mInspectionNotDonePixmap = QPixmap("./images/todo.png").scaled(ui->mInspectionDoneIcon->geometry().width(),ui->mInspectionDoneIcon->geometry().height());


+ 27
- 18
Sources/Widgets/ConnectorSelectWidget.cpp View File

@@ -14,7 +14,7 @@ CConnectorSelectWidget::CConnectorSelectWidget(QWidget *parent) :


//6 pins //6 pins
InputClickZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::INPUT_6_PINS_CONNECTOR_TYPE,this); InputClickZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::INPUT_6_PINS_CONNECTOR_TYPE,this);
InputClickZoneHandle->setGeometry(316,152,53,54);
InputClickZoneHandle->setGeometry(316,153,53,54);
InputClickZoneHandle->show(); InputClickZoneHandle->show();
InputClickZoneHandle->raise(); InputClickZoneHandle->raise();
connect(InputClickZoneHandle,SIGNAL(ConnectorZoneClicked(CConnectorClickZoneWidget*)),this,SLOT(InputConnectorZoneClicked(CConnectorClickZoneWidget*))); connect(InputClickZoneHandle,SIGNAL(ConnectorZoneClicked(CConnectorClickZoneWidget*)),this,SLOT(InputConnectorZoneClicked(CConnectorClickZoneWidget*)));
@@ -22,7 +22,15 @@ CConnectorSelectWidget::CConnectorSelectWidget(QWidget *parent) :


//14 pins //14 pins
InputClickZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::INPUT_14_PINS_CONNECTOR_TYPE,this); InputClickZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::INPUT_14_PINS_CONNECTOR_TYPE,this);
InputClickZoneHandle->setGeometry(316,21,53,54);
InputClickZoneHandle->setGeometry(316,31,53,54);
InputClickZoneHandle->show();
InputClickZoneHandle->raise();
connect(InputClickZoneHandle,SIGNAL(ConnectorZoneClicked(CConnectorClickZoneWidget*)),this,SLOT(InputConnectorZoneClicked(CConnectorClickZoneWidget*)));
mInputClickZoneList.append(InputClickZoneHandle);

//10 pins
InputClickZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::INPUT_10_PINS_CONNECTOR_TYPE,this);
InputClickZoneHandle->setGeometry(202,32,28,86);
InputClickZoneHandle->show(); InputClickZoneHandle->show();
InputClickZoneHandle->raise(); InputClickZoneHandle->raise();
connect(InputClickZoneHandle,SIGNAL(ConnectorZoneClicked(CConnectorClickZoneWidget*)),this,SLOT(InputConnectorZoneClicked(CConnectorClickZoneWidget*))); connect(InputClickZoneHandle,SIGNAL(ConnectorZoneClicked(CConnectorClickZoneWidget*)),this,SLOT(InputConnectorZoneClicked(CConnectorClickZoneWidget*)));
@@ -30,7 +38,7 @@ CConnectorSelectWidget::CConnectorSelectWidget(QWidget *parent) :


//24 pins //24 pins
InputClickZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::INPUT_24_PINS_CONNECTOR_TYPE,this); InputClickZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::INPUT_24_PINS_CONNECTOR_TYPE,this);
InputClickZoneHandle->setGeometry(236,23,48,86);
InputClickZoneHandle->setGeometry(245,33,48,86);
InputClickZoneHandle->show(); InputClickZoneHandle->show();
InputClickZoneHandle->raise(); InputClickZoneHandle->raise();
connect(InputClickZoneHandle,SIGNAL(ConnectorZoneClicked(CConnectorClickZoneWidget*)),this,SLOT(InputConnectorZoneClicked(CConnectorClickZoneWidget*))); connect(InputClickZoneHandle,SIGNAL(ConnectorZoneClicked(CConnectorClickZoneWidget*)),this,SLOT(InputConnectorZoneClicked(CConnectorClickZoneWidget*)));
@@ -38,7 +46,7 @@ CConnectorSelectWidget::CConnectorSelectWidget(QWidget *parent) :


//72 pins //72 pins
InputClickZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::INPUT_72_PINS_CONNECTOR_TYPE,this); InputClickZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::INPUT_72_PINS_CONNECTOR_TYPE,this);
InputClickZoneHandle->setGeometry(234,150,47,120);
InputClickZoneHandle->setGeometry(245,150,47,120);
InputClickZoneHandle->show(); InputClickZoneHandle->show();
InputClickZoneHandle->raise(); InputClickZoneHandle->raise();
connect(InputClickZoneHandle,SIGNAL(ConnectorZoneClicked(CConnectorClickZoneWidget*)),this,SLOT(InputConnectorZoneClicked(CConnectorClickZoneWidget*))); connect(InputClickZoneHandle,SIGNAL(ConnectorZoneClicked(CConnectorClickZoneWidget*)),this,SLOT(InputConnectorZoneClicked(CConnectorClickZoneWidget*)));
@@ -46,7 +54,7 @@ CConnectorSelectWidget::CConnectorSelectWidget(QWidget *parent) :


//90 pins //90 pins
InputClickZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::INPUT_90_PINS_CONNECTOR_TYPE,this); InputClickZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::INPUT_90_PINS_CONNECTOR_TYPE,this);
InputClickZoneHandle->setGeometry(320,306,33,73);
InputClickZoneHandle->setGeometry(324,286,33,73);
InputClickZoneHandle->show(); InputClickZoneHandle->show();
InputClickZoneHandle->raise(); InputClickZoneHandle->raise();
connect(InputClickZoneHandle,SIGNAL(ConnectorZoneClicked(CConnectorClickZoneWidget*)),this,SLOT(InputConnectorZoneClicked(CConnectorClickZoneWidget*))); connect(InputClickZoneHandle,SIGNAL(ConnectorZoneClicked(CConnectorClickZoneWidget*)),this,SLOT(InputConnectorZoneClicked(CConnectorClickZoneWidget*)));
@@ -54,7 +62,7 @@ CConnectorSelectWidget::CConnectorSelectWidget(QWidget *parent) :


//108 pins //108 pins
InputClickZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::INPUT_108_PINS_CONNECTOR_TYPE,this); InputClickZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::INPUT_108_PINS_CONNECTOR_TYPE,this);
InputClickZoneHandle->setGeometry(235,308,47,149);
InputClickZoneHandle->setGeometry(245,308,47,149);
InputClickZoneHandle->show(); InputClickZoneHandle->show();
InputClickZoneHandle->raise(); InputClickZoneHandle->raise();
connect(InputClickZoneHandle,SIGNAL(ConnectorZoneClicked(CConnectorClickZoneWidget*)),this,SLOT(InputConnectorZoneClicked(CConnectorClickZoneWidget*))); connect(InputClickZoneHandle,SIGNAL(ConnectorZoneClicked(CConnectorClickZoneWidget*)),this,SLOT(InputConnectorZoneClicked(CConnectorClickZoneWidget*)));
@@ -62,7 +70,7 @@ CConnectorSelectWidget::CConnectorSelectWidget(QWidget *parent) :


//120 pins //120 pins
InputClickZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::INPUT_120_PINS_CONNECTOR_TYPE,this); InputClickZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::INPUT_120_PINS_CONNECTOR_TYPE,this);
InputClickZoneHandle->setGeometry(316,403,42,74);
InputClickZoneHandle->setGeometry(319,380,42,74);
InputClickZoneHandle->show(); InputClickZoneHandle->show();
InputClickZoneHandle->raise(); InputClickZoneHandle->raise();
connect(InputClickZoneHandle,SIGNAL(ConnectorZoneClicked(CConnectorClickZoneWidget*)),this,SLOT(InputConnectorZoneClicked(CConnectorClickZoneWidget*))); connect(InputClickZoneHandle,SIGNAL(ConnectorZoneClicked(CConnectorClickZoneWidget*)),this,SLOT(InputConnectorZoneClicked(CConnectorClickZoneWidget*)));
@@ -73,35 +81,35 @@ CConnectorSelectWidget::CConnectorSelectWidget(QWidget *parent) :


//6 pins //6 pins
OutputSelectZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::OUTPUT_6_PINS_CONNECTOR_TYPE,this); OutputSelectZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::OUTPUT_6_PINS_CONNECTOR_TYPE,this);
OutputSelectZoneHandle->setGeometry(12,148,38,38);
OutputSelectZoneHandle->setGeometry(2,152,43,43);
OutputSelectZoneHandle->show(); OutputSelectZoneHandle->show();
OutputSelectZoneHandle->raise(); OutputSelectZoneHandle->raise();
mOutputSelectZoneList.append(OutputSelectZoneHandle); mOutputSelectZoneList.append(OutputSelectZoneHandle);


//14 pins //14 pins
OutputSelectZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::OUTPUT_14_PINS_CONNECTOR_TYPE,this); OutputSelectZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::OUTPUT_14_PINS_CONNECTOR_TYPE,this);
OutputSelectZoneHandle->setGeometry(13,24,41,42);
OutputSelectZoneHandle->setGeometry(2,30,45,47);
OutputSelectZoneHandle->show(); OutputSelectZoneHandle->show();
OutputSelectZoneHandle->raise(); OutputSelectZoneHandle->raise();
mOutputSelectZoneList.append(OutputSelectZoneHandle); mOutputSelectZoneList.append(OutputSelectZoneHandle);


//24 pins //24 pins
OutputSelectZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::OUTPUT_24_PINS_CONNECTOR_TYPE,this); OutputSelectZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::OUTPUT_24_PINS_CONNECTOR_TYPE,this);
OutputSelectZoneHandle->setGeometry(91,23,48,86);
OutputSelectZoneHandle->setGeometry(80,33,48,86);
OutputSelectZoneHandle->show(); OutputSelectZoneHandle->show();
OutputSelectZoneHandle->raise(); OutputSelectZoneHandle->raise();
mOutputSelectZoneList.append(OutputSelectZoneHandle); mOutputSelectZoneList.append(OutputSelectZoneHandle);


//72 pins //72 pins
OutputSelectZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::OUTPUT_72_PINS_CONNECTOR_TYPE,this); OutputSelectZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::OUTPUT_72_PINS_CONNECTOR_TYPE,this);
OutputSelectZoneHandle->setGeometry(92,150,46,121);
OutputSelectZoneHandle->setGeometry(80,150,46,121);
OutputSelectZoneHandle->show(); OutputSelectZoneHandle->show();
OutputSelectZoneHandle->raise(); OutputSelectZoneHandle->raise();
mOutputSelectZoneList.append(OutputSelectZoneHandle); mOutputSelectZoneList.append(OutputSelectZoneHandle);


//108 pins //108 pins
OutputSelectZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::OUTPUT_108_PINS_CONNECTOR_TYPE,this); OutputSelectZoneHandle = new CConnectorClickZoneWidget(CConnectorDefs::OUTPUT_108_PINS_CONNECTOR_TYPE,this);
OutputSelectZoneHandle->setGeometry(92,308,47,148);
OutputSelectZoneHandle->setGeometry(80,308,47,148);
OutputSelectZoneHandle->show(); OutputSelectZoneHandle->show();
OutputSelectZoneHandle->raise(); OutputSelectZoneHandle->raise();
mOutputSelectZoneList.append(OutputSelectZoneHandle); mOutputSelectZoneList.append(OutputSelectZoneHandle);
@@ -116,13 +124,13 @@ void CConnectorSelectWidget::paintEvent(QPaintEvent *event)


QPen pen; QPen pen;


// pen.setStyle(Qt::SolidLine);
// pen.setWidth(10);
// pen.setBrush(Qt::red);
// painter.setPen(pen);
pen.setStyle(Qt::SolidLine);
pen.setWidth(10);
pen.setBrush(Qt::red);
painter.setPen(pen);


//painter.drawRect(this->geometry());
// painter.drawRect(QRect(7,149,53,54));
// painter.drawRect(this->geometry());
// painter.drawRect(QRect(320,306,33,73));


} }


@@ -153,6 +161,7 @@ void CConnectorSelectWidget::InputConnectorZoneClicked(CConnectorClickZoneWidget
OutputSelZone = FindOutputSelectionZone(CConnectorDefs::OUTPUT_14_PINS_CONNECTOR_TYPE); OutputSelZone = FindOutputSelectionZone(CConnectorDefs::OUTPUT_14_PINS_CONNECTOR_TYPE);
break; break;
} }
case CConnectorDefs::INPUT_10_PINS_CONNECTOR_TYPE:
case CConnectorDefs::INPUT_24_PINS_CONNECTOR_TYPE: case CConnectorDefs::INPUT_24_PINS_CONNECTOR_TYPE:
{ {
OutputSelZone = FindOutputSelectionZone(CConnectorDefs::OUTPUT_24_PINS_CONNECTOR_TYPE); OutputSelZone = FindOutputSelectionZone(CConnectorDefs::OUTPUT_24_PINS_CONNECTOR_TYPE);


BIN
images/connecteurs - Copy.png View File

Before After
Width: 376  |  Height: 537  |  Size: 28 KiB

BIN
images/connecteurs.png View File

Before After
Width: 376  |  Height: 537  |  Size: 28 KiB Width: 376  |  Height: 537  |  Size: 51 KiB

+ 1
- 1
ui_CMainPage.h View File

@@ -1,7 +1,7 @@
/******************************************************************************** /********************************************************************************
** Form generated from reading UI file 'CMainPage.ui' ** Form generated from reading UI file 'CMainPage.ui'
** **
** Created: Fri Dec 6 12:10:43 2019
** Created: Tue Jul 16 13:17:58 2024
** by: Qt User Interface Compiler version 4.8.1 ** by: Qt User Interface Compiler version 4.8.1
** **
** WARNING! All changes made in this file will be lost when recompiling UI file! ** WARNING! All changes made in this file will be lost when recompiling UI file!


+ 1
- 1
ui_CableTestPage.h View File

@@ -1,7 +1,7 @@
/******************************************************************************** /********************************************************************************
** Form generated from reading UI file 'CableTestPage.ui' ** Form generated from reading UI file 'CableTestPage.ui'
** **
** Created: Fri Dec 6 12:10:44 2019
** Created: Tue Jul 16 13:17:58 2024
** by: Qt User Interface Compiler version 4.8.1 ** by: Qt User Interface Compiler version 4.8.1
** **
** WARNING! All changes made in this file will be lost when recompiling UI file! ** WARNING! All changes made in this file will be lost when recompiling UI file!


+ 1
- 1
ui_OptionsPage.h View File

@@ -1,7 +1,7 @@
/******************************************************************************** /********************************************************************************
** Form generated from reading UI file 'OptionsPage.ui' ** Form generated from reading UI file 'OptionsPage.ui'
** **
** Created: Fri Dec 6 12:10:44 2019
** Created: Tue Jul 16 13:17:58 2024
** by: Qt User Interface Compiler version 4.8.1 ** by: Qt User Interface Compiler version 4.8.1
** **
** WARNING! All changes made in this file will be lost when recompiling UI file! ** WARNING! All changes made in this file will be lost when recompiling UI file!


+ 1
- 1
ui_VisualInspectionPage.h View File

@@ -1,7 +1,7 @@
/******************************************************************************** /********************************************************************************
** Form generated from reading UI file 'VisualInspectionPage.ui' ** Form generated from reading UI file 'VisualInspectionPage.ui'
** **
** Created: Fri Dec 6 12:10:44 2019
** Created: Tue Jul 16 13:17:58 2024
** by: Qt User Interface Compiler version 4.8.1 ** by: Qt User Interface Compiler version 4.8.1
** **
** WARNING! All changes made in this file will be lost when recompiling UI file! ** WARNING! All changes made in this file will be lost when recompiling UI file!


Loading…
Cancel
Save