Index: sources/view/VEventSpy.cpp =================================================================== diff -u -r1c18f738693756ca1f0342c2cc158e32bc28f90b -r2ef03b2ce51b4dc507f66e9671953a8e0824bde9 --- sources/view/VEventSpy.cpp (.../VEventSpy.cpp) (revision 1c18f738693756ca1f0342c2cc158e32bc28f90b) +++ sources/view/VEventSpy.cpp (.../VEventSpy.cpp) (revision 2ef03b2ce51b4dc507f66e9671953a8e0824bde9) @@ -1,15 +1,15 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * Copyright (c) 2020-2024 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * - * \file VEventSpy.cpp - * \author (last) Behrouz NematiPour - * \date (last) 16-Oct-2020 - * \author (original) Behrouz NematiPour - * \date (original) 23-Aug-2020 + * \file VEventSpy.cpp + * \author (last) Behrouz NematiPour + * \date (last) 08-Jun-2022 + * \author (original) Behrouz NematiPour + * \date (original) 23-Aug-2020 * */ #include "VEventSpy.h" @@ -23,7 +23,10 @@ #include "GuiGlobals.h" #include "FileHandler.h" #include "DeviceController.h" +#include "BluetoothInterface.h" +#undef DEBUG_BCUFF_MIMIC + // if needs to spy on the mouse events // (which is happening on the desktop only since there is not mouse attached to the device) // remove the #define comment line below. @@ -39,11 +42,11 @@ void VEventSpy::initConnections() { - // coco begin validated: this code has been manually tested. + // disabled coco begin validated: this code has been manually tested. // This should never happen with the current design and usage. // put here for developer safety if (Gui::_viewer) { - // coco end + // disabled coco end QObject::connect(Gui::_viewer , SIGNAL( eventSpy(QEvent*)), this , SLOT(onEventSpy(QEvent*))); } @@ -59,7 +62,7 @@ QEvent::Type mType = vEvent->type(); switch (mType) { - // coco begin validated: this code has been manually tested. + // disabled coco begin validated: this code has been manually tested. // the only intention of this code is to be used for EMC testing and has been tested and is working fine. // Mouse case QEvent::Type::MouseButtonDblClick : mouseEventSpy(vEvent, "mD"); break; @@ -77,7 +80,7 @@ // Keyboard case QEvent::Type::KeyPress : keybdEventSpy(vEvent ); break; - // coco end + // disabled coco end default : break; @@ -94,7 +97,7 @@ * \param vEvent - mouse event * \param vTypeName - mouse button type name */ -// coco begin validated: this code has been manually tested. +// disabled coco begin validated: this code has been manually tested. // the only intention of this code is to be used for EMC testing and has been tested and is working fine. void VEventSpy::mouseEventSpy(QEvent *vEvent, const QString &vTypeName) { @@ -135,23 +138,23 @@ .arg(y, 4, 10, QChar('0'))); #endif } -// coco end +// disabled coco end -// coco begin validated: this code has been manually tested. +// disabled coco begin validated: this code has been manually tested. // the only intention of this code is to be used for EMC testing and has been tested and is working fine. /*! * \brief VEventSpy::doMouseReset * \details mouse event count reset */ void VEventSpy::doMouseReset() { mouseCount(0); } -// coco end +// disabled coco end /*! * \brief VEventSpy::touchEventSpy * \param vEvent - touch event * \param vTypeName - The type of the QEvent which has been shortened e.g. tB: TouchBegin */ -// coco begin validated: this code has been manually tested. +// disabled coco begin validated: this code has been manually tested. // the only intention of this code is to be used for EMC testing and has been tested and is working fine. void VEventSpy::touchEventSpy(QEvent *vEvent, const QString &vTypeName) { @@ -178,19 +181,19 @@ } LOG_DEBUG( vTypeName + logString ); } -// coco end +// disabled coco end -// coco begin validated: this code has been manually tested. +// disabled coco begin validated: this code has been manually tested. // the only intention of this code is to be used for EMC testing and has been tested and is working fine. /*! * \brief VEventSpy::doTouchReset * \details touch event counter reset */ void VEventSpy::doTouchReset() { touchCount(0); } -// coco end +// disabled coco end -// coco begin validated: this code has been manually tested. +// disabled coco begin validated: this code has been manually tested. // the only intention of this code is to be used for testing and has been tested and is working fine. /*! * \brief VEventSpy::keybdEventSpy @@ -215,10 +218,24 @@ firstEntry = false; QKeyEvent *keyEvent = static_cast(vEvent); - if (keyEvent->key() == Qt::Key_F12) { - QImage screenshotImage = Gui::_viewer->grabWindow(); // this has to be called in Gui Thread regarding the Qt doc - QString screenshotFileName = Storage::USB_Mount_Point + QString(Storage::Screenshot_Base_Path_Name) + currentDateTime + ".png"; - _DeviceController.doScreenshot(screenshotImage, screenshotFileName); + switch (keyEvent->key()) { + case Qt::Key_F12: { + QImage screenshotImage = Gui::_viewer->grabWindow(); // this has to be called in Gui Thread regarding the Qt doc + QString screenshotFileName = Storage::USB_Mount_Point + QString(Storage::Screenshot_Base_Path_Name) + currentDateTime + ".png"; + _DeviceController.doScreenshot(screenshotImage, screenshotFileName); } + break; + +#ifdef DEBUG_BCUFF_MIMIC + case Qt::Key_F11: { + static quint16 systolic, diastolic, pulserate ; + _BluetoothInterface.mimic( ++systolic, ++diastolic, ++pulserate); + } + break; +#endif + + default: + break; + } } -// coco end +// disabled coco end