Index: sources/canbus/messageglobals.h =================================================================== diff -u -re1605219ac2baf49ef21d0889f845ac53d59c3c1 -r56d00a82669a7a2c00ab90109a89dbec8db27527 --- sources/canbus/messageglobals.h (.../messageglobals.h) (revision e1605219ac2baf49ef21d0889f845ac53d59c3c1) +++ sources/canbus/messageglobals.h (.../messageglobals.h) (revision 56d00a82669a7a2c00ab90109a89dbec8db27527) @@ -15,29 +15,23 @@ // Qt #include -#include // Project #include "guiglobals.h" -using namespace Gui; namespace Can { -extern QThread _CanFrame_Thread; -extern QThread _CanMessage_Thread; - - /*! * \brief Payload Length * \details List of each ActionID required data (in byte) length in the message. * So the data collector has to collect this amount of bytes as payload of a message. */ -const QHash payloadLen { - {GuiActionType::PowerOff , 1 }, - {GuiActionType::KeepAlive , 0 }, - {GuiActionType::BloodFlow , 7 * 4 } , // 7 parameters each 4bytes - {GuiActionType::DialysateFlow , 7 * 4 } , // 7 parameters each 4bytes - {GuiActionType::String , 255 }, +const QHash payloadLen { + {Gui::GuiActionType::PowerOff , 1 }, + {Gui::GuiActionType::KeepAlive , 0 }, + {Gui::GuiActionType::BloodFlow , 7 * 4 } , // 7 parameters each 4bytes + {Gui::GuiActionType::DialysateFlow , 7 * 4 } , // 7 parameters each 4bytes + {Gui::GuiActionType::String , 255 }, }; /*! @@ -103,12 +97,13 @@ * \details The message structure after it's been converted form hex bytes to meaningful struct for UI. */ struct Message { // TODO : Should be converted to MessageModel class // no time left for now !!! - Can_Id can_id; - GuiActionType actionId = GuiActionType::Unknown; - int length = 0; - QByteArray head; - QByteArray data; - bool initialized = false; + Can_Id can_id; + Gui::GuiActionType actionId = Gui::GuiActionType::Unknown; + int length = 0; + QByteArray head; + QByteArray data; + bool initialized = false; + bool isEmpty () { return !initialized || !data.length(); } bool isComplete() { return !isEmpty() && data.length() == length; } };