Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

68 linhas
2.3 KiB

  1. #include "CableTestPage.h"
  2. #include "ui_CableTestPage.h"
  3. #include "CableTestBench.h"
  4. #include <QTextCodec>
  5. CCableTestPage::CCableTestPage(QWidget *parent) :
  6. QWidget(parent),
  7. ui(new Ui::CCableTestPage)
  8. {
  9. QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
  10. ui->setupUi(this);
  11. mProgramHandle = 0;
  12. mInspectionNotDonePixmap = QPixmap("./images/todo.png").scaled(ui->mInspectionDoneIcon->geometry().width(),ui->mInspectionDoneIcon->geometry().height());
  13. mInspectionDonePixmap = QPixmap("./images/done1.png").scaled(ui->mInspectionDoneIcon->geometry().width(),ui->mInspectionDoneIcon->geometry().height());
  14. ui->mInspectionDoneIcon->setPixmap(mInspectionNotDonePixmap);
  15. connect(ui->mExecInspVisuelleBtn,SIGNAL(clicked()),this,SLOT(InspVisuelleBtnClicked()));
  16. connect(ui->mConnectorSelectWidget,SIGNAL(ConnectorSelected(CConnectorDefs::eConnectorType)),this,SLOT(ConnectorSelectionChanged(CConnectorDefs::eConnectorType)));
  17. ui->mInputTestVisualisationWidget->SetConnectorPinCount(0);
  18. ui->mOutputTestVisualisationWidget->SetConnectorPinCount(0);
  19. ui->mVisualInspStepChkBx->setCheckable(false);
  20. }
  21. CCableTestPage::~CCableTestPage()
  22. {
  23. delete ui;
  24. }
  25. void CCableTestPage::InspVisuelleBtnClicked()
  26. {
  27. mProgramHandle->ExecVisualInspectionRequest();
  28. }
  29. int CCableTestPage::SetVisualInspectionDone(bool Done)
  30. {
  31. if(Done)
  32. {
  33. ui->mInspectionDoneIcon->setPixmap(mInspectionDonePixmap);
  34. ui->mExecInspVisuelleBtn->setText(QString("Réviser Inspection").toUtf8());
  35. ui->mVisualInspStepChkBx->setCheckable(true);
  36. ui->mVisualInspStepChkBx->setChecked(true);
  37. ui->mVisualInspStepChkBx->setCheckable(false);
  38. }
  39. else
  40. {
  41. ui->mInspectionDoneIcon->setPixmap(mInspectionNotDonePixmap);
  42. ui->mExecInspVisuelleBtn->setText("Effectuer Inspection");
  43. ui->mVisualInspStepChkBx->setChecked(false);
  44. }
  45. return RET_OK;
  46. }
  47. void CCableTestPage::ConnectorSelectionChanged(CConnectorDefs::eConnectorType ConType)
  48. {
  49. CCable* Cable;
  50. Cable = mProgramHandle->SetSelectedConnector(ConType);
  51. if(Cable != 0)
  52. {
  53. ui->mInputTestVisualisationWidget->SetConnectorPinCount(Cable->GetInputConnector()->GetPinCount());
  54. ui->mOutputTestVisualisationWidget->SetConnectorPinCount(Cable->GetOutputConnector()->GetPinCount());
  55. }
  56. }