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.
 
 
 
 

54 linhas
828 B

  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. mMainPageHandle = w->mMainPage;
  16. mVisualInspPageHandle = w->mVisualInspPage;
  17. return 1;
  18. }
  19. quint8 CCableTestBench::DecToBCDByte(const quint8 byte)
  20. {
  21. quint8 out = 0;
  22. out = ((byte/10) << 4) + (byte%10);
  23. return out;
  24. }
  25. quint16 CCableTestBench::DecToBCDWord(const quint16 word)
  26. {
  27. quint16 out = 0;
  28. quint16 temp = 0;
  29. out = word % 10;
  30. temp = (((word /10) % 10) << 4);
  31. out += temp;
  32. temp = (((word / 100) % 10) << 8);
  33. out += temp;
  34. temp = (((word / 1000) % 10) << 12);
  35. out += temp;
  36. return out;
  37. }