Code cleanup

This commit is contained in:
2023-01-28 09:01:02 -05:00
parent eeb1d04f9b
commit 74b6a23045
24 changed files with 1548 additions and 1442 deletions
+90
View File
@@ -0,0 +1,90 @@
#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);
quint64 mRawValue;
double mPhysicalValue;
};
#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
*/