2023-06-06 17:59:30 -04:00

93 lines
1.8 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef CANSIGNAL_H
#define CANSIGNAL_H
#include <QtGlobal>
#include <QString>
class CCANSignal
{
public:
enum eCANSignalEncoding
{
CAN_SIGNAL_ENCODING_INTEL = 0,
CAN_SIGNAL_ENCODING_MOTOROLA,
CAN_SIGNAL_ENCODING_INVALID,
CAN_SIGNAL_ENCODING_MAX
};
enum eCANSignalMultiplexing
{
CAN_SIGNAL_MULTIPLEXING_NONE,
CAN_SIGNAL_MULTIPLEXING_SWITCH,
CAN_SIGNAL_MULTIPLEXING_MULTIPLEXED,
CAN_SIGNAL_MULTIPLEXING_MAX
};
enum eCANSIgnalValueType
{
CAN_SIGNAL_TYPE_INVALID,
CAN_SIGNAL_TYPE_SIGNED_INT,
CAN_SIGNAL_TYPE_UNSIGNED_INT,
CAN_SIGNAL_TYPE_32_BIT_FLOAT,
CAN_SIGNAL_TYPE_64_BIT_DOUBLE,
CAN_SIGNAL_TYPE_MAX
};
public:
CCANSignal();
QString mSignalName;
QString mSignalComment;
unsigned int mEncoding;
unsigned int mMultiplexing;
unsigned int mStartBit;
unsigned int mSignalSize;
unsigned int mValueType;
double mValueFactor;
double mValueOffset;
int mMinValue;
int mMaxValue;
QString mSignalUnit;
int ComputeNewSignalValue(quint64 NewValue, quint16 MessageSize);
CCANSignal &operator=(const CCANSignal &source);
quint64 mRawValue;
double mPhysicalValue;
// quint64 mPhysicalValueUINT;
// qint64 mPhysicalValueINT;
};
#endif // CANSIGNAL_H
/*
physical_value = raw_value * factor + offset
raw_value = (physical_value offset) / factor
*/
/*
* Signal: name='_BA_Resp_SW_Ver_Revision', unit=''
qname='IVT-S_all-variations_12082020.IVT_Msg_Response._BA_Resp_SW_Ver_Revision'
comment=''
encoding='Motorola'
representation='Unsigned'
value min=0.00, value max=0.00
scale faktor=1.00, offset=0.00
startbit=24, length=8
*/