Ajout du support pour les fichiers CAN database .dbc

Ajout shortcut pour RDP vers le PC dans le champs
This commit is contained in:
2023-01-09 16:45:23 -05:00
parent c888a889f2
commit 087245571a
47 changed files with 7885 additions and 692 deletions
+34 -5
View File
@@ -1,14 +1,34 @@
/*******************************************************************************
* *
* Gros Gin électronique *
* 2023 *
* *
* Project: Otarcik CAN *
* *
* *
* *
*******************************************************************************/
/*
Description:
This class interfaces the PCAN USB CAN puck
*/
#include "PCANInterface.h"
#include "GeneralMessagesLogDispatcher.h"
CPCANInterface::CPCANInterface(QObject *parent) : QObject(parent)
{
}
int CPCANInterface::Init()
{
QString LogMsg;
TPCANStatus Result;
Result = CAN_Initialize(PCAN_USBBUS1, PCAN_BAUD_500K);
CGeneralMessagesLogDispatcher::instance()->AddLogMessage(QString("Initializing PCAN USB module. Channel:%1, Baudrate:%2").arg(PCAN_USBBUS1).arg(PCAN_BAUD_500K));
if(Result != PCAN_ERROR_OK)
{
@@ -17,10 +37,19 @@ int CPCANInterface::Init()
char strMsg[256];
CAN_GetErrorText(Result, 0, strMsg);
qDebug("%s",strMsg);
CGeneralMessagesLogDispatcher::instance()->AddLogMessage(strMsg);
CGeneralMessagesLogDispatcher::instance()->AddLogMessage(QString("Could not initialize PCAN USB module. Error:%1").arg(strMsg),true,CGeneralMessagesLogDispatcher::GEN_MSG_TXT_ERROR_STATUS);
}
return 0;
else
{
CGeneralMessagesLogDispatcher::instance()->AddLogMessage("PCAN USB init SUCCESS");
}
return RET_OK;
}
int CPCANInterface::DeInit(unsigned short Channel)
{
CAN_Uninitialize(Channel);
return RET_OK;
}