UnionComDLL/canidcalc.h

66 lines
1.1 KiB
C++

#ifndef CANIDCALC_H
#define CANIDCALC_H
#include <QWidget>
namespace Ui {
class CanIdCalc;
}
class CanIdCalc : public QWidget
{
Q_OBJECT
public:
explicit CanIdCalc(QWidget *parent = nullptr);
~CanIdCalc();
private slots:
void on_DataTypeBox_currentIndexChanged(int index);
void on_SensorTypeBox_currentIndexChanged(int index);
void on_SensorIdBox_valueChanged(int arg1);
void on_DeviceIdBox_valueChanged(int arg1);
void on_StrAdrBox_valueChanged(int arg1);
void on_routeBox_stateChanged(int arg1);
private:
void id_Calc();
bool isModbus = false;
union Can_ID{
struct Can_ID_Fields
{
uint Device:8;
uint SensorID:11;
uint SensorType:5;
uint DataType:4;
uint Route:1;
}Fields;
uint ID_All:29;
}CanId;
union Can_ID_Modbus{
struct Can_ID_Fields
{
uint Device:8;
uint CountReg:8;
uint StrAdr:8;
uint DataType:4;
uint Route:1;
}Fields;
uint ID_All:29;
}CanIdModbus;
Ui::CanIdCalc *ui;
};
#endif // CANIDCALC_H