You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

63 line
1.0 KiB

  1. #include "CableTestBench.h"
  2. #include <QDateTime>
  3. CCableTestBench::CCableTestBench(QObject *parent) :
  4. QObject(parent)
  5. {
  6. w = new MainWindow(0,this);
  7. }
  8. CCableTestBench::~CCableTestBench()
  9. {
  10. delete w;
  11. }
  12. int CCableTestBench::Start()
  13. {
  14. // w->showMaximized();
  15. w->show();
  16. mMainPageHandle = w->mMainPage;
  17. mVisualInspPageHandle = w->mVisualInspPage;
  18. mCableTestPageHandle = w->mCableTestPage;
  19. return 1;
  20. }
  21. quint8 CCableTestBench::DecToBCDByte(const quint8 byte)
  22. {
  23. quint8 out = 0;
  24. out = ((byte/10) << 4) + (byte%10);
  25. return out;
  26. }
  27. quint16 CCableTestBench::DecToBCDWord(const quint16 word)
  28. {
  29. quint16 out = 0;
  30. quint16 temp = 0;
  31. out = word % 10;
  32. temp = (((word /10) % 10) << 4);
  33. out += temp;
  34. temp = (((word / 100) % 10) << 8);
  35. out += temp;
  36. temp = (((word / 1000) % 10) << 12);
  37. out += temp;
  38. return out;
  39. }
  40. int CCableTestBench::ExecVisualInspectionRequest()
  41. {
  42. qDebug("Exec Visual Inspection clicked");
  43. mCableTestPageHandle->SetVisualInspectionDone(true);
  44. }