Index: en_US.udic =================================================================== diff -u -r13d6a4fae2f910ab6e289ac9280258a94f734405 -r052c794d6a8db55a2fbfdad172275af073ee54c3 --- en_US.udic (.../en_US.udic) (revision 13d6a4fae2f910ab6e289ac9280258a94f734405) +++ en_US.udic (.../en_US.udic) (revision 052c794d6a8db55a2fbfdad172275af073ee54c3) @@ -133,3 +133,8 @@ SIGINT SIGTERM DGVersions +Defs +Msg +Endian +CRC +fprintf Index: sources/canbus/CanInterface.cpp =================================================================== diff -u -r6816b783f50e08267aa016d64350bc020080d901 -r052c794d6a8db55a2fbfdad172275af073ee54c3 --- sources/canbus/CanInterface.cpp (.../CanInterface.cpp) (revision 6816b783f50e08267aa016d64350bc020080d901) +++ sources/canbus/CanInterface.cpp (.../CanInterface.cpp) (revision 052c794d6a8db55a2fbfdad172275af073ee54c3) @@ -288,6 +288,7 @@ else { view = vFrame.payload().toHex('.').replace(QByteArray("a5"),QByteArray("\033[1;33mA5\033[0m")); } + // the fprintf is used for the colored output fprintf(stderr, "%s %s %s %i %s\n", vFrameCount.toLatin1().constData(), time.toLatin1().constData(), flags.toLatin1().constData(), vFrame.frameId(), view.toLatin1().constData()); } // coco end Index: sources/canbus/MessageBuilder.cpp =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -r052c794d6a8db55a2fbfdad172275af073ee54c3 --- sources/canbus/MessageBuilder.cpp (.../MessageBuilder.cpp) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/canbus/MessageBuilder.cpp (.../MessageBuilder.cpp) (revision 052c794d6a8db55a2fbfdad172275af073ee54c3) @@ -463,9 +463,11 @@ } } view = Format::toHexString(vCan_Id, false, eLenChannelDigits).toLatin1() + " " + byteList.join('.'); + // the fprintf is used for the colored output fprintf(stderr, "%s\n", view.constData()); } else { view = Format::toHexString(vCan_Id, false, eLenChannelDigits).toLatin1() + " " + vPayload.toHex('.'); + // the fprintf is used for the colored output fprintf(stderr, "%s\n", view.constData()); } // coco end Index: sources/device/DeviceController.cpp =================================================================== diff -u -rf38edd22f7b63694c21b83d6f4b69ea618390126 -r052c794d6a8db55a2fbfdad172275af073ee54c3 --- sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) +++ sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision 052c794d6a8db55a2fbfdad172275af073ee54c3) @@ -106,11 +106,14 @@ */ void DeviceController::initConnections() { - connect(&_ApplicationController, SIGNAL(didUSBDriveUmount()), - this , SLOT( onUSBDriveUmount())); - connect(&_Logger , SIGNAL(didRemoveLogs(bool)), - this , SLOT( onRemoveLogs(bool))); + connect(&_ApplicationController , SIGNAL(didUSBDriveUmount()), + this , SLOT( onUSBDriveUmount())); + connect(&_Logger , SIGNAL(didRemoveLogs(bool)), + this , SLOT( onRemoveLogs(bool))); + connect(this , SIGNAL(didScreenshot(const QImage &, const QString &)), + this , SLOT( onScreenshot(const QImage &, const QString &))); + DEVICE_DEV_INIT_CONNECTIONS_LIST } @@ -320,7 +323,7 @@ } if (error != lastError) { - LOG_DEBUG(error); + LOG_DEBUG("USB: " + error); lastError = error; } } @@ -513,3 +516,23 @@ emit didAttributeResponse(_deviceBrightnessResponse._data); } } + +/*! + * \brief DeviceController::doScreenshot + * \details emit the screenshot signal to run that in Device controller thread + * \param vCurrentDateTime + */ +void DeviceController::doScreenshot(const QImage &vImage, const QString &vFileName) { + emit didScreenshot(vImage, vFileName); +} + +/*! + * \brief DeviceController::onScreenshot + * \details The function to save the image vImage in the file vFileName + * \param vImage - The image source object + * \param vFileName - The filename to same the image to + */ +void DeviceController::onScreenshot(const QImage &vImage, const QString &vFileName) { + vImage.save(vFileName); + LOG_DEBUG("Screenshot saved in " + vFileName); +} Index: sources/device/DeviceController.h =================================================================== diff -u -rf38edd22f7b63694c21b83d6f4b69ea618390126 -r052c794d6a8db55a2fbfdad172275af073ee54c3 --- sources/device/DeviceController.h (.../DeviceController.h) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) +++ sources/device/DeviceController.h (.../DeviceController.h) (revision 052c794d6a8db55a2fbfdad172275af073ee54c3) @@ -77,11 +77,13 @@ bool init(); bool init(QThread &vThread); + void doScreenshot(const QImage &vImage, const QString &vFileName); + private slots: void quit(); void onRemoveLogs(bool vInProgress); + void onScreenshot(const QImage &vImage, const QString &vFileName); - protected: void timerEvent(QTimerEvent *) override; @@ -101,6 +103,14 @@ signals: /*! + * \brief didScreenshot + * \details The screenshot signal to run the onScreenshot slot in device controller thread. + * \param vImage - The image source object + * \param vFileName - The filename to same the image to + */ + void didScreenshot(const QImage &vImage, const QString &vFilenNme); + + /*! * \brief didUSBDriveMount * \details notifies UI when USB device is available and has been mounted. */ Index: sources/storage/StorageGlobals.cpp =================================================================== diff -u -r13d6a4fae2f910ab6e289ac9280258a94f734405 -r052c794d6a8db55a2fbfdad172275af073ee54c3 --- sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision 13d6a4fae2f910ab6e289ac9280258a94f734405) +++ sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision 052c794d6a8db55a2fbfdad172275af073ee54c3) @@ -32,7 +32,7 @@ #ifdef BUILD_FOR_TARGET const char *USB_Mount_Point = "/media/usb/"; #else - const char *USB_Mount_Point = "/media/denali/usb-disk/"; + const char *USB_Mount_Point = "/home/denali/Desktop/usb-disk/"; #endif const char *USB_File_System = "vfat"; @@ -43,15 +43,11 @@ const char *SDCard_Base_Path_Name = "/media/sd-card/"; #else // should not be in the project application folder. [not tracking by git] - const char *SDCard_Base_Path_Name = "/media/denali/sd-card/"; + const char *SDCard_Base_Path_Name = "/home/denali/Desktop/sd-card/"; #endif - // Screenshot store folder -#ifdef BUILD_FOR_TARGET - const char *Screenshot_Base_Path_Name = "/home/root/screenshots/"; -#else - const char *Screenshot_Base_Path_Name = "/home/denali/Desktop/Screenshots/"; -#endif +// Screenshot store folder +const char *Screenshot_Base_Path_Name = "Screenshots/"; // this is the base path which will use the USB_Mount_Point to store the screenshots. // Settings #ifdef BUILD_FOR_TARGET @@ -77,10 +73,10 @@ // FIXME : Not sure having global settings object is a good idea. -#ifdef BUILD_FOR_DESKTOP - QSettings WifiSettings("/home/denali/wifi.ini"); -#elif BUILD_FOR_TARGET +#ifdef BUILD_FOR_TARGET QSettings WifiSettings("/home/root/wifi.ini", QSettings::IniFormat); +#else + QSettings WifiSettings("/home/denali/wifi.ini"); #endif // TODO : These need to be removed from here because they are only used in their specific classes. Index: sources/view/VEventSpy.cpp =================================================================== diff -u -r13d6a4fae2f910ab6e289ac9280258a94f734405 -r052c794d6a8db55a2fbfdad172275af073ee54c3 --- sources/view/VEventSpy.cpp (.../VEventSpy.cpp) (revision 13d6a4fae2f910ab6e289ac9280258a94f734405) +++ sources/view/VEventSpy.cpp (.../VEventSpy.cpp) (revision 052c794d6a8db55a2fbfdad172275af073ee54c3) @@ -23,6 +23,7 @@ #include "GuiGlobals.h" #include "Logger.h" #include "FileHandler.h" +#include "DeviceController.h" // if needs to spy on the mouse events // (which is happening on the desktop only since there is not mouse attached to the device) @@ -203,7 +204,7 @@ static QString dateTime = QDateTime::currentDateTime().toString(datetimeFormat); QString currentDateTime = QDateTime::currentDateTime().toString(datetimeFormat); if ( firstEntry ) { // we will only need to check for the folder once in application life time. - folderAvailable = FileHandler::makeFolder(Screenshot_Base_Path_Name); + folderAvailable = FileHandler::makeFolder(QString(USB_Mount_Point) + Screenshot_Base_Path_Name); if ( ! folderAvailable ) { LOG_DEBUG(QString("Folder is not available for screenshot [%1]").arg(Storage::Screenshot_Base_Path_Name)); } @@ -216,13 +217,9 @@ firstEntry = false; QKeyEvent *keyEvent = static_cast(vEvent); if (keyEvent->key() == Qt::Key_F12) { - // it's known that this code will be called in the main thread. - // Since this is a test code it is not worth working on the threading. - // Logging has it's own thread and is independent of the function it is being called. - QImage screenshot = Gui::_viewer->grabWindow(); - QString screenshotFileName = QString(Screenshot_Base_Path_Name) + currentDateTime + ".png"; - screenshot.save(screenshotFileName); - LOG_DEBUG("Screenshot saved in " + screenshotFileName); + 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); } } // coco end Index: sources/view/VTreatmentCreate.cpp =================================================================== diff -u -r6816b783f50e08267aa016d64350bc020080d901 -r052c794d6a8db55a2fbfdad172275af073ee54c3 --- sources/view/VTreatmentCreate.cpp (.../VTreatmentCreate.cpp) (revision 6816b783f50e08267aa016d64350bc020080d901) +++ sources/view/VTreatmentCreate.cpp (.../VTreatmentCreate.cpp) (revision 052c794d6a8db55a2fbfdad172275af073ee54c3) @@ -351,7 +351,6 @@ QString aConcentrate; QString bCarbConcentrate; QString dType; - qDebug() << acidConcentrateOptions().length(); if ((acidConcentrateOptions().length() - 1 < (int)_acidConcentrate)) aConcentrate = "None"; else