kbLogger 2.0.b1
The automotive ready test and logging program.
TranslatorMessage Class Reference

This class defines the API of the TranslatorMessage.

#include <translator.h>

Public Slots

TranslatorMessage related functions.
TranslatorMessagecopyValues ()
 Copy all signal values from RX to TX.
 
bool isBigEndian ()
 Returns true in case of BigEndian.
 
bool isLittleEndian ()
 Returns true in case of LittleEndian.
 
TranslatorMessagesetBigEndian ()
 Switches the message to BigEndian.
 
TranslatorMessagesetLittleEndian ()
 Switches the message to LittleEndian.
 
TranslatorMessagesetCallback (QString strCallback)
 Sets the callback function, which is called whenever this message was translated successfully.
 
TranslatorMessagesetCallback (QString strTarget, QString strCallback)
 Sets the callback function in a connected ScriptObject, which is called whenever this message was translated successfully.
 
TranslatorMessagesetCallback (QString strProject, QString strTarget, QString strCallback)
 Sets the callback function in a ScriptObject in another project, which is called whenever this message was translated successfully.
 
TranslatorMessageappend (TranslatorSignal *pSignal)
 Appends a signal.
 
TranslatorProtocolgetProtocol ()
 Returns the signal with the given index.
 
TranslatorSignalgetSignal (unsigned int uSignal)
 Returns the signal with the given index.
 
TranslatorSignalgetSignal (QString strSignal)
 Returns the signal with the given name.
 
void send (QString strTarget)
 Sends the message.
 
void send (QString strTarget, QString strMetadata)
 Sends the message.
 
void send (QString strTargetProject, QString strTarget, QString strMetadata)
 Sends the message.
 
int translate ()
 Translate the TX message in a dry run. Returns the complete length of the resulting message.
 

Member Function Documentation

◆ append

TranslatorMessage * append ( TranslatorSignal * pSignal)
slot

Appends a signal to the message.

Example:

var message11 = tr.createMessage(0x01000001, "message11");
var signal1 = tr.createSignalBool("mySignal", myOffset);
var signal2 = tr.createSignalUint8("myUint8", myOffset).setHex();
message1.append(signal1).append(signal2);
Parameters
pSignalThe handle of the signal.
Returns
Returns the handle to the message or 0 in case of an error.

◆ getSignal

TranslatorSignal * getSignal ( QString strSignal)
slot
Parameters
strSignalReturns the signal with the given name.

◆ send [1/3]

void send ( QString strTarget)
slot
Parameters
strTargetSends the message.

◆ send [2/3]

void send ( QString strTarget,
QString strMetadata )
slot
Parameters
strMetadataSends the message.

◆ send [3/3]

void send ( QString strTargetProject,
QString strTarget,
QString strMetadata )
slot
Parameters
strMetadataSends the message.

◆ setCallback [1/3]

TranslatorMessage * setCallback ( QString strCallback)
slot
Parameters
strCallbackSets the callback function, which is called whenever this message was translated successfully.

◆ setCallback [2/3]

TranslatorMessage * setCallback ( QString strProject,
QString strTarget,
QString strCallback )
slot
Parameters
strCallbackSets the callback function, which is called whenever this message was translated successfully.

◆ setCallback [3/3]

TranslatorMessage * setCallback ( QString strTarget,
QString strCallback )
slot
Parameters
strCallbackSets the callback function, which is called whenever this message was translated successfully.