From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- .../CanEasy_Xoraya_Plugin.sln | 20 + .../CanEasy_Xoraya_Plugin.vcproj | 369 ++ ...ya_Plugin.vcproj.SCHLEISSHEIMER.Eisenhauer.user | 65 + .../CanEasy_Xoraya_PluginDlg.cpp | 766 +++ .../CanEasy_Xoraya_PluginDlg.h | 133 + .../CanEasy_Xoraya_PluginDll.aps | Bin 0 -> 41568 bytes .../CanEasy_Xoraya_PluginDll.cpp | 489 ++ .../CanEasy_Xoraya_PluginDll.def | 13 + .../CanEasy_Xoraya_PluginDll.h | 53 + .../CanEasy_Xoraya_PluginDll.ico | Bin 0 -> 766 bytes .../CanEasy_Xoraya_PluginDll.rc | 256 + .../CanEasy_Xoraya_Plugin/CodeGenerator.cpp | 236 + .../CanEasy_Xoraya_Plugin/CodeGenerator.h | 34 + .../CanEasy_Xoraya_Plugin/FloatSliderCtrl.cpp | 94 + .../CanEasy_Xoraya_Plugin/FloatSliderCtrl.h | 81 + .../CanEasy_Xoraya_Plugin/LogImport.cpp | 107 + .../CanEasy_Xoraya_Plugin/LogImport.h | 17 + .../CanEasy_Xoraya_Plugin/NumEdit.cpp | 32 + .../CanEasy_Xoraya_Plugin/NumEdit.h | 48 + .../CanEasy_Xoraya_Plugin/PanelDropTarget.h | 125 + .../CanEasy_Xoraya_Plugin/Signal.cpp | 233 + .../CanEasy_Xoraya_Plugin/Signal.h | 58 + .../CanEasy_Xoraya_Plugin/StdAfx.cpp | 4 + .../CanEasy_Xoraya_Plugin/StdAfx.h | 41 + .../CanEasy_Xoraya_Plugin/XorayaAdaptor.cpp | 382 ++ .../CanEasy_Xoraya_Plugin/XorayaAdaptor.h | 72 + .../CanEasy_Xoraya_Plugin/include/canduserapi.h | 6487 ++++++++++++++++++++ .../CanEasy_Xoraya_Plugin/lib/CanDll.lib | Bin 0 -> 98640 bytes .../res/CanEasy_Xoraya_PluginDll.rc2 | 13 + .../CanEasy_Xoraya_Plugin/resource.h | 42 + .../CanEasy_Xoraya_Plugin/x2e.ico | Bin 0 -> 2238 bytes .../CanEasy_Xoraya_Plugin/doc/Doxyfile | 1604 +++++ 32 files changed, 11874 insertions(+) create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.sln create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.vcproj create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.vcproj.SCHLEISSHEIMER.Eisenhauer.user create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDlg.cpp create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDlg.h create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.aps create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.cpp create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.def create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.h create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.ico create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.rc create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CodeGenerator.cpp create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CodeGenerator.h create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/FloatSliderCtrl.cpp create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/FloatSliderCtrl.h create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/LogImport.cpp create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/LogImport.h create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/NumEdit.cpp create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/NumEdit.h create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/PanelDropTarget.h create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/Signal.cpp create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/Signal.h create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/StdAfx.cpp create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/StdAfx.h create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/XorayaAdaptor.cpp create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/XorayaAdaptor.h create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/include/canduserapi.h create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/lib/CanDll.lib create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/res/CanEasy_Xoraya_PluginDll.rc2 create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/resource.h create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/x2e.ico create mode 100644 Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/doc/Doxyfile (limited to 'Master/Masterarbeit/src/CanEasyPlugin') diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.sln b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.sln new file mode 100644 index 0000000..fdd2c79 --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CanEasy_Xoraya_Plugin", "CanEasy_Xoraya_Plugin\CanEasy_Xoraya_Plugin.vcproj", "{BB958F41-20BA-4C41-A845-A6B07582575B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BB958F41-20BA-4C41-A845-A6B07582575B}.Debug|Win32.ActiveCfg = Debug|Win32 + {BB958F41-20BA-4C41-A845-A6B07582575B}.Debug|Win32.Build.0 = Debug|Win32 + {BB958F41-20BA-4C41-A845-A6B07582575B}.Release|Win32.ActiveCfg = Release|Win32 + {BB958F41-20BA-4C41-A845-A6B07582575B}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.vcproj b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.vcproj new file mode 100644 index 0000000..0347d09 --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.vcproj @@ -0,0 +1,369 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.vcproj.SCHLEISSHEIMER.Eisenhauer.user b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.vcproj.SCHLEISSHEIMER.Eisenhauer.user new file mode 100644 index 0000000..679acd4 --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.vcproj.SCHLEISSHEIMER.Eisenhauer.user @@ -0,0 +1,65 @@ + + + + + + + + + + + diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDlg.cpp b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDlg.cpp new file mode 100644 index 0000000..44d8b49 --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDlg.cpp @@ -0,0 +1,766 @@ +// CanEasy_Xoraya_PluginDlg.cpp: Implementatoin file +// + +#include "stdafx.h" +#include "CanEasy_Xoraya_PluginDll.h" +#include "CanEasy_Xoraya_PluginDlg.h" +#include "XorayaAdaptor.h" +#include "CodeGenerator.h" +#include +#include +#include +#include +#include "global.h" +#include "protocol.h" +#include "LogImport.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +#define WM_UPDATE_CONTROLS (WM_USER + 5) + +#define OBJECT_NAME_LEN 256 + +#define STR_CONNECTED _T("Connected") +#define STR_DISCONNECTED _T("Disconnected") +#define STR_MAP_SEP " -> " +#define nSTR_INVALID_SOFILE "INVALIDSOFILE" +typedef boost::tokenizer > tokenizer; + +///////////////////////////////////////////////////////////////////////////// +// Dialog CCanEasy_Xoraya_PluginDlg + +///////////////////////////////////////////////////////////////////////////// +// global pointer to the dialog +CCanEasy_Xoraya_PluginDlg* g_pCanEasy_Xoraya_PluginDlg = NULL; + + +CCanEasy_Xoraya_PluginDlg::CCanEasy_Xoraya_PluginDlg(CWnd* pParent /*=NULL*/) +:CDialog(CCanEasy_Xoraya_PluginDlg::IDD, pParent) +{ + //{{AFX_DATA_INIT(CCanEasy_Xoraya_PluginDlg) + //m_sEdit = _T(""); + m_sXorayaIpAddress = nDEFAULT_IP; + //}}AFX_DATA_INIT + + // keep in mind that the LoadIcon doesn't need a following DestroyIcon-Call at Win32 + m_hIcon = AfxGetApp()->LoadIcon(IDI_ICON1); + + g_pCanEasy_Xoraya_PluginDlg = this; + +} + + +void CCanEasy_Xoraya_PluginDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CCanEasy_Xoraya_PluginDlg) + //DDX_Control(pDX, IDC_EDIT1, m_editCtrl); + //DDX_Control(pDX, IDC_SLIDER1, m_sliderCtrl); + //DDX_Text(pDX, IDC_EDIT1, m_sEdit); + DDX_Control(pDX,IDC_XORAYA_IPADDRESS,m_cIpAddressCtrl); + + DDX_Text(pDX,IDC_XORAYA_IPADDRESS,m_sXorayaIpAddress); + // HINWEIS: Der Klassen-Assistent fügt hier DDX- und DDV-Aufrufe ein + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CCanEasy_Xoraya_PluginDlg, CDialog) + //{{AFX_MSG_MAP(CCanEasy_Xoraya_PluginDlg) + ON_WM_HSCROLL() + ON_EN_KILLFOCUS(IDC_XORAYA_IPADDRESS, OnKillfocusIpAddress) + //}}AFX_MSG_MAP + ON_MESSAGE(WM_UPDATE_CONTROLS, OnUpdateControls) + ON_BN_CLICKED(IDC_BUTTON_CONNECT, &CCanEasy_Xoraya_PluginDlg::OnBnClickedConnect) + ON_BN_CLICKED(IDC_MAP_BUTTON, &CCanEasy_Xoraya_PluginDlg::OnBnClickedMap) + ON_BN_CLICKED(IDC_UNMAP_BUTTON, &CCanEasy_Xoraya_PluginDlg::OnBnClickedUnmap) + ON_BN_CLICKED(IDC_GETINTERFACES_BUTTON, &CCanEasy_Xoraya_PluginDlg::OnBnClickedGetinterfaces) + ON_BN_CLICKED(IDC_START_BUTTON, &CCanEasy_Xoraya_PluginDlg::OnBnClickedStart) + ON_BN_CLICKED(IDC_STOP_BUTTON, &CCanEasy_Xoraya_PluginDlg::OnBnClickedStop) + ON_BN_CLICKED(IDC_BUTTON_DISCONNECT, &CCanEasy_Xoraya_PluginDlg::OnBnClickedDisconnect) + ON_BN_CLICKED(IDC_BUTTON_SHUTDOWN, &CCanEasy_Xoraya_PluginDlg::OnBnClickedShutdown) + ON_BN_CLICKED(IDC_IMPORTLOG_BUTTON, &CCanEasy_Xoraya_PluginDlg::OnBnClickedImportLog) + ON_BN_CLICKED(IDC_BUTTON_ENUMLOGS, &CCanEasy_Xoraya_PluginDlg::OnBnClickedEnumLogs) +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// message processing routines of CCanEasy_Xoraya_PluginDlg + +BOOL CCanEasy_Xoraya_PluginDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + /* Set the icon for this Dialog. Will be processed automatically + if the main window of the application isn't a dialogfield. */ + SetIcon(m_hIcon, TRUE); // use small symbol + SetIcon(m_hIcon, FALSE); // use big symbol + // register panel as a drop target + m_dropTarget.Register(this); + + CAND_tHandle hBus; + char acBusName[OBJECT_NAME_LEN]; + hBus = CAND_hGetFirstBus(); + CComboBox* pxBusCombo = reinterpret_cast(GetDlgItem(IDC_BUS_COMBO)); + while(hBus) + { + CAND_enGetName(hBus,acBusName,OBJECT_NAME_LEN); + pxBusCombo->AddString(acBusName); + hBus = CAND_hGetNextBus(hBus); + } + if(pxBusCombo->GetCount() > 0) + { + pxBusCombo->SetCurSel(0); + } + // activate all assigned controls + EnableControls(); + + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurückgeben +} + +// for reaction to changes of the database +void CCanEasy_Xoraya_PluginDlg::OnDatabaseChanged() +{ + // Insert Code that has to be processed on changings of the database. +} + +BYTE CALLBACK OnSignalValueChanged(CAND_tHandle hSig, DWORD dwUserData) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + if(g_pCanEasy_Xoraya_PluginDlg) + return g_pCanEasy_Xoraya_PluginDlg->OnSignalValueChanged(hSig, 0); + + return 1; +} + +BYTE CALLBACK OnMsgDataChanged(CAND_tHandle hMsg, DWORD dwUserData) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + if(g_pCanEasy_Xoraya_PluginDlg) + return g_pCanEasy_Xoraya_PluginDlg->OnMsgDataChanged(hMsg,0); + + return 1; +} + +/***************************************************************************** +* +* CPluginDemoDlg::OnDragOver +* +* Description : Called when the user drags the object over a control. +* +* Parameter : pDataObject : Points to the COleDataObject being dragged +* over the drop target. +* dwKeyState : Contains the state of the modifier keys. +* point : The current mouse position relative to the +* view client area. +* +* Return : Called by the framework during a drag operation when the +* mouse is moved over the drop target window. +* +*****************************************************************************/ +DROPEFFECT CCanEasy_Xoraya_PluginDlg::OnDragOver(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point) +{ + // let only pass when the simulation is halted + if(CAND_boIsRunning()) + return DROPEFFECT_NONE; + + // retrieve the character string the Drag&Drop-Object contains + HGLOBAL hGlobal = pDataObject->GetGlobalData(CF_TEXT); + LPTSTR lpcString = (LPTSTR)GlobalLock(hGlobal); + CString sText = lpcString; + GlobalUnlock(hGlobal); + + // Transform the Drag&Drop character string to a Handle. A NULL-Handle is returned + // if the object hasn't been found. + CAND_tHandle hObj = CAND_hTextToHandle(sText); + if(hObj == CAND_hNullHandle()) + return DROPEFFECT_NONE; + + // check the type of the Handle + CAND_tenHandleType enType; + if(CAND_enGetHandleType(hObj, &enType) != CAND_nERR_OK) + return DROPEFFECT_NONE; + + // let pass signals only + if(enType != CAND_nSig) + return DROPEFFECT_NONE; + + CWnd* pWndFromPoint = ChildWindowFromPoint(point); + if(pWndFromPoint == NULL || !IsChild(pWndFromPoint)) + return DROPEFFECT_NONE; + + // allow dragging only at the wanted controls + //if( (pWndFromPoint == &m_sliderCtrl) || + // (pWndFromPoint == &m_editCtrl) ) + //{ + // return DROPEFFECT_MOVE; + //} + + return DROPEFFECT_NONE; +} + + +/***************************************************************************** +* +* CPluginDemoDlg::OnDrop +* +* Description : Called when the user drops the object onto the control +* +* Parameter : pWnd: Points to the window the cursor is entering. +* pDataObject: Points to the data object containing the data +* that can be dropped. +* dropEffect: Contains the effect on the data after dropping (NONE, MOVE, COPY etc.). +* point: Contains the current location of the cursor in +* client coordinates. +* +* Return : BOOL: Nonzero if the drop is successful; otherwise 0. +* +*****************************************************************************/ +BOOL CCanEasy_Xoraya_PluginDlg::OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point) +{ + // let only pass when the simulation is halted + if(CAND_boIsRunning()) + return DROPEFFECT_NONE; + + // determine the window that the object has been dropped onto + CWnd* pWndFromPoint = ChildWindowFromPoint(point); + if(pWndFromPoint && IsChild(pWndFromPoint)) + { + // retrieve the character string the Drag&Drop-Object contains + HGLOBAL hGlobal = pDataObject->GetGlobalData(CF_TEXT); + LPTSTR lpcString = (LPTSTR)GlobalLock(hGlobal); + CString sText = lpcString; + GlobalUnlock(hGlobal); + + // Transform the Drag&Drop character string to a Handle. Returns a NULL-Handle + // if the object hasn't been found. + CAND_tHandle hObj = CAND_hTextToHandle(sText); + if(hObj == CAND_hNullHandle()) + return FALSE; + + // check the type of the Handle + CAND_tenHandleType enType; + if(CAND_enGetHandleType(hObj, &enType) != CAND_nERR_OK) + return FALSE; + + // let pass signals only + if(enType != CAND_nSig) + return FALSE; + + CString sName; + const int iLen = OBJECT_NAME_LEN; + VERIFY(CAND_enGetName(hObj, sName.GetBuffer(iLen), iLen) == CAND_nERR_OK); + sName.ReleaseBuffer(); + + // determine control element that the object has been dropped onto + int iID = pWndFromPoint->GetDlgCtrlID(); + + //switch(iID) + //{ + //case IDC_SLIDER1: + //case IDC_EDIT1: + // m_signalEdit.Attach(hObj); + // break; + //default: + // return FALSE; + //} + + EnableControls(); + InitControls(); + return TRUE; + } + + return FALSE; +} + +void CCanEasy_Xoraya_PluginDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) +{ + CString sTemp; + + if(pScrollBar != NULL) + { + //switch(pScrollBar->GetDlgCtrlID()) + //{ + //case IDC_SLIDER1: + // { + // // retrieve the value of the slider an assign to the signal + // double dVal = m_sliderCtrl.GetPosEx(); + // m_signalEdit = dVal; + + // // update the edit field + // CString sText; + // sText.Format("%g", dVal); + // m_sEdit = sText; + // UpdateData(FALSE); + // } + // break; + //default: + // break; + //} + } + + CDialog::OnHScroll(nSBCode, nPos, pScrollBar); +} + +/* Will be called by the Framework, i.e. if Enter has been pressed */ +void CCanEasy_Xoraya_PluginDlg::OnOK() +{ + UpdateData(); + + /* Here we select temporarily the next control, to provoke a KillFocus of + current Edit-Field. Then we set the focus back, so the content of the + inputfield is completely selected an can be edited immediately. */ + NextDlgCtrl(); + PrevDlgCtrl(); + + /* If we provide OnOK to the base class here, the dialog will be closed! + Just uncomment the following line if you want to have this behavior */ + //CDialog::OnOK(); +} + +// when the user leaves the Input-Field +void CCanEasy_Xoraya_PluginDlg::OnKillfocusIpAddress() +{ + UpdateData(); + //if(m_signalEdit.IsAttached()) + //{ + // double dVal = atof(m_sEdit); + // m_signalEdit = dVal; + // m_sliderCtrl.SetPosEx(dVal); + //} +} + +void CCanEasy_Xoraya_PluginDlg::InitControls() +{ + //if(m_signalEdit.IsAttached()) + //{ + // CAND_tHandle hSig = m_signalEdit; + // // Register callback which will be called when the signal value changes + // if(CAND_enRegisterCallback(::OnSignalValueChanged, CAND_enSigValueChanged, hSig, 0) == CAND_nERR_OK) + // { + // double dMin = m_signalEdit.GetMinVal(); + // double dMax = m_signalEdit.GetMaxVal(); + // double dFactor = m_signalEdit.GetFactor(); + // double dVal = m_signalEdit; + // int iResolution = (int)((dMax - dMin) / dFactor); + + // m_sliderCtrl.SetRangeEx(dMin, dMax, 0, iResolution, TRUE); + // m_sliderCtrl.SetPosEx(dVal); + + // CString sText; + // sText.Format("%g", dVal); + // m_sEdit = sText; + // } + //} + PostMessage(WM_UPDATE_CONTROLS); +} + +// activate all assigned controls, deactivate the others +void CCanEasy_Xoraya_PluginDlg::EnableControls() +{ + //GetDlgItem(IDC_SLIDER1)->EnableWindow(m_signalEdit.IsAttached()); + //GetDlgItem(IDC_EDIT1)->EnableWindow(m_signalEdit.IsAttached()); + GetDlgItem(IDC_XORAYA_IPADDRESS)->EnableWindow(); + GetDlgItem(IDC_BUS_COMBO)->EnableWindow(); +} + +/******************************************************************************************** +* +* Function : OnSignalValueChanged - Callback-Function; +* +* Description : Will be called when a signal value has been changed. +* +* Parameter : hSig: Handle to the signal that has been changed. +* dwUserData: user defined data +* +* Return : BYTE (always return 1 here) +* +********************************************************************************************/ +BYTE CCanEasy_Xoraya_PluginDlg::OnSignalValueChanged(CAND_tHandle hSig, DWORD dwUserData) +{ + //if(hSig == m_signalEdit) + //{ + // double dVal = m_signalEdit; + // m_sliderCtrl.SetPosEx(dVal); + + // CString sText; + // sText.Format("%g", dVal); + // m_sEdit = sText; + // PostMessage(WM_UPDATE_CONTROLS); + //} + CAND_tHandle hMsg = CAND_hGetMessage(hSig); + OnMsgDataChanged(hMsg,0); + return 1; +} + +BYTE CCanEasy_Xoraya_PluginDlg::OnMsgDataChanged(CAND_tHandle hMsg, DWORD dwUserData) +{ + if(m_pcAdaptor) + { + m_xMsgUpdMutex.lock(); + int32_t i32Interface; + unsigned long ul32MsgId; + uint8_t au8MsgData[8]; + CAND_enGetMsgID(hMsg,&ul32MsgId); + CAND_enGetMsgData(hMsg,au8MsgData); + CAND_tHandle hEcu = CAND_hGetEcu(hMsg); + CAND_tHandle hBus = CAND_hGetBus(hEcu); + char acBusName[OBJECT_NAME_LEN]; + memset((void*) acBusName,0,OBJECT_NAME_LEN); + CAND_enGetName(hBus,acBusName,OBJECT_NAME_LEN); + std::string sBusName(acBusName); + + tInterfaceMap::right_const_iterator it = m_xInterfaceMap.right.find(sBusName); + if( it != m_xInterfaceMap.right.end() ) + { + i32Interface = it->second; + Log("sending update for msg %#x",ul32MsgId); + m_pcAdaptor->vChangeMsgData(i32Interface,ul32MsgId,au8MsgData); + } + m_xMsgUpdMutex.unlock(); + } + + return 1; +} + +/* Will be called when the signal has been changed and the controls have to be updated */ +LRESULT CCanEasy_Xoraya_PluginDlg::OnUpdateControls(WPARAM /* wParam */, LPARAM lParam) +{ + UpdateData(FALSE); + return 0; +} + +void CCanEasy_Xoraya_PluginDlg::OnBnClickedConnect() +{ + vConnect(); +} + +void CCanEasy_Xoraya_PluginDlg::vConnect() +{ + if(!m_pcAdaptor) + { + Log(m_sXorayaIpAddress); + m_pcAdaptor.reset( + new CXorayaAdaptor( this, std::string( (LPCTSTR) m_sXorayaIpAddress) ) + ); + Log("%s adaptor started",__FUNCTION__); + } +} + +void CCanEasy_Xoraya_PluginDlg::Log(const char * format,...) +{ + boost::lock_guard lock(m_xLogMutex); + //m_xLogMutex.lock(); + char buffer[5000]; + memset(buffer,0,5000); + buffer[0] = '\r'; + buffer[1] = '\n'; + + va_list ap; + + va_start(ap, format); + vsprintf_s( (buffer+2), 4997, format, ap); + va_end(ap); + + m_cLog = reinterpret_cast(GetDlgItem(IDC_LOG)); + CString sLog; + m_cLog->SetSel( + m_cLog->GetWindowTextLengthA(), + m_cLog->GetWindowTextLengthA() + ); + m_cLog->ReplaceSel(CString(buffer)); + + //m_xLogMutex.unlock(); +} +void CCanEasy_Xoraya_PluginDlg::OnBnClickedMap() +{ + std::string sBus,sInterface; + CString sSelectedBusString,sSelectedInterface; + int32_t i32Interface; + CComboBox* pxBusCombo = reinterpret_cast(GetDlgItem(IDC_BUS_COMBO)); + CComboBox* pxInterfaceCombo = reinterpret_cast(GetDlgItem(IDC_INTERFACE_COMBO)); + int i32BusIdx = pxBusCombo->GetCurSel(); + int i32InterfaceIdx = pxInterfaceCombo->GetCurSel(); + if(i32BusIdx == -1 || i32InterfaceIdx == -1) + { + return; + } + pxBusCombo->GetLBText(i32BusIdx,sSelectedBusString); + pxInterfaceCombo->GetLBText(i32InterfaceIdx,sSelectedInterface); + sInterface = (LPCTSTR) sSelectedInterface; + i32Interface = boost::lexical_cast( sInterface.substr(4,1) ); + sBus = (LPCTSTR) sSelectedBusString; + vAddInterfaceMapping(i32Interface,sBus); +} + +void CCanEasy_Xoraya_PluginDlg::vSetInterfaces( const char* pcInterface) +{ + CComboBox* pxInterfaceCombo = reinterpret_cast(GetDlgItem(IDC_INTERFACE_COMBO)); + pxInterfaceCombo->ResetContent(); + char *pcTok; + char acBuf[508]; + strcpy(acBuf,pcInterface); + pcTok = strtok( acBuf, "\n" ); + while( pcTok != NULL) + { + pxInterfaceCombo->AddString( CString(pcTok) ); + pcTok = strtok(NULL,"\n"); + } + pxInterfaceCombo->SetCurSel(0); +} +void CCanEasy_Xoraya_PluginDlg::OnBnClickedUnmap() +{ + int32_t i32Interface = i32GetSelectedMappedInterface(); + vRemoveInterfaceMapping(i32Interface); +} + +void CCanEasy_Xoraya_PluginDlg::OnBnClickedGetinterfaces() +{ + vConnect(); + m_pcAdaptor->vEnumerateInterfaces(); +} + +void CCanEasy_Xoraya_PluginDlg::OnBnClickedImportLog() +{ + CComboBox* pxLogsCombo = reinterpret_cast(GetDlgItem(IDC_LOGS_COMBO)); + int i32SelectedLogIdx = pxLogsCombo->GetCurSel(); + if(i32SelectedLogIdx == -1) + { + return; + } + CString sSelectedLogString; + pxLogsCombo->GetLBText(i32SelectedLogIdx,sSelectedLogString); + std::string s((LPCTSTR)sSelectedLogString); + vConnect(); + m_pcAdaptor->vImportLogFile(s.c_str()); +} + +void CCanEasy_Xoraya_PluginDlg::OnBnClickedStart() +{ + std::string sSelectedCanEasyBusname; + int32_t i32Interface = 0; + std::string sSharedObjectFilename(nSTR_INVALID_SOFILE); + i32Interface = i32GetSelectedMappedInterface(); + bool boAutoload = false; + CButton* pcAutoloadCheck = reinterpret_cast(GetDlgItem(IDC_CHECK_AUTOLOAD)); + int i32Autoload = pcAutoloadCheck->GetCheck(); + boAutoload = (i32Autoload==0)?false:true; + vGetSelectedMappedBus(sSelectedCanEasyBusname); + if(sSelectedCanEasyBusname.empty()) + { + this->Log("No bus selected"); + return; + } + vConnect(); + vStopInterface(i32Interface); + + CCodeGenerator xCodeGen(i32Interface,sSelectedCanEasyBusname,sSharedObjectFilename,boAutoload); + if( sSharedObjectFilename.compare(nSTR_INVALID_SOFILE) == 0 ) + { + this->Log("Error creating shared object"); + return; + } + m_pcAdaptor->vStartPlugin(i32Interface,sSharedObjectFilename.c_str()); +} + +void CCanEasy_Xoraya_PluginDlg::OnBnClickedStop() +{ + int32_t i32Interface = i32GetSelectedMappedInterface(); + + // Unregister callbacks + tInterfaceMap::left_map::iterator it = m_xInterfaceMap.left.find(i32Interface); + if( it != m_xInterfaceMap.left.end() ) + { + std::string sBusName = it->second; + CAND_tHandle hBus = CAND_hGetBusByName(sBusName.c_str()); + if( CAND_boIsValidHandle(hBus) ) + { + CAND_tHandle hEcu = CAND_hGetFirstEcu(hBus); + while( hEcu ) + { + CAND_tHandle hMsg = CAND_hGetFirstMsg(hEcu); + while( hMsg ) + { + CAND_enUnRegisterCallback( + ::OnMsgDataChanged,CAND_enMsgDataChanged,hMsg,0); + + hMsg = CAND_hGetNextMsg(hMsg); + } + hEcu = CAND_hGetNextEcu(hEcu); + } + } + + } + vStopInterface(i32Interface); +} + +void CCanEasy_Xoraya_PluginDlg::OnBnClickedShutdown() +{ + vConnect(); + m_pcAdaptor->vShutdown(); +} + +void CCanEasy_Xoraya_PluginDlg::OnBnClickedDisconnect() +{ + vDisconnect(); +} +void CCanEasy_Xoraya_PluginDlg::vSetConnectionState( bool boConnected ) +{ + CStatic* pxStatusField = reinterpret_cast(GetDlgItem(IDC_CONNECTION_STATUS)); + pxStatusField->SetWindowTextA( boConnected ? STR_CONNECTED : STR_DISCONNECTED ); +} +void CCanEasy_Xoraya_PluginDlg::vDisconnect() +{ + if( m_pcAdaptor ) + { + m_pcAdaptor->vDisconnect(); + m_pcAdaptor.reset(); + } + vSetInterfaces(""); + CComboBox* pxMappedBusCombo = reinterpret_cast(GetDlgItem(IDC_MAPPEDBUS_COMBO)); + pxMappedBusCombo->ResetContent(); + pxMappedBusCombo->SetCurSel(0); + CComboBox* pxLogsCombo = reinterpret_cast(GetDlgItem(IDC_LOGS_COMBO)); + pxLogsCombo->ResetContent(); + pxLogsCombo->SetCurSel(0); +} +int32_t CCanEasy_Xoraya_PluginDlg::i32GetSelectedMappedInterface() +{ + std::vector asTokens; + vGetSelectedMappedBusTokens(asTokens); + if( asTokens.size() != 3 ) + { + return -1; + } + return boost::lexical_cast(asTokens[2]); +} +void CCanEasy_Xoraya_PluginDlg::vGetSelectedMappedBus(std::string &sSelMappedBus) +{ + std::vector asTokens; + vGetSelectedMappedBusTokens(asTokens); + if( !asTokens.empty() ) + { + sSelMappedBus = asTokens[0]; + } +} +void CCanEasy_Xoraya_PluginDlg::vGetSelectedMappedBusTokens(std::vector &asTokens) +{ + CComboBox* pxMappedBusCombo = reinterpret_cast(GetDlgItem(IDC_MAPPEDBUS_COMBO)); + int i32MappedIdx = pxMappedBusCombo->GetCurSel(); + if(i32MappedIdx == -1) + { + return; + } + CString sMappedBusString; + pxMappedBusCombo->GetLBText(i32MappedIdx,sMappedBusString); + boost::char_separator sep(STR_MAP_SEP); + std::string s((LPCTSTR)sMappedBusString); + tokenizer tok(s, sep); + for (tokenizer::iterator it = tok.begin(); it != tok.end(); ++it) + { + asTokens.push_back(*it); + } +} + +void CCanEasy_Xoraya_PluginDlg::vStopInterface(int32_t i32Interface) +{ + vConnect(); + m_pcAdaptor->vStopPlugin(i32Interface); +} + +void CCanEasy_Xoraya_PluginDlg::vAddInterfaceMapping(int32_t i32Interface, std::string sBus) +{ + vRemoveInterfaceMapping(i32Interface); + tInterfaceMap::right_const_iterator it = m_xInterfaceMap.right.find(sBus); + if( it != m_xInterfaceMap.right.end() ) + { + vRemoveInterfaceMapping(it->second); + } + m_xInterfaceMap.insert(tInterfaceMap::value_type(i32Interface,sBus)); + vUpdateMappingCombo(); +} +void CCanEasy_Xoraya_PluginDlg::vRemoveInterfaceMapping(boost::int32_t i32Interface) +{ + if( m_xInterfaceMap.left.find(i32Interface) != m_xInterfaceMap.left.end() ) + { + vStopInterface(i32Interface); + m_xInterfaceMap.left.erase(i32Interface); + } + vUpdateMappingCombo(); +} +void CCanEasy_Xoraya_PluginDlg::vUpdateMappingCombo() +{ + tInterfaceMap::iterator it; + CComboBox* pxMappedBusCombo = reinterpret_cast(GetDlgItem(IDC_MAPPEDBUS_COMBO)); + pxMappedBusCombo->ResetContent(); + for( it = m_xInterfaceMap.begin(); it != m_xInterfaceMap.end(); it++) + { + std::stringstream sstr; + sstr << (it->right) << STR_MAP_SEP << "CAN " << (it->left); + pxMappedBusCombo->AddString( CString( sstr.str().c_str() ) ); + } + pxMappedBusCombo->SetCurSel(0); +} + +void CCanEasy_Xoraya_PluginDlg::vGetLog(const char* pcFilename) +{ + std::string sLogFilename(pcFilename); + Log("LogFilename received: %s",sLogFilename.c_str()); + CLogImport xLogImport(sLogFilename); + + CAND_tstParam stSrcFile; + CAND_tstParam stDestFile; + CAND_tstParam stVersion; + + stSrcFile.pstNext = &stDestFile; + stDestFile.pstNext = &stVersion; + stVersion.pstNext = NULL; + + stSrcFile.sVal = nASC_FILE; + stDestFile.sVal = NULL; + stVersion.sVal = "memman4.dll"; + + CAND_boDoActionId(NULL,"ConvertLog",&stSrcFile); + CAND_tHandle hEnvVarRoot = CAND_hGetRootEnvVar(); + if( CAND_enIsNullHandle(hEnvVarRoot) ) + { + return; + } + CAND_tHandle hDestFileNameVar = CAND_hGetEnvVarByName(hEnvVarRoot,"ConvertedRecord"); + if( CAND_enIsNullHandle(hDestFileNameVar) ) + { + return; + } + char acDestFileName[64]; + memset(acDestFileName,0,64); + if( CAND_enGetEnvVarValue(hDestFileNameVar, (void*) acDestFileName, 64) != CAND_nERR_OK ) + { + return; + } + Log(acDestFileName); + +} +void CCanEasy_Xoraya_PluginDlg::OnBnClickedEnumLogs() +{ + vConnect(); + m_pcAdaptor->vEnumerateLogs(); +} +void CCanEasy_Xoraya_PluginDlg::vSetLogfiles(const char *pcLogfiles) +{ + CComboBox* pxLogsCombo = reinterpret_cast(GetDlgItem(IDC_LOGS_COMBO)); + pxLogsCombo->ResetContent(); + char *pcTok; + char acBuf[508]; + strcpy(acBuf,pcLogfiles); + pcTok = strtok( acBuf, "\n" ); + while( pcTok != NULL) + { + pxLogsCombo->AddString( CString(pcTok) ); + pcTok = strtok(NULL,"\n"); + } + pxLogsCombo->SetCurSel(0); +} \ No newline at end of file diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDlg.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDlg.h new file mode 100644 index 0000000..4bf4dd4 --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDlg.h @@ -0,0 +1,133 @@ +#if !defined(AFX_CanEasy_Xoraya_PluginDLG_H__62389228_87FF_4955_888E_1C54AF2A80F8__INCLUDED_) +#define AFX_CanEasy_Xoraya_PluginDLG_H__62389228_87FF_4955_888E_1C54AF2A80F8__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 +// CanEasy_Xoraya_PluginDlg.h : Header-Datei +// + +#include "resource.h" // main symbols +#include "PanelDropTarget.h" +#include "Signal.h" +#include "FloatSliderCtrl.h" +#include "NumEdit.h" +#include +#include +#include +#include +#include "global.h" +#include +#include + +#define nREQ_BUFF_SIZE (16) + +typedef boost::bimap tInterfaceMap; + +class CXorayaAdaptor; + +///////////////////////////////////////////////////////////////////////////// +// Dialog CCanEasy_Xoraya_PluginDlg + +class CCanEasy_Xoraya_PluginDlg : public CDialog +{ +// Construction +public: + CCanEasy_Xoraya_PluginDlg(CWnd* pParent = NULL); // Standard constructor + + void OnDatabaseChanged(); + BYTE OnSignalValueChanged(CAND_tHandle hSig, DWORD dwUserData); + BYTE OnMsgDataChanged(CAND_tHandle hMsg, DWORD dwUserData); +// dialog data + //{{AFX_DATA(CCanEasy_Xoraya_PluginDlg) + enum { IDD = IDD_PLUGIN_MAIN_DIALOG }; + + //CNumEdit m_editCtrl; + //CFloatSliderCtrl m_sliderCtrl; + //CString m_sEdit; + //}}AFX_DATA + + +// overridings + //{{AFX_VIRTUAL(CCanEasy_Xoraya_PluginDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// implementation +protected: + // for Drag&Drop functionality + friend class CPanelDropTarget; + CPanelDropTarget m_dropTarget; + // Drag&Drop functions + DROPEFFECT OnDragOver(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point); + BOOL OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point); + + //CSignal m_signalEdit; // signal for the slider + + // generated message assignment functions + //{{AFX_MSG(CCanEasy_Xoraya_PluginDlg) + virtual BOOL OnInitDialog(); + afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); + afx_msg void OnKillfocusIpAddress(); + afx_msg LRESULT OnUpdateControls(WPARAM wParam, LPARAM lParam); + virtual void OnOK(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +private: + HICON m_hIcon; + CIPAddressCtrl m_cIpAddressCtrl; + CEdit* m_cLog; + + CString m_sXorayaIpAddress; + boost::shared_ptr m_pcAdaptor; + boost::mutex m_xLogMutex; + boost::mutex m_xMsgUpdMutex; + tInterfaceMap m_xInterfaceMap; + + void InitControls(void); + void EnableControls(void); + void vConnect(); +public: + void Log(const char*,...); + void vSetInterfaces( const char* pcInterface ); + void vSetConnectionState( bool boConnected ); + void vDisconnect(); + void vGetLog(const char* pcFilename); + void vSetLogfiles( const char* pcLogfiles ); + + int32_t i32GetSelectedMappedInterface(); + void vGetSelectedMappedBus(std::string& sSelMappedBus); + void vGetSelectedMappedBusTokens(std::vector< std::string >& asTokens); + void vStopInterface(int32_t i32Interface); + void vAddInterfaceMapping(int32_t i32Interface, std::string sBus); + void vRemoveInterfaceMapping(int32_t i32Interface); + void vUpdateMappingCombo(); + const char* sGetBusnameByInterface(int32_t i32Interface) const + { + if( m_xInterfaceMap.left.find(i32Interface) != m_xInterfaceMap.left.end() ) + { + return m_xInterfaceMap.left.at(i32Interface).c_str(); + } + else + { + return NULL; + } + } + + afx_msg void OnBnClickedConnect(); + afx_msg void OnBnClickedMap(); + afx_msg void OnBnClickedUnmap(); + afx_msg void OnBnClickedGetinterfaces(); + afx_msg void OnBnClickedStart(); + afx_msg void OnBnClickedStop(); + afx_msg void OnBnClickedDisconnect(); + afx_msg void OnBnClickedShutdown(); + afx_msg void OnBnClickedImportLog(); + afx_msg void OnBnClickedEnumLogs(); +}; + +//{{AFX_INSERT_LOCATION}} + +#endif // AFX_CanEasy_Xoraya_PluginDLG_H__62389228_87FF_4955_888E_1C54AF2A80F8__INCLUDED_ diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.aps b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.aps new file mode 100644 index 0000000..82bc087 Binary files /dev/null and b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.aps differ diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.cpp b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.cpp new file mode 100644 index 0000000..9b458db --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.cpp @@ -0,0 +1,489 @@ +// CanEasy_Xoraya_Plugin.cpp : Determines the initilization routines for the DLL. +// + + +#include "stdafx.h" +#include "CanEasy_Xoraya_PluginDll.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +// Export-Definitions +#define USERDLL_API __declspec(dllexport) +#define USERDLL_CALL __stdcall + + +// Add this macro in front of every function in Ansi-C notation +// (Sample: Callback-Functions of the CanDll, also exported functions of this DLL.) +#define ANSI_C extern "C" + +///////////////////////////////////////////////////////////////////////////// +// CCanEasy_Xoraya_PluginApp + +BEGIN_MESSAGE_MAP(CCanEasy_Xoraya_PluginApp, CWinApp) + //{{AFX_MSG_MAP(CCanEasy_Xoraya_PluginApp) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CCanEasy_Xoraya_PluginApp Konstruktion + +CCanEasy_Xoraya_PluginApp::CCanEasy_Xoraya_PluginApp() +{ +} + +///////////////////////////////////////////////////////////////////////////// +// the only CCanEasy_Xoraya_PluginApp-Object + +CCanEasy_Xoraya_PluginApp theApp; + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// // +// Prototypes Own local functions // +// // +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +ANSI_C void USERDLL_CALL OnDatabaseChanged(CAND_tenDBChangedReason enReason, CAND_tHandle hObject); + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// // +// Exported Standard-Functions // +// // +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/******************************************************************************************** + * + * Function : DLL_dwGetAPIVersion + * + * Description : This function is called after loading the DLL file and before the + * DLL_boInit executed and is used to verify the API functions. + * In case of incompatibility the DLL gets unloaded. + * + * This function belongs to the standard functions pool and it + * MUST NOT HAVE TO BE deleted. Otherwise the DLL can not be + * loaded inside CanEasy! + * + * Parameter : void + * + * Return : CANDLL_API_VERSION + * + ********************************************************************************************/ +ANSI_C USERDLL_API DWORD USERDLL_CALL DLL_dwGetAPIVersion() +{ + return CANDLL_API_VERSION; +} + +/******************************************************************************************** +* +* Function : DLL_boInit +* +* Description : This function will be called once, when DLL is loaded, +* and is only called one single time, when the program has started. +* +* This function belongs to the standard functions pool and it +* MUST NOT HAVE TO BE deleted. Otherwise the DLL can not be +* loaded inside CanEasy! +* +* Parameter : HWND handle to the CanEasy application window +* +* Return : Returns TRUE on success, otherwise FALSE. +* +********************************************************************************************/ +ANSI_C USERDLL_API BOOL USERDLL_CALL DLL_boInit(HWND hMainWnd) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + + static CWnd wnd; + if(!wnd.GetSafeHwnd()) + { + wnd.Attach(hMainWnd); + AfxGetApp()->m_pMainWnd = &wnd; + } + + // Show the dialog only now, so that it receives the correct MainWnd. + theApp.ShowMainPanelDlg(TRUE); + theApp.Init(); + + // Register OnDatabaseChanged. + if(CAND_enRegisterCallback(OnDatabaseChanged, CAND_enDBChanged, CAND_hNullHandle(), 0) == CAND_nERR_OK) + { + // Insert code that has to be processed in case of successful registration. + OnDatabaseChanged(CAND_nDB_CHANGED, CAND_hNullHandle()); + } + return TRUE; +} + +/******************************************************************************************** +* +* Function : DLL_vDeInit +* +* Description : This function will be called once the DLL is unloaded, +* and is used for the final deinitialization. (Deallocation of dynamically +* reserved memory, etc.) +* +* This function belongs to the standard functions pool and it +* MUST NOT HAVE TO BE deleted. Otherwise the DLL can not be +* loaded inside CanEasy or WinKI! +* +* Parameter : void +* +* Return : void +* +********************************************************************************************/ +ANSI_C USERDLL_API void USERDLL_CALL DLL_vDeInit() +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + AfxGetMainWnd()->Detach(); + + // Unregister OnDatabaseChanged. + if(CAND_enUnRegisterCallback(OnDatabaseChanged, CAND_enDBChanged, CAND_hNullHandle(), 0) == CAND_nERR_OK) + { + // Insert code that has to be processed in case of successful deregistration. + } + theApp.DeInit(); +} + +/******************************************************************************************** +* +* Function : DLL_vStart +* +* Description : This function will be called on the startup of +* simulation. +* +* This function belongs to the standard functions pool and it +* MUST NOT HAVE TO BE deleted. Otherwise the DLL can not be +* loaded inside CanEasy! +* +* Parameter : void +* +* Return : void +* +********************************************************************************************/ +ANSI_C USERDLL_API void USERDLL_CALL DLL_vStart() +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); +} + + +/******************************************************************************************** +* +* Function : DLL_vStop +* +* Description : This function will be called on the halt of the simulation run. +* +* This function belongs to the standard functions pool and it +* MUST NOT HAVE TO BE deleted. Otherwise the DLL can not be +* loaded inside CanEasy! +* +* Parameter : void +* +* Return : void +* +********************************************************************************************/ +ANSI_C USERDLL_API void USERDLL_CALL DLL_vStop() +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); +} + +/******************************************************************************************** +* +* Function : DLL_iPreTranslateMessage +* +* Description : This function will be called when a window message has to be processed. +* (relevant for applications that create own windwos) +* +* Parameter : MSG* lpMsg: Points to a message structure of the Windows-Message. +* +* Return : TRUE, if the message has been exploited by the plugin and no further +* actions shall take place. Otherwise FALSE. +* +********************************************************************************************/ +ANSI_C int USERDLL_CALL DLL_iPreTranslateMessage(MSG* lpMsg) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + TRY + { + return AfxGetThread()->PreTranslateMessage(lpMsg); + } + END_TRY + + return FALSE; +} + + +/******************************************************************************************** +* +* Function : DLL_vOnIdle +* +* Description : This function will be called when no window messages have to be +* processed (the Thread is idling). +* +* Parameter : void +* +* Return : void +* +********************************************************************************************/ +ANSI_C void USERDLL_CALL DLL_vOnIdle(void) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + TRY + { + // flush it all at once + long lCount = 0; + while (AfxGetThread()->OnIdle(lCount)) + lCount++; + } + END_TRY +} + +/******************************************************************************************** +* +* Function : DLL_iOnEvent +* +* Description : This function will be called when a tree event (e.g. left click) on the plugin +* tree entry occurs. +* +* Parameter : void +* +* Return : void +* +********************************************************************************************/ +ANSI_C int USERDLL_CALL DLL_iOnEvent( UINT uiEvent, DWORD dwUserData1, DWORD dwUserData2 ) +{ + CPoint point; + CMenu menu; + CMenu* pPopup; + int iRet = FALSE; + AFX_MANAGE_STATE( AfxGetStaticModuleState() ); + + switch(uiEvent) + { + case CAND_nSelected: + iRet = TRUE; + break; + case CAND_nDblClick: + theApp.ShowMainPanelDlg(TRUE); + iRet = TRUE; + break; + case CAND_nRBClick: + /* context menu */ + GetCursorPos(&point); + if(!menu.LoadMenu(ID_POPUP_TREE_MENU)) + return -1; + pPopup = menu.GetSubMenu(0); + + if(CAND_boIsRunning()) + menu.EnableMenuItem(ID_POPUP_REMOVE, MF_GRAYED | MF_BYCOMMAND); + + iRet = pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON | + TPM_RETURNCMD | TPM_NONOTIFY, point.x, point.y, AfxGetMainWnd()); + + switch(iRet) + { + case ID_POPUP_SHOW: + theApp.ShowMainPanelDlg(TRUE); + iRet = TRUE; + break; + case ID_POPUP_REMOVE: + iRet = CAND_nDoDelete; + break; + default: + iRet = TRUE; + break; + } + + if(iRet == ID_POPUP_SHOW) + theApp.ShowMainPanelDlg(TRUE); + + break; + + default: + /* Nothing to do. iRetVal is FALSE */ + break; + } + + return iRet; +} + +/******************************************************************************************** + * + * Function : DLL_iOnLoad + * + * Description : This function will be called on loading of the workspace. + * + * Parameter : hFileModule: Handle to the module registered at the FileManager. + * Relevant for loading the settings. + * dwModulVersion: Plugin version. It can be set in DLL_iSaveStates. + * + * Return : int: CAND_nFileNoError on success + * + ********************************************************************************************/ +ANSI_C int USERDLL_CALL DLL_iOnLoad(DWORD hFileModule, DWORD dwModulVersion) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + + WINDOWPLACEMENT info; + + // Load stored window placement + if( CAND_enReadData(hFileModule, &info, sizeof(WINDOWPLACEMENT)) != CAND_nERR_OK) + return CAND_nFileErrorContinue; + + if( theApp.m_pMainDlg->SetWindowPlacement(&info) == 0) + return CAND_nFileErrorContinue; + + return CAND_nFileNoError; +} + +/******************************************************************************************** + * + * Function : DLL_iOnSave + * + * Description : This function will be called on saving of the workspace. + * + * Parameter : hFileModule: Handle to the module registered at the FileManager. + * Relevant for saving of settings. + * pdwModulVersion: Pointer to a structure for storage the plugin version. + * + * Return : int: CAND_nFileNoError on success + * + ********************************************************************************************/ +ANSI_C int USERDLL_CALL DLL_iOnSave(DWORD hFileModule, DWORD* pdwModulVersion) +{ + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + + WINDOWPLACEMENT info; + + if(theApp.m_pMainDlg->GetWindowPlacement(&info) == 0) + return CAND_nFileErrorContinue; + + // Store current window placement + if(CAND_enWriteData(hFileModule, &info, sizeof(WINDOWPLACEMENT)) != CAND_nERR_OK ) + return CAND_nFileErrorContinue; + + return CAND_nFileNoError; +} + +BOOL CCanEasy_Xoraya_PluginApp::InitInstance() +{ + return CWinApp::InitInstance(); +} + +int CCanEasy_Xoraya_PluginApp::ExitInstance() +{ + return CWinApp::ExitInstance(); +} + +void CCanEasy_Xoraya_PluginApp::Init() +{ + try + { + ASSERT(m_pMainDlg == NULL); + m_pMainDlg = new CCanEasy_Xoraya_PluginDlg(); + m_pMainDlg->Create(IDD_PLUGIN_MAIN_DIALOG, NULL); + m_pMainDlg->ShowWindow(SW_SHOWNORMAL); + + CString sDllName; + if(!GetDllName(sDllName)) + ASSERT(0); + + // set the dialogs capture + m_pMainDlg->SetWindowText(sDllName); + } + catch(...) + { + ASSERT(0); + } +} + +void CCanEasy_Xoraya_PluginApp::DeInit() +{ + if(m_pMainDlg) + { + m_pMainDlg->DestroyWindow(); + delete m_pMainDlg; + m_pMainDlg = NULL; + } +} + +void CCanEasy_Xoraya_PluginApp::ShowMainPanelDlg(BOOL boShow) +{ + if(m_pMainDlg && m_pMainDlg->m_hWnd) + { + if(boShow) + { + m_pMainDlg->ShowWindow(SW_SHOWNORMAL); + m_pMainDlg->SetForegroundWindow(); + } + else + m_pMainDlg->ShowWindow(SW_HIDE); + } +} + +/***************************************************************************** +* +* Function : GetDllName +* +* Description : Extract the filename from the path declaration. +* Sample: GetFilename("C:\\TEMP\\TEST.TXT", sFilename) +* returns in sFilename TEST.TXT. +* +* Parameter : sName: Recieves the Name of the DLL. +* +* Return : BOOL: TRUE on success +* +*****************************************************************************/ +BOOL CCanEasy_Xoraya_PluginApp::GetDllName(CString& sName) +{ + int iPos, iLength; + CString sModuleName; + + if(! GetModuleFileName(AfxGetInstanceHandle(), sModuleName.GetBuffer(MAX_PATH), MAX_PATH)) + return FALSE; + + sModuleName.ReleaseBuffer(); + + iLength = sModuleName.GetLength(); + iPos = sModuleName.ReverseFind('\\'); + if(iLength > 0) + { + if(iPos >= 0) + sName = sModuleName.Mid(iPos + 1, iLength - iPos); + else + sName = sModuleName; + + // cut the ending + iPos = sName.ReverseFind('.'); + if(iPos >= 0) + sName = sName.Left(iPos); + + return TRUE; + } + + return FALSE; +} + +/******************************************************************************************** +* +* Function : OnDatabaseChanged - Callback-Function +* +* Description : Will be called on changings of the database. +* Example: - Database has been newly generated. +* - Another database has been loaded. +* +* Parameter : enReason: The reason why the database has been changed. +* hObject: The object that has been changed. +* Return : void +* +********************************************************************************************/ +ANSI_C void USERDLL_CALL OnDatabaseChanged(CAND_tenDBChangedReason enReason, CAND_tHandle hObject) +{ + if(theApp.m_pMainDlg && theApp.m_pMainDlg->m_hWnd) + { + theApp.m_pMainDlg->OnDatabaseChanged(); + } +} + + + diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.def b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.def new file mode 100644 index 0000000..adde3e8 --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.def @@ -0,0 +1,13 @@ +; CanEasy_Xoraya_PluginDll.def : Declares the module parameters for the DLL. + +EXPORTS + DLL_dwGetAPIVersion + DLL_boInit + DLL_vDeInit + DLL_vStart + DLL_vStop + DLL_iPreTranslateMessage + DLL_vOnIdle + DLL_iOnEvent + DLL_iOnLoad + DLL_iOnSave diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.h new file mode 100644 index 0000000..b9ebf98 --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.h @@ -0,0 +1,53 @@ +// CanEasy_Xoraya_Plugin.h : Main header file for the DLL CanEasy_Xoraya_Plugin +// + +#if !defined(AFX_CanEasy_Xoraya_Plugin_H__7825E21A_0213_44FD_9B84_343D09F0721F__INCLUDED_) +#define AFX_CanEasy_Xoraya_Plugin_H__7825E21A_0213_44FD_9B84_343D09F0721F__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#ifndef __AFXWIN_H__ + #error include 'stdafx.h' before including this file for PCH +#endif + +#include "resource.h" // main symbols +#include "canduserapi.h" +#include "CanEasy_Xoraya_PluginDlg.h" + + +///////////////////////////////////////////////////////////////////////////// +// CCanEasy_Xoraya_PluginApp +// See CanEasy_Xoraya_Plugin.cpp for implementation of this class. +// + +class CCanEasy_Xoraya_PluginApp : public CWinApp +{ +public: + CCanEasy_Xoraya_PluginApp(); + void ShowMainPanelDlg(BOOL boShow); + BOOL GetDllName(CString& sName); + + CCanEasy_Xoraya_PluginDlg *m_pMainDlg; + +// overridings + //{{AFX_VIRTUAL(CCanEasy_Xoraya_PluginApp) + public: + virtual BOOL InitInstance(); + virtual int ExitInstance(); + + void Init(); + void DeInit(); + //}}AFX_VIRTUAL + + //{{AFX_MSG(CCanEasy_Xoraya_PluginApp) + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} + +#endif // !defined(AFX_CanEasy_Xoraya_Plugin_H__7825E21A_0213_44FD_9B84_343D09F0721F__INCLUDED_) diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.ico b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.ico new file mode 100644 index 0000000..b69ad08 Binary files /dev/null and b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.ico differ diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.rc b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.rc new file mode 100644 index 0000000..94c93c8 --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.rc @@ -0,0 +1,256 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Deutsch (Deutschland) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) +#ifdef _WIN32 +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "#define _AFX_NO_SPLITTER_RESOURCES\r\n" + "#define _AFX_NO_OLE_RESOURCES\r\n" + "#define _AFX_NO_TRACKER_RESOURCES\r\n" + "#define _AFX_NO_PROPERTY_RESOURCES\r\n" + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)\r\n" + "#ifdef _WIN32\r\n" + "LANGUAGE 7, 1\r\n" + "#pragma code_page(1252)\r\n" + "#endif //_WIN32\r\n" + "#include ""res\\CanEasy_Xoraya_PluginDll.rc2"" // Nicht mit Microsoft Visual C++ bearbeitete Ressourcen\r\n" + "#include ""l.deu\\afxres.rc"" // Standardkomponenten\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 3,4,30,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040704B0" + BEGIN + VALUE "FileDescription", "CanEasy_Xoraya_Plugin DLL" + VALUE "FileVersion", "1, 0, 0, 1" + VALUE "InternalName", "CanEasy_Xoraya_Plugin" + VALUE "LegalCopyright", "Copyright© 2007" + VALUE "OriginalFilename", "CanEasy_Xoraya_Plugin.DLL" + VALUE "ProductName", "CanEasy_Xoraya_Plugin Dynamic Link Library" + VALUE "ProductVersion", "3, 4, 30, 0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x407, 1200 + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_PLUGIN_MAIN_DIALOG DIALOGEX 0, 0, 478, 377 +STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "XORAYA Connect" +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + GROUPBOX "TCP/IP Connection",IDC_GRP_XORAYA_CONNECTION,7,7,262,77 + LTEXT "IP address",IDC_STATIC,17,23,34,8 + CONTROL "",IDC_XORAYA_IPADDRESS,"SysIPAddress32",WS_TABSTOP,112,19,139,12 + LTEXT "Connection Status",IDC_STATIC,17,43,59,8 + LTEXT "Disconnected",IDC_CONNECTION_STATUS,112,43,45,8 + PUSHBUTTON "Connect",IDC_BUTTON_CONNECT,112,61,58,14 + PUSHBUTTON "Disconnect",IDC_BUTTON_DISCONNECT,190,61,61,14 + GROUPBOX "Interface Mapping",IDC_STATIC,7,92,262,83 + LTEXT "Interface",IDC_STATIC,17,113,29,8 + LTEXT "Bus",IDC_STATIC,17,134,13,8 + COMBOBOX IDC_INTERFACE_COMBO,112,109,139,77,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_BUS_COMBO,112,129,139,67,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Map",IDC_MAP_BUTTON,190,153,61,14 + PUSHBUTTON "Unmap",IDC_UNMAP_BUTTON,112,343,58,14 + GROUPBOX "Import Log to CanEasy",IDC_STATIC,7,186,262,64 + PUSHBUTTON "Import Log",IDC_IMPORTLOG_BUTTON,190,228,61,14 + GROUPBOX "Control",IDC_STATIC,7,265,262,101 + LTEXT "Mapped CanEasy Bus",IDC_STATIC,17,284,71,8 + COMBOBOX IDC_MAPPEDBUS_COMBO,112,279,139,65,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Start",IDC_START_BUTTON,112,318,58,14 + PUSHBUTTON "Stop",IDC_STOP_BUTTON,190,318,61,14 + EDITTEXT IDC_LOG,276,11,194,355,ES_MULTILINE | ES_AUTOHSCROLL | WS_VSCROLL | WS_HSCROLL + PUSHBUTTON "Get Interfaces",IDC_GETINTERFACES_BUTTON,112,153,58,14 + PUSHBUTTON "Shutdown",IDC_BUTTON_SHUTDOWN,190,343,61,14 + CONTROL "Autoload",IDC_CHECK_AUTOLOAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,112,299,44,10 + PUSHBUTTON "Enumerate Logs",IDC_BUTTON_ENUMLOGS,112,228,58,14 + COMBOBOX IDC_LOGS_COMBO,112,205,139,70,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "Logfiles",IDC_STATIC,17,209,25,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_PLUGIN_MAIN_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 471 + VERTGUIDE, 17 + VERTGUIDE, 112 + VERTGUIDE, 170 + VERTGUIDE, 190 + VERTGUIDE, 251 + VERTGUIDE, 269 + TOPMARGIN, 7 + BOTTOMMARGIN, 366 + HORZGUIDE, 11 + HORZGUIDE, 31 + HORZGUIDE, 51 + HORZGUIDE, 61 + HORZGUIDE, 128 + HORZGUIDE, 149 + HORZGUIDE, 174 + HORZGUIDE, 217 + HORZGUIDE, 228 + HORZGUIDE, 250 + HORZGUIDE, 304 + HORZGUIDE, 311 + HORZGUIDE, 332 + HORZGUIDE, 366 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_ICON1 ICON "x2e.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +ID_POPUP_TREE_MENU MENU +BEGIN + POPUP "Menu", CHECKED + BEGIN + MENUITEM "&Anzeigen", ID_POPUP_SHOW + MENUITEM "&Entfernen", ID_POPUP_REMOVE + END +END + +#endif // Deutsch (Deutschland) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// Englisch (USA) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +ID_POPUP_TREE_MENU MENU +BEGIN + POPUP "Menu", CHECKED + BEGIN + MENUITEM "&Show", ID_POPUP_SHOW + MENUITEM "&Remove", ID_POPUP_REMOVE + END +END + +#endif // Englisch (USA) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#define _AFX_NO_SPLITTER_RESOURCES +#define _AFX_NO_OLE_RESOURCES +#define _AFX_NO_TRACKER_RESOURCES +#define _AFX_NO_PROPERTY_RESOURCES + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) +#ifdef _WIN32 +LANGUAGE 7, 1 +#pragma code_page(1252) +#endif //_WIN32 +#include "res\CanEasy_Xoraya_PluginDll.rc2" // Nicht mit Microsoft Visual C++ bearbeitete Ressourcen +#include "l.deu\afxres.rc" // Standardkomponenten +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CodeGenerator.cpp b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CodeGenerator.cpp new file mode 100644 index 0000000..9a2308e --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CodeGenerator.cpp @@ -0,0 +1,236 @@ +#include "StdAfx.h" +#include "CodeGenerator.h" +#include "canduserapi.h" +#include +#include +#include +#include +#include + +#define OBJECT_NAME_LEN 256 +#define FTP_CMD_FILE "c:\\temp\\ftpcmd.txt" + +CCodeGenerator::CCodeGenerator(uint32_t u32Interface, const std::string& sBusName, std::string& sFilename, bool boAutoload) +:m_u32XorayaInterface(u32Interface) +,m_u32NumOfCanTxMessages(0) +,m_boAutoload(boAutoload) +,m_sCanEasyBusname(sBusName) +{ + m_sClassName = "CXorayaPlugin_" + m_sCanEasyBusname; + m_sImplFilename = "C:/temp/"+m_sClassName+".cpp"; + m_sTargetFilename = "C:/temp/"+m_sClassName+".so"; + vWriteImpl(); + vWriteMakefile(); + if( nenOK != enMakeTarget() ) + { + return; + } + if( nenOK != enFtpSend() ) + { + return; + } + sFilename = "./"+m_sClassName+".so"; +} + +CCodeGenerator::~CCodeGenerator(void) +{ +} + +void CCodeGenerator::vWriteImpl() +{ + m_xStream.clear(); + vGenerateMessages(); + std::string sAutoload = m_boAutoload?"true":"false"; + m_xStream << "#include \"plugin_api.h\"\n" + << "#include \"global.h\"\n" + << "\n" + << "class " << m_sClassName << " : public IPlugin\n{\n" + << "private:\n" + << "\tint32_t m_i32InterfaceHandle;\n" + << "\tuint32_t m_u32PluginId;\n" + << "\ttstCanTxMessage m_axCanTxMessages[" << m_u32NumOfCanTxMessages << "];\n" + << "public:\n" + << m_sClassName << "()\n" + << ":m_i32InterfaceHandle(0)" + << ",m_u32PluginId(0)" + << ",m_axCanTxMessages({"; + m_xStream << m_xCanTxMessageStream.str(); + m_xStream << "})\n" + << "{\n" + /*<< "\tDEBUG_PRINT(\"constructor\");\n"*/; + m_xStream << "}\n" + << "virtual ~" << m_sClassName << "()\n{\n}\n" + << "virtual void vRun()\n{\n}\n" + << "virtual tpstCanTxMessage pxGetCanTxMessage( const uint32_t u32MsgIndex )\n" + << "{\n" + << "\treturn &m_axCanTxMessages[u32MsgIndex];\n" + << "}\n" + << "virtual uint32_t u32GetNumOfCanTxMessages( void )\n" + << "{\n" + << "\treturn " << m_u32NumOfCanTxMessages << ";\n" + << "}\n" + << "virtual int32_t i32GetCanInterfaceHandle( void )\n" + << "{\n" + << "\treturn m_i32InterfaceHandle;\n" + << "}\n" + << "virtual void vLogMessage(const tstLogMessage& stLogMessage)\n{\n}\n" + << "virtual void vInit(void* pvExecutor, void* pvIfMan, int32_t i32Interface, uint32_t u32PluginId) \n" + << "{\n" + << "\tm_i32InterfaceHandle=i32Interface;\n" + << "\tm_u32PluginId=u32PluginId;\n" + << "}\n" + << "virtual bool boAutoload( void)\n" + << "{\n" + << "\treturn " << sAutoload << ";\n" + << "}\n" + << "virtual bool boIsLogger( void)\n" + << "{\n" + << "\treturn false;\n" + << "}\n" + << "tenRetCodes enGetLog(const char* pcRequest, char* pcResponse) \n" + << "{\n" + << "\treturn nenERR_NOTIMPLEMENTED;\n" + << "}\n" + << "};\n" + << "static " << m_sClassName << " xPlugin; \n" + << "extern \"C\" IPlugin* pxCreatePlugin(" + << "void* pvExecutor, void* pvIfMan, int32_t i32Interface, uint32_t u32PluginId)\n" + << "{\n" + << "\txPlugin.vInit(pvExecutor,pvIfMan,i32Interface,u32PluginId);\n" + << "\treturn &xPlugin;\n" + << "}\n" + << "extern \"C\" void vDestroyPlugin(IPlugin* pxPlugin)\n" + << "{\n" + << "}\n"; + vWriteStringstreamToFile(m_sImplFilename.c_str()); +} + +void CCodeGenerator::vGenerateMessages() +{ + m_xCanTxMessageStream.clear(); + CAND_tHandle hBus,hEcu,hMsg; + CAND_tenSimState enSimState; + uint32_t u32MsgCounter = 0; + unsigned long ul32MsgId; + unsigned short u16MsgCycleTime; + uint8_t u8MsgDlc; + uint8_t au8MsgData[8]; + char acBusName[OBJECT_NAME_LEN]; + hBus = CAND_hGetFirstBus(); + while(hBus) + { + CAND_enGetName(hBus,acBusName,OBJECT_NAME_LEN); + if( strcmp(acBusName,m_sCanEasyBusname.c_str()) == 0 ) + { + hEcu = CAND_hGetFirstEcu(hBus); + while(hEcu) + { + CAND_enGetEcuState(hEcu,&enSimState); + if( enSimState == CAND_nSimulated ) + { + hMsg = CAND_hGetFirstMsg(hEcu); + while(hMsg) + { + CAND_enGetMsgCycleTime(hMsg,&u16MsgCycleTime); + if( u16MsgCycleTime > 0 ) + { + CAND_enGetMsgID(hMsg,&ul32MsgId); + CAND_enGetMsgDLC(hMsg,&u8MsgDlc); + CAND_enGetMsgData(hMsg,au8MsgData); + m_xCanTxMessageStream << "{ " << u16MsgCycleTime + << ", " << 0 + << ", " << ul32MsgId + << ", {"; + for(uint8_t u8Ctr=0; u8Ctr<8; u8Ctr++) + { + if( u8Ctr != 0) + { + m_xCanTxMessageStream << ", "; + } + m_xCanTxMessageStream << static_cast(au8MsgData[u8Ctr]); + } + m_xCanTxMessageStream << " }" + << ", " << static_cast(u8MsgDlc) + << "}, "; + m_u32NumOfCanTxMessages++; + CAND_enRegisterCallback( + OnMsgDataChanged,CAND_enMsgDataChanged,hMsg,0); + //CAND_tHandle hSig; + //hSig = CAND_hGetFirstSig(hMsg); + //while(hSig) + //{ + // CAND_enRegisterCallback(OnSignalValueChanged,CAND_enSigValueChanged, hSig, 0); + // hSig = CAND_hGetNextSig(hSig); + //} + } + hMsg = CAND_hGetNextMsg(hMsg); + } + } + hEcu = CAND_hGetNextEcu(hEcu); + } + break; + } + hBus = CAND_hGetNextBus(hBus); + } +} + +void CCodeGenerator::vWriteMakefile() +{ + std::string sObjFilename = m_sClassName + ".o"; + m_xStream.clear(); + m_xStream << "LIBS := \n" + << "G++ := c:/programme/x2e/x2e/toolchain/bin/powerpc-linux-gnu-g++.exe\n" + << "all:\n" + << "\t@echo 'Invoking cross compiler'\n" + << "\t$(G++)" + << " -Ic:/programme/x2e/x2e/toolchain/powerpc-linux-gnu/libc/usr/include" + << " -I\"c:\\Dokumente und Einstellungen\\Eisenhauer\\Eigene Dateien\\Masterarbeit\\src\\common\\inc\"" + << " -Os -g0 -Wall -c -fno-strict-aliasing -std=c++0x -msoft-float" + << " -mcpu=405 -fPIC -MMD -MP -o " << sObjFilename << " " + << m_sImplFilename << "\n" + << "\t@echo 'Invoking linker'\n" + << "\t$(G++) -L\"c:\\Programme\\x2e\\x2e\\toolchain\\powerpc-linux-gnu\\libc\\nof\\lib\"" + << " -msoft-float -shared -o \"" << m_sTargetFilename << "\" " << sObjFilename + << " $(LIBS)\n" ; + vWriteStringstreamToFile("c:/temp/Makefile"); +} + +tenRetCodes CCodeGenerator::enMakeTarget() { + tenRetCodes enRetCode = nenOK; + int i32Res = system("cmd.exe /C \"cd c:\\temp && c:\\Programme\\x2e\\x2e\\toolchain\\bin\\make.exe\""); + if( i32Res != 0 ) + { + enRetCode = nenERR_MAKE; + } + return enRetCode; +} + +void CCodeGenerator::vWriteStringstreamToFile(const char* pcFilename) +{ + std::ofstream ofStr; + ofStr.open(pcFilename); + ofStr << m_xStream.rdbuf(); + ofStr.close(); +} +void CCodeGenerator::vWriteFtpCommandFile() +{ + m_xStream.clear(); + m_xStream << "open 192.168.1.214\n" + << "user connect x2e\n" + << "\n" + << "binary\n" + << "put " << m_sTargetFilename << "\n" + << "bye\n"; + vWriteStringstreamToFile(FTP_CMD_FILE); +} +tenRetCodes CCodeGenerator::enFtpSend() +{ + tenRetCodes enRetCode = nenOK; + vWriteFtpCommandFile(); + int i32Res = system("cmd.exe /C \"ftp -n -s:c:\\temp\\ftpcmd.txt\""); + if( i32Res != 0 ) + { + enRetCode = nenERR_FTP; + } + return enRetCode; +} \ No newline at end of file diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CodeGenerator.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CodeGenerator.h new file mode 100644 index 0000000..ec2feab --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CodeGenerator.h @@ -0,0 +1,34 @@ +#pragma once + +#include +#include +#include + +#include +extern BYTE CALLBACK OnSignalValueChanged(CAND_tHandle hSig, DWORD dwUserData); +extern BYTE CALLBACK OnMsgDataChanged(CAND_tHandle hMsg, DWORD dwUserData); + +class CCodeGenerator +{ +public: + CCodeGenerator(uint32_t u32Interface, const std::string& sBusName, std::string& sFilename, bool boAutoload); + ~CCodeGenerator(void); +private: + uint32_t m_u32XorayaInterface; + uint32_t m_u32NumOfCanTxMessages; + bool m_boAutoload; + std::string m_sCanEasyBusname; + std::string m_sImplFilename; + std::string m_sTargetFilename; + std::string m_sClassName; + std::stringstream m_xStream; + std::stringstream m_xCanTxMessageStream; + void vWriteImpl(); + void vWriteMakefile(); + void vWriteStringstreamToFile(const char* pcFilename); + void vGenerateMessages(); + void vWriteFtpCommandFile(); + + tenRetCodes enFtpSend(); + tenRetCodes enMakeTarget(); +}; diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/FloatSliderCtrl.cpp b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/FloatSliderCtrl.cpp new file mode 100644 index 0000000..e51f2a7 --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/FloatSliderCtrl.cpp @@ -0,0 +1,94 @@ +// FloatSliderCtrl.cpp: Implementation file +// +// Author: Stefan Rinke, Schleissheimer GmbH +// + +#include "stdafx.h" + +#include "FloatSliderCtrl.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + + +BEGIN_MESSAGE_MAP(CFloatSliderCtrl, CSliderCtrl) + //{{AFX_MSG_MAP(CFloatSliderCtrl) + ON_WM_KEYDOWN() + ON_WM_KEYUP() + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + + + + +void CFloatSliderCtrl::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) +{ + if(nChar == VK_DOWN || + nChar == VK_LEFT || + nChar == VK_NEXT) + { + int iPos = GetPos(); + int iDelta = (nChar == VK_NEXT || GetKeyState(VK_SHIFT) < 0) ? GetPageSize() : GetLineSize(); + int iMin = GetRangeMin(); + + // avoid overflow + if(iPos - iMin < iDelta) + SetPos(iMin); + else + SetPos(iPos - iDelta); + + // notify parent of position changing + if(CWnd* pParent = GetParent()) + { + pParent->SendMessage(WM_HSCROLL, SB_RIGHT, (LPARAM)m_hWnd); + pParent->SendMessage(WM_HSCROLL, SB_ENDSCROLL, (LPARAM)m_hWnd); + } + } + else if(nChar == VK_UP || + nChar == VK_RIGHT || + nChar == VK_PRIOR) + { + int iPos = GetPos(); + int iDelta = (nChar == VK_PRIOR || GetKeyState(VK_SHIFT) < 0) ? GetPageSize() : GetLineSize(); + int iMax = GetRangeMax(); + + // avoid overflow + if(iMax - iPos < iDelta) + SetPos(iMax); + else + SetPos(iPos + iDelta); + + // notify parent of position changing + if(CWnd* pParent = GetParent()) + { + pParent->SendMessage(WM_HSCROLL, SB_LEFT, (LPARAM)m_hWnd); + pParent->SendMessage(WM_HSCROLL, SB_ENDSCROLL, (LPARAM)m_hWnd); + } + } + else + { + Default(); + } +} + + +void CFloatSliderCtrl::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) +{ + if(nChar == VK_DOWN || + nChar == VK_LEFT || + nChar == VK_NEXT) + { + } + else if(nChar == VK_UP || + nChar == VK_RIGHT || + nChar == VK_PRIOR) + { + } + else + { + Default(); + } +} diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/FloatSliderCtrl.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/FloatSliderCtrl.h new file mode 100644 index 0000000..c05fb65 --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/FloatSliderCtrl.h @@ -0,0 +1,81 @@ +#if !defined(AFX_FLOATSLIDERCTRL_H__F20BCF0E_FF88_466E_927F_BA63BDAD32CC__INCLUDED_) +#define AFX_FLOATSLIDERCTRL_H__F20BCF0E_FF88_466E_927F_BA63BDAD32CC__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 +// FloatSliderCtrl.h : Header-File +// +// Author: Stefan Rinke, Schleissheimer GmbH +// + +#include // Für floor + +///////////////////////////////////////////////////////////////////////////// +// utility class CFloatSliderCtrl + +// derived class for simple handling of the sliders scope +class CFloatSliderCtrl : public CSliderCtrl +{ +private: + double m_fMin; + double m_fMax; + + int m_iMin; + int m_iMax; + +public: + void SetRangeEx(double fMin, double fMax, double fResolution, BOOL bRedraw = FALSE) + { + m_fMin = fMin; + m_fMax = fMax; + m_iMin = 0; + m_iMax = int (fabs(fMax - fMin) / fResolution); + SetRange(m_iMin, m_iMax, bRedraw); + UpdatePageSize(); + }; + void SetRangeEx(double dMin, double dMax, int iMin, int iMax, BOOL bRedraw = FALSE) + { + m_fMin = dMin; + m_fMax = dMax; + m_iMin = iMin; + m_iMax = iMax; + SetRange(m_iMin, m_iMax, bRedraw); + UpdatePageSize(); + }; + void SetPosEx(double fPos) + { + int iPos = (int) (m_iMin + (fPos - m_fMin) * (m_iMax - m_iMin) / (m_fMax - m_fMin)); + SetPos(iPos); + }; + double GetPosEx() const + { + int iPos = GetPos(); + double fRetVal = m_fMin + (iPos - m_iMin) * (m_fMax - m_fMin) / (m_iMax - m_iMin); + return fRetVal; + }; + +private: + void UpdatePageSize() + { + // set step range (50 steps, but at least 10 units) + int iPage = (m_iMax - m_iMin) / 50; + if(iPage < 10) + iPage = 10; + if(iPage > m_iMax) + iPage = m_iMax; + SetPageSize(iPage); + }; + + //{{AFX_MSG(CFloatSliderCtrl) + afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ inserts, in front of the foregoing Line, more declarations directly. + +#endif // AFX_FLOATSLIDERCTRL_H__F20BCF0E_FF88_466E_927F_BA63BDAD32CC__INCLUDED_ diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/LogImport.cpp b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/LogImport.cpp new file mode 100644 index 0000000..77479dd --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/LogImport.cpp @@ -0,0 +1,107 @@ +#include "StdAfx.h" +#include "LogImport.h" +#include +#include +#include +#include +#include +#include +#include + +#define nFTP_CMD_FILE "c:\\temp\\fetchlog_ftpcmd.txt" +#define nFTP_CMD(x) "cmd.exe /C \"ftp -n -s:" ##x "\"" +#define nFTP_LOCAL_LOG_FILE "c:\\temp\\xoraya.log" + +CLogImport::CLogImport(std::string& sLogFilename) +:m_sLogFilename(sLogFilename) +{ + enFetchLogfile(); + enConvertLog(); +} + +CLogImport::~CLogImport(void) +{ +} + +tenRetCodes CLogImport::enFetchLogfile() +{ + tenRetCodes enRetCode = nenOK; + std::ofstream ofStr; + ofStr.open(nFTP_CMD_FILE); + ofStr << "open 192.168.1.214\n" + << "user connect x2e\n" + << "\n" + << "binary\n" + << "get " << m_sLogFilename << " " << nFTP_LOCAL_LOG_FILE << "\n" + << "bye\n"; + ofStr.close(); + int i32Res = system(nFTP_CMD(nFTP_CMD_FILE)); + if( i32Res != 0 ) + { + enRetCode = nenERR_FTP; + } + return enRetCode; +} + +tenRetCodes CLogImport::enConvertLog() +{ + std::ofstream os( nASC_FILE ); + std::ifstream is( nFTP_LOCAL_LOG_FILE, std::ios::in | std::ios::binary ); + uint32_t u32Cnt = 0; + unsigned __int64 u64StartTs, u64ActTs; + double dAbsTs = 0.0; + int32_t i32Time = 0; + time_t xEpochSeconds = 0; + is.read( reinterpret_cast(&i32Time), sizeof(int32_t)); + i32Time = _byteswap_ulong(i32Time); + xEpochSeconds = i32Time; + CTime xNow(xEpochSeconds); + CString sDate = xNow.Format("%a %b %d %H:%M:%S %Y"); + os << "date " << sDate.GetBuffer() << std::endl; + os << "base hex timestamps absolute" << std::endl; + os << "internal events logged" << std::endl; + os << "// version 7.1.0" << std::endl; + os << "Begin Triggerblock " << sDate.GetBuffer() << std::endl; + while( is.good() ) + { + std::stringstream ss; + tstLogMessage stLogMsg; + char* p = reinterpret_cast(&stLogMsg); + is.read(p,sizeof(tstLogMessage)); + stLogMsg.u32TsHigh = BYTE_SWAP32(uint32_t,stLogMsg.u32TsHigh); + stLogMsg.u32TsLow = BYTE_SWAP32(uint32_t,stLogMsg.u32TsLow); + if( u32Cnt == 0) + { + u64StartTs = ((unsigned __int64) stLogMsg.u32TsHigh) << 32 | stLogMsg.u32TsLow; + u64ActTs = u64StartTs; + } + else + { + u64ActTs = ((unsigned __int64) stLogMsg.u32TsHigh) << 32 | stLogMsg.u32TsLow; + } + dAbsTs = ((double) (u64ActTs - u64StartTs)) * 0.0000001; + if( dAbsTs > (24 * 60 * 60 * 7) ) + { + continue; + } + stLogMsg.i32Interface = BYTE_SWAP32(int32_t,stLogMsg.i32Interface); + stLogMsg.u32MsgId = BYTE_SWAP32(uint32_t,stLogMsg.u32MsgId); + ss << std::right << std::setw(11) << std::fixed << dAbsTs << " " + << std::left << std::setw(2) + << stLogMsg.i32Interface << " " << std::setw(15) + << std::hex << stLogMsg.u32MsgId << " " + << ( (stLogMsg.u8Dir==0)?"Rx":"Tx" ) <<" d 8 "; + for( uint8_t u8Cnt = 0; u8Cnt < 8; u8Cnt++) + { + ss << " " << std::setfill('0') << std::setw(2) << std::right; + ss << static_cast(stLogMsg.au8Data[u8Cnt]); + } + ss << std::endl; + os << ss.rdbuf() << std::flush; + u32Cnt++; + } + os << "End Triggerblock" << std::endl; + is.close(); + os.close(); + return nenOK; +} \ No newline at end of file diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/LogImport.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/LogImport.h new file mode 100644 index 0000000..2c0e36e --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/LogImport.h @@ -0,0 +1,17 @@ +#pragma once + +#include +#include "global.h" + +#define nASC_FILE "c:\\temp\\xoraya.asc" + +class CLogImport +{ +public: + CLogImport(std::string&); + virtual ~CLogImport(void); +private: + std::string& m_sLogFilename; + tenRetCodes enFetchLogfile(); + tenRetCodes enConvertLog(); +}; diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/NumEdit.cpp b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/NumEdit.cpp new file mode 100644 index 0000000..770aa7d --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/NumEdit.cpp @@ -0,0 +1,32 @@ +// NumEdit.cpp: Implementation file +// +// Author: Stefan Rinke, Schleissheimer GmbH +// + +#include "stdafx.h" +#include "NumEdit.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CNumEdit + +BEGIN_MESSAGE_MAP(CNumEdit, CEdit) + //{{AFX_MSG_MAP(CNumEdit) + ON_WM_CHAR() + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// Processroutines for the Messages of CNumEdit + +void CNumEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) +{ + // let pass only numbers and control characters + if(isdigit(nChar) || iscntrl(nChar) || ispunct(nChar)) + CEdit::OnChar(nChar, nRepCnt, nFlags); +} diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/NumEdit.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/NumEdit.h new file mode 100644 index 0000000..7025de4 --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/NumEdit.h @@ -0,0 +1,48 @@ +#if !defined(AFX_NUMEDIT_H__B5C5A09A_3CE1_499E_9138_6C184712E2A2__INCLUDED_) +#define AFX_NUMEDIT_H__B5C5A09A_3CE1_499E_9138_6C184712E2A2__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 +// NumEdit.h : Header-File +// +// Author: Stefan Rinke, Schleissheimer GmbH +// + +///////////////////////////////////////////////////////////////////////////// +// Fenster CNumEdit + +class CNumEdit : public CEdit +{ +// Konstruktion +public: + +// Attribute +public: + +// Operationen +public: + +// Überschreibungen + // Overloadings of virtual Functions, which are generetad by the classassistant + //{{AFX_VIRTUAL(CNumEdit) + //}}AFX_VIRTUAL + +// Implementierung +public: + + // Generated Messageassignfunctions +protected: + //{{AFX_MSG(CNumEdit) + afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ inserts, in front of the foregoing Line, more declarations directly. + +#endif // AFX_NUMEDIT_H__B5C5A09A_3CE1_499E_9138_6C184712E2A2__INCLUDED_ diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/PanelDropTarget.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/PanelDropTarget.h new file mode 100644 index 0000000..1c78ad8 --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/PanelDropTarget.h @@ -0,0 +1,125 @@ +// PanelDropTarget.h +// +// Author: Stefan Rinke, Schleissheimer GmbH +// +// Generic implementation for a COleDropTarget +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_PANELDROPTARGET_H__CAD0927D_1E0D_49B2_BF15_4C2098E4155E__INCLUDED_) +#define AFX_PANELDROPTARGET_H__CAD0927D_1E0D_49B2_BF15_4C2098E4155E__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + + +template +class CPanelDropTarget : public COleDropTarget +{ +public: + /***************************************************************************** + * + * CPanelDropTarget::OnDragEnter + * + * Description : Called when the user drags the object into the panel. + * + * Parameter : pWnd: Points to the window the cursor is entering + * pDataObject: Points to the data object containing the data + * that can be dropped. + * dwKeyState: Contains the state of the modifier keys. + * point: Contains the current location of the cursor in + * client coordinates. + * + * Return : DROPEFFECT + * + *****************************************************************************/ + DROPEFFECT OnDragEnter(CWnd* pWnd, COleDataObject* pDataObject, + DWORD dwKeyState, CPoint point) + { + DROPEFFECT dropeffectRet = DROPEFFECT_COPY; + + if((dwKeyState & MK_CONTROL) != MK_CONTROL) + dropeffectRet = DROPEFFECT_COPY; + + // Don't change anything while the simulation is running + if(CAND_boIsRunning()) + return DROPEFFECT_NONE; + + return dropeffectRet; + } + + /***************************************************************************** + * + * CPanelDropTarget::OnDragOver + * + * Description : Called when the user drags the object over tree control + * + * Parameter : pWnd: Points to the window the cursor is entering + * pDataObject: Points to the data object containing the data + * that can be dropped. + * dwKeyState: Contains the state of the modifier keys. + * point: Contains the current location of the cursor in + * client coordinates. + * + * Return : DROPEFFECT + * + *****************************************************************************/ + DROPEFFECT OnDragOver(CWnd* pWnd, COleDataObject* pDataObject, + DWORD dwKeyState, CPoint point) + { + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + + T* pDlg = static_cast(pWnd); + + if(pWnd != NULL) + return pDlg->OnDragOver(pDataObject, dwKeyState, point); + + return DROPEFFECT_NONE; + } + /***************************************************************************** + * + * CPanelDropTarget::OnDragLeave + * + * Description : Called when the user drags the object out of a panel + * + * Parameter : CWnd* pWnd - + * + * Return : void + * + *****************************************************************************/ + void OnDragLeave(CWnd* pWnd) + { + } + + /***************************************************************************** + * + * CPanelDropTarget::OnDrop + * + * Description : Called when the user drops the object to the Tree control + * + * Parameter : pWnd: Points to the window the cursor is entering + * pDataObject: Points to the data object containing the data + * that can be dropped. + * dropEffect: Contains the effect on the data after dropping (NONE, MOVE, COPY etc.). + * point: Contains the current location of the cursor in + * client coordinates. + * + * Return : BOOL : Nonzero if the drop is successful; otherwise 0. + * + *****************************************************************************/ + BOOL OnDrop(CWnd* pWnd, COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point) + { + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + + T* pDlg = static_cast(pWnd); + + if(pWnd != NULL) + return pDlg->OnDrop(pDataObject, dropEffect, point); + + return FALSE; + } +}; + + +#endif // !defined(AFX_PANELDROPTARGET_H__CAD0927D_1E0D_49B2_BF15_4C2098E4155E__INCLUDED_) diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/Signal.cpp b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/Signal.cpp new file mode 100644 index 0000000..3b57b3d --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/Signal.cpp @@ -0,0 +1,233 @@ +// Signal.cpp: Implementation of the class CSignal. +// +// Author: Stefan Rinke, Schleissheimer GmbH +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "Signal.h" + +#include + +#ifdef _DEBUG +#undef THIS_FILE +static char THIS_FILE[]=__FILE__; +#define new DEBUG_NEW +#endif + +#define MAX_SIGNAL_PATH_LENGTH 255 + +// rounds the given number to the next possible multiple of fraction up/down +double roundAdv(double a, double fraction) +{ + double a1 = floor(a / fraction) * fraction; + double a2 = (floor(a / fraction)+1) * fraction; + if ((a - a1) < (a2 - a)) + return a1; + else + return a2; +} + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CSignal::CSignal() +{ + m_hSignal = CAND_hNullHandle(); +} + + +////////////////////////////////////////////////////////////////////// +// Methods +////////////////////////////////////////////////////////////////////// + +BOOL CSignal::Attach(CAND_tHandle hSig) +{ + if(!CAND_enIsNullHandle(hSig)) + { + m_hSignal = hSig; + + char cpPath[MAX_SIGNAL_PATH_LENGTH]; + if(CAND_enHandleToText(hSig, cpPath, MAX_SIGNAL_PATH_LENGTH) == CAND_nERR_OK) + { + m_sSigPath = cpPath; + return TRUE; + } + } + + return FALSE; +} + +BOOL CSignal::IsAttached() +{ + return m_hSignal != CAND_hNullHandle(); +} + +// with the signal path it retrieves the Handle again +void CSignal::UpdateHandle() +{ + m_hSignal = CAND_hTextToHandle(m_sSigPath); +} + +// assignoperator for physical values +CSignal& CSignal::operator=(double dVal) +{ + if(!CAND_enIsNullHandle(m_hSignal)) + { + double dFactor; + if(CAND_enGetSigFactor(m_hSignal, &dFactor) == CAND_nERR_OK) + { + dVal = roundAdv(dVal, dFactor); + VERIFY(CAND_enSetSigDataPhys(m_hSignal, dVal) == CAND_nERR_OK); + } + } + + return *this; +} + +// assignoperator for hex values +CSignal& CSignal::operator=(DWORD dwVal) +{ + if(!CAND_enIsNullHandle(m_hSignal)) + { + VERIFY(CAND_enSetSigDataHex(m_hSignal, (QWORD)dwVal) == CAND_nERR_OK); + } + + return *this; +} + + +// assignoperator for hex values +CSignal& CSignal::operator=(QWORD qwVal) +{ + if(!CAND_enIsNullHandle(m_hSignal)) + { + VERIFY(CAND_enSetSigDataHex(m_hSignal, qwVal) == CAND_nERR_OK); + } + + return *this; +} + + +// assignoperator für hex values +CSignal& CSignal::operator=(int iVal) +{ + if(!CAND_enIsNullHandle(m_hSignal)) + { + VERIFY(CAND_enSetSigDataHex(m_hSignal, (QWORD)iVal) == CAND_nERR_OK); + } + + return *this; +} + +CSignal::operator double() const +{ + double dVal = 0.; + if(!CAND_enIsNullHandle(m_hSignal)) + { + CAND_enGetSigDataPhys(m_hSignal, &dVal); + } + + return dVal; +} + +CSignal::operator DWORD() const +{ + QWORD qwVal = 0; + if(!CAND_enIsNullHandle(m_hSignal)) + { + CAND_enGetSigData(m_hSignal, &qwVal, sizeof(qwVal)); + } + + return (DWORD)qwVal; +} + +CSignal::operator QWORD() const +{ + QWORD qwVal = 0; + if(!CAND_enIsNullHandle(m_hSignal)) + { + CAND_enGetSigData(m_hSignal, &qwVal, sizeof(qwVal)); + } + + return qwVal; +} + +CSignal::operator int() const +{ + QWORD qwVal = 0; + if(!CAND_enIsNullHandle(m_hSignal)) + { + CAND_enGetSigData(m_hSignal, &qwVal, sizeof(qwVal)); + } + + return (int)qwVal; +} + +CSignal::operator bool() const +{ + QWORD qwVal = 0; + if(!CAND_enIsNullHandle(m_hSignal)) + { + CAND_enGetSigData(m_hSignal, &qwVal, sizeof(qwVal)); + } + + return qwVal != 0; +} + +CSignal::operator CAND_tHandle() const +{ + return m_hSignal; +} + +bool CSignal::operator==(CAND_tHandle hObj) const +{ + return m_hSignal == hObj; +} + + +double CSignal::GetMaxVal() const +{ + double dMax = 0.; + if(!CAND_enIsNullHandle(m_hSignal)) + { + CAND_enGetSigMax(m_hSignal, &dMax); + } + + return dMax; +} + +double CSignal::GetMinVal() const +{ + double dMin = 0.; + if(!CAND_enIsNullHandle(m_hSignal)) + { + CAND_enGetSigMin(m_hSignal, &dMin); + } + + return dMin; +} + + +double CSignal::GetFactor() const +{ + double dFactor = 0.; + if(!CAND_enIsNullHandle(m_hSignal)) + { + CAND_enGetSigFactor(m_hSignal, &dFactor); + } + + return dFactor; +} + +double CSignal::GetOffset() const +{ + double dOffset = 0.; + if(!CAND_enIsNullHandle(m_hSignal)) + { + CAND_enGetSigOffset(m_hSignal, &dOffset); + } + + return dOffset; +} diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/Signal.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/Signal.h new file mode 100644 index 0000000..c729f81 --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/Signal.h @@ -0,0 +1,58 @@ +// Signal.h: Interface for the Class CSignal. +// +// Author: Stefan Rinke, Schleissheimer GmbH +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_SIGNAL_H__03D122FB_9154_4693_8E7F_0C36ECB8E816__INCLUDED_) +#define AFX_SIGNAL_H__03D122FB_9154_4693_8E7F_0C36ECB8E816__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "CandUserApi.h" + +///////////////////////////////////////////////////////////////////////////// +// Helper class for signals + +class CSignal +{ +public: + CSignal(); + +public: + BOOL Attach(CAND_tHandle hSig); // assign a Handle to the object + BOOL IsAttached(); // returns TRUE on assignment of a signal + void UpdateHandle(); // with the signal path it retrieves the Handle again + + CSignal& operator=(double dVal); + CSignal& operator=(DWORD dwVal); + CSignal& operator=(QWORD qwVal); + CSignal& operator=(int iVal); + + operator double() const; + + operator DWORD() const; + operator QWORD() const; + operator int() const; + operator bool() const; + + operator CAND_tHandle() const; + + bool operator==(CAND_tHandle hObj) const; + + double GetMaxVal() const; + double GetMinVal() const; + double GetFactor() const; + double GetOffset() const; + +private: + CAND_tHandle m_hSignal; + + // Attributes +public: + CString m_sSigPath; +}; + +#endif // !defined(AFX_SIGNAL_H__03D122FB_9154_4693_8E7F_0C36ECB8E816__INCLUDED_) diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/StdAfx.cpp b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/StdAfx.cpp new file mode 100644 index 0000000..f251b95 --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/StdAfx.cpp @@ -0,0 +1,4 @@ +#include "stdafx.h" + + + diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/StdAfx.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/StdAfx.h new file mode 100644 index 0000000..54c2d44 --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/StdAfx.h @@ -0,0 +1,41 @@ +#define _CRT_SECURE_NO_WARNINGS + +#if !defined(AFX_STDAFX_H__51E8D306_6C43_400B_9999_4B4FF5E89C0A__INCLUDED_) +#define AFX_STDAFX_H__51E8D306_6C43_400B_9999_4B4FF5E89C0A__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#ifndef WINVER +#define WINVER 0x0502 +#endif + +#define VC_EXTRALEAN + +#include +#include + +#ifndef _AFX_NO_OLE_SUPPORT +#include +#include +#include +#endif // _AFX_NO_OLE_SUPPORT + + +#ifndef _AFX_NO_DB_SUPPORT +#include +#endif // _AFX_NO_DB_SUPPORT + +#ifndef _AFX_NO_DAO_SUPPORT +#include +#endif // _AFX_NO_DAO_SUPPORT + +#include +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include +#endif // _AFX_NO_AFXCMN_SUPPORT + +//{{AFX_INSERT_LOCATION}} + +#endif // !defined(AFX_STDAFX_H__51E8D306_6C43_400B_9999_4B4FF5E89C0A__INCLUDED_) diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/XorayaAdaptor.cpp b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/XorayaAdaptor.cpp new file mode 100644 index 0000000..3e11d90 --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/XorayaAdaptor.cpp @@ -0,0 +1,382 @@ +#include "StdAfx.h" +#include "XorayaAdaptor.h" +#include "CanEasy_Xoraya_PluginDlg.h" +#include +#include +#include +#include +#include +#include "protocol.h" + +CXorayaAdaptor::CXorayaAdaptor(CCanEasy_Xoraya_PluginDlg* pDlg, const std::string& sIpAddress) +:m_pDlg(pDlg),m_work(m_io_service),m_sock(m_io_service) +,m_xInStream(m_xRxNetworkBuffer.elems,nNETWORK_BUFFSIZE) +,m_xOutStream(m_xTxNetworkBuffer.elems,nNETWORK_BUFFSIZE) +,m_xNetworkMessageBuffer(8) +,m_i32ReqUnread(0),m_i32TxMsgUnread(0),m_boTxMsgActive(false) +{ + if( sIpAddress.empty() ) + { + return; + } + try + { + boost::asio::ip::tcp::endpoint endpoint( + boost::asio::ip::address::from_string(sIpAddress), + nPORT + ); + m_sock.async_connect(endpoint, + boost::bind( + &CXorayaAdaptor::vConnectHandler, + this, + boost::asio::placeholders::error + ) + ); + m_pThread.reset(new boost::thread(boost::bind(&boost::asio::io_service::run, &m_io_service))); + } + catch (std::exception& e) + { + m_pDlg->Log("%s caught exception: %s",__FUNCTION__,e.what()); + } +} + +CXorayaAdaptor::~CXorayaAdaptor(void) +{ + vDisconnect(); + m_pDlg->Log(__FUNCTION__); +} + +void CXorayaAdaptor::vReadHandler(const boost::system::error_code &ec, std::size_t bytes_transferred) +{ + if (!ec) + { + uint32_t u32BytesConsumed = 0; + uint32_t u32Len = nNETWORK_DATALENGTH; + uint32_t u32Pos = 0; + CNetworkDatacontainer::tstRespEnumerateInterfaces& stRespEnumerateInterfacesData = + *(reinterpret_cast(m_xDataContainer.pvGetVarPtr(nenRespEnumerateInterfaces))); + CNetworkDatacontainer::tstRespEnumerateLogs& stRespEnumerateLogsData = + *(reinterpret_cast(m_xDataContainer.pvGetVarPtr(nenRespEnumerateLogs))); + CNetworkDatacontainer::tstRespImportLog& stRespImportLogData = + *(reinterpret_cast(m_xDataContainer.pvGetVarPtr(nenRespImportLog))); + CNetworkDatacontainer::tstRxNetworkMessageMsg& stRxMsg = + *(reinterpret_cast(m_xDataContainer.pvGetVarPtr(nenNumberOfNetworkMessageTypes))); + do + { + u32Pos = m_xInStream.u32GetByteCount(); + sxRxMsgHeader.vRead(m_xDataContainer,m_xInStream); + if( !m_xInStream.boIsOK() ) + { + tenStreamError enError; + m_xInStream.vGetError(enError); + ERROR_PRINT("instream error %d",enError); + break; + } + m_xInStream.vSetPosition(u32Pos); + switch( stRxMsg.stHeader.enMessageType ) + { + case nenRespStopPlugin: + sxRespStopPluginMessage.vRead(m_xDataContainer,m_xInStream); + m_pDlg->Log("nenRespStopPlugin"); + break; + case nenRespStartPlugin: + sxRespStartPluginMessage.vRead(m_xDataContainer,m_xInStream); + m_pDlg->Log("nenRespStartPlugin"); + break; + case nenRespInvalidArg: + sxRxMsgHeader.vRead(m_xDataContainer,m_xInStream); + m_pDlg->Log("nenRespInvalidArg"); + break; + case nenRespUnknownReq: + sxRespUnknownReqMessage.vRead(m_xDataContainer,m_xInStream); + m_pDlg->Log("nenRespUnknownReq"); + break; + case nenRespEnumerateInterfaces: + m_pDlg->Log("nenRespEnumerateInterfaces"); + sxRespEnumerateInterfacesMessage.vRead(m_xDataContainer,m_xInStream); + m_pDlg->vSetInterfaces(stRespEnumerateInterfacesData.acInterfaces); + break; + case nenRespImportLog: + m_pDlg->Log("Receiving Xoraya log"); + sxRespImportLogMessage.vRead(m_xDataContainer,m_xInStream); + m_pDlg->vGetLog(stRespImportLogData.acFilename); + break; + case nenRespChangeMsgData: + sxRespChangeMsgDataMessage.vRead(m_xDataContainer,m_xInStream); + m_pDlg->Log("nenRespChangeMsgData"); + break; + case nenRespShutdown: + sxRespShutdownMessage.vRead(m_xDataContainer,m_xInStream); + m_pDlg->Log("nenRespShutdown"); + m_pDlg->vDisconnect(); + break; + case nenRespEnumerateLogs: + m_pDlg->Log("nenRespEnumerateLogs"); + sxRespEnumarateLogsMessage.vRead(m_xDataContainer,m_xInStream); + m_pDlg->vSetLogfiles(stRespEnumerateLogsData.acFilenames); + break; + case nenReqUploadLogMsg: + sxReqUploadLogMsgMessage.vRead(m_xDataContainer,m_xInStream); + vHandleLogMessageUpload(); + break; + default: + m_pDlg->Log("Received unknown message type %d",stRxMsg.stHeader.enMessageType); + break; + } + u32BytesConsumed = m_xInStream.u32GetByteCount(); + } + while(u32BytesConsumed < bytes_transferred); + vWaitForData(); + } + else if( ec == boost::asio::error::eof) + { + m_pDlg->Log("%s eof %s",__FUNCTION__,ec.message().c_str()); + vDisconnect(); + } + else + { + m_pDlg->Log("%s failed %s",__FUNCTION__,ec.message().c_str()); + vDisconnect(); + } +} + +void CXorayaAdaptor::vWriteHandler(const boost::system::error_code &ec, std::size_t bytes_transferred) +{ + if (!ec) + { + memset(m_xTxNetworkBuffer.elems,0,nNETWORK_BUFFSIZE); + m_xOutStream.vSetPosition(0); + vSendNextMessage(); + } + else + { + m_pDlg->Log("%s failed %s",__FUNCTION__,ec.message().c_str()); + vDisconnect(); + } +} + +void CXorayaAdaptor::vConnectHandler(const boost::system::error_code &ec) +{ + if (!ec) + { + m_pDlg->Log("%s connected",__FUNCTION__); + vWaitForData(); + m_pDlg->vSetConnectionState(true); + } + else + { + m_pDlg->Log("%s received error: %s",__FUNCTION__, ec.message().c_str()); + m_pDlg->vSetConnectionState(false); + } +} + +void CXorayaAdaptor::vWaitForData() +{ + memset(m_xRxNetworkBuffer.elems,0,nNETWORK_BUFFSIZE); + m_xInStream.vSetPosition(0); + boost::asio::async_read(m_sock + ,boost::asio::buffer(m_xRxNetworkBuffer) + ,boost::asio::transfer_at_least( sizeof(tstNetworkMessageHeader) ) + ,boost::bind( + &CXorayaAdaptor::vReadHandler, + shared_from_this(), + boost::asio::placeholders::error, + boost::asio::placeholders::bytes_transferred + ) + ); +} + +void CXorayaAdaptor::vDisconnect() +{ + try + { + m_sock.shutdown(boost::asio::ip::tcp::socket::shutdown_both); + m_sock.close(); + m_io_service.stop(); + m_pThread->interrupt(); + //m_pThread->join(); + m_pDlg->Log("%s disconnected",__FUNCTION__); + m_pDlg->vSetConnectionState(false); + } + catch (std::exception& e) + { + m_pDlg->Log("%s caught exception: %s",__FUNCTION__,e.what()); + } +} + +void CXorayaAdaptor::vHandleLogMessageUpload() +{ + CNetworkDatacontainer::tstReqUploadLogMsg& stReqUploadLogMsgData = + *(reinterpret_cast(m_xDataContainer.pvGetVarPtr(nenReqUploadLogMsg))); + + vSendMessage(nenRespUploadLogMsg); + + //CAND_tHandle hMsg = CAND_hNullHandle(); + //const char* pcBusnameForInterface = m_pDlg->sGetBusnameByInterface(stReqUploadLogMsgData.stLogMessage.i32Interface); + //if( pcBusnameForInterface != NULL ) + //{ + // hMsg = CAND_hFindObject(pcBusnameForInterface,NULL,NULL,stReqUploadLogMsgData.stLogMessage.u32MsgId,NULL,CAND_hNullHandle()); + // if( CAND_nFALSE == CAND_enIsNullHandle(hMsg) ) + // { + // BYTE arData[8]; + // CAND_enGetMsgData(hMsg,arData); + // arData[0] = ~arData[0]; + // CAND_enSetMsgData(hMsg,arData); + // m_pDlg->Log("updating msg data %#x to %#x",stReqUploadLogMsgData.stLogMessage.u32MsgId,arData[0]); + // } + //} +} + +void CXorayaAdaptor::vStartPlugin(const int32_t i32Interface, const char* pcFilename) +{ + m_xReqStartPluginDataMutex.lock(); + CNetworkDatacontainer::tstReqStartPlugin& stReqStartPluginData = + *(reinterpret_cast(m_xDataContainer.pvGetVarPtr(nenReqStartPlugin))); + stReqStartPluginData.i32Interface = i32Interface; + memcpy(stReqStartPluginData.acFilename,pcFilename,nNETWORK_DATALENGTH-4); + m_xReqStartPluginDataMutex.unlock(); + vSendMessage(nenReqStartPlugin); +} + +void CXorayaAdaptor::vStopPlugin(const int32_t i32Interface) +{ + m_xReqStopPluginDataMutex.lock(); + CNetworkDatacontainer::tstReqStopPlugin& stReqStopPluginData = + *(reinterpret_cast(m_xDataContainer.pvGetVarPtr(nenReqStopPlugin))); + stReqStopPluginData.i32Interface = i32Interface; + m_xReqStopPluginDataMutex.unlock(); + vSendMessage(nenReqStopPlugin); +} + +void CXorayaAdaptor::vChangeMsgData( const int32_t i32Interface, const uint32_t u32CanMsgId, const uint8_t* pu8Data ) +{ + + m_xReqChangeMsgDataDataMutex.lock(); + CNetworkDatacontainer::tstReqChangeMsgData& stReqChangeMsgDataData = + *(reinterpret_cast(m_xDataContainer.pvGetVarPtr(nenReqChangeMsgData))); + stReqChangeMsgDataData.i32Interface = i32Interface; + stReqChangeMsgDataData.u32CanMsgId = u32CanMsgId; + memcpy(stReqChangeMsgDataData.au8Data,pu8Data,8); + m_xReqChangeMsgDataDataMutex.unlock(); + vSendMessage(nenReqChangeMsgData); +} + +void CXorayaAdaptor::vShutdown() +{ + vSendMessage(nenReqShutdown); +} + +void CXorayaAdaptor::vEnumerateLogs() +{ + vSendMessage(nenReqEnumerateLogs); +} + +void CXorayaAdaptor::vEnumerateInterfaces() +{ + vSendMessage(nenReqEnumerateInterfaces); +} + +void CXorayaAdaptor::vImportLogFile(const char* pcFilename) +{ + m_xReqImportLogDataMutex.lock(); + CNetworkDatacontainer::tstReqImportLog& stReqImportLogData = + *(reinterpret_cast(m_xDataContainer.pvGetVarPtr(nenReqImportLog))); + memcpy(stReqImportLogData.acFilename,pcFilename,nNETWORK_DATALENGTH); + m_xReqImportLogDataMutex.unlock(); + vSendMessage(nenReqImportLog); +} + +void CXorayaAdaptor::vSendMessage(const tenNetworkMessageType enMsgType) +{ + m_io_service.post(boost::bind(&CXorayaAdaptor::vDoSendMessage, shared_from_this(), enMsgType)); +} + +void CXorayaAdaptor::vSendNextMessage() +{ + bool boTxActive = false; + { + boost::mutex::scoped_lock lock(m_xTxMutex); + boTxActive = m_boTxMsgActive; + } + if( boTxActive ) + { + tenNetworkMessageType enMsgType = nenNumberOfNetworkMessageTypes; + { + boost::mutex::scoped_lock lock(m_xTxMutex); + enMsgType = m_xNetworkMessageBuffer[--m_i32TxMsgUnread]; + if( m_i32TxMsgUnread == 0 ) + { + m_boTxMsgActive = false; + } + } + switch( enMsgType ) + { + case nenReqStartPlugin: + m_xReqStartPluginDataMutex.lock(); + sxReqStartPluginMessage.vWrite(m_xDataContainer,m_xOutStream); + m_xReqStartPluginDataMutex.unlock(); + break; + case nenReqStopPlugin: + m_xReqImportLogDataMutex.lock(); + sxReqStopPluginMessage.vWrite(m_xDataContainer,m_xOutStream); + m_xReqImportLogDataMutex.unlock(); + break; + case nenReqShutdown: + sxReqShutdownMessage.vWrite(m_xDataContainer,m_xOutStream); + break; + case nenReqEnumerateInterfaces: + sxReqEnumerateInterfacesMessage.vWrite(m_xDataContainer,m_xOutStream); + break; + case nenReqImportLog: + m_xReqImportLogDataMutex.lock(); + sxReqImportLogMessage.vWrite(m_xDataContainer,m_xOutStream); + m_xReqImportLogDataMutex.unlock(); + break; + case nenReqEnumerateLogs: + sxReqEnumerateLogsMessage.vWrite(m_xDataContainer,m_xOutStream); + break; + case nenRespUploadLogMsg: + sxRespUploadLogMsgMessage.vWrite(m_xDataContainer,m_xOutStream); + break; + case nenReqChangeMsgData: + m_xReqChangeMsgDataDataMutex.lock(); + sxReqChangeMsgDataMessage.vWrite(m_xDataContainer,m_xOutStream); + m_xReqChangeMsgDataDataMutex.unlock(); + break; + default: + break; + } + if( m_xOutStream.boIsOK() ) + { + boost::asio::async_write(m_sock, + boost::asio::buffer(m_xTxNetworkBuffer,m_xOutStream.u32GetByteCount() ), + boost::bind( + &CXorayaAdaptor::vWriteHandler, + shared_from_this(), + boost::asio::placeholders::error, + boost::asio::placeholders::bytes_transferred + ) + ); + } + else + { + tenStreamError enError; + m_xOutStream.vGetError(enError); + ERROR_PRINT("outstream error %d",enError); + m_xOutStream.vReset(); + } + } +} + +void CXorayaAdaptor::vDoSendMessage(tenNetworkMessageType enMsgType) +{ + boost::mutex::scoped_lock lock(m_xTxMutex); + m_xNetworkMessageBuffer.push_front(enMsgType); + ++m_i32TxMsgUnread; + if( !m_boTxMsgActive ) + { + m_boTxMsgActive = true; + lock.unlock(); + vSendNextMessage(); + } +} \ No newline at end of file diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/XorayaAdaptor.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/XorayaAdaptor.h new file mode 100644 index 0000000..0aa75bb --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/XorayaAdaptor.h @@ -0,0 +1,72 @@ +#pragma once + +#if !defined(XORAYA_ADAPTOR_H_) +#define XORAYA_ADAPTOR_H_ + +#include +#include +#include +#include +#include +#include +#include +#include "global.h" +#include "protocol.h" +#include "CNetworkStream.h" +#include "NetworkTypes.h" + +class CCanEasy_Xoraya_PluginDlg; + +typedef boost::circular_buffer tNetworkMessageBuffer; + +class CXorayaAdaptor : public boost::enable_shared_from_this +{ +public: + CXorayaAdaptor(CCanEasy_Xoraya_PluginDlg* pDlg, const std::string& sIpAddress); + virtual ~CXorayaAdaptor(void); +private: + // pointer to the controlling dialog + CCanEasy_Xoraya_PluginDlg* m_pDlg; + + boost::asio::io_service m_io_service; + boost::asio::io_service::work m_work; + boost::asio::ip::tcp::socket m_sock; + + tNetworkBuffer m_xRxNetworkBuffer; + tNetworkBuffer m_xTxNetworkBuffer; + CNetworkInStream m_xInStream; + CNetworkOutStream m_xOutStream; + CNetworkDatacontainer m_xDataContainer; + boost::mutex m_xReqStartPluginDataMutex; + boost::mutex m_xReqStopPluginDataMutex; + boost::mutex m_xReqImportLogDataMutex; + boost::mutex m_xReqChangeMsgDataDataMutex; + tNetworkMessageBuffer m_xNetworkMessageBuffer; + int32_t m_i32TxMsgUnread; + int32_t m_i32ReqUnread; + bool m_boTxMsgActive; + + boost::shared_ptr m_pThread; + boost::mutex m_xTxMutex; + void vWaitForData(); + void vHandleLogMessageUpload(); + + +public: + void vConnectHandler(const boost::system::error_code &ec); + void vReadHandler(const boost::system::error_code &ec, std::size_t bytes_transferred); + void vWriteHandler(const boost::system::error_code &ec, std::size_t bytes_transferred); + void vDisconnect(); + void vSendMessage(const tenNetworkMessageType enMsgType); + void vSendNextMessage(); + void vStartPlugin(const int32_t i32Interface, const char* pcFilename); + void vStopPlugin(const int32_t i32Interface); + void vShutdown(); + void vEnumerateLogs(); + void vEnumerateInterfaces(); + void vImportLogFile(const char* pcFilename); + void vChangeMsgData( const int32_t i32Interface, const uint32_t u32CanMsgId, const uint8_t* pu8Data ); + void vDoSendMessage(const tenNetworkMessageType enMsgType); +}; + +#endif // XORAYA_ADAPTOR_H_ \ No newline at end of file diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/include/canduserapi.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/include/canduserapi.h new file mode 100644 index 0000000..714207d --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/include/canduserapi.h @@ -0,0 +1,6487 @@ + +/*! + * \file + * CandUserAPI.H + * + * \brief + * This file describes all function interfaces, that can be used + * by plugins to communicate with CanEasy. + * + * \author + * Schleißheimer GmbH + * + */ + +/* Check if information are already included */ +#ifndef CAND_USER_API_H +#define CAND_USER_API_H + +#if defined(_MSC_VER) && _MSC_VER > 1000 +#pragma once +#endif /* _MSC_VER > 1000 */ + +/* Use standard windows header or declare needed types */ +#ifndef _WINDEF_ +typedef unsigned long DWORD; +typedef unsigned short WORD; +typedef unsigned char BYTE; +typedef void* HWND; +typedef int BOOL; +typedef void* HANDLE; +typedef unsigned int UINT; +typedef const char* LPCTSTR; +typedef void MSG; +#endif + +/* Unsigned 64 Bit integer */ +#ifndef QWORD_HAS_BEEN_DEFINED +#define QWORD_HAS_BEEN_DEFINED +typedef unsigned __int64 QWORD; /*!< For simple using of unsigned __int64 */ +#endif /* QWORD_HAS_BEEN_DEFINED */ + +#ifndef CANDLL_API +#ifdef CANDLL_EXPORTS +/* Export-Declarations */ +#define CANDLL_API __declspec(dllexport) +#else +/* Import-Declarations */ +#define CANDLL_API __declspec(dllimport) +#endif +#endif /* CANDLL_API */ + +/*! Calling-Convention */ +#ifndef CANDLL_CALL +#define CANDLL_CALL __stdcall +#endif /* CANDLL_CALL */ +/*! Calling-Convention */ +#ifndef CANDLL_CALLBACK +#define CANDLL_CALLBACK(function_name) (CANDLL_CALL *function_name) +#endif /* CANDLL_CALLBACK */ + +#ifdef __cplusplus +extern "C" +{ +#endif + +/* API version */ +/*! Major version - incremented on large changes that render every plugin incompatible */ +#define CANDLL_API_VERSION_MAJOR 3 +/*! Minor version - incremented on smaller changes. Most plugins will still work */ +#define CANDLL_API_VERSION_MINOR 10 +#define CANDLL_API_VERSION (CANDLL_API_VERSION_MAJOR << 8 | CANDLL_API_VERSION_MINOR) + +/*! Definition of output styles for reports */ +#define REPORT_IN_MSGBOX 0x01 +#define REPORT_IN_REPORT_WND 0x02 + +/*! + * \defgroup ecu_functions Control units + * Control units are electrical modules in an automobile which can read, process and render information. + * Control units are a part of the communication matrix. They + * define control tasks, eg. for motor, display elements, the light system or airbags. + * + * CanEasy control units can handle messages and attributes. You can create control + * units only as a subtree element of a bus. + * + * \ref p_working_with_ecus + * + */ + +/*! + * \defgroup callback_functions Callbacks + * Callback functions are a convenient way of getting informed about + * events that happen inside CanEasy eg. with data, messages or hardware. + * + * Use callbacks to get informed about changes in the database, events + * that occur on the bus or to synchronize your application with CanEasy. + * + * Use the function ::CAND_enRegisterCallback in combination with the values of ::CAND_tenCallbackType + * to register a callback of the specified type. You can stop getting the callback using the function + * ::CAND_enUnRegisterCallback. Make sure that you unregister all callbacks before closing CanEasy. + * + */ + +/*! + * \defgroup attribute_functions Attributes + * Attributes provide additional information to CanEasy database objects. + * Attributes can be specified on each hierarchical level of the datbase. They + * are not part of the communiation matrix. + * + * There are custom attributes that can be freely defined by the user and some standard attributes that + * change behaviour, look and feel of CanEasy. + * + */ + +/*! + * \defgroup bus_functions Bus + * Busses are objects in a CanEasy database. They provide the base for a simulation. + * The bus can be an interface to hardware and a real bus system. You can create control units + * beneath a bus. The bus functions allow you to create, delete or modify a bus before starting a simulation. + * + */ + +/*! + * \defgroup message_functions Messages + * A message is a collection of information, which is transported by a control + * unit on a bus. A message can be transmitted cyclically and inform about a + * certain status e.g. temperature or it can be transmitted event driven e.g. + * to inform about malfunction of a light. A message is clearly defined by its + * unique identifier. + * + * You can only create messages as a subtree element of a control unit in CanEasy. A special + * type of message is the multiplexed message. This type of message can be + * created as a subelement of an existing normal message. A multiplexed message needs an + * associated multiplex value, therefore at least one signal has to be defined + * as multiplex signal to distinguish between different multiplexed messages. + * Please refer to the CanEasy help documentation for more infomration about multiplexed + * messages. + * + * \ref p_working_with_messages + * + */ + +/*! + * \defgroup signal_functions Signals + * A signal is a defined information unit inside a message or a multiplex + * message. The signal is the smallest information unit on a bus system. + * + * You can create signals as a subtree element of a message or a multiplexed message. + * + * \ref p_working_with_signals + */ + +/*! + * \defgroup record_functions Records + * A record is an internal storage buffer in CanEasy. Every message and event on the bus is + * recorded and stored to the record. The record gives you the opportunity to analyse bus + * traffic. + * You can disable the recording to save system ressources. With a disabled record you can not + * anaylse or view the messages or bus events in an analysis tool like trace or plot. + * + */ + +/*! + * \defgroup ui_functions User Interface + * + * Functions in this section are needed for interaction with the user interface of + * CanEasy. They can be used to receive events that occur on the user interface. + * They can also be used to trigger the refreshing and updating of other CanEasy windows. + */ + +/*! + * \defgroup fileio_functions File I/O + * + * This set of functions allows you to read and write data to and from the CanEasy + * workspace. The functions are used to load and save project specific data that + * is needed inside your project or plug-in within the main workspace file. + * + */ + +/*! + * \defgroup action_functions Actions + * + * The action manager maintains actions that can be registered and used + * by plugins. Registering actions provides a way to extend the functionality of your own and other + * plugins. This mechanism is used to integrate your plugin into others + * and estabilish the interconnection. + * + * For example: + * You want your plugin to get notified everytime a certain + * key was pressed. In order to implement this your plugin would register an action and provide this + * action to other plugins. Then you could use the "Shortcut" plugin to build a queue of + * actions which will be executed when pressing a certain key. You plugin could be one of + * the action subscribers inside the queue. + * + * Each action can have an amount of parameters with different behaviour. For all actions an + * individual user interface is created that shows all created parameters for that action. + * So the user can manipulate the action parameters on runtime. A special parameter provides you the + * ability to select CanEasy database objects. + * + */ + +/*! + * \defgroup env_functions Environment Variables + * + * Environment variables are CanEasy wide storage units that can be accessed by any + * plugin or script. With environment variables you can transfer data within different + * modules. + * The variables can be grouped in namespaces. Each namespace can contain environment + * variables and again namespaces, which allows you to subgroup your variables. + * + * Environment variables are automatically imported while generating a database from a dbc file. + */ + +/*! + * \defgroup simulation_functions Simulation + * + * This set of functions allows you to control the initialization of CanEasy as well + * as the control of the simulation flow. The functions to retrieve the + * simulation time are also included here. + * + */ + +/*! + * \defgroup general_functions General + * + */ + +/*! + * \defgroup handle_functions Handles + * + * All CanEasy objects are referenced by their handles. The set of + * handle functions consists of general purpose functions for all kinds of CanEasy handles. + * Functions that are only usable with a certain type of handles are described + * in the corresponding sections of this help manual. + * + */ + +/*! + * \defgroup database_functions Database + * + * The CanEasy database is the heart of the simulation. There are busses, ecus, + * messages, signals and attributes stored inside. The database functions allow you + * to adjust properties of database elements. + * + */ + +/*! + * \ingroup env_functions + * + * \brief + * Enumaration of supported EnvVar types. + * + * \see + * CAND_enGetEnvVarType, CAND_tstEnvVarType + */ +typedef enum +{ + CAND_EnvVarInvalid, /*!< Invalid Value */ + CAND_EnvVarString, /*!< String Value */ + CAND_EnvVarBool, /*!< 8-Bit unsigned char */ + CAND_EnvVarInt, /*!< 32-Bit signed integer */ + CAND_EnvVarDouble, /*!< 64-Bit floating point */ + CAND_EnvVarByte, /*!< 8-Bit unsigned char */ + CAND_EnvVarWord, /*!< 16-Bit unsigned short */ + CAND_EnvVarDword, /*!< 32-Bit unsigned long*/ + CAND_EnvVarQword /*!< 64-Bit unsigned long long */ +} CAND_tenEnvVarType; + +/*! + * \ingroup env_functions + * + * \brief + * Structure used for messages and bus events. + * + * \see + * CAND_enGetEnvVarType + */ +typedef struct _CAND_tstEnvVarType +{ + CAND_tenEnvVarType enType; /*!< Type for the environment variable. */ + BOOL boIsArray; /*!< Specifies whether the variable is an array. */ +} CAND_tstEnvVarType; + +/*! + * \ingroup attribute_functions + * + * \brief + * Structure used to create enum attributes. + * + * \see + * CAND_hCreateAttribute + */ +typedef struct CAND_stEnum +{ + const char* sDesc; + int iVal; + struct CAND_stEnum* pstNext; +} CAND_tstEnum; + +/*! + * \ingroup ecu_functions + * + * \brief + * Enumeration for simulation status of control units. + * + * The ::CAND_tenSimState enum contains the possible status which a control unit can + * have. You can find this setting in the control unit editor. + * + * \see + * CAND_enGetEcuState | CAND_enSetEcuState + */ +typedef enum +{ + CAND_nReal, /*!< Specifies that the ECU is physically present at can bus. */ + CAND_nSimulated /*!< Specifies that the ECU is simulated. */ +} CAND_tenSimState; + +/*! + * \ingroup message_functions + * + * \brief + * Enumeration with modes of message generation. + * + * The ::CAND_tenGenMsgMode enum contains the possible modes of message generation + * for a control unit. You can find this setting in the control unit editor. + * + * \see + * CAND_enSetEcuMsgMode | CAND_enGetEcuMsgMode + */ +typedef enum +{ + CAND_nGenModeOff, /*!< Off, no generation of messages */ + CAND_nGenModeAdapt, /*!< Reduced, only RX messages of real existent control units will be displayed */ + CAND_nGenModeFull, /*!< Full, all messages of the control unit will be sent */ + CAND_nGenModeNone /*!< control unit is not simulated, thus no message geenration is possible */ +} CAND_tenGenMsgMode; + +/*! + * \ingroup ui_functions + * + * \brief + * Enumeration with events that can be triggered by the CanEasy tree. + * + * These are the values that can be received via the DLL_iOnEvent function + * of a plugin, in the "uiEvent" parameter. + * + * \see + * DLL_iOnEvent + */ + +// ACHTUNG: in userinterfaceapi gibt es das gleiche enum noch einmal. Die Werte müssen identisch sein. +typedef enum +{ + CAND_nSelected = 0, /*!< Item is selected */ + CAND_nUnSelected, /*!< Item is unselected */ + CAND_nDblClick, /*!< Double click */ + CAND_nRBClick, /*!< Right button click */ + CAND_nBeginDrag, /*!< Begin drag operation */ + CAND_nDragOver, /*!< Item drag over */ + CAND_nDrop, /*!< Item dropped */ + CAND_nKeyDown, /*!< Key pressed */ + CAND_nDoDelete, /*!< Item should be deleted */ + CAND_nDoCreate, /*!< Item should be created */ + CAND_nBeginLabelEdit, /*!< Item name will be edited */ + CAND_nEndLabelEdit, /*!< Item name has been edited */ + CAND_nEndDrag /*!< End drag operation */ +} CAND_tenTreeEvent; + +/*! + * \ingroup bus_functions + * + * \brief + * Enumeration with the send modes of a bus. + * + * Use this enumeration values to set the sending mode of a bus. + * + * \see + * CAND_enGetBusState | CAND_enSetBusState + */ +typedef enum +{ + CAND_nDisabled, /*!< Specifies that sending and receiving messages is disabled. */ + CAND_nEnableTx, /*!< Specifies that only sending messages is enabled. */ + CAND_nEnableRx, /*!< Specifies that only receiving messages is enabled. */ + CAND_nEnableBoth /*!< Specifies that sending and receiving messages is enabled. */ +} CAND_tenBusState; + +/*! + * \ingroup callback_functions + * + * \brief + * Enumeration which contains the reasons for why the database change callback has been triggerd. + * + * \see + * CAND_tDbChangedCb + */ +typedef enum +{ + CAND_nDB_CHANGED, /*!< The database structure has been changed */ + CAND_nDB_NEW, /*!< A new database has been generated or loaded */ + CAND_nDB_NEW_BUS, /*!< A new bus has been added to the database */ + CAND_nDB_NEW_ECU, /*!< A new ECU has been added to the database */ + CAND_nDB_NEW_MSG, /*!< A new message has been added to the database */ + CAND_nDB_NEW_SIG, /*!< A new signal has been added to the database */ + CAND_nDB_DEL, /*!< The database has been completely removed */ + CAND_nDB_DEL_BUS, /*!< A bus has been deleted from database */ + CAND_nDB_DEL_ECU, /*!< An ECU has been deleted from database */ + CAND_nDB_DEL_MSG, /*!< A message has been deleted from database */ + CAND_nDB_DEL_SIG, /*!< A signal has been deleted from database */ + CAND_nDB_ATTR_CHANGE /*!< An attribute has been changed */ +} CAND_tenDBChangedReason; + +/*! + * \ingroup callback_functions + * + * \brief + * Enumeration of shortcut scopes + * + * The ::CAND_tenShortCutScope enum contains scope specifiers for shortcut registrations. + * + * \see + * CAND_enRegisterShortcut + */ +typedef enum +{ + CAND_nAnyScope, /*!< Scope is irrelevant (internal use only) */ + CAND_nAppScope, /*!< Application wide */ + CAND_nSystemScope /*!< System wide */ +} CAND_tenShortCutScope; + +/*! + * \ingroup general_functions + * + * \brief + * Enumeration unit with standard return values of API functions. + * + */ +typedef enum +{ + CAND_nFALSE, /*!< Return-value means not true */ + CAND_nTRUE, /*!< Return-value means true */ + + CAND_nERR_OK, /*!< Function proceeded successfully */ + CAND_nERR_INVALID_HANDLE, /*!< Handle is invalid */ + CAND_nERR_INVALID_PARAM, /*!< Parameter is invalid */ + CAND_nERR_NO_MATCH, /*!< Result is undetermined */ + CAND_nERR_TX_FAILED, /*!< Transmit failed */ + CAND_nERR_SIM_IS_RUNNING, /*!< Error because simulation is running */ + CAND_nERR_NOT_POSSIBLE, /*!< Operation is currently not possible */ + CAND_nERR_FILE_READ, /*!< The specified file could not be read/found */ + CAND_nERR_FILE_FORMAT, /*!< The specified file has the wrong format or is empty */ +} CAND_tenRetVal; +//Es muss daran gedacht werden, dass das Makro CANDRESULTCHECK angepasst wird, +//wenn hier neue Enum-Werte hinzugefügt werden! + + +/*! + * \ingroup attribute_functions + * + * \brief + * Enumeration with Attribute types that can be used with the database. + * + * \see + * CAND_enGetAttrType | CAND_hCreateAttribute + */ +typedef enum +{ + CAND_TypeInvalid = -1, /*!< Invalid Value */ + CAND_TypeString = 0, /*!< String Value */ + CAND_TypeInt = 1, /*!< 32-Bit signed integer */ + CAND_TypeDouble = 2, /*!< 64-Bit floating point */ + CAND_TypeHex = 3, /*!< 32-Bit unsigned integer */ + CAND_TypeQword = 4, /*!< 64-Bit unsigned integer */ + CAND_TypeBool = 5, /*!< 32-Bit unsigned integer */ + CAND_TypeEnum = 6 /*!< 32-Bit signed integer */ +} CAND_enAttrType; + + +/*! + * \ingroup attribute_functions + * + * \brief + * Enumeration with kinds of Attributes that can be created. + * + * \see + * CAND_hCreateAttribute + */ +typedef enum +{ + CAND_TypeDbc = 0, /*!< Standard attribute that is used by dbc files */ + CAND_TypeInternal = 1, /*!< Internal attribute that is normally used by CanEasy */ + CAND_TypeTemp = 2, /*!< Runtime attribute that only exists for the current CanEasy seesion */ +} CAND_enKindOfAttr; + +/*! + * \ingroup message_functions + * + * \brief + * Enumeration with the supported byte order type of signals. + * + * \see + * CAND_enGetSigByteOrder + */ +typedef enum +{ + CAND_OrderIntel = 0, /*!< Use Intel byte order, LSB first */ + CAND_OrderMotorola = 1, /*!< Use Motorola byte order, MSB first */ +} CAND_enByteOrder; + +/*! + * \ingroup callback_functions + * + * \brief + * Enumeration with modifier values for shortcut keys. + * + * \see + * CAND_enNotifyShortcut | CAND_enShortcutRegistered + */ +typedef enum +{ + /* These are bitmasks! */ + CAND_nenNoKey = 0x00, /*!< No key modifier */ + CAND_nenAltKey = 0x01, /*!< Alt-Key */ + CAND_nenCtrlKey = 0x02, /*!< Ctrl-Key */ + CAND_nenShiftKey = 0x04, /*!< Shift-Key */ + CAND_nenWinKey = 0x08 /*!< Windows-Key */ +} CAND_enKeyModifier; + +/*! + * \ingroup ui_functions + * + * \brief + * Enumeration with values to control the behaviour + * of the database browsing dialog. + * + * \see + * CAND_enBrowseDatabase + */ +typedef enum +{ + CAND_nenSelectBus = 0x0001, /*!< Allow selection of busses */ + CAND_nenShowBus = 0x0002, /*!< Display busses */ + CAND_nenSelectEcu = 0x0004, /*!< Allow selection of ECUs */ + CAND_nenShowEcu = 0x0008, /*!< Display ECUs */ + CAND_nenSelectMsg = 0x0010, /*!< Allow selection of messages */ + CAND_nenShowMsg = 0x0020, /*!< Display messages */ + CAND_nenSelectSig = 0x0040, /*!< Allow selection of signals */ + CAND_nenShowSig = 0x0080, /*!< Display signals */ + CAND_nenSelectAll = 0x0055, /*!< Allow selection of anything */ + CAND_nenShowAll = 0x00AA, /*!< Display everything in the database */ + + /* Shortcuts to browse for a specific object type */ + /*! Display everything in the database and to allow the user to select signals only. */ + CAND_nenBrowseSig = CAND_nenShowBus | CAND_nenShowEcu | CAND_nenShowMsg | CAND_nenShowSig | CAND_nenSelectSig, + /*! Display only busses, ECUs and messages. The user is only allowed to select messages. */ + CAND_nenBrowseMsg = CAND_nenShowBus | CAND_nenShowEcu | CAND_nenShowMsg | CAND_nenSelectMsg, + /*! Display only busses and ECUs. The user is only allowed to select an ECU. */ + CAND_nenBrowseEcu = CAND_nenShowBus | CAND_nenShowEcu | CAND_nenSelectEcu, + /*! Display busses only. The user is only allowed to select an bus. */ + CAND_nenBrowseBus = CAND_nenShowBus | CAND_nenSelectBus, +} CAND_tenBrowseDbFlags; + +/*! + * \ingroup bus_functions + * + * \brief + * Possible bus states in a chip state request frame on the can bus. The chip state will be + * stored in the first byte of the chip state message. + * + */ +typedef enum +{ + CAND_nCHIPSTAT_BUSOFF = 0x01, /*!< can bus has been disconnected */ + CAND_nCHIPSTAT_ERROR_PASSIVE = 0x02, /*!< can bus in passive mode */ + CAND_nCHIPSTAT_ERROR_WARNING = 0x04, /*!< can bus in warning mode */ + CAND_nCHIPSTAT_ERROR_ACTIVE = 0x08 /*!< can bus is active */ +} CAND_tenCanBusState; + +/*! + * \ingroup message_functions + * + * \brief + * Enumeration with special Id masks for message Ids. + * + * This enumeration contains message id masks that have to be used to determine if + * a message is a normal bus message or a special message event. + * + * \see + * CAND_boIsSpecialEvent + */ +enum +{ /* anonymous enum */ + CAND_nExtendedIdMask = 0x80000000, /*!< This bit is set for an extended message ID. */ + CAND_nSpecialEventMask = 0x40000000, /*!< This bit is set for internal or special events. */ + CAND_nRemoteFrameMask = 0x20000000, /*!< This bit is set for a remote frame. */ + CAND_nMessageIdMask = 0x1fffffff, /*!< A message ID is up to 29 bits long. */ + CAND_nMessageTypeMask = 0xE0000000, /*!< Bits 29 through 31 are reserved. */ + + CAND_nErrorFrameID = 0x40000001, /*!< ID for an error frame */ + + CAND_nChipStateID = 0x40000002, /*!< ID for a chip state + - Data[0] is the CAND_tenBusState + - Data[1] is the Tx error counter + - Data[2] is the Rx error counter */ + CAND_nMarkerID = 0x40000003, /*!< ID for marker points (manually set by the user) + Markers will always be "sent" on the first CAN bus */ + CAND_nOverrunFrameID = 0x40000004, /*!< < */ +}; + +/*! + * \ingroup record_functions + * + * \brief + * Enumeration with special Id masks for lin events. + */ +typedef enum +{ + CAND_nLinWakeUpID = 0x40000006, /*!< ID for a LIN-Wakeup event */ + CAND_nLinSleepID = 0x40000007 /*!< ID for a LIN-Sleep event */ +} CAND_tenLinBusState; + +/*! + * \ingroup record_functions + * + * \brief + * Enumeration with special Id masks for lin events. + */ +typedef enum +{ + CAND_nLinNoAnswerID = 0x40000005, /*!< ID for a header without Answer/Data + Msg-ID valid, Msg-Data not valid */ + CAND_nLinSyncErrorID = 0x40000008, /*!< ID for a LIN-Snyc-Error event */ + CAND_nLinErrorMsgID = 0x40000009, /*!< ID for a Error-Msg (wrong CRC, anything else wrong) + Msg-ID and Msg-Data not valid */ + CAND_nLinCrcErrorID = 0x4000000A /*!< ID for a Error-Msg (wrong CRC, anything else wrong) + Msg-ID and Msg-Data valid */ +} CAND_tenLinBusError; + +/*! + * \ingroup message_functions + * + * \brief + * Maximum value for standard identifier. + */ +#define CAND_nMaxStdId 0x000007FF + +/*! + * \ingroup message_functions + * + * \brief + * Maximum value for extended identifier. + */ + +#define CAND_nMaxExtId 0x1FFFFFFF + +/*! + * \ingroup message_functions + * + * \brief + * Determines if a message has an extended identifier (29bit). + * + * \param id + * Message id to check for extended id + * + * Use this macro to determine if a message id is a remote frame id. + */ +#define CAND_ISEXTID(id) (((id) & CAND_nExtendedIdMask) == CAND_nExtendedIdMask) + +/*! + * \ingroup message_functions + * + * \brief + * Converts the id to an extended identifier. + * + * \param id + * Message id to convert. + * + * \retval - Converted extended id + */ +#define CAND_MAKEEXTID(id) (((id) & CAND_nMaxExtId) | CAND_nExtendedIdMask) + +/*! + * \ingroup message_functions + * + * \brief + * Converts the id to a standard identifier. + * + * \param id + * Message id to convert. + */ +#define CAND_MAKESTDID(id) ((id) & CAND_nMaxStdId) + +/*! + * \ingroup message_functions + * + * \brief + * Determines if a message is a remote frame. + * + * \param id + * Message id to check + * + * Use this macro to determine if a message id is a remote frame id. + */ +#define CAND_boIsRemoteFrame(id) (((id) & CAND_nRemoteFrameMask) == CAND_nRemoteFrameMask) + +/*! + * \ingroup message_functions + * + * \brief + * Determines if a message is a special event. + * + * \param id + * Message id to check. + * + * Use this macro to determine if a message is a normal message or a special event. You + * can differ the special events with the special event mask enum. + * + */ +#define CAND_boIsSpecialEvent(id) (((id) & CAND_nSpecialEventMask) == CAND_nSpecialEventMask) + +/*! + * \ingroup handle_functions + * + * \brief + * Enumeration with handle types that are used by various interfaces. + * + * Use this function to determine the type of a given handle. + * + * \see + * CAND_enGetHandleType + */ +typedef enum +{ + CAND_nInvalidType, /*!< Specifies an invalid handle. */ + CAND_nBus, /*!< Specifies that the handle is a CAN bus. */ + CAND_nEcu, /*!< Specifies that the handle is an ECU. */ + CAND_nMsg, /*!< Specifies that the handle is a message. */ + CAND_nSig, /*!< Specifies that the handle is a signal. */ + CAND_nAtt, /*!< Specifies that the handle is an attribute. */ + CAND_nDB, /*!< Specifies that the handle is a database. */ + CAND_nEnvVar /*!< Specifies that the handle is a enviroment variable. */ +} CAND_tenHandleType; + +typedef enum +{ + TypeBool, /*!< Specifies a boolean type. */ + TypeEdit1, /*!< Specifies a slider with edit box */ + TypeEdit2, /*!< Specifies an edit box */ + TypeCombo, /*!< Specifies a combobox */ + TypeInvalid = 0xFF /*!< Specifies a nonspecified type */ +} CAND_tenSigType; + +/*! + * \ingroup message_functions + * + * \brief + * Version of checksum calculation used by LIN messages. + * + */ +typedef enum /// ACHTUNG: dieses Enum muss Identisch mit dem Enum candb::Message::ChecksumVersion sein. +{ + CAND_nLinChecksumClassic = 0, /*!< Use the classic checksum calculation of LIN version 1.3 */ + CAND_nLinChecksumEnhanced /*!< Use the enhanced checksum calculation of LIN version 2.1 */ +} CAND_tenLinChecksumVersion; + + + /*! + * \ingroup fileio_functions + * + * \brief + * Return values for the standard file access functions of a plugin. + * + */ +typedef enum +{ + CAND_nFileNoError, /*!< No error. Loading or saving was successful. */ + CAND_nFileErrorAbort, /*!< General error with abort of the further serialisation. */ + CAND_nFileErrorContinue, /*!< Gereral error with continuation of the serialisation. */ + CAND_nFileErrorInvalidVersion, /*!< Only on Load: The given version number is not supported. */ + CAND_nFileErrorInvalidIdent /*!< Only on Load: The read block identifier is not supported */ +} CAND_tenFileAccess; + +/*! + * \ingroup callback_functions + * + * \brief + * The ::CAND_tenCallbackPos enum contains the insert position of a transmission callback. + * + * \see CAND_enRegisterTxConfirmCallback, CAND_enRegisterRxConfirmCallback, CAND_enRegisterPreCopyCallback, CAND_enRegisterPreTransmitCallback + */ +typedef enum +{ + CAND_nPosFirst, + CAND_nPosNeutral, + CAND_nPosLast +} CAND_tenCallbackPos; + +/*! + * \ingroup handle_functions + * + * \brief + * Compares two handles. + * + * \param handle1 + * First handle that is compared with the second + * + * \param handle2 + * Second handle that is compared with the first + * + * \retval - ::CAND_nTRUE Both handles are equal + * \retval - ::CAND_nFALSE The handels are not equal + * + * \ex CAND_boEqualHandles.cpp + */ +#define CAND_boEqualHandles(handle1, handle2) ((handle1).internal==(handle2).internal) + +/*! + * \ingroup handle_functions + * + * \brief + * Structure that depicts a handle to CanEasy database objects. + * + * \remarks + * Handle-Type for busses, ECUs, messages, signals and attributes. Handles + * provide faster access than access by name or ID. + * + */ +typedef struct _CAND_tHandle +{ + unsigned long internal; /*!< Internal data - Do not modify! */ + CAND_tenHandleType enType; /*!< Type of handle - Do not modify! */ + +#ifdef __cplusplus + /*! + * \brief Allow if(hObject){...} and the like + */ + operator void*() { return (void*)internal; } + + /*! + * \brief Operator for easier CAND_tHandle handling. + */ + bool operator==(const _CAND_tHandle& rhs) const + { + return CAND_boEqualHandles(rhs, *this) == CAND_nTRUE; + } + + /*! + * \brief Operator for easier ::CAND_tHandle handling. + */ + bool operator<(const _CAND_tHandle& rhs) const + { + return internal < rhs.internal; + } + + /*! + * \brief Operator for easier ::CAND_tHandle handling. + */ + bool operator!=(const _CAND_tHandle& rhs) const + { + return !CAND_boEqualHandles(rhs, *this); + } + + /*! + * \brief Operator for easier ::CAND_tHandle handling. + */ + operator DWORD() + { + return internal; + } +#endif +} CAND_tHandle; + +/*! + * \ingroup handle_functions + * + * \brief + * The handle type for filemanager access. + * + * \remarks + * Handle-Type an internal filemanager, allow to store/load data from workspace. + * + */ +typedef DWORD CAND_tFileHandle; + +/*! + * \ingroup handle_functions + * + * \brief + * Structure that contains information about the type of the filter object + * and its reference. + * + * \remarks + * Handle-Type for messages to receive information from a simulation + * record. Handles provide faster access than access by name or ID. + * + */ +typedef struct _CAND_tFilterHandle +{ + DWORD dummy; /*!< Internal data - Do not modify! */ +} *CAND_tFilterHandle; + +/*! + * \ingroup record_functions + * + * \brief + * Handle for iterators. + * + */ +typedef struct _CAND_tIteratorHandle +{ + DWORD dummy; /*!< Internal data - Do not modify! */ +} *CAND_tIteratorHandle; + +/*! + * \ingroup message_functions + * + * \brief + * Scaling factors for use with timestamps. + * + * \see + * CAND_tstCanMessage + */ +enum +{ /* anonymous enum */ + CAND_enTicksPerSecond = 1000000, /*!< Divisor to calculate the time in seconds using a timestamp */ + CAND_enTicksPerMilliSecond = 1000 /*!< Divisor to calculate the time in milli seconds using a timestamp */ +}; + +#pragma pack(push, 1) +/*! + * \ingroup message_functions + * + * \brief + * Structure used for messages and bus events. + * + * \see + * CAND_tCanEventCb + */ +typedef struct CAND_stCanMessage +{ + CAND_tHandle hBus; /*!< Specifies the ::CAND_tHandle handle of message's bus. */ + DWORD dwMessageID; /*!< Specifies the ID of the message or event. */ + QWORD qwTimestamp; /*!< Specifies the 64-bit-timestamp when message was sent/received (use ::CAND_enTicksPerMilliSecond to get the millisecond value). */ + BYTE bDlc; /*!< Specifies the length of the message in bytes. */ + BYTE bRx; /*!< Specifies whether the message was received. */ + BYTE abData[8]; /*!< Points to an array of bytes that contains the contents of the message. */ +} CAND_tstCanMessage; + +typedef enum +{ + CAND_nCanRecordEntry, + CAND_nLinRecordEntry, + CAND_nFlexrayRecordEntry, +} CAND_tenMsgRecordEntryType; + +typedef enum +{ + CAND_nMsgRecordEntry, + CAND_nCanBusErrorRecordEntry, + CAND_nCanBusStateRecordEntry, + CAND_nLinBusStateRecordEntry, + CAND_nMarkerRecordEntry, + //CAND_nEnvVarRecordEntry, + //CAND_nXcpRecordEntry +} CAND_tenRecordEntryType; + +/*! + * \ingroup message_functions + * + * \brief + * Structure used for bus information in the record. + */ +typedef struct CAND_stBusRecordEntry +{ + CAND_tHandle hBus; /*!< Specifies the ::CAND_tHandle handle of message's bus. */ + BYTE u8Channel; /*!< Specifies the bus channel. */ +} CAND_tstBusRecordEntry; + +/*! + * \ingroup message_functions + * + * \brief + * Structure used for record entries. + */ +typedef struct CAND_stCanBusState +{ + BYTE u8RxErrors; /*!< Count of Rx-Errors. */ + BYTE u8TxErrors; /*!< Count of Tx-Errors. */ + CAND_tenCanBusState enChipstate; /*!< Specifies the can busstate. */ +} CAND_tstCanBusstate; + +/*! + * \ingroup message_functions + * + * \brief + * Structure used for CAN messages in the record. + */ +typedef struct CAND_stMsgRecordEntry +{ + CAND_tenMsgRecordEntryType enType;/*!< Specifies the message type (LIN, CAN, ...). */ + DWORD u32MsgId; /*!< Specifies the ID of the message. */ + BYTE u8Dlc; /*!< Specifies the length of the message in bytes. */ + BYTE u8Rx; /*!< Specifies whether the message was received. */ + const BYTE* pu8Data; /*!< Points to an array of bytes that contains the contents of the message. */ +} CAND_tstMsgRecordEntry; + +/*! + * \ingroup message_functions + * + * \brief + * Structure used for LIN messages in the record. + */ +typedef struct CAND_stLinMsgRecordEntry +{ + CAND_tstMsgRecordEntry stMsgRecordEntry; /*!< Specifies infomations about the message. */ + CAND_tenLinChecksumVersion ChecksumVersion; /*!< Specifies the lin checksum version. */ +} CAND_tstLinMsgRecordEntry; + +/*! + * \ingroup message_functions + * + * \brief + * Structure used for record entries. + */ +typedef struct CAND_stRecordEntry +{ + CAND_tenRecordEntryType enType; /*!< Specifies the type of the record entry. */ + QWORD u64Timestamp; /*!< Specifies the 64-bit-timestamp when message was sent/received (use ::CAND_enTicksPerMilliSecond to get the millisecond value). */ + CAND_tstBusRecordEntry stBus; /*!< Specifies bus information. */ + union + { + CAND_tstCanBusstate stCanBusState; /*!< Specifies bus status informations. */ + CAND_tenLinBusState enLinBusState; /*!< Specifies lin status informations. */ + CAND_tenLinBusError enLinBusError; /*!< Specifies lin status informations. */ + CAND_tstMsgRecordEntry stMsg; /*!< Specifies message data. */ + CAND_tstLinMsgRecordEntry stLinMsg; /*!< Specifies lin message data. */ + DWORD u32MarkerId; /*!< Specifies the markers id. */ + }; + +} CAND_tstRecordEntry; + +#pragma pack(pop) + +/*! + * \ingroup bus_functions + * + * \brief + * Structure for bus statistic information + * + * \see + * CAND_enGetBusStat + */ +typedef struct CAND_stBusStat +{ + QWORD qwRxStd; /*!< Count of received standard frames */ + QWORD qwTxStd; /*!< Count of transmitted stadard frames */ + QWORD qwRxXtd; /*!< Count of received extended frames */ + QWORD qwTxXtd; /*!< Count of transmitted extended frames */ + QWORD qwRxRem; /*!< Count of received remote frames */ + QWORD qwTxRem; /*!< Count of transmitted remote frames */ + QWORD qwErr; /*!< Count of error frames */ + QWORD qwBits; /*!< Count of bits on bus since simulation start */ + BYTE bChipState; /*!< Hardware chip state */ +}CAND_tstBusStat; + +/*! + * \ingroup callback_functions + * + * \brief + * Structure which identifies a transmission callback + * + * \see CAND_enRegisterTxConfirmCallback, CAND_enRegisterRxConfirmCallback, CAND_enRegisterPreCopyCallback, CAND_enRegisterPreTransmitCallback + */ +typedef struct CAND_stCallbackdata +{ + CAND_tenCallbackPos enPos; /*!< Position were the callback should be called */ + CAND_tHandle hItem; /*!< Handle for which the callback was registered */ + const char* sFilter; /*!< Filter string */ + void* pUserParam; /*!< User defined pointer */ + const char* sId; /*!< Unique name for the callback */ +} CAND_tstCallbackdata; + +/*! + * \ingroup callback_functions + * + * \brief + * Structure which contains changeable CAN frame data + * + * \see CAND_enRegisterTxConfirmCallback, CAND_enRegisterRxConfirmCallback, CAND_enRegisterPreCopyCallback, CAND_enRegisterPreTransmitCallback + */ +typedef struct CAND_stMessagedata +{ + CAND_tHandle hBus; /*!< Handle to the bus were the message belongs to */ + CAND_tHandle hMsg; /*!< Handle to an equivalent database message */ + DWORD u32MsgId; /*!< Identifier for the message */ + BYTE* pu8MsgData; /*!< Pointer to the message data */ + BYTE u8MsgLength; /*!< Message length */ + QWORD u64Timestamp; /*!< Timestamp, when the message was received/transmitted */ +} CAND_tstMessagedata; + +/*! + * \ingroup callback_functions + * + * \brief + * Structure which contains nonchangeable CAN frame data + * + */ +typedef struct CAND_stMessagedataConst +{ + CAND_tHandle hBus; /*!< Handle to the bus were the message belongs to */ + CAND_tHandle hMsg; /*!< Handle to an equivalent database message */ + DWORD u32MsgId; /*!< Identifier for the message */ + const BYTE* pu8MsgData; /*!< Pointer to the const message data */ + BYTE u8MsgLength; /*!< Message length */ + QWORD u64Timestamp; /*!< Timestamp, when the message was received/transmitted */ +} CAND_tstMessagedataConst; + + +/*! + * \ingroup callback_functions + * + * \brief + * Enumeration which contains the reasons for why a record callback has been triggered. + * + * \see + * CAND_tRecorderCallback + */ +typedef enum +{ + CAND_enRecordUnload, /*!< The user has unloaded the current record. */ + CAND_enRecordLoad /*!< The user has loaded a new record */ +} CAND_tenRecorderCallbackReason; + +/*! + * \ingroup callback_functions + * + * \brief + * The ::CAND_tenCallbackType enum contains information about the type of + * the callback. + * + * \see CAND_enRegisterCallback, CAND_enUnRegisterCallback + */ +typedef enum +{ + CAND_enTimer, /*!< Cyclic timer callback (in milliseconds). Use it to register a timer callback. The function should have the type ::CAND_tTimerCb. */ + + CAND_enMsgDataChanged, /*!< Callback occures when the message data has changed. Use it to register a callback which is called when a messaged has changed. The function should have the type ::CAND_tDataChangedCb. */ + CAND_enSigValueChanged, /*!< Callback occures when signal's value has changed. Use it to register a callback which is called when a signal has changed. The function should have the type ::CAND_tDataChangedCb. */ + + CAND_enDBChanged, /*!< Callback occures when a database has changed. Use it to register a callback which is called if the database has changed. The function should have the type ::CAND_tDbChangedCb. */ + + CAND_enRecordChanged, /*!< Callback occures when a record has changed. Use it to register a callback which is called if the recoprd has changed. The function should have the type ::CAND_tRecorderCallback. */ + + CAND_enMsHandle /*!< Signals an event every 1ms. Use it to register a callback which is called every millisecond. */ +} CAND_tenCallbackType; + + +/*! + * \ingroup callback_functions + * + * \brief Callback type definition for a PreTransmit callback + * + * The application has to provide this function pointer at the registration of a callback. + * The callback will be called before a message is sent. + * + * \param pData + * Pointer to a structure which identifies the transmission callback. + * + * \param pMsg + * Pointer to structure which contains the data of a can frame + * + * \see CAND_enRegisterPreTransmitCallback, CAND_enUnRegisterPreTransmitCallback + */ +typedef BOOL CANDLL_CALLBACK(CAND_tPreTansmit)(const CAND_tstCallbackdata* pData, CAND_tstMessagedata* pMsg); + +/*! + * \ingroup callback_functions + * + * \brief Callback type definition for a PreCopy callback. + * + * The application has to provide this function pointer at registration of a callback. + * The callback will be called before the data of a received message is copied into the database. + * + * \param pData + * Pointer to a structure which identifies the transmission callback. + * + * \param pMsg + * Pointer to a structure which contains the data of a can frame + * + * \see CAND_enRegisterPreCopyCallback, CAND_enUnRegisterPreCopyCallback + */ +typedef BOOL CANDLL_CALLBACK(CAND_tPreCopy)(const CAND_tstCallbackdata* pData, CAND_tstMessagedata* pMsg); + +/*! + * \ingroup callback_functions + * + * \brief Callback type definition for the TxConfirm callback + * + * The application has to provide this function pointer at the registration of a callback. + * The callback is called after a message has successfully been transmitted. + * + * \param pData + * Pointer to a structure which identifies the transmission callback. + * + * \param pMsg + * Pointer to a structure which contains the data for a can frame. + * + * \see CAND_enRegisterCallback, CAND_enUnRegisterCallback + */ +typedef void CANDLL_CALLBACK(CAND_tTxConfirm)(const CAND_tstCallbackdata* pData, CAND_tstMessagedataConst* pMsg); + +/*! + * \ingroup callback_functions + * + * \brief Callback type definition for RxConfirm callbacks + * + * The application has to provide this function pointer at the registration of a callback. + * The callback will be called when a message is received. + * + * \param pData + * Pointer to a structure which identifies the transmission callback. + * + * \param pMsg + * Pointer to a structure which contains the data for a can frame. + * + * \see CAND_enRegisterRxConfirmCallback, CAND_enUnRegisterRxConfirmCallback + */ +typedef void CANDLL_CALLBACK(CAND_tRxConfirm)(const CAND_tstCallbackdata* pData, CAND_tstMessagedataConst* pMsg); + +/*! + * \ingroup callback_functions + * + * \brief Type definition for callbacks of type: ::CAND_enTimer + * + * The application has to provide this function pointer on registering a callback. + * The callback will be triggered periodically each time the internal CanEasy timer + * achieves the predefined value of milliseconds. + * + * \param dwInterval + * Interval which the call has to take place in. The interval time is specified in milliseconds. + * + * \param dwUserParam + * User defined data that has been specified at the registration of the callback. + * + * \remark The callback types used for this callback are: + * - ::CAND_enTimer + * + * \ex CAND_tTimerCb.cpp + */ +typedef void CANDLL_CALLBACK(CAND_tTimerCb)(unsigned long dwInterval, unsigned long dwUserParam); + +/*! + * \ingroup callback_functions + * + * \brief Type for DB change callback. + * + * The application has to provide this function pointer on registering a callback. + * The function will be calles each time the Can-Database has been changed. + * + * \param iReason + * Specifies the reason why the database has changed. + * + * \param hObject + * Specifies the handle to object that has changed. + * + * \param dwUserData + * User defined data that has been specified on registration of the callback. + * + * \remark + * The callback reasons for this function are specified in the enum ::CAND_tenDBChangedReason. + * + * \remark + * When the database has been changed, all handles are invalidated. + * Do not use any handle to a bus, ECU, message, signal or attribute + * which has been obtained before.\n + * Additionally, all registered callbacks for message events and signal events + * are going to be automatically unregistered. Do not try to unregister them, + * unless, of course, you registered them by yourself after the function call. + * Other callbacks (such as timers) are still valid. + * + * \ex CAND_tDbChangedCb.cpp + */ +typedef void CANDLL_CALLBACK(CAND_tDbChangedCb)(CAND_tenDBChangedReason iReason, CAND_tHandle hObject); + +/*! + * \ingroup callback_functions + * + * \brief Callback type definition for data changed callbacks. + * + * The application provides this type of function pointer to register + * a callback that will be triggerd if the value of a signal or message + * has been changed inside the CanEasy database. + * + * \param hObject + * Handle of a database object (message or signal) whose data has been changed. + * + * \param dwUserData + * User defined data that has been specified at registration of the callback. + * + * \remark The callback types used for this callback are: + * - ::CAND_enMsgValueChanged + * - ::CAND_enSigValueChanged + * + * \ex CAND_tDataChangedCb.cpp + */ +typedef void CANDLL_CALLBACK(CAND_tDataChangedCb)(CAND_tHandle hObject, DWORD dwUserData); + +/*! + * \ingroup callback_functions + * + * \brief Callback type definition for a recorder callback. + * + * The application provides this function pointer at the registration of a recorder callback. + * The callback will be called when the user loads or unloads the record. + * + * \param iReason + * Specifies the reason why the function has been called. + * + * \param dwUserData + * User defined data that has been specified at the registration of the callback. + * + * \remarks + * If iReason is ::CAND_enRecordUnload, all iterator handles will be + * invalidated after this callback returns. In this case make sure you do not use + * iterators any longer (i.e. stop timers or threads that use iterators). + * + * \ex CAND_tRecorderCallback.cpp + */ +typedef void CANDLL_CALLBACK(CAND_tRecorderCallback)(CAND_tenRecorderCallbackReason iReason, DWORD dwUserData); + +/*! + * \ingroup callback_functions + * + * \brief Callback type definition for shortcut callbacks. + * + * This callback will be triggerd when the user pressed the registered key. + * + * \param wKey + * The virtual key code of the pressed key + * + * \param dwModifiers + * Additional pressed keys like Ctrl, Alt, Shift + * + * \param dwUserData + * User defined data that has been specified at the registration of the callback. + * + * \return + * The return value indicates if the event has been consumed. + * + * \see + * CAND_enRegisterShortcut | CAND_enNotifyShortcut | CAND_enKeyModifier + * + * \ex CAND_tShortCutCb.cpp + */ +typedef BOOL CANDLL_CALLBACK(CAND_tShortCutCb)(WORD wKey, DWORD dwModifier, DWORD dwUserData); + +/*! + * \ingroup callback_functions + * + * \brief Type definition for a filter callback. + * + * The application provides this function pointer at the registration of a filter callback. + * Which will be called to decide whether a message should be ignored or not. + * + * \param pstMessage + * Specifies the message which is to be examined. Use this structure to decide whether to skip that message or not. + * + * \param dwUserData + * User defined data which has been specified on registration of the callback. + * + * \retval - ::CAND_nTRUE The message is filtered and should be skipped. + * \retval - ::CAND_nFALSE The message passes the filter and should be processed. + * + * \ex CAND_tFilterCallback.cpp + */ +typedef BOOL CANDLL_CALLBACK(CAND_tFilterCallback)(CAND_tstRecordEntry* pstRecordEntry, DWORD dwUserData); + +/*! + * \ingroup callback_functions + * + * \brief + * Callback type definition for status information during the database generation process. + * + * The application provides this function pointer to register a callback, that will + * be triggered at the generation of a database. Use this callback to show + * the progress of the generation. + * + * \param lProgress + * Specifies the percentage of the generation progress. + * + * \ex CAND_tGenerateCb.cpp + */ +typedef void CANDLL_CALLBACK(CAND_tGenerateCb)(long lProgress); + +/*! + * \ingroup callback_functions + * + * \brief + * Callback type definition for CAN-bus-state changes. + * + * \param hBus + * Specifies the bus handle. + * + * \param enEvent + * Enum for CAN-Bus-state. + * + * \param rxCount + * Rx error count. + * + * \param txCount + * Tx error count. + * + * \param pUserData + * User defined parameter passed on callback registration. + */ +typedef void CANDLL_CALLBACK(CAND_tCanBusState)(CAND_tHandle hBus, CAND_tenCanBusState enEvent, BYTE rxCount, BYTE txCount, void* pUserData); + +/*! + * \ingroup callback_functions + * + * \brief + * Callback type definition for CAN-bus error-frames. + * + * \param hBus + * Specifies the bus handle. + * + * \param timestamp + * Hardware timestamp. + * + * \param pUserData + * User defined parameter passed on callback registration. + */ +typedef void CANDLL_CALLBACK(CAND_tCanBusError)(CAND_tHandle hBus, QWORD timestamp, void* pUserData); + +/*! + * \ingroup callback_functions + * + * \brief + * Callback type definition for LIN-bus-state changes. + * + * \param hBus + * Specifies the bus handle. + * + * \param enEvent + * Enum for LIN-Bus-state. + * + * \param pUserData + * User defined parameter passed on callback registration. + */ +typedef void CANDLL_CALLBACK(CAND_tLinBusState)(CAND_tHandle hBus, CAND_tenLinBusState enEvent, void* pUserData); + +/*! + * \ingroup callback_functions + * + * \brief + * Callback type definition for LIN-bus errors. + * + * \param pstMsgData + * Structure which contains the CAN frame data + * + * \param enEvent + * Enum for LIN-Bus-error. + * + * \param pUserData + * User defined parameter passed on callback registration. + */ +typedef void CANDLL_CALLBACK(CAND_tLinBusError)(CAND_tstMessagedataConst* pstMsgData, CAND_tenLinBusError enEvent, void* pUserData); + +/*! + * \ingroup database_functions + * + * \brief + * Looks for an object that is characterized by the given parameters within CanEasy database. + * + * The first object matching the given parameters will returned.\n + * The parameters pcBusName, pcEcuName, pcMsgName, pcSigName can be NULL, if + * they are not known.\n + * Parameter dwMsgID has to be -1 (0xFFFFFFFF) if unknown.\n\n + * The Database is organized in the following way: + * - BusA + * - Ecu1 + * - Msg1 + * - Msg2 + * . + * - Ecu2 + * - Msg3 + * . + * . + * - BusB + * - Ecu3 + * - Msg11 + * - Msg12 + * . + * - Ecu4 + * - Msg13 + * - Msg14 + * . + * . + * . + * \n + * If you pass a null handle as hBeginSearch, the complete database will be searched. + * If you pass a handle to an object, only objects after hBeginSearch will be returned; + * e.g. if you pass a handle to Msg3 and search for Ecu1, the search can never succeed + * since Ecu1 comes "before" Msg3. + * + * \param pcBusName + * Points to a null terminated string which contains the name of the bus. + * + * \param pcEcuName + * Points to a null terminated string which contains the name of the ECU. + * + * \param pcMsgName + * Points to a null terminated string which contains the name of the message. + * + * \param dwMsgID + * ID of message. + * + * \param pcSigName + * Points to a null terminated string which contains the name of the signal. + * + * \param hBeginSearch + * Handle to an CanEasy database object which should be used as the start for the search. The first object which the searching is started with is the one, which is right after the one selected here. + * + * \return + * The Function returns a valid handle to a object that fits the given parameters. If + * there was no match the function return a invalid handle. You must use the function + * ::CAND_enIsNullHandle to check the result. + * + * \remark + * The search is not case sensitive. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hFindObject.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hFindObject(const char* pcBusName, + const char* pcEcuName, + const char* pcMsgName, + unsigned long dwMsgID, + const char* pcSigName, + CAND_tHandle hBeginSearch); + +/*! + * \ingroup database_functions + * + * \brief + * Returns the name of an object as a null terminated string. The object can be a bus, a control unit, a message or a signal. + * + * \param hObject + * Handle to the object which name should be returned. + * + * \param pcName + * Pointer to a buffer that receives the name of the object. This pointer must not be NULL. + * A terminating NULL-character will be automatically appended. + * + * \param dwLen + * Maximum length of pcName in characters.\n (Including room for a termination NULL character.) + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified Handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The Function succeded. + * + * \ex CAND_enGetName.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetName(CAND_tHandle hObject, char* pcName, unsigned long dwLen); + +/*! + * \ingroup database_functions + * + * \brief + * Sets the name of an object. The object can be a bus, a control unit, a message or a signal. + * + * \param hObject + * Handle to the object thats name should be modified. + * + * \param pcName + * Pointer to null terminated string that contains the name to be applied. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The Function succeded. + * + * \ex CAND_enSetName.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetName(CAND_tHandle hObject, const char* pcName); + + +/*! + * \ingroup attribute_functions + * + * \brief + * Call this function to retrieve a handle to an attribute for the + * given object in the current database. + * + * \param hObject + * Specifies a handle to a can bus, ECU, message or signal that owns the attribute. + * + * \param pszAttrName + * Specifies the name of the attribute you want to retrieve. + * + * \return + * If the function succeeds, the return value is a valid handle to the first attribute matching the + * search criteria. If the function fails or the attribute does not exist, the return value + * is a null handle. Check the result with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hGetAttrByName.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetAttrByName(CAND_tHandle hObject, const char* pszAttrName); + +/*! + * \ingroup attribute_functions + * + * \brief + * Call this function to retrieve the first handle to an attribute of + * the given object in current database. + * + * \param hObject + * Specifies a handle to a bus, ECU, message or signal that owns the attribute. + * + * \return + * If the function succeeds, the return value is a valid handle to the first attribute of + * the object. If the function fails or the attribute does not exist, the return value + * is a null handle. Check the result with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hGetFirstAttr.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetFirstAttr(CAND_tHandle hObject); + +/*! + * \ingroup attribute_functions + * + * \brief + * Call this function to retrieve the next handle of a attribute from + * the given object in the current CanEasy database. + * + * \param hAttr + * Specifies a handle to an attribute. + * + * \return + * If the function succeeds, the return value is a valid handle to the next attribute of + * the object. If the function fails or the attribute does not exist, the return value + * is a null handle. Check the result with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hGetNextAttr.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetNextAttr(CAND_tHandle hAttr); + +/*! + * \ingroup attribute_functions + * + * \brief + * Call this function to retrieve the type of an attribute for the + * given object. + * + * \param hAttr + * Specifies a valid handle to an attribute. + * + * \param penType + * Points to a buffer that receives the type of the attribute. This pointer must not be NULL. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The Function succeeded. + * + * \ex CAND_enGetAttrType.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetAttrType(CAND_tHandle hAttr, CAND_enAttrType* penType); + +/*! + * \ingroup attribute_functions + * + * \brief + * Call this function to retrieve the value of an attribute. + * + * \param hAttr + * Specifies a handle to a valid attribute. + * + * \param pvValue + * Points to a buffer that receives the value of the attribute. If this value is NULL the function will only + * determine the needed space to store the value in pvValue. The needed size will be returned in pu32Length. + * + * \param pu32Length + * Specifies the length (in Byte) of pvValue. + * If the type is ::CAND_TypeString, the buffer has to be at least the length of + * the String. If the Type is not ::CAND_TypeString, this parameter has to be the + * exact length of the Type (i.e. 4 for 32Bit-Values). + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The Function succeeded. + * + * \ex CAND_enGetAttrValue.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetAttrValue(CAND_tHandle hAttr, void* pvValue, unsigned int* pu32Length); + +/*! + * \ingroup attribute_functions + * + * \brief + * Call this function to retrieve the value of an enum attribute entry. + * + * \param hAttr + * Specifies a handle to a valid attribute. + * \param u32Entry + * Specifies the requested entry. + * \param sName + * Pointer where the entry name will be copied. + * \param u32NameSize + * Size of the buffer sName. + * \param piValue + * Entries value. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The Function succeeded. + * + * \ex CAND_enGetAttrEnumEntry.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetAttrEnumEntry(CAND_tHandle hAttr, unsigned int u32Entry, char* sName, unsigned int u32NameSize, int* piValue); + +/*! + * \ingroup attribute_functions + * + * \brief + * Call this function to set a new value of an attribute. + * + * \param hAttr + * Specifies a valid handle to an attribute. + * + * \param pvValue + * Points to a buffer that specifies the new value of the attribute. This pointer must not be NULL. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK Function succeeded + * + * \ex CAND_enSetAttrValue.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetAttrValue(CAND_tHandle hAttr, const void* pvValue); + +/*! + * \ingroup attribute_functions + * + * \brief + * Call this function to create a new attribute. + * + * \param hObject + * Specifies a handle to an database item + * + * \param szName + * The name of the new Attribute. + * + * \param pvValue + * Attribute value buffer. To create an enum attribute pass a pointer to CAND_tstEnum. + * + * \param enType + * Type for the new attribute. + * + * \param enTypeOf + * Specifies whether it is an internal, dbc or runtime attribute. See ::CAND_enKindOfAttr for more information. + * + * \return + * If the function succeeds, the return value is the handle to the new + * created attribute. Otherwise the function returns value is a NULL handle. + * Check the function result with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hCreateAttribute.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hCreateAttribute(CAND_tHandle hObject, const char* szName, const void* pvValue, CAND_enAttrType enType, CAND_enKindOfAttr enTypeOf); + +/*! + * \ingroup attribute_functions + * + * \brief + * Call this function to retrieve the owner of the attribute. The owner can + * be a bus, an ECU, a message or a signal. + * + * \param hAttr + * Specifies the handle of the attribute. + * + * \return + * If the function succeeds, the return value is the handle of the attribute's + * owner. If the function fails the return value is a NULL handle. Check + * the return value with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hGetAttrOwner.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetAttrOwner(CAND_tHandle hAttr); + +/*! + * \ingroup attribute_functions + * + * \brief + * Call this function to retrieve the attribute name. The owner can be a + * bus, an control unit, a message or a signal. + * + * \param hAttr + * Specifies the handle of the attribute. + * + * \param szName + * Points to a buffer where the name will be inserted. If this pointer is NULL the function will only + * determine the required buffer length and return it in pu32Length. + * + * \param pu32Length + * Length of the buffer and maximum length of the name. Or if szName is NULL the function will + * write the requered length for the buffer into this pointer. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetAttrName.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetAttrName(CAND_tHandle hAttr, char* szName, unsigned int* pu32Length); + +/*! + * \ingroup attribute_functions + * + * \brief + * Call this function to retrieve the attributes maximum value. + * + * \param hAttr + * Specifies the handle of the attribute. + * + * \param pMax + * Pointer to a double where the maximum value will be inserted. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetAttrMax.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetAttrMax(CAND_tHandle hAttr, double* pMax); + +/*! + * \ingroup attribute_functions + * + * \brief + * Call this function to retrieve the attributes minimum value. + * + * \param hAttr + * Specifies the handle of the attribute. + * + * \param pMin + * Pointer to a double where the minimum value will be inserted. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetAttrMin.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetAttrMin(CAND_tHandle hAttr, double* pMin); + +/*! + * \ingroup attribute_functions + * + * \brief + * Sets the attribute maximum value. + * + * \param hAttr + * Specifies the handle of the attribute. + * + * \param dMax + * Maximum value for the attribute. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetAttrMax.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetAttrMax(CAND_tHandle hAttr, double dMax); + +/*! + * \ingroup attribute_functions + * + * \brief + * Sets the attribute minimum value. + * + * \param hAttr + * Specifies the handle of the attribute. + * + * \param dMin + * Minimum value for the attribute. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetAttrMin.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetAttrMin(CAND_tHandle hAttr, double dMin); + +/*! + * \ingroup database_functions + * + * \brief + * Retrieves the handle to the database, which is the root of the CanEasy database. + * + * \return + * Returns the handle for the database. Otherwise a null handle will be + * returned if no database exists. + * + * \ex CAND_hGetDatabase.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetDatabase(void); + +/*! + * \ingroup database_functions + * + * \brief + * Generates a new bus from a dbc- or ldf-file. + * + * \param pcName + * Name of the bus to be generated. + * + * \param pcPath + * Filepath of dbc- or ldf-file. + * + * \param pfnProgress + * Callback to get generation status information. + * + * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter + * \retval - ::CAND_nERR_OK Function succeeded + * \retval - ::CAND_nERR_SIM_IS_RUNNING Simulation is running + * \retval - ::CAND_nERR_NOT_POSSIBLE Generator is not available + * + * \ex CAND_enGenerateBus.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGenerateBus(const char* pcName, const char* pcPath, CAND_tGenerateCb pfnProgress); + +/*! + * \ingroup database_functions + * + * \brief + * Exports a new bus into a dbc-file or ldf-file. + * + * \param hBus + * Specifies a handle to a bus. + * + * \param cpFilename + * Filepath of the destination dbc-file or ldf-file. + * + * \retval - ::CAND_nERR_OK Function succeeded + * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter + * \retval - ::CAND_nERR_NOT_POSSIBLE Export ist not allowed or the responsible module + * could not be found + * \retval - ::CAND_nERR_FILE_FORMAT Invalid fileformat for the given bus. + * + * \remark ::CAND_nERR_FILE_FORMAT will be returned if cpFilename describes a + * LDF file and a other Bus than a LIN bus is described by hBus. + * + * \ex CAND_enExportBus.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enExportBus(CAND_tHandle hBus, const char* cpFilename); + +/*! + * \ingroup database_functions + * + * \brief + * Imports a ecu from a ncf-file. + * + * \param hBus + * Specifies a handle to a bus. + * + * \param cpFilename + * Filepath of the source ncf-file. + * + * \retval - ::CAND_nERR_OK Function succeeded + * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter + * \retval - ::CAND_nERR_NOT_POSSIBLE Import is not allowed or the responsible module + * could not be found + * \retval - ::CAND_nERR_FILE_FORMAT Invalid fileformat for the given bus. + * + * \remark ::CAND_nERR_FILE_FORMAT will be returned if cpFilename describes a + * NCF file and a other Bus than a LIN bus is described by hBus. + * + * \ex CAND_enGenerateEcu.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGenerateEcu( CAND_tHandle hBus, const char* cpFilename ); + +/*! + * \ingroup database_functions + * + * \brief + * Exports a ecu into a ncf-file. + * + * \param hBus + * Specifies a handle to a bus. + * + * \param hEcu + * Specifies a handle to a ecu. + * + * \param cpFilename + * Filepath of the destination ncf-file. + * + * \retval - ::CAND_nERR_OK Function succeeded + * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter + * \retval - ::CAND_nERR_NOT_POSSIBLE Export ist not allowed or the responsible module + * could not be found + * + * \ex CAND_enExportEcu.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enExportEcu(CAND_tHandle hBus, CAND_tHandle hEcu, const char* cpFilename); + +/*! + * \ingroup database_functions + * + * \brief + * Determines if a database is available. + * + * \retval - ::CAND_nTRUE if a database exists. + * \retval - ::CAND_nFALSE if no database exists. + * + * \ex CAND_boIsDatabaseAvailable.cpp + */ +CANDLL_API BOOL CANDLL_CALL CAND_boIsDatabaseAvailable(void); + +/*! + * \ingroup bus_functions + * + * \brief + * Adds a new bus to the database. + * + * \param lpBusName + * Name of a new bus. + * + * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter + * \retval - ::CAND_nERR_OK Function succeeded + * + * \ex CAND_enAddNewBus.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enAddNewBus(LPCTSTR lpBusName); + +/*! + * \ingroup bus_functions + * + * \brief + * Searches for a bus by its name. + * + * \param pcBusName + * Points to a null terminated string which contains the name of the bus. This + * pointer must not be NULL and the string must be terminated by a + * NULL-character. + * + * \return + * If the function succeeds, the return value is the handle to the bus with + * the specified name. If the bus does not exist in the database or the function + * fails the return value is a NULL handle. Check the return value with + * ::CAND_enIsNullHandle. + * + * \remarks + * Call this function to get a handle to a can bus. + * + * \ex CAND_hGetBusByName.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetBusByName(const char* pcBusName); + + +/*! + * \ingroup bus_functions + * + * \brief + * For the given handle of an object, this function returns the handle to its bus. + * + * \param hObject + * Specifies a handle to an ECU, a message or a signal, whose bus should be retrieved. + * + * \return + * If the function succeeds, the return value is the handle to the bus. If the + * handle does not exist in the database or the function + * fails the return value is a NULL handle. Check the return value with + * ::CAND_enIsNullHandle. + * + * \remarks + * Call this function with a handle to a message, signal or ECU. In + * all cases, ::CAND_hGetBusHandle returns a handle to the corresponding bus. + * + * \ex CAND_hGetBus.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetBus(CAND_tHandle hObject); + +/*! + * \ingroup bus_functions + * + * \brief + * Retrieves the first bus within the CanEasy database. + * + * \return + * If the function succeeds, the return value is the handle to the first + * bus in the database. If the bus does not exist in the database or the function + * fails the return value is a NULL handle. Check the return value with + * ::CAND_enIsNullHandle. + * + * \ex CAND_hGetFirstBus.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetFirstBus(void); + +/*! + * \ingroup bus_functions + * + * \brief + * Retrieves the next bus within the database. + * + * \param hBus + * Specifies a handle to a bus. + * + * \return + * If the function succeeds, the return value is the handle to the next bus + * in the database. If the bus does not exist in the database or the function + * fails the return value is a NULL handle. Check the return value with + * ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hGetNextBus.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetNextBus(CAND_tHandle hBus); + +/*! + * \ingroup bus_functions + * + * \brief + * Retrieves the current baudrate of the bus. + * + * \param hBus + * Handle to a bus. + * + * \param pdwBaudrate + * Pointer to an unsigned long value buffer which will receive the baudrate of the + * bus. This pointer must not be NULL. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_NO_MATCH Attribute 'Baudrate' was not found + * \retval - ::CAND_nERR_OK The function succeeded + * + * \ex CAND_enGetBaudrate.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetBaudrate(CAND_tHandle hBus, unsigned long* pdwBaudrate); + +/*! + * \ingroup bus_functions + * + * \brief + * Sets the baudrate of the bus. + * + * \param hBus + * Handle to a bus. + * + * \param dwBaudrate + * Baudrate of the bus. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded + * + * \ex CAND_enSetBaudrate.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetBaudrate(CAND_tHandle hBus, unsigned long dwBaudrate); + +/*! + * \ingroup bus_functions + * + * \brief + * Call this function to change the bit timing register of the bus. + * + * The BTR values represent the baudrate. Their combination + * stands for a certain baudrate. + * + * \param hBus + * Specifies a handle to a can bus. + * + * \param bBTR0 + * Specifies the new value for BTR0. + * + * \param bBTR1 + * Specifies the new value for BTR1. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \remarks + * Changes which concern the hardware will be only applied after the restart of simulation. + * + * \ex CAND_enSetBTR.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetBTR(CAND_tHandle hBus, unsigned char bBTR0, unsigned char bBTR1); + +/*! + * \ingroup bus_functions + * + * \brief + * Retrieve the BTR values of a bus. + * + * \param hBus + * Handle to a bus. + * + * \param pbBTR0 + * Points to an unsigned char which receives the the BTR0 value. This pointer must + * not be NULL. + * + * \param pbBTR1 + * Points to an unsigned char which receives the the BTR1 value. This pointer must not be NULL. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetBTR.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetBTR(CAND_tHandle hBus, unsigned char* pbBTR0, unsigned char* pbBTR1); + +/*! + * \ingroup bus_functions + * + * \brief + * Sets the state of the bus. Sending and receiving can be switched on separately. + * + * \param hBus + * Specifies a handle to a can bus. + * + * \param nState + * Specifies whether the bus should be enabled or disabled. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetBusState.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetBusState(CAND_tHandle hBus, CAND_tenBusState nState); + +/*! + * \ingroup bus_functions + * + * \brief + * Determines whether the bus is allowed to send or receive messages. + * + * \param hBus + * Specifies a handle to a can bus. + * + * \param pnState + * Pointer to the type variable which receives the bus state. This pointer must not be NULL. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetBusState.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetBusState(CAND_tHandle hBus, CAND_tenBusState* pnState); + +/*! + * \ingroup bus_functions + * + * \brief + * Retrieves the bus status information + * + * \param hBus + * Specifies a handle to a can bus. + * + * \param pStat + * Points to the type that receives bus status. This pointer must not be NULL. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetBusStat.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetBusStat(CAND_tHandle hBus, CAND_tstBusStat* pStat); + +/*! + * \ingroup bus_functions + * + * \brief + * Reset the bus status information + * + * \param hBus + * Specifies a handle to a can bus. + * The status information of all busses will be resetted if hBus is a CAND_hNullHandle() + * + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enResetBusStat.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enResetBusStat(CAND_tHandle hBus); + +/*! + * \ingroup bus_functions + * + * \brief + * Shows the bus statistic dialog + * + * \ex CAND_vShowBusStat.cpp + */ +CANDLL_API void CANDLL_CALL CAND_vShowBusStat(void); + +/*! + * \ingroup database_functions + * + * \brief + * Deletes a bus, ECU, message or signal + * + * \param hObj + * Specifies a valid handle to an object + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enDelete.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enDelete(CAND_tHandle hObj); + +/*! + * \ingroup ecu_functions + * + * \brief + * Adds a new ECU to the specified bus. + * + * \param hBus + * Handle to a bus. + * + * \param lpEcuName + * Name of the new ECU. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enAddNewECU.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enAddNewECU(CAND_tHandle hBus, LPCTSTR lpEcuName); + +/*! + * \ingroup ecu_functions + * + * \brief + * Retrieves the handle of the LIN Master ECU if the given bus is a LIN bus. + * + * \param hBus + * Handle to the LIN bus. + * + * \returns + * If the function succeeds, the return value is the handle to the LIN master + * control unit. If the bus does not exist in the database or the function + * fails the return value is a NULL handle. Check the return value with + * ::CAND_enIsNullHandle. + * + * \remarks + * This function works only for busses of the type LIN! You can find out the bus type + * in the bus editor of CanEasy. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hGetLinMaster.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetLinMaster(CAND_tHandle hBus); + +/*! + * \ingroup ecu_functions + * + * \brief + * Sets the specified control unit as LIN master. + * + * \param hObj + * Handle to the control unit which should be the new LIN master. + * + * \returns + * If the function succeeds, the return value is the handle to the new LIN master + * control unit. If the control unit does not exist in the database or the function + * fails the return value is a NULL handle. Check the return value with + * ::CAND_enIsNullHandle. + * + * \remarks + * This function works only for busses of the type LIN! You can find out the bus type + * in the bus editor of CanEasy. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hSetLinMaster.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hSetLinMaster(CAND_tHandle hObj); + +/*! + * \ingroup bus_functions + * + * \brief + * Enumeration with the supported bus types of CanEasy. + * + * \remarks + * By default every Bus is a can bus! + * + * \see + * CAND_enGetBusType | CAND_enSetBusType + */ +typedef enum +{ + CAND_enBusTypeCan, + CAND_enBusTypeLin +} CAND_tenBusType; + +/*! + * \ingroup bus_functions + * + * \brief + * Retrieves the bus type using the specified bus handle. + * + * \param hBus + * Handle to a bus. + * + * \param penBusType + * Pointer to a variable which receives the bus type. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \see + * CAND_tenBusType + * + * \ex CAND_enGetBusType.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetBusType(CAND_tHandle hBus, CAND_tenBusType* penBusType); + +/*! + * \ingroup bus_functions + * + * \brief + * Sets the type of a bus. + * + * \param hBus + * Handle to a bus. + * + * \param enBusType + * New type of the bus, that should be set. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetBusType.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetBusType(CAND_tHandle hBus, CAND_tenBusType enBusType); + +/*! + * \ingroup bus_functions + * + * \brief + * Retrieves the information if the master of the given LIN-bus is real. + * + * \param hBus + * Handle to the LIN-bus. + * + * \param pboIsReal + * Buffer to recieve the information + * + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_INVALID_HANDLE The given bus does not exists. + * \retval - ::CAND_nERR_NOT_POSSIBLE Given bus is not a LIN-bus. + * \retval - ::CAND_nERR_OK The Function succeded. + * + * \ex CAND_enLinMasterIsReal.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enLinMasterIsReal(CAND_tHandle hBus, bool* pboIsReal); + +/*! + * \ingroup bus_functions + * + * \brief + * Sets the state of the LIN-bus. + * + * \param hBus + * Handle to the LIN-bus. + * + * \param enState + * The state in which the LIN-bus should go. + * + * \retval - ::CAND_nERR_OK success + * \retval - ::CAND_nERR_INVALID_HANDLE The bus-handle is invalid. + * \retval - ::CAND_nERR_NOT_POSSIBLE 1. The bus isn't a LIN-bus. + * 2. Bus should go into sleep, but the master-ECU isn't simulated. + * \retval - ::CAND_nERR_NO_MATCH Simulation isn't running. + * + * \remark + * May only be used while simulation is running. + * + * \remark + * The sleep-state can only be set if the master-ECU is simulated. + * + * \ex CAND_enSetLinBusState.cpp + * + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetLinBusState(CAND_tHandle hBus, CAND_tenLinBusState enState); + +/*! + * \ingroup ecu_functions + * + * \brief + * Retrieves the handle of an ECU using a handle of a signal or a message. + * + * \param hObject + * Specifies a handle to a message or a signal. + * + * \return + * If the function succeeds, the return value is the handle to the control unit + * which own the given object. If the object does not exist in the database or the function + * fails the return value is a NULL handle. Check the return value with + * ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hGetEcu.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetEcu(CAND_tHandle hObject); + +/*! + * \ingroup ecu_functions + * + * \brief + * Retrieves the handle of a control unit in the database, expects controls name as parameter. + * + * \param hBus + * Specifies a handle to a bus. + * + * \param pcEcuName + * Points to a null terminated string containing the name of the ECU. + * + * \return + * If the function succeeds, the return value is the handle to the control unit + * with the specified name. If the control unit does not exist in the database or + * the function fails the return value is a NULL handle. Check the + * return value with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hGetEcuByName.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetEcuByName(CAND_tHandle hBus, const char* pcEcuName); + +/*! + * \ingroup ecu_functions + * + * \brief + * Call this function to retrieve the first control unit from a bus. + * + * \param hBus + * Specifies a handle to a can bus. + * + * \return + * If the function succeeds, the return value is the handle to the first control + * unit. If the control unit does not exist in the database or + * the function fails the return value is a NULL handle. Check the + * return value with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hGetFirstEcu.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetFirstEcu(CAND_tHandle hBus); + +/*! + * \ingroup ecu_functions + * + * \brief + * Call this function to retrieve the next ECU on the bus. + * + * \param hEcu + * Specifies a handle of a control unit. + * + * \return + * If the function succeeds, the return value is the handle to the next control + * unit. If the control unit does not exist in the database or + * the function fails the return value is a NULL handle. Check the + * return value with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hGetNextEcu.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetNextEcu(CAND_tHandle hEcu); + +/*! + * \ingroup ecu_functions + * + * \brief + * Call this function to set the state of an ECU. + * + * \param hEcu + * Specifies a handle of an ECU. + * + * \param nState + * Specifies the new state of the ECU. If this parameter is + * ::CAND_nReal the ECU is set up as a real ECU and does not simulate any + * messages. If the parameter is ::CAND_nSimulated, simulation of messages + * is enabled. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \remark + * Call this function to set the simulation state of an ECU. + * + * \see + * CAND_tenSimState + * + * \ex CAND_enSetEcuState.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetEcuState(CAND_tHandle hEcu, CAND_tenSimState nState); + +/*! + * \ingroup ecu_functions + * + * \brief + * Call this function to retrieve the state of an ECU. + * + * \param hEcu + * Specifies a handle to an ECU. + * + * \param pnState + * Pointer to a variable which will receive the state of the ECU. This pointer must not be NULL. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetEcuState.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetEcuState(CAND_tHandle hEcu, CAND_tenSimState* pnState); + +/*! + * \ingroup ecu_functions + * + * \brief + * Call this function to set message mode of an ECU. + * + * \param hEcu + * Handle to the ECU. + * + * \param nMode + * Specifies the new message mode of the ECU. This option will only apply if Ecu is simulated. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetEcuMsgMode.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetEcuMsgMode(CAND_tHandle hEcu, CAND_tenGenMsgMode nMode); + +/*! + * \ingroup ecu_functions + * + * \brief + * Call this member function to retrieve the message mode of an ECU. + * + * \param hEcu + * Specifies a handle to an ECU. + * + * \param pnMode + * Pointer to buffer which will receive the mode of the ECU. This pointer must not be NULL. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetEcuMsgMode.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetEcuMsgMode(CAND_tHandle hEcu, CAND_tenGenMsgMode* pnMode); + +/*! + * \ingroup message_functions + * + * \brief + * Returns a signal which is currently defined as the multiplexer signal, + * to distinguish between multiplexed messages. + * + * \param hMsg + * Handle of multiplex message. + * + * \return + * If the function succeeds, the return value is the handle of the multiplex signal. + * If the multiplex signal does not exist beneath the message or + * the function fails the return value is a NULL handle. Check the + * return value with ::CAND_enIsNullHandle. + * + * \ex CAND_hGetMultiplexSig.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetMultiplexSig(CAND_tHandle hMsg); + +/*! + * \ingroup message_functions + * + * \brief + * Sets the signal which is used as the multiplexer signal, to distinguish + * between multiplex messages. + * + * \param hMsg + * Handle of a message. + * + * \param hSig + * Handle of the signal that should be the multiplexer signal. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetMultiplexSig.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetMultiplexSig(CAND_tHandle hMsg, CAND_tHandle hSig); + +/*! + * \ingroup message_functions + * + * \brief + * Adds a new message to the specified control unit or message. + * + * \param hObj + * Handle to the parent. Beneath this object the new message is created. + * + * \param lpMsgName + * Name of the new message. (null terminated string) + * + * \param dwMsgId + * Id of the new message. The message id must be unique within a bus. And + * unique on message level for a multiplexed message. + * + * \param bDlc + * Length of a message in bytes. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enAddNewMessage.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enAddNewMessage(CAND_tHandle hObj, LPCTSTR lpMsgName, DWORD dwMsgId, BYTE bDlc); + +/*! + * \ingroup message_functions + * + * \brief + * Retrieves the message handle from a signal or multiplexed message. + * + * \param hSig + * Specifies a handle to a signal or multiplexed message. + * + * \return + * If the function succeeds, the return value is the handle to the message + * which this object belongs to. If the control unit does not exist in the + * database or the function fails the return value is a NULL handle. Check + * the return value with ::CAND_enIsNullHandle. + * + * \remarks + * Call this function to get a handle to the message. Handles provide + * faster access than accessing by message name or ID. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hGetMessage.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetMessage(CAND_tHandle hSig); + +/*! + * \ingroup message_functions + * + * \brief + * Queries a message from the database. Starts searching with hObj. + * + * \param hObj + * Specifies a handle to a bus, ecu, or message. The function will only + * find objects just after this handle. To browse the whole CanEasy database + * just provide the handle of the database. + * + * \param pcMsgName + * Points to a null terminated string containing the name of the message. + * + * \return + * If the function succeeds, the return value is the handle to the message + * to with the given name. If the message does not exist in the + * database or the function fails the return value is a NULL handle. You + * must check the return value with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hGetMessageByName.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetMessageByName(CAND_tHandle hObj, const char* pcMsgName); + +/*! + * \ingroup message_functions + * + * \brief + * Queries a message from the database using the bus handle and message ID. + * + * \param hBus + * Specifies a handle to a bus. + * + * \param dwMsgID + * Identifies the message whose handle is required. + * + * \return + * If the function succeeds, the return value is the handle to the message + * with the given ID on the specified bus. If the message does not exist in the + * database or the function fails the return value is a NULL handle. You + * must check the return value with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hGetMessageByID.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetMessageByID(CAND_tHandle hBus, unsigned long dwMsgID); + +/*! + * \ingroup message_functions + * + * \brief + * Retrieves the first message from a control unit or a message. + * + * \param hObject + * Specifies a handle to a control unit or a message. + * + * \return + * If the function succeeds, the return value is the handle to the first message + * beneath the starting object. If the message does not exist in the + * database or the function fails the return value is a NULL handle. You + * must check the return value with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hGetFirstMsg.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetFirstMsg(CAND_tHandle hObject); + +/*! + * \ingroup message_functions + * + * \brief Retrieves the next message with the same parent. + * + * \param hMsg + * Specifies a handle to a message. + * + * \return + * If the function succeeds, the return value is the handle to the next message + * after the starting object. If the message does not exist in the + * database or the function fails the return value is a NULL handle. You + * must check the return value with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hGetNextMsg.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetNextMsg(CAND_tHandle hMsg); + +/*! + * \ingroup message_functions + * + * \brief Call this function to retrieve the ID of a message. + * + * \param hMsg + * Specifies a handle to a message. + * + * \param pdwMsgID + * Pointer to an unsigned long variable that receives the message ID. This pointer must not be NULL. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetMsgID.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetMsgID(CAND_tHandle hMsg, unsigned long* pdwMsgID); + +/*! + * \ingroup message_functions + * + * \brief Call this function to set the ID of a message. It is not allowed to change the + * message ID when simulation is running. + * + * \param hMsg + * Specifies a handle to a message. + * + * \param dwMsgID + * Message ID. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_NOT_POSSIBLE Operation currently not possible. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetMsgID.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetMsgID(CAND_tHandle hMsg, unsigned long dwMsgID); + +/*! + * \ingroup message_functions + * + * \brief + * Retrieves the number of data bytes of a message using its handle. + * + * \param hMsg + * Handle of the message. + * + * \param pcMsgDLC + * Pointer to a char variable that receives the message length. This pointer must not be NULL. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetMsgDLC.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetMsgDLC(CAND_tHandle hMsg, unsigned char* pcMsgDLC); + +/*! + * \ingroup message_functions + * + * \brief + * Sets the number of data bytes of a message using its handle. + * + * \param hMsg + * Handle of the message. + * + * \param msgDLC + * Message length in bytes. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_NOT_POSSIBLE Operation currently not possible. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetMsgDLC.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetMsgDLC(CAND_tHandle hMsg, unsigned char msgDLC); + +/*! + * \ingroup message_functions + * + * \brief + * Retrieves the data bytes of a message using its handle. + * + * \param hMsg + * Handle to a message. + * + * \param pbMsgData + * Points to an array of bytes that receives the contents of the message. Make sure that + * the buffer is large enough. This pointer must not be NULL. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetMsgData.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetMsgData(CAND_tHandle hMsg, unsigned char* pbMsgData); + +/*! + * \ingroup message_functions + * + * \brief + * Sets the data bytes of a message using its handle. + * + * \param hMsg + * Specifies a handle to a message. + * + * \param pbMsgData + * Points to an array of 8 bytes that specifies the contents of the message.\n This pointer must not be NULL. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetMsgData.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetMsgData(CAND_tHandle hMsg, const unsigned char* pbMsgData); + +/*! + * \ingroup message_functions + * + * \brief + * Retrieves one byte of a message. + * + * \param hMsg + * Handle to a message. + * + * \param u32Index + * Index of the byte to be red. + * + * \param pu8Data + * Points to a byte where the message byte is copied to. This pointer must not be NULL. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetMsgByte.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetMsgByte(CAND_tHandle hMsg, unsigned int u32Index, unsigned char* pu8Data); + +/*! + * \ingroup message_functions + * + * \brief + * Sets one byte of a message. + * + * \param hMsg + * Handle to a message. + * + * \param u32Index + * Index of the byte to be red. + * + * \param u8Data + * Data byte to be set. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetMsgByte.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetMsgByte(CAND_tHandle hMsg, unsigned int u32Index, unsigned char u8Data); + +/*! + * \ingroup message_functions + * + * \brief + * Sends a message from the CanEasy database to the bus. + * + * \param hObj + * Specifies a handle to a message or a signal. + * + * \remark + * The simulation must be in the run state to send a message! + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_NOT_POSSIBLE Simulation is not running. + * \retval - ::CAND_nERR_TX_FAILED Could not send this message + * \retval - ::CAND_nERR_OK The Function succeeded. + * + * \ex CAND_enSend.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSend(CAND_tHandle hObj); + +/*! + * \ingroup message_functions + * + * \brief + * Sends a free message on the specified bus. A free message doesn't have to exist inside the CanEasy + * database. This function can only be used with CAN busses. + * + * \param hBus + * Specifies a handle to a can bus. + * + * \param dwMsgID + * Specifies the ID of the message. + * + * \param pbData + * Points to an array of bytes that specifies the contents of the message. This pointer must not be NULL. + * + * \param bDlc + * Number of data bytes. + * + * \param boOverwritable + * Specifies if the message can be overwritten if message is send again before it is on bus. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * \retval - ::CAND_nERR_TX_FAILED Message could not be sent + * + * \remark + * If simulation is not in the running state, the function returns ::CAND_nERR_TX_FAILED. + * + * \ex CAND_enSendFreeCanMsg.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSendFreeCanMsg(CAND_tHandle hBus, unsigned long dwMsgID, + const unsigned char* pbData, unsigned char bDlc, + unsigned char boOverwritable); + +/*! + * \ingroup message_functions + * + * \brief + * Set the slave data of a lin message on the specified bus. This function can only be used with LIN busses. + * + * \param hBus + * Specifies a handle to a can bus. + * + * \param dwMsgID + * Specifies the ID of the message. + * + * \param pbData + * Points to an array of bytes that specifies the contents of the message. This pointer must not be NULL. + * + * \param bDlc + * Number of data bytes. + * + * \param checksumVersion + * Checksum version to be used for the lin message. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_NOT_POSSIBLE Simulation is not running. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetLinData.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetLinData(CAND_tHandle hBus, BYTE bMsgID, + const BYTE* pbData, BYTE bDlc, + CAND_tenLinChecksumVersion checksumVersion); +/*! + * \ingroup message_functions + * + * \brief + * Sends a lin header frame. This function can only be used with LIN busses with simulated lin master. + * + * \param hBus + * Specifies a handle to a can bus. + * + * \param dwMsgID + * Specifies the ID of the message. + * + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_NOT_POSSIBLE Simulation is not running. + * \retval - ::CAND_nERR_TX_FAILED Message could not be sent + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \remark + * If simulation is not in the running state, the function returns ::CAND_nERR_TX_FAILED. + * + * \ex CAND_enSendLinHeader.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSendLinHeader(CAND_tHandle hBus, BYTE bMsgID); + +/*! + * \ingroup message_functions + * + * \brief + * Enables a lin message. If the master is simulated only der header-frame will be send. + * If the master is real, the data of simulated messages are not added to teh header-frame. + * + * \param hBus + * Specifies a handle to a can bus. + * + * \param bMsgID + * Specifies the ID of the message. + * + * \param bEnable + * 0 = message will be disabled. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetLinMsgState.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetLinMsgState(CAND_tHandle hBus, BYTE bMsgID, BYTE bEnable); + +/*! + * \ingroup message_functions + * + * \brief + * Returns the lin message state. + * + * \param hBus + * Specifies a handle to a can bus. + * + * \param bMsgID + * Specifies the ID of the message. + * + * \param pbEnable + * 0 = message is disabled. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetLinMsgState.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetLinMsgState(CAND_tHandle hBus, BYTE bMsgID, BYTE* pbEnable); + + + +/*! + * \ingroup message_functions + * + * \brief + * Returns the cycle time of a message from the CanEasy database. + * + * \param hMsg + * Specifies a handle to a message. + * + * \param pwValue + * Points to a buffer that receives the message cycle time . + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetMsgCycleTime.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetMsgCycleTime(CAND_tHandle hMsg, unsigned short* pwValue); + +/*! + * \ingroup message_functions + * + * \brief + * Sets the cycle time of a message, which is used for the intervals of its cyclic dispatchment. + * + * \remark + * This value is indicated in milliseconds. + * + * \param hMsg + * Handle of the message. + * + * \param wCycleTime + * Specifies the new cycle time. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetMsgCycleTime.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetMsgCycleTime(CAND_tHandle hMsg, unsigned short wCycleTime); + +/*! + * \ingroup message_functions + * + * \brief + * Enables or disables the sending of a cyclic message. + * + * \param hMsg + * Specifies a handle to a message. + * + * \param bEnable + * Specifies, if the message is sent or not. If 0 the message is not sent. Otherwise + * the message is sent cyclically. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \remark + * This function has is only effective if the message is cyclically dispatched. + * Keep in mind that this function is slow, because the user interface has to be + * updated on each call. + * + * \ex CAND_enEnableMsg.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enEnableMsg(CAND_tHandle hMsg, unsigned char bEnable); + +/*! + * \ingroup message_functions + * + * \brief + * Returns the state, which says whether the cyclic generating of a message is active or not. + * + * \param hMsg + * Specifies a handle to a message. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nTRUE Cyclic sending is enabled. + * \retval - ::CAND_nFALSE Cyclic sending is disabled. + * + * \remark + * This function specifies if the cyclically sending of the message is enabled + * or not. + * + * \ex CAND_enIsMsgEnabled.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enIsMsgEnabled(CAND_tHandle hMsg); + +/*! + * \ingroup signal_functions + * + * \brief + * Adds a new signal to a message. + * + * \param hMsg + * Handle of the message. + * + * \param pcSigName + * Name of the new signal. + * + * \param bStartBit + * Starting bit position of the new signal in the message. + * + * \param bBitCount + * Bitcount of the new signal. + * + * \param enByteOrder + * Byteorder for the signal (intel or motorola). + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_NOT_POSSIBLE Operation currently not possible. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enAddNewSignal.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enAddNewSignal(CAND_tHandle hMsg, const char* pcSigName, + BYTE bStartBit, BYTE bBitCount, CAND_enByteOrder enByteOrder); + +/*! + * \ingroup signal_functions + * + * \brief + * Queries a signal from the database using the message handle. + * + * \param hMsg + * Handle to the message that owns the signal. + * + * \param pcSigName + * Points to a null terminated string containing the name of the signal. + * + * \return + * If the function succeeds, the return value is the handle to the signal + * with the specified name. If the signal does not exist in the + * database or the function fails the return value is a NULL handle. You + * must check the return value with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hGetSignalByName.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetSignalByName(CAND_tHandle hMsg, + const char* pcSigName); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to retrieve the first signal of a message. + * + * \param hMessage + * Specifies a handle to a message. + * + * \return + * If the function succeeds, the return value is the handle to the first + * signal beneath the given object. If the signal does not exist in the + * database or the function fails the return value is a NULL handle. You + * must check the return value with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hGetFirstSig.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetFirstSig(CAND_tHandle hMessage); + +/*! + * \ingroup signal_functions + * + * \brief + * Retrieves the next signal of a message. + * + * \param hSig + * Specifies a handle to a signal. + * + * \return + * If the function succeeds, the return value is the handle to the next + * signal after the given object. If the signal does not exist in the + * database or the function fails the return value is a NULL handle. You + * must check the return value with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hGetNextSig.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetNextSig(CAND_tHandle hSig); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to retrieve the signal value using its handle. You will + * receive a byte stream with the data, as if it has been sent on the bus. + * + * \param hSig + * Specifies the handle of a signal. + * + * \param pbData + * Points to a buffer that receives the data of the signal. This pointer must + * not be NULL. + * + * \param ulLength + * Specifies the number of bytes to be read. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetSigData.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetSigData(CAND_tHandle hSig, void* pbData, unsigned long ulLength); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to set the data bytes of a signal. + * + * \param hSig + * Specifies the handle to a signal. + * + * \param pbData + * Specifies the new byte value. + * + * \param iLength + * Specifies the number of bytes to be written. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetSigData.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetSigData(CAND_tHandle hSig, const BYTE* pbData, int iLength); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to set the unscaled value of a signal. + * + * \param hSig + * Specifies the handle to a signal. + * + * \param qwData + * Specifies the new unscaled value. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetSigDataHex.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetSigDataHex(CAND_tHandle hSig, QWORD qwData); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to retrieve the signal value by its handle. The result is the + * scaled (physical) value of the signal. + * + * \param hSig + * Specifies the handle to a signal. + * + * \param pdbValue + * Points to a buffer that receives the scaled (physical) value of the signal. This + * pointer must not be NULL. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetSigDataPhys.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetSigDataPhys(CAND_tHandle hSig, double* pdbValue); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to set the (physically) scaled value of a signal. + * + * \param hSig + * Specifies the handle to a signal. + * + * \param dbValue + * Specifies the new scaled (physical) value of the signal. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_NOT_POSSIBLE Operation is currently not possible + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetSigDataPhys.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetSigDataPhys(CAND_tHandle hSig, double dbValue); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to retrieve the minimum value of a signal by its + * handle. The result ist the (physically) scaled value of the minimum. + * + * \param hSig + * Specifies the handle to a signal. + * + * \param pdbValue + * Points to a buffer that receives the scaled (physical) value of the signal-minimum. + * This pointer must not be NULL. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetSigMin.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetSigMin(CAND_tHandle hSig, double* pdbValue); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to set the minimum value of a signal by its handle. + * + * \param hSig + * Specifies the handle to a signal. + * + * \param dbValue + * The scaled (physical) value of the signal-minimum. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_NOT_POSSIBLE Database is currently not editable + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetSigMin.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetSigMin(CAND_tHandle hSig, double dbValue); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to set the signal length of a signal by its handle. + * + * \param hSig + * Specifies the handle to a signal. + * + * \param u32Value + * The new length of the signal. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_NOT_POSSIBLE Database is currently not editable + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetSigBitLen.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetSigBitLen(CAND_tHandle hSig, unsigned int u32Value); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to set the signal display type using its handle. + * + * \param hSig + * Specifies the handle to a signal. + * + * \param enSigType + * The new signal type. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_NOT_POSSIBLE Database is currently not editable + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetSigDisplayType.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetSigDisplayType(CAND_tHandle hSig, CAND_tenSigType enSigType); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to retrieve the maximum value of a signal handle. The result + * is the (physically) scaled value of the maximum. + * + * \param hSig + * Specifies the handle to a signal. + * + * \param pdbValue + * Points to a buffer that receives the scaled (physical) value of the + * signal maximum. This pointer must not be NULL. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetSigMax.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetSigMax(CAND_tHandle hSig, double* pdbValue); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to set the maximum value of a signal by its handle. + * + * \param hSig + * Specifies the handle to a signal. + * + * \param dbValue + * The scaled (physical) value of the signal-maximum. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_NOT_POSSIBLE Database is currently not editable + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetSigMax.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetSigMax(CAND_tHandle hSig, double dbValue); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to retrieve the offset value of a signal by its + * handle. The result is the physical value. + * + * \param hSig + * Specifies the handle to a signal. + * + * \param pdbValue + * Points to a buffer that receives the scaled (physical) value of the signal-offset. This + * pointer must not be NULL. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetSigOffset.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetSigOffset(CAND_tHandle hSig, double* pdbValue); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to set the offset value of a signal by its handle. + * + * \param hSig + * Specifies the handle to a signal. + * + * \param dbValue + * The scaled (physical) value of the signal-offset. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_NOT_POSSIBLE Database is currently not editable + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetSigOffset.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetSigOffset(CAND_tHandle hSig, double dbValue); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to retrieve the factor of a signal by its handle. The + * result is the physical value. + * + * \param hSig + * Specifies the handle to a signal. + * + * \param pdbValue + * Points to a buffer that receives the scaled (physical) value of the signal-factor. This + * pointer must not be NULL. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetSigFactor.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetSigFactor(CAND_tHandle hSig, double* pdbValue); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to set the factor of a signal using its handle. + * + * \param hSig + * Specifies the handle to a signal. + * + * \param dbValue + * The scaled (physical) value of the signal-factor. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_NOT_POSSIBLE Database is currently not editable + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetSigFactor.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetSigFactor(CAND_tHandle hSig, double dbValue); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to retrieve the value from the value table of a signal. + * + * \param hSig + * Specifies the handle to a signal. + * + * \param uiIndex + * Specifies the index of the state. + * + * \param pdwStateVal + * Points to a buffer that receives the value of the state. This pointer must not be NULL. + * + * \param pcEntryBuf + * Points to a buffer that receives description of the signal-state. This pointer + * must not be NULL. A terminating NULL-character will be automatically appended. + * + * \param dwBufLen + * Specifies the maximum number of characters to copy to the buffer, including the + * NULL character. If the text exceeds this limit, it is truncated. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK Function succeeded + * + * \ex CAND_enGetSigEntry.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetSigEntry(CAND_tHandle hSig, + unsigned int uiIndex, + unsigned long* pdwStateVal, + char* pcEntryBuf, + unsigned long dwBufLen); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to retrieve the number of signal entries from the + * value table of a signal. + * + * \param hSig + * Specifies the handle to a signal. + * + * \param pdwEntryCount + * Specifies the number of signalentrys. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetSigEntryCount.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetSigEntryCount(CAND_tHandle hSig, + unsigned long *pdwEntryCount); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to set the value of a signal to default. + * + * \param hObject + * Specifies a handle to a bus, ecu, message or signal. If the handle is from a bus + * all signals in the bus will be set to their default values. if the handle is from an + * ecu all signals of the ecu will be set to their default values etc. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetSigToDef.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetSigToDef(CAND_tHandle hObject); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to retrieve the physical value of a signal. + * + * \param hSig + * Specifies the handle of signal. + * + * \param pData + * Points to a buffer that specifies the data byte of the message which contains the signal. + * This pointer must not be NULL. + * + * \param pValue + * Points to a buffer that receives the signal value of the signal. This pointer must + * not be NULL. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetPhysValueByMsgData.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetPhysValueByMsgData(CAND_tHandle hSig, + const unsigned char* pData, + double* pValue); +// TODO BTP #4363 +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetMsgDataByPhysVal(CAND_tHandle hSig, + unsigned char* pData, + double value); + +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetHexValueByMsgData(CAND_tHandle hSig, + const unsigned char* pData, + QWORD* pu64Value); + + +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetMsgDataByHexValue(CAND_tHandle hSig, + unsigned char* pData, + QWORD u64Value); + +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetDisplayChannel(CAND_tHandle hBus, BYTE* pu8Channel); + +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetDisplayChannel(CAND_tHandle hBus, BYTE u8Channel); + + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to get a copy of the message data containing the certain signal with + * the provided physical value. This function will not change the message data in the CanEasy + * database. + * + * \param hSig + * Specifies the handle of signal. + * + * \param pData + * Points to a buffer that specifies the data byte of the message which receive the signal value. + * This pointer must not be NULL. + * + * \param dValue + * Signal value to be set into message data. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetMsgDataByPhysValue.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetMsgDataByPhysValue(CAND_tHandle hSig, + unsigned char* pData, double dValue); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to retrieve the length of a signal in bits. + * + * \param hSig + * Specifies the handle of signal. + * + * \param pValue + * Points to a buffer that receives the bit length of the signal. This pointer + * must not be NULL. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetSigBitLen.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetSigBitLen(CAND_tHandle hSig, + short* pValue); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to retrieve the start bit of a signal. + * + * \param hSig + * Specifies the handle of signal. + * + * \param pValue + * Points to a buffer that receives the start bit of the signal. This pointer + * must not be NULL. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetSigStartBit.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetSigStartBit(CAND_tHandle hSig, short* pValue); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to get the bit order of a signal. + * + * \param hSig + * Specifies the handle of signal. + * + * \param penOrder + * Points to the buffer that reveives the bit order of the signal. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetSigByteOrder.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetSigByteOrder(CAND_tHandle hSig, CAND_enByteOrder* penOrder); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to retrieve a textual description of an Object. + * + * \param hObj + * Specifies the handle to an object. + * + * \param pcBuffer + * Points to the buffer that receives the description of the object. + * This pointer must not be NULL. + * + * \param iBuffSize + * Size of the reserved memory for pcBuffer. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enGetDescription.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetDescription(CAND_tHandle hObj, char* pcBuffer, int iBuffSize); + +/*! + * \ingroup signal_functions + * + * \brief + * Call this function to set the textual description of an object. + * + * \param hSig + * Specifies the handle of an signal. + * + * \param szText + * The new text to set. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_NOT_POSSIBLE Database is currently not editable. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enSetDescription.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetDescription(CAND_tHandle hSig, const char* szText); + +/*! + * \ingroup signal_functions + * + * \brief + * Retrieves the first receiving ECU of this signal. + * + * \param hSig + * Specifies a handle to a signal. + * + * \return + * If the function succeeds, the return value is the handle to the first + * control unit that receives this signal. If the ECU does not exist in the + * database or the function fails the return value is a NULL handle. You + * must check the return value with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hGetFirstReceiver.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetFirstReceiver(CAND_tHandle hSig); + +/*! + * \ingroup signal_functions + * + * \brief + * Retrieves the next receiving ECU of this signal. + * + * \param hSig + * Specifies a handle to a signal. + * + * \param hEcu + * Specifies a handle to the current receiver ECU. + * + * \return + * If the function succeeds, the return value is the handle to the next + * control unit that receives this signal. If the ECU does not exist in the + * database or the function fails the return value is a NULL handle. You + * must check the return value with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hGetNextReceiver.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetNextReceiver(CAND_tHandle hSig, CAND_tHandle hEcu); + +/*! + * \ingroup signal_functions + * + * \brief + * Adds a control unit to the list of the receiving control units that receive this signal. + * + * \param hSig + * Specifies a handle to a signal. + * + * \param hEcu + * Specifies a handle to the current receiver ECU. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_NOT_POSSIBLE Database is currently not editable + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enAddReceiver.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enAddReceiver(CAND_tHandle hSig, CAND_tHandle hEcu); + +/*! + * \ingroup signal_functions + * + * \brief + * Removes an ECU from the receiving control unit list of this signal. + * + * \param hSig + * Specifies a handle to a signal. + * + * \param hEcu + * Specifies a handle to the current receiver control unit. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_NOT_POSSIBLE Database is currently not editable. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enRemoveReceiver.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enRemoveReceiver(CAND_tHandle hSig, CAND_tHandle hEcu); + +/*! + * \ingroup callback_functions + * + * \brief + * Call this function to register a callback-function that is called + * on timer-events, database-event or on errors. + * + * \param fpvFuncPtr + * Specifies the function-pointer to the callback-function. This pointer + * must not be NULL. + * + * \param enType + * Specifies the type of the callback. + * + * \param dwParam1 + * Multi-used parameter, depends on enType. + * + * \param dwParam2 + * Multi-used parameter, depends on enType. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \remarks + * Be careful when using ::CAND_enPreTransmitFree. Sending the same message + * in this callback may cause an endless program loop (i.e. a stack overflow + * occurs). + * + * \ex CAND_enRegisterCallback.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enRegisterCallback(void* fpvFuncPtr, + CAND_tenCallbackType enType, + unsigned long dwParam1, + unsigned long dwParam2); + +/*! + * \ingroup callback_functions + * + * \brief + * Call this function to remove a registered timer, database or an + * error callback which has been previously registered with the function ::CAND_enRegisterCallback. + * + * \param fpvFuncPtr + * Specifies the function-pointer to the callback-function. + * + * \param enType + * Specifies the type of the callback. + * + * \param dwParam1 + * Multi-used parameter, depends on enType. + * + * \param dwParam2 + * Multi-used parameter, depends on enType. + * + * \retval - ::CAND_nERR_INVALID_HANDLE Invalid handle. + * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter + * \retval - ::CAND_nERR_OK The Function succeeded. + * + * \ex CAND_enUnRegisterCallback.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enUnRegisterCallback(void* fpvFuncPtr, + CAND_tenCallbackType enType, + unsigned long dwParam1, + unsigned long dwParam2); + +/*! + * \ingroup callback_functions + * + * \brief + * Call this function to register a callback for CAN bus state changes. + * + * \param fpCallback + * Specifies the callback function-pointer. + * + * \param pUserParam + * This pointer will be passed as callback-parameter. + * + * \retval - ::CAND_nERR_NOT_POSSIBLE Callback allready exists. + * \retval - ::CAND_nERR_OK The Function suceeded. + * + * \ex CAND_enRegisterCanBusStateCallback.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enRegisterCanBusStateCallback(CAND_tCanBusState fpCallback, void* pUserParam); + +/*! + * \ingroup callback_functions + * + * \brief + * Call this function to remove a registered callback for CAN bus state changes. + * + * \param fpCallback + * Specifies the callback function-pointer. + * + * \param pUserParam + * User-Parameter passed on callback registration. + * + * \retval - ::CAND_nERR_NO_MATCH Callback not found. + * \retval - ::CAND_nERR_OK The Function suceeded. + * + * \ex CAND_enUnRegisterCanBusStateCallback.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enUnRegisterCanBusStateCallback(CAND_tCanBusState fpCallback, void* pUserParam); + +/*! + * \ingroup callback_functions + * + * \brief + * Call this function to register a callback for CAN bus error-frames. + * + * \param fpCallback + * Specifies the callback function-pointer. + * + * \param pUserParam + * This pointer will be passed as callback-parameter. + * + * \retval - ::CAND_nERR_NOT_POSSIBLE Callback allready exists. + * \retval - ::CAND_nERR_OK The Function suceeded. + * + * \ex CAND_enRegisterCanBusErrorCallback.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enRegisterCanBusErrorCallback(CAND_tCanBusError fpCallback, void* pUserParam); + +/*! + * \ingroup callback_functions + * + * \brief + * Call this function to remove a registered callback for CAN bus error-frames. + * + * \param fpCallback + * Specifies the callback function-pointer. + * + * \param pUserParam + * User-Parameter passed on callback registration. + * + * \retval - ::CAND_nERR_NO_MATCH Callback not found. + * \retval - ::CAND_nERR_OK The Function suceeded. + * + * \ex CAND_enUnRegisterCanBusErrorCCallback.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enUnRegisterCanBusErrorCallback(CAND_tCanBusError fpCallback, void* pUserParam); + +/*! + * \ingroup callback_functions + * + * \brief + * Call this function to register a callback for LIN bus state changes. + * + * \param fpCallback + * Specifies the callback function-pointer. + * + * \param pUserParam + * This pointer will be passed as callback-parameter. + * + * \retval - ::CAND_nERR_NOT_POSSIBLE Callback allready exists. + * \retval - ::CAND_nERR_OK The Function suceeded. + * + * \ex CAND_enRegisterLinBusStateCallback.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enRegisterLinBusStateCallback(CAND_tLinBusState fpCallback, void* pUserParam); + +/*! + * \ingroup callback_functions + * + * \brief + * Call this function to remove a registered callback for LIN bus state changes. + * + * \param fpCallback + * Specifies the callback function-pointer. + * + * \param pUserParam + * User-Parameter passed on callback registration. + * + * \retval - ::CAND_nERR_NO_MATCH Callback not found. + * \retval - ::CAND_nERR_OK The Function suceeded. + * + * \ex CAND_enUnRegisterLinBusStateCallback.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enUnRegisterLinBusStateCallback(CAND_tLinBusState fpCallback, void* pUserParam); + +/*! + * \ingroup callback_functions + * + * \brief + * Call this function to register a callback for LIN bus errors. + * + * \param fpCallback + * Specifies the callback function-pointer. + * + * \param pUserParam + * This pointer will be passed as callback-parameter. + * + * \retval - ::CAND_nERR_NOT_POSSIBLE Callback allready exists. + * \retval - ::CAND_nERR_OK The Function suceeded. + * + * \ex CAND_enRegisterLinBusStateCallback.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enRegisterLinBusErrorCallback(CAND_tLinBusError fpCallback, void* pUserParam); + +/*! + * \ingroup callback_functions + * + * \brief + * Call this function to remove a registered callback for LIN bus errors. + * + * \param fpCallback + * Specifies the callback function-pointer. + * + * \param pUserParam + * User-Parameter passed on callback registration. + * + * \retval - ::CAND_nERR_NO_MATCH Callback not found. + * \retval - ::CAND_nERR_OK The Function suceeded. + * + * \ex CAND_enUnRegisterLinBusStateCallback.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enUnRegisterLinBusErrorCallback(CAND_tLinBusError fpCallback, void* pUserParam); + +/*! + * \ingroup callback_functions + * + * \brief + * Call this function to register a PreTransmit callback which + * will be called before a message is sent. + * + * \param pFunc + * Specifies the function-pointer to the callback-function. + * + * \param enPos + * Specifies the position the callback is called. + * + * \param hItem + * Handle to the database item where the callback is registered. + * + * \param sFilter + * Filter string, e.g. "can(0) id(0-f0)". + * + * \param sId + * Unique name for the callback. + * + * \param pUserParam + * User defined pointer. + * + * \retval - ::CAND_nERR_INVALID_HANDLE Invalid handle. + * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter + * \retval - ::CAND_nERR_OK The Function succeeded. + * + * \ex CAND_enRegisterPreTransmitCallback.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enRegisterPreTransmitCallback(CAND_tPreTansmit pFunc, + CAND_tenCallbackPos enPos, + CAND_tHandle hItem, + const char* sFilter, + const char* sId, + void* pUserParam); + +/*! + * \ingroup callback_functions + * + * \brief + * Call this function to remove a PreTransmit callback + * which has been previously registered with ::CAND_enRegisterPreTransmitCallback. + * + * \param pFunc + * Specifies the function-pointer to the callback-function. + * + * \param hItem + * Handle to the database item where the callback is registered. + * + * \param sFilter + * Filter string, e.g. "can(0) id(0-f0)". + * + * \param sId + * Unique name for the callback. + * + * \param pUserParam + * User defined pointer. + * + * \retval - ::CAND_nERR_INVALID_HANDLE Invalid handle. + * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter + * \retval - ::CAND_nERR_OK The Function succeeded. + * + * \ex CAND_enUnRegisterPreTransmitCallback.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enUnRegisterPreTransmitCallback(CAND_tPreTansmit pFunc, + CAND_tHandle hItem, + const char* sFilter, + const char* sId, + void* pUserParam); + +/*! + * \ingroup callback_functions + * + * \brief + * Call this function to register a PreCopy callback which + * will be called before the data of a received message is copied into database. + * + * \param pFunc + * Specifies the function-pointer to the callback-function. + * + * \param enPos + * Specifies the position the callback is called. + * + * \param hItem + * Handle to the database item where the callback is registered. + * + * \param sFilter + * Filter string, e.g. "can(0) id(0-f0)". + * + * \param sId + * Unique name for the callback. + * + * \param pUserParam + * User defined pointer. + * + * \retval - ::CAND_nERR_INVALID_HANDLE Invalid handle. + * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter + * \retval - ::CAND_nERR_OK The Function succeeded. + * + * \ex CAND_enRegisterPreCopyCallback.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enRegisterPreCopyCallback(CAND_tPreCopy pFunc, + CAND_tenCallbackPos enPos, + CAND_tHandle hItem, + const char* sFilter, + const char* sId, + void* pUserParam); + +/*! + * \ingroup callback_functions + * + * \brief + * Call this function to remove a PreCopy callback + * which was previously registered with ::CAND_enRegisterPreCopyCallback. + * + * \param pFunc + * Specifies the function-pointer to the callback-function. + * + * \param hItem + * Handle to the database item where the callback is registered. + * + * \param sFilter + * Filter string, e.g. "can(0) id(0-f0)". + * + * \param sId + * Unique name for the callback. + * + * \param pUserParam + * User defined pointer. + * + * \retval - ::CAND_nERR_INVALID_HANDLE Invalid handle. + * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter + * \retval - ::CAND_nERR_OK The Function succeeded. + * + * \ex CAND_enUnRegisterPreCopyCallback.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enUnRegisterPreCopyCallback(CAND_tPreCopy pFunc, + CAND_tHandle hItem, + const char* sFilter, + const char* sId, + void* pUserParam); + +/*! + * \ingroup callback_functions + * + * \brief + * Call this function to register a TxConfirm callback which + * will be called after a message was successfully transmitted. + * + * \param pFunc + * Specifies the function-pointer to the callback-function. + * + * \param enPos + * Specifies the position the callback is called. + * + * \param hItem + * Handle to the database item where the callback is registered. + * + * \param sFilter + * Filter string, e.g. "can(0) id(0-f0)". + * + * \param sId + * Unique name for the callback. + * + * \param pUserParam + * User defined pointer. + * + * \retval - ::CAND_nERR_INVALID_HANDLE Invalid handle. + * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter + * \retval - ::CAND_nERR_OK The Function succeeded. + * + * \ex CAND_enRegisterTxConfirmCallback.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enRegisterTxConfirmCallback(CAND_tTxConfirm pFunc, + CAND_tenCallbackPos enPos, + CAND_tHandle hItem, + const char* sFilter, + const char* sId, + void* pUserParam); + +/*! + * \ingroup callback_functions + * + * \brief + * Call this function to remove a TxConfirm callback + * which was previously registered with ::CAND_enRegisterTxConfirmCallback. + * + * \param pFunc + * Specifies the function-pointer to the callback-function. + * + * \param hItem + * Handle to the database item where the callback is registered. + * + * \param sFilter + * Filter string, e.g. "can(0) id(0-f0)". + * + * \param sId + * Unique name for the callback. + * + * \param pUserParam + * User defined pointer. + * + * \retval - ::CAND_nERR_INVALID_HANDLE Invalid handle. + * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter + * \retval - ::CAND_nERR_OK The Function succeeded. + * + * \ex CAND_enUnRegisterTxConfirmCallback.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enUnRegisterTxConfirmCallback(CAND_tTxConfirm pFunc, + CAND_tHandle hItem, + const char* sFilter, + const char* sId, + void* pUserParam); + +/*! + * \ingroup callback_functions + * + * \brief + * Call this function to register a RxConfirm callback which + * will be called when a message was received. + * + * \param pFunc + * Specifies the function-pointer to the callback-function. + * + * \param enPos + * Specifies the position the callback is called. + * + * \param hItem + * Handle to the database item where the callback is registered. + * + * \param sFilter + * Filter string, e.g. "can(0) id(0-f0)". + * + * \param sId + * Unique name for the callback. + * + * \param pUserParam + * User defined pointer. + * + * \retval - ::CAND_nERR_INVALID_HANDLE Invalid handle. + * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter + * \retval - ::CAND_nERR_OK The Function succeeded. + * + * \ex CAND_enRegisterRxConfirmCallback.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enRegisterRxConfirmCallback(CAND_tRxConfirm pFunc, + CAND_tenCallbackPos enPos, + CAND_tHandle hItem, + const char* sFilter, + const char* sId, + void* pUserParam); + +/*! + * \ingroup callback_functions + * + * \brief + * Call this function to remove a RxConfirm callback + * which was previously registered with ::CAND_enRegisterRxConfirmCallback. + * + * \param pFunc + * Specifies the function-pointer to the callback-function. + * + * \param hItem + * Handle to the database item where the callback is registered. + * + * \param sFilter + * Filter string, e.g. "can(0) id(0-f0)". + * + * \param sId + * Unique name for the callback. + * + * \param pUserParam + * User defined pointer. + * + * \retval - ::CAND_nERR_INVALID_HANDLE Invalid handle. + * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter + * \retval - ::CAND_nERR_OK The Function succeeded. + * + * \ex CAND_enUnRegisterRxConfirmCallback.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enUnRegisterRxConfirmCallback(CAND_tRxConfirm pFunc, + CAND_tHandle hItem, + const char* sFilter, + const char* sId, + void* pUserParam); + +/*! + * \ingroup callback_functions + * + * \brief + * Call this function to notify a shortcut. + * + * \param wKey + * Specifies the virtual key code + * + * \param nModifier + * Specifies ALT, SHIFT or CTRL key. + * + * \retval - ::CAND_nFALSE Key combination not found. + * \retval - ::CAND_nTRUE Key combination sucessfully signaled. + * + * \ex CAND_enNotifyShortcut.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enNotifyShortcut(WORD wKey, CAND_enKeyModifier nModifier); + + +/*! + * \ingroup callback_functions + * + * \brief + * Call this function to check whether a shortcut is already registered + * + * \param wKey Specifies the virtual key code + * \param nModifier Specifies ALT, SHIFT or CTRL key + * + * \retval - ::CAND_nFALSE Key combination is available for registration + * \retval - ::CAND_nTRUE Key combination is already registered + * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter + * + * \ex CAND_enShortcutRegistered.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enShortcutRegistered(WORD wKey, CAND_enKeyModifier nModifier); + +/*! + * \ingroup callback_functions + * + * \brief + * Call this function to register a shortcut callback. + * + * \param wKey + * Specifies the virtual key code. + * + * \param dwModifier + * Specifies modifier keys. Use elements of CAND_enKeyModifier. + * Multiple modifiers can be combined using the binary OR operator. + * + * \param fpShortcut + * Specifies the function to be called. + * + * \param dwUserData + * User defined data. + * + * \param enScope + * Scope of the shortcut. + * CAND_nSystemScope: system wide + * CAND_nAppScope: application scope (active windows) + * + * \retval - ::CAND_nFALSE Key combination allready used. + * \retval - ::CAND_nTRUE Callback was registered successfully. + * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter. + * + * \remark + * Note that you cannot use this function to register keys which are already + * registered. + * + * \ex CAND_enRegisterShortcut.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL +CAND_enRegisterShortcut(WORD wKey, DWORD dwModifier, CAND_tShortCutCb fpShortcut, DWORD dwUserData, CAND_tenShortCutScope enScope); + +/*! + * \ingroup callback_functions + * + * \brief + * Call this function to remove a registered shortcut callback. + * + * \param wKey + * Specifies the virtual key code. + * + * \param dwModifier + * Specifies Alt, Ctrl or both keys. + * + * \retval - ::CAND_nFALSE Key combination not found + * \retval - ::CAND_nTRUE Callback was removed succesfully + * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter + * + * \ex CAND_enUnRegisterShortcut.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enUnRegisterShortcut(WORD wKey, DWORD dwModifier); + +/*! + * \ingroup callback_functions + * + * \brief + * Disable or enable all database callbacks. + * + * \param bAllow + * Specifies if the callbacks should be enabled or disabled. + * + * \ex CAND_vAllowDBCallbacks.cpp + */ +CANDLL_API void CANDLL_CALL CAND_vAllowDBCallbacks(BOOL bAllow); + +/*! + * \ingroup record_functions + * + * \brief + * Call this function to create a marker. The marker will be recorded, so you + * can mark any point within the simulation. + * + * \ex CAND_vCreateMarker.cpp + */ +CANDLL_API void CANDLL_CALL CAND_vCreateMarker(void); + +/*! + * \ingroup record_functions + * + * \brief + * Call this function to get the number of created markers in the current record. + * + * \ex CAND_uiGetMarkerCount.cpp + */ +CANDLL_API unsigned int CANDLL_CALL CAND_uiGetMarkerCount(void); + +/*! + * \ingroup record_functions + * + * \brief + * Creates a filter that pass all messages. + * + * \remarks + * This filter will allow all messages. You have to call ::CAND_vDestroyFilter + * when you no longer need this filter. + * + * \return + * If the function succeeds, the return value is the handle to the new + * created filter. If the function fails the return value is a NULL handle. You + * must check the return value with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hCreateFilterAll.cpp + */ +CANDLL_API CAND_tFilterHandle CANDLL_CALL CAND_hCreateAllFilter(); + +/*! + * \ingroup record_functions + * + * \brief + * Creates a filter. This filter lets only pass the message specified by dwMessageID. + * + * \param hBus + * Specifies a handle to the bus to which the filter will be applied. + * + * \param dwMessageID + * ID of the message that will pass the filter. + * + * \remarks + * This filter will only allow the single specified message. You have to call ::CAND_vDestroyFilter + * when you no longer need this filter. + * + * \return + * If the function succeeds, the return value is the handle to the new + * created filter. If the function fails the return value is a NULL handle. You + * must check the return value with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hCreateMsgFilter.cpp + */ +CANDLL_API CAND_tFilterHandle CANDLL_CALL CAND_hCreateMsgFilter(CAND_tHandle hBus, DWORD dwMessageID); + +/*! + * \ingroup record_functions + * + * \brief + * Creates a filter. This filter lets only pass the specific message. + * + * \param hMessage + * Specifies a handle to the message that will be allowed. + * + * \remarks + * This filter will only allow this message.You have to call ::CAND_vDestroyFilter + * when you no longer need this filter. + * + * \return + * If the function succeeds, the return value is the handle to the new + * created filter. If the function fails the return value is a NULL handle. You + * must check the return value with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hCreateMsgFilterByH.cpp + */ +CANDLL_API CAND_tFilterHandle CANDLL_CALL CAND_hCreateMsgFilterByH(CAND_tHandle hMessage); + +/*! + * \ingroup record_functions + * + * \brief + * Creates a filter. This filter type allows the user to decide if + * the message should be skipped. + * + * \param pfnCallback + * Pointer to callback function + * + * \param dwUserData + * User defined data. This value will be passed to the callback function. + * + * \remark + * Note that a filter callback is not necessarily called in ascending + * order for messages; you should not rely on this function being called + * in any specific order. + * + * \return + * If the function succeeds, the return value is the handle to the new + * created filter. If the function fails the return value is a NULL handle. You + * must check the return value with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hCreateCallbackFilter.cpp + */ +CANDLL_API CAND_tFilterHandle CANDLL_CALL CAND_hCreateCallbackFilter(CAND_tFilterCallback pfnCallback, DWORD dwUserData); + +/*! + * \ingroup record_functions + * + * \brief + * Creates a filter using database handle. + * + * \param hObject + * Handle to a message for which the filter will be generated. + * + * \return + * If the function succeeds, the return value is the handle to the new + * created filter. If the function fails the return value is a NULL handle. You + * must check the return value with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hCreateItemRecordFilter.cpp + */ +CANDLL_API CAND_tFilterHandle CANDLL_CALL CAND_hCreateItemRecordFilter(CAND_tHandle hObject); + +/*! + * \ingroup record_functions + * + * \brief + * Creates a filter using record type. + * + * \param enType + * Type of record-entry for which the filter will be generated. + * + * \return + * If the function succeeds, the return value is the handle to the new + * created filter. If the function fails the return value is a NULL handle. You + * must check the return value with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hCreateRecordFilter.cpp + */ +CANDLL_API CAND_tFilterHandle CANDLL_CALL CAND_hCreateRecordFilter(CAND_tenRecordEntryType enType); + +/*! + * \ingroup record_functions + * + * \brief + * Creates a filter for strings. + * + * \param sFilter + * String (e.g. "c(0) id(0-5)") for which the filter will be generated. + * + * \return + * If the function succeeds, the return value is the handle to the new + * created filter. If the function fails the return value is a NULL handle. You + * must check the return value with ::CAND_enIsNullHandle. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hCreateStrRecordFilter.cpp + */ +CANDLL_API CAND_tFilterHandle CANDLL_CALL CAND_hCreateStrRecordFilter(const char* sFilter); + +/*! + * \ingroup record_functions + * + * \brief + * Creates a filter which will only let pass the messages that + * match both filters. + * + * \param hFirst + * The first sub-filter + * + * \param hSecond + * The second sub-filter. If hFirst already determined that a message should be skipped, + * the second filter will never be called. + * + * \return + * If the function succeeds, the return value is the handle to the new + * created filter. If the function fails the return value is a NULL handle. You + * must check the return value with ::CAND_enIsNullHandle. + * + * \remark + * Returns a handle to the newly created filter or null handle if an error occurs. + * You have to call ::CAND_vDestroyFilter when you no longer need this filter. + * + * \ex CAND_hCreateAndFilter.cpp + */ +CANDLL_API CAND_tFilterHandle CANDLL_CALL CAND_hCreateAndFilter(CAND_tFilterHandle hFirst, CAND_tFilterHandle hSecond); + +/*! + * \ingroup record_functions + * + * \brief + * Creates a new filter based on both given filters. The new filter will let pass a message, if one or both + * given filters would allow it. The two filters are or'ed together to a new filter. + * + * \param hFirst + * The first sub-filter + * + * \param hSecond + * The second sub-filter. If hFirst already determined that a message should + * not be skipped, the second filter will never be called. + * + * \return + * If the function succeeds, the return value is the handle to the new + * created filter. If the function fails the return value is a NULL handle. You + * must check the return value with ::CAND_enIsNullHandle. + * + * \remark You have to call ::CAND_vDestroyFilter when you no longer need this + * filter. + * + * \ex CAND_hCreateOrFilter.cpp + */ +CANDLL_API CAND_tFilterHandle CANDLL_CALL CAND_hCreateOrFilter(CAND_tFilterHandle hFirst, CAND_tFilterHandle hSecond); + +/*! + * \ingroup record_functions + * + * \brief + * Create an inverted filter to the provided one. + * + * \param hFilter + * The filter which should be inverted. + * + * \return + * If the function succeeds, the return value is the handle to the new + * created filter. If the function fails the return value is a NULL handle. You + * must check the return value with ::CAND_enIsNullHandle. + * + * \remarks + * Returns a handle to the newly created filter or a null handle if an error + * occurs. You have to call ::CAND_vDestroyFilter when you no longer need + * this filter. If hFilter allows a message, then the newly created filter will + * skip a message, and vice versa. + * + * \ex CAND_hCreateInvFilter.cpp + */ +CANDLL_API CAND_tFilterHandle CANDLL_CALL CAND_hCreateInvFilter(CAND_tFilterHandle hFilter); + +/*! + * \ingroup record_functions + * + * \brief + * Call this function to destroy a filter you do not need any longer. + * + * \param hFilter + * Handle to the filter that is to be deleted. + * + * \remark + * Generally speaking, filters are valid from the time they were created + * until they are destroyed by a call to ::CAND_vDestroyFilter. However, if + * a filter is part of another filter (e.g. its handle has been used in a + * call to ::CAND_hCreateAndFilter and that filter has not been destroyed + * yet), the handle remains valid until its "parent filter" is destroyed. + * + * \ex CAND_vDestroyFilter.cpp + */ +CANDLL_API void CANDLL_CALL CAND_vDestroyFilter(CAND_tFilterHandle hFilter); + +/*! + * \ingroup record_functions + * + * \brief + * Creates an iterator that is used to iterate through a record. + * + * \return + * If the function succeeds, the return value is the handle to the new + * created iterator. If the function fails the return value is a NULL handle. You + * must check the return value with ::CAND_enIsNullHandle. + * + * \remarks + * Iterators are used to iterate through a record. You can think of + * iterators as a pointer in an array: You can dereference + * iterators or you can move them around. + * There are two special iterators: The "begin"-iterator and "end"-iterator. + * The begin-iterator points to the very first message while the end-iterator + * points to a message "past-the-end" (the latter iterator thus cannot be + * dereferenced). All iterators in the sequence [begin,end) can be + * dereferenced, and for example [begin,begin) is an empty sequence which doesn't + * contain any messages.\n + * Initially, all iterators point to the begining of a record (which may be + * the end of a record as well in case no messages have been recorded). + * All iterator handles are valid until a record is unloaded. In this case, + * a ::CAND_enRecordUnload callback will be generated. All iterators will be + * invalidated after this callback returns. While it is not strictly necessary + * to manually unregister iterator handles in this special case, it is good + * practice to destroy iterators when you no longer need them. + * You should delete iterators when you + * no longer need them to release occupied resources. + * + * \see + * CAND_vDestroyIterator | CAND_enRecordUnload | CAND_vDestroyIterator | CAND_boDereferenceIterator + * + * \ex CAND_hCreateIterator.cpp + */ +CANDLL_API CAND_tIteratorHandle CANDLL_CALL CAND_hCreateIterator(void); + +/*! + * \ingroup record_functions + * + * \brief + * This function clones an iterator. + * + * \param hIterator + * Specifies a handle to the iterator that will be cloned. + * + * \return + * If the function succeeds, the return value is the handle to the copied + * iterator. If the function fails the return value is a NULL handle. You + * must check the return value with ::CAND_enIsNullHandle. + * + * \remark + * You have to call ::CAND_vDestroyIterator when you no longer need this + * iterator. + * + * \ex CAND_hDuplicateIterator.cpp + */ +CANDLL_API CAND_tIteratorHandle CANDLL_CALL CAND_hDuplicateIterator(CAND_tIteratorHandle hIterator); + +/*! + * \ingroup record_functions + * + * \brief + * Call this function to create an iterator that points to a message + * that another iterator already points to. + * + * \param hDest + * Destination iterator + * + * \param hSource + * Source iterator + * + * \remark + * A call to this function is similar to destroying the destination + * iterator and cloning the source iterator. + * + * \ex CAND_vAssignIterator.cpp + */ +CANDLL_API void CANDLL_CALL CAND_vAssignIterator(CAND_tIteratorHandle hDest, CAND_tIteratorHandle hSource); + +/*! + * \ingroup record_functions + * + * \brief + * Call this function to destroy an iterator. + * + * \param hIterator + * The iterator that will be destroyed. + * + * \remark + * You should destroy an iterator when you no longer need it to free + * occupied resources. All iterators are automatically destroyed when + * a record is unloaded. + * + * \ex CAND_vDestroyIterator.cpp + */ +CANDLL_API void CANDLL_CALL CAND_vDestroyIterator(CAND_tIteratorHandle hIterator); + +/*! + * \ingroup record_functions + * + * \brief + * Call this function to dereference an iterator, i.e. get the message + * an iterator points to. + * + * \param hIterator + * The iterator that will be dereferenced + * + * \param pstRecordEntry + * Pointer to a data structure that receives the record data. + * This pointer must not be NULL. + * + * \retval - ::CAND_nTRUE on success + * \retval - ::CAND_nFALSE on error + * + * \ex CAND_boDereferenceIterator.cpp + */ +CANDLL_API BOOL CANDLL_CALL CAND_boDereferenceIterator(CAND_tIteratorHandle hIterator, CAND_tstRecordEntry* pstRecordEntry); + +/*! + * \ingroup record_functions + * + * \brief + * Compares two iterators in their order. + * + * \param hLeft + * The first comperand + * + * \param hRight + * The second comperand + * + * \retval - <0 if hLeft points to a message before hRight + * \retval - 0 if hLeft and hRight point to the same message + * \retval - >0 if hLeft points to a message after hRight + * + * \ex CAND_iCompareIterators.cpp + */ +CANDLL_API int CANDLL_CALL CAND_iCompareIterators(CAND_tIteratorHandle hLeft, CAND_tIteratorHandle hRight); + +/* + * \ingroup record_functions + * + * \brief + * Calculates the number of messages between two iterators. + * + * \param hLeft + * The first iterator + * + * \param hRight + * The second iterator + * + * \retval - + * Number of messages between hLeft and hRight, i.e. if hLeft and + * hRight were pointers to elements in an array, this function would return + * (hRight - hLeft) + * + * \ex CAND_qwIteratorDifference.cpp + */ +CANDLL_API __int64 CANDLL_CALL CAND_qwIteratorDifference(CAND_tIteratorHandle hLeft, CAND_tIteratorHandle hRight); + +/*! + * \ingroup record_functions + * + * \brief + * Call this function to move an iterator to the beginning of a record. + * + * \param hIterator + * The iterator that will be moved + * + * \ex CAND_vMoveIteratorToBegin.cpp + */ +CANDLL_API void CANDLL_CALL CAND_vMoveIteratorToBegin(CAND_tIteratorHandle hIterator); + +/*! + * \ingroup record_functions + * + * \brief + * Call this function to move an iterator to the end of a record. + * + * \param hIterator + * The iterator that will be moved. + * + * \ex CAND_vMoveIteratorToEnd.cpp + */ +CANDLL_API void CANDLL_CALL CAND_vMoveIteratorToEnd(CAND_tIteratorHandle hIterator); + +/*! + * \ingroup record_functions + * + * \brief + * Call this function to search for the next message. Start right after the current + * message. This function will search messages in ascending order within the + * range (hStart,hStop). + * + * \param hStart + * Pointer to the message where to start searching. Upon return, this + * iterator will point to the next message or to hStop if no message was found. + * + * \param hStop + * This iterator points past the last message, i.e. hStop points to the + * first message that will not be tested. This iterator must point to a + * message after hStart or else the function will fail. + * + * \param hFilter + * To return only certain messages, you can pass a filter here. If you pass + * NULL, no filter will be applied. + * + * \retval - ::CAND_nTRUE if a message has been found + * \retval - ::CAND_nFALSE otherwise + * + * \remark + * This function first increments the iterator by one and then applies + * the filter, i.e. the message at hStart will never be tested. + * + * \ex CAND_boNextMessage.cpp + */ +CANDLL_API BOOL CANDLL_CALL CAND_boNextMessage(CAND_tIteratorHandle hStart, CAND_tIteratorHandle hStop, CAND_tFilterHandle hFilter); + +/*! + * \ingroup record_functions + * + * \brief + * Call this function to search for the next message begining with the current message. This + * function will search messages in ascending order within the range (hStart,hStop). + * + * \param hStart + * Pointer to the message where to start with searching. By the returning, this iterator + * points to the next message or to hStop if no message was found. + * + * \param hStop + * This iterator points behind the last message, i.e. hStop points to the first + * message that will not be tested. This iterator must point to a message after + * hStart otherwise the function will fail. + * + * \param hFilter + * To return only selected messages, you can pass a filter here. If you pass NULL, + * no filter will be applied. + * + * \retval - ::CAND_nTRUE if a message has been found + * \retval - ::CAND_nFALSE otherwise + * + * \remark + * This function works similar to ::CAND_boNextMessage except it first + * tests the message pointed to by hStart and then increments it, i.e. the + * message at hStart is the first message that will be tested. + * + * \ex CAND_boFindNextMessage.cpp + */ +CANDLL_API BOOL CANDLL_CALL CAND_boFindNextMessage(CAND_tIteratorHandle hStart, CAND_tIteratorHandle hStop, CAND_tFilterHandle hFilter); + +/*! + * \ingroup record_functions + * + * \brief + * Call this function to search for the next message. This function will search + * messages in descending order within the range (hStop,hStart). + * + * \param hStart + * Pointer to the message where to start searching. After the returning, this iterator + * points to the next message or to hStop if no message has been found. + * + * \param hStop + * This iterator points behind the last message, i.e. hStop points to the first + * message that will not be tested. This iterator must point to a message + * before hStart otherwise the function will fail. + * + * \param hFilter To return only certain messages, you can pass a filter + * here. If you pass NULL, no filter will be applied. + * + * \retval - ::CAND_nTRUE if a message has been found + * \retval - ::CAND_nFALSE otherwise + * + * \remark + * This function decrements the iterator by one first and then applies + * the filter, i.e. the message at hStart will never be tested. + * + * \ex CAND_boPrevMessage.cpp + */ +CANDLL_API BOOL CANDLL_CALL CAND_boPrevMessage(CAND_tIteratorHandle hStart, CAND_tIteratorHandle hStop, CAND_tFilterHandle hFilter); + +/*! + * \ingroup record_functions + * + * \brief + * Call this function to search for the next message. This function + * will search messages in descending order in the range (hStop,hStart). + * + * + * \param hStart + * Pointer to the message where to start searching. After the returning, this + * iterator will point to the next message or to hStop if no message was found. + * + * \param hStop + * This iterator points behind the last message, i.e. hStop points to the first + * message that will not be tested. This iterator must point to a message before + * hStart otherwise the function will fail. + * + * \param hFilter + * To return only certain messages, you can pass a filter here. If you pass NULL, + * no filter will be applied. + * + * \retval - ::CAND_nTRUE if a message has been found + * \retval - ::CAND_nFALSE otherwise + * + * \remark + * This function works similar to ::CAND_boPrevMessage except it first tests the + * message pointed to by hStart and then decrements it, i.e. the message at hStart + * is the first message that will be tested. + * + * \ex CAND_boFindPrevMessage.cpp + */ +CANDLL_API BOOL CANDLL_CALL CAND_boFindPrevMessage(CAND_tIteratorHandle hStart, CAND_tIteratorHandle hStop, CAND_tFilterHandle hFilter); + +/*! + * \ingroup record_functions + * + * \brief + * This function will return the first message whose timestamp is not + * lesser than qwTimestamp. + * + * \param hStart + * Pointer to the message where to start searching. Upon return, this iterator + * will point to the next message or to hStop if no message was found. + * + * \param hStop + * This iterator points past the last message, i.e. hStop points to the first + * message that will not be tested. This iterator must point to a message after + * hStart or else the function will fail. + * + * \param qwTimestamp + * Specifies the timestamp to search for. + * + * \retval - ::CAND_nTRUE if a message has been found + * \retval - ::CAND_nFALSE otherwise + * + * \ex CAND_boFindMessageTimestamp.cpp + */ +CANDLL_API BOOL CANDLL_CALL CAND_boFindMessageTimestamp(CAND_tIteratorHandle hStart, CAND_tIteratorHandle hStop, QWORD qwTimestamp); + +/*! + * \ingroup record_functions + * + * \brief + * Finds the last occurence of a message before hStop. + * + * \param hStart + * Pointer to the message where to start searching. Upon return, this iterator will + * point to the message that was found or to hStop if no message has been found. + * + * \param hStop + * This iterator points past the last message that should be searched. Since + * ::CAND_boFindLastMessage searches in reverse order, hStop must point to a message + * before hStart. + * + * \param hMessage + * The message to search for. + * + * \param pstMessage + * If pstMessageData is not NULL and a message was found, then the message data will + * be copied into this structure. In certain situations this is faster than a + * call to ::CAND_boDereferenceIterator. If no message was found, this structure + * will not be modified. + * + * \retval - ::CAND_nTRUE if a message has been found + * \retval - ::CAND_nFALSE otherwise + * + * \remark + * Sometimes only the latest state of a message is important and a + * call to ::CAND_boPrevMessage can be expensive in some situations, for + * example you start searching at the end and the only message is at the + * beginning. ::CAND_boFindLastMessage searches in an internal cache and + * works well for large distances, whereas ::CAND_boPrevMessage checks + * every message between hStart and hStop, so it works better for short + * distances. + * + * \see + * CAND_boDereferenceIterator | CAND_boPrevMessage | CAND_boFindLastMessage + * + * \ex CAND_boFindLastMessageByH.cpp + */ +CANDLL_API BOOL CANDLL_CALL CAND_boFindLastMessageByH(CAND_tIteratorHandle hStart, CAND_tIteratorHandle hStop, CAND_tHandle hMessage, CAND_tstRecordEntry* pRecordEntry); + +/*! + * \ingroup ui_functions + * + * \brief + * Call this function to open a dialog to browse the database. + * + * \param hParent + * The parent window of this dialog. + * + * \param phObject + * A pointer to a handle that will receive a handle to the + * user's selection. This will be NULL if the user cancelled the dialog. + * + * \param hRoot + * The root element in the tree. Only hRoot and elements below hRoot will be displayed. Pass + * a null handle to show the complete database. + * + * \param hSelection + * The initially selected object in the dialog. You may pass a null handle here. + * + * \param nFlags + * Any combination of ::CAND_tenBrowseDbFlags + * + * \param pszTitle + * The caption of the dialog + * + * \retval - ::CAND_nERR_INVALID_HANDLE Invalid handle + * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \remark + * Be sure to pass meaningful parameters to this function. For example, + * it does not make sense to set hRoot to a message and set nFlags to ::CAND_nenBrowseEcu. + * In this case, the user will not be able to select anything in the database. + * Or, for example, if you set hRoot to a null handle and pass ::CAND_nenShowSig | + * ::CAND_nenSelectSig as nFlags, the user will only see signals without seeing their + * corresponding messages. + * While this is reasonable in some situations, it is better to show all levels in + * order to avoid confusion. In most cases, you'll simply want to pass one of + * the ::CAND_tenBrowseDbFlags constants. + * + * \ex CAND_enBrowseDatabase.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enBrowseDatabase(HWND hParent, CAND_tHandle* phObject, + CAND_tHandle hRoot, CAND_tHandle hSelection, + unsigned int nFlags, const char* pszTitle); + +/*! + * \ingroup ui_functions + * + * \brief + * Registers a Window to the CanDLL. + * + * The Window identified by hWindow will have its position saved in the + * project workspace. You should unregister a window as soon as its + * position is no longer of any interest, e.g. if your plugin gets + * unloaded. Otherwise its position will be saved although it is not needed + * any more. + * + * \attention + * Only windows that have been created in the application's main + * thread are allowed to call this function. + * + * \param sName + * Internal name of the window. This name should be unique. It is used to identify a window + * after its position been loaded from a workspace. + * + * \param hWindow + * Handle to the window whose position will be saved. + * + * \param hInstance + * Handle of the instance + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enRegisterWindow.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enRegisterWindow(const char* sName, HWND hWindow, HANDLE hInstance); + +/*! + * \ingroup ui_functions + * + * \brief + * Unregisters a window previously registered with ::CAND_enRegisterWindow. + * + * \param sName + * Internal name of the window. This is the same name that was passed to ::CAND_enRegisterWindow. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_OK Function succeeded + * + * \ex CAND_enUnregisterWindow.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enUnregisterWindow(const char* sName); + +/*! + * \ingroup ui_functions + * + * \brief + * Registers a message hook function that will be called to process application messages. + * + * \param pfPreTranslateMessage + * Function pointer to the new PreTranslate function that should be registered. + * + * \retval - ::CAND_nFALSE The specified function could not be registered + * \retval - ::CAND_nTRUE The function succeeded. + * + * \ex CAND_boRegisterMessageHook.cpp + */ +CANDLL_API BOOL CANDLL_CALL CAND_boRegisterMessageHook(int (CANDLL_CALL* pfPreTranslateMessage)(MSG* lpMsg)); + +/*! + * \ingroup ui_functions + * + * \brief + * Unregisters a previously registered message hook function. + * + * \param pfPreTranslateMessage + * Function pointer to the PreTranslate function that should be unregistered. + * + * \retval - ::CAND_nFALSE The specified function could not be unregistered + * \retval - ::CAND_nTRUE The function succeeded. + * + * \ex CAND_vUnregisterMessageHook.cpp + */ +CANDLL_API void CANDLL_CALL CAND_vUnregisterMessageHook(int (CANDLL_CALL* pfPreTranslateMessage)(MSG* lpMsg)); + +/*! + * \ingroup ui_functions + * + * \brief + * Registers an idle hook function that will be called on idle time. + * + * \param pfOnIdle + * Function pointer to the new IdleHook function that should be registered. + * + * \retval - ::CAND_nFALSE The specified function could not be registered + * \retval - ::CAND_nTRUE The function succeeded. + * + * \ex CAND_boRegisterIdleCallback.cpp + */ +CANDLL_API BOOL CANDLL_CALL CAND_boRegisterIdleCallback(void (CANDLL_CALL* pfOnIdle)(void)); + +/*! + * \ingroup ui_functions + * + * \brief + * Unregisters a previously registered idle hook function. + * + * \param pfOnIdle + * Function pointer to the IdleHook function that should be unregistered. + * + * \retval - ::CAND_nFALSE The specified function could not be unregistered + * \retval - ::CAND_nTRUE The function succeeded. + * + * \ex CAND_vUnregisterIdleCallback.cpp + */ +CANDLL_API void CANDLL_CALL CAND_vUnregisterIdleCallback(void (CANDLL_CALL* pfOnIdle)(void)); + +/*! + * \ingroup ui_functions + * + * \brief + * Returns the tree window if it exists. + * + * \return + * Handle to the tree ctrl window. + * + * \ex CAND_hGetTreeWnd.cpp + */ +CANDLL_API HWND CANDLL_CALL CAND_hGetTreeWnd(void); + +/*! + * \ingroup handle_functions + * + * \brief + * Use this function to convert a handle into humanly readable format. + * + * You can then save and load this string to/from a file. You can use + * ::CAND_hTextToHandle to convert returned string back into a handle. + * Returns a string specifing the object. The object can be a bus, + * an ECU, a message, a signal or a attribute. + * + * \param hObject + * Handle to an object whose name will be returned. + * + * \param pcName + * Pointer to a buffer that receives the name of the object. See the remarks + * section for a brief description of the format. This pointer must not be + * NULL. A terminating NUL-character will be automatically appended. + * + * \param dwLen + * Length of pcName in characters. (Including room for a terminating NUL character.) + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \remarks + * Depending on the type of the object, the string will be in one of + * the following formats: + * + * + * + * + * + * + * + * + * + * + * + *
Type of objectReturned string
Bus/Name of bus
ECU/Name of bus/Name of ECU
Message/Name of bus/Name of ECU/Name of message-ID of message
Signal/Name of bus/Name of ECU/Name of message-ID of message/Name of signal
+ * + * \ex CAND_enHandleToText.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enHandleToText(CAND_tHandle hObject, char* pcName, unsigned long dwLen); + +/*! + * \ingroup handle_functions + * + * \brief + * Returns the handle out of the string. + * + * \param pcName + * Pointer to a buffer that specifies the object. + * + * \return + * If the function succeeds, the return value is the handle of the specified + * object. If the function fails the return value is a NULL handle. You + * must check the return value with ::CAND_enIsNullHandle. + * + * \remarks + * Depending on the type of the object, the string will be in one of + * the following formats:\n + * + * + * + * + * + * + * + * + * + * + * + *
Type of objectReturned string
Bus/Name of bus
ECU/Name of bus/Name of ECU
Message/Name of bus/Name of ECU/Name of message-ID of message
Signal/Name of bus/Name of ECU/Name of message-ID of message/Name of signal
+ * You can access an attribute by appending a dot and the attribute name, + * e.g. /Can-B/.Manufacturer returns a handle to the "Manufacturer" attribute + * of Can-B. + * + * \ex CAND_hTextToHandle.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hTextToHandle(const char* pcName); + +/*! + * \ingroup handle_functions + * + * \brief + * Determines the type of the object that is associated with the given handle. + * + * \param hObject + * Handle to the object. + * + * \param pType + * Pointer to a buffer that receives the type of the handle. This pointer must not be NULL. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \remark + * Note that the function will fail if a null handle is passed. + * + * \ex CAND_enGetHandleType.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetHandleType(CAND_tHandle hObject, CAND_tenHandleType* pType); + + +/*! + * \ingroup handle_functions + * + * \brief + * Call this function to determine whether a handle is valid or not. + * + * \param hObject + * Specifies the handle that should be determined. + * + * \retval - ::CAND_nFALSE if the handle is not valid. + * \retval - ::CAND_nTRUE if the handle is valid. + * + * \ex CAND_boIsValidHandle.cpp + */ +CANDLL_API BOOL CANDLL_CALL CAND_boIsValidHandle(CAND_tHandle hObject); + +/*! + * \ingroup handle_functions + * + * \brief + * Call this function to determine whether a handle is a valid handle or a null handle. + * + * \param hObject + * Specified the handle that is to be examined. + * + * \retval - ::CAND_nFALSE Handle is not a null handle. + * \retval - ::CAND_nTRUE Handle is a null handle. + * + * \ex CAND_enIsNullHandle.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enIsNullHandle(CAND_tHandle hObject); + +/*! + * \ingroup handle_functions + * + * \brief + * Call this function to get a null handle. + * + * \return + * The function always returns an invalid null handle. + * + * \ex CAND_hNullHandle.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hNullHandle(void); + +/*! + * \ingroup ui_functions + * + * \brief + * Makes a report, that will be shown in a message box. + * + * \param pcMsg + * Pointer to a char-string which content will be shown in the MessageBox. + * + * \param pcTitel + * Pointer to a char-string which is used for the message-box titel. + * + * \param type + * Style of the MessageBox. Look at the WinApi MessageBox documentation for further information. + * + * \return + * The return value depends on the style you choose. Look at the WinApi + * MessageBox documentation for further information. + * + * \ex CAND_iShowMessage.cpp + */ +CANDLL_API int CANDLL_CALL CAND_iShowMessage(const char* pcMsg, const char* pcTitel, UINT type); + +/*! + * \ingroup ui_functions + * + * \brief + * Makes an asynchronous (non blocking) report, that will be shown in a message box or in the report window. + * + * \param pcMsg + * Pointer to a char-string which content will be shown in the MessageBox. + * + * \param pcTitel + * Pointer to a char-string which is used for the message-box titel. + * + * \param type + * Style of the MessageBox. Look at the WinApi MessageBox documentation for further information. + * + * \param dwOutputStyle + * Output style. There are three possibilities: + * -# dwOutputStyle == REPORT_IN_MSGBOX: Report shall be shown in a message box. + * -# dwOutputStyle == REPORT_IN_REPORT_WND: Report shall be shown in the report window. + * -# dwOutputStyle == (REPORT_IN_MSGBOX|REPORT_IN_REPORT_WND): Report shall be shown in both, a + * message box and the report window. + * + * \return + * The returnvalue depends on the style you choose. Look at the WinApi MessageBox documentation + * for further information. + * + * \ex CAND_vShowAsyncMessage.cpp + */ +CANDLL_API int CANDLL_CALL CAND_vShowAsyncMessage(const char* pcMsg, const char* pcTitel, UINT type, DWORD dwOutputStyle); + +/*! + * \ingroup ui_functions + * + * \brief + * Makes an asynchronous (non blocking) report, that will be shown in the report window. + * + * \param sMsg + * Pointer to a char-string which content will be shown in the MessageBox. + * + * \param sWndName + * Pointer to a char-string which contains the report window name. + * + * \param type + * Style of the Report. Look at the WinApi MessageBox documentation for further information. + * + * \retval - ::CAND_nERR_OK Function proceeded successfully. + * \retval - ::CAND_nERR_INVALID_PARAM Parameter is invalid. + * \retval - ::CAND_nERR_NO_MATCH Window not exists + * + * \ex CAND_enMakeReport.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enMakeReport(const char* sMsg, const char* sWndName, UINT type); + +/*! + * \ingroup ui_functions + * + * \brief + * Creates a new report window. + * + * \param sWndName + * Pointer to a char-string which contains the report window name. + * + * \retval - ::CAND_nERR_OK Function proceeded successfully. + * \retval - ::CAND_nERR_INVALID_PARAM Parameter is invalid. + * \retval - ::CAND_nERR_NOT_POSSIBLE Window already exists. + * + * \ex CAND_enCreateReportWnd.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enCreateReportWnd(const char* sWndName); + +/*! + * \ingroup ui_functions + * + * \brief + * Destroys a report window created with CAND_vCreateReportWnd. + * + * \param sWndName + * Pointer to a char-string which contains the report window name. + * + * \retval - ::CAND_nERR_OK Function proceeded successfully. + * \retval - ::CAND_nERR_INVALID_PARAM Parameter is invalid. + * \retval - ::CAND_nERR_NO_MATCH Window not exists. + * \retval - ::CAND_nERR_NOT_POSSIBLE Window can not be destroyed. + * + * \ex CAND_enDestroyReportWnd.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enDestroyReportWnd(const char* sWndName); + +/*! + * \ingroup ui_functions + * + * \brief + * Clears all reports in the report window. + * + * \param sWndName + * Pointer to a char-string which contains the report window name. + * + * \retval - ::CAND_nERR_OK Function proceeded successfully. + * \retval - ::CAND_nERR_INVALID_PARAM Parameter is invalid. + * \retval - ::CAND_nERR_NO_MATCH Window not exists. + * + * \ex CAND_enClearReportWnd.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enClearReportWnd(const char* sWndName); + + +/*! + * \ingroup simulation_functions + * + * \brief + * Determines the status of the simulation. + * + * \retval - 1 Simulation has been started. + * \retval - 0 Simulation has been stopped. + * + * \ex CAND_boIsRunning.cpp + */ +CANDLL_API BOOL CANDLL_CALL CAND_boIsRunning(void); + +/*! + * \ingroup fileio_functions + * + * \brief + * Writes binary data into workspace + * + * \param hFileModule + * Filemanager handle + * + * \param pData + * Data pointer (start address) + * + * \param dwBytesToWrite + * Size of bytes to write + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enWriteData.cpp + */ +CANDLL_API CAND_tenRetVal CAND_enWriteData(CAND_tFileHandle hFileModule, const void* pData, DWORD dwBytesToWrite); + +/*! + * \ingroup fileio_functions + * + * \brief + * Reads binary data from the workspace + * + * \param hFileModule + * Filemanager handle + * + * \param pData + * Data pointer (start address) + * + * \param dwBytesToRead + * Size of bytes to read + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The function succeeded. + * + * \ex CAND_enReadData.cpp + */ +CANDLL_API CAND_tenRetVal CAND_enReadData(CAND_tFileHandle hFileModule, void* pData, DWORD dwBytesToRead); + +/*! + * \ingroup ui_functions + * + * \brief + * Enables or disables all CanDll windows. + * + * Call this function when you want to display a modal dialog box and need + * to disable all other non-modal windows. + * + * \param bEnable + * Specifies whether all windows should be enabled (::CAND_nTRUE) or disabled (::CAND_nFALSE) + * + * \retval - ::CAND_nTRUE The function succeeded, the new window stats was set. + * \retval - ::CAND_nFALSE The fucntion failed, the new window state could not be set or was the same. + * + * \ex CAND_enEnableWindows.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enEnableWindows(BOOL bEnable); + +/*! + * \ingroup ui_functions + * + * \brief + * Makes a rebuild of all GUI Elements. + * + * \ex CAND_vRebuildGUI.cpp + */ +CANDLL_API void CANDLL_CALL CAND_vRebuildGUI(void); + + +/*! + * \ingroup action_functions + * + * \brief + * Structure that is used to store parameters for actionmanager actions. + * + * \see + * CAND_boDoActionId | CAND_boDoAction | CAND_stGetBrowseParam + */ +typedef struct CAND_stParam +{ + const char* sVal; /*!< Value of the parameter */ + const char* sPrompt; /*!< Display text for the parameter */ + const char* sDesc; /*!< Tooltip text for this parameter */ + void (CANDLL_CALL *fpConfig)(char* sVal, unsigned int uiSize, DWORD dwUserData); /*!< Optional callback function to set sVal */ + BOOL (CANDLL_CALL *fpValidate)(const char* sVal); /*!< Optional callback funktion to validate sVal*/ + struct CAND_stParam* pstNext; /*!< Pointer to the next parameter or NULL if this ist the last one */ + DWORD dwUserData; /*!< User defined parameter for free use */ + void* pUserData; /*!< User defined pointer for free use */ +} CAND_tstParam; + +/*! + * \ingroup database_functions + * + * \brief + * Loads a CanEasy database file (*.candb | *.dat). + * + * \param pcPath + * File name to load. + * + * \retval - ::CAND_nERR_OK The function succeeded. + * \retval - ::CAND_nERR_NOT_POSSIBLE Loading failed / Generator is not available + * \retval - ::CAND_nERR_SIM_IS_RUNNING Simulation is running, stop it first. + * \retval - ::CAND_nERR_INVALID_PARAM Parameter is invalid (i.e. empty filestring) + * + * \ex CAND_enLoadDatFile.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enLoadDatFile(const char* pcPath); + +/*! + * \ingroup simulation_functions + * + * \brief + * Initializes the CanDll. + * + * \param hMainWnd + * Handle to the application main window. Use NULL if you don't have + * a window application. + * + * \param nChildId + * Only neccessary if hMainWnd is not NULL. Used to create the child splitter window. + * + * \returns + * Returns the handle of the new created CanEasy splitter Window. + * + * \see + * CAND_vDeinitDLL + * + * \ex CAND_hInitDLL.cpp + */ +CANDLL_API HWND CANDLL_CALL CAND_hInitDLL(HWND hMainWnd, UINT nChildId); + +/*! + * \ingroup simulation_functions + * + * \brief + * Deinitializes the CanDll. + * + * \see + * CAND_hInitDLL + * + * \ex CAND_vDeinitDLL.cpp + */ +CANDLL_API void CANDLL_CALL CAND_vDeinitDLL(void); + +/*! + * \ingroup simulation_functions + * + * \brief + * Initializes the CanDll functions and starts the simulation. + * + * \returns + * The function returns ::CAND_nTRUE if the simulation could be startet otherwise ::CAND_nFALSE. + * + * \ex CAND_boInitRun.cpp + */ +CANDLL_API BOOL CANDLL_CALL CAND_boInitRun(void); + +/*! + * \ingroup simulation_functions + * + * \brief + * Deinitializes the CanDll functions and stops the simulation. + * + * \returns + * The function returns ::CAND_nTRUE if the simulation could be stopped otherwise ::CAND_nFALSE. + * + * \ex CAND_boDeinitRun.cpp + */ +CANDLL_API BOOL CANDLL_CALL CAND_boDeinitRun(void); + +/*! + * \ingroup action_functions + * + * \brief + * Structure definition of a CanEasy action. + * The callback function returns a boolean value that is used to tell the + * action's caller that the function was successfuly called. The overall + * return value of the DoAction functions is TRUE only when the callback + * function returns TRUE. An overall result of FALSE doesn't carry the + * information if either the action was invalid or the callback function + * returned FALSE! + * + * \see + * CAND_boDoActionId | CAND_boDoAction | CAND_stGetBrowseParam + */ +typedef struct CAND_stAction +{ + HINSTANCE hInstance; /*!< Handle of the instance of this dll */ + const char* sActionId; /*!< String id that must be unique inside this instance of hInstance */ + const char* sDesc; /*!< Description of this action, also used as tooltip */ + CAND_tstParam* pstFirstParam; /*!< Pointer to the first parameter of this action, or NULL if unused */ + BOOL (CANDLL_CALL *fpDoActionAsync)(struct CAND_stAction*); /*!< Callback function, that is called on execution of the action */ + BOOL (CANDLL_CALL *fpDoActionSync)(struct CAND_stAction*); /*!< Callback function, that is called on execution of the action */ + DWORD dwUserData; /*!< User defined parameter for free use */ + void* pUserData; /*!< User definde pointer for free use */ + BOOL boIsThreadSafe; /*!< If this Flag ist not set, the specified functions can only be called from the Main-Thread (not thread safe) */ + +#ifdef __cplusplus + /*! + * \brief + * Initialize the sturcutre to a defined state. + * If you are not using c++ you have to initialize + * the structure by your own, before you register + * the action! + */ + CAND_stAction() + { + hInstance = NULL; + sActionId = NULL; + sDesc = NULL; + pstFirstParam = NULL; + fpDoActionAsync = NULL; + fpDoActionSync = NULL; + dwUserData = 0; + pUserData = NULL; + boIsThreadSafe = false; + } +#endif +} CAND_tstAction; + +/*! + * \ingroup action_functions + * + * \brief + * Registers a new action in the action manager. + * + * \param pstAction + * Complete filled and initialized structure for the new action. + * This parameter (pointer) is stored in an internal data structure and must + * remain valid until the action is deregistered. + * + * \retval - ::CAND_nTRUE The action was successfully registered. + * \retval - ::CAND_nFALSE The action could not be registered. + * + * \ex CAND_boRegisterAction.cpp + */ +CANDLL_API BOOL CANDLL_CALL CAND_boRegisterAction(CAND_tstAction* pstAction); + +/*! + * \ingroup action_functions + * + * \brief + * Unregisters a previously registered action in the action manager. + * + * \param pstAction + * Pointer to the action structure that depends to the action. + * + * \retval - ::CAND_nTRUE The action was successfully unregistered. + * \retval - ::CAND_nFALSE The action could not be unregistered. + * + * \ex CAND_boUnRegisterAction.cpp + */ +CANDLL_API BOOL CANDLL_CALL CAND_boUnRegisterAction(const CAND_tstAction* pstAction); + +/*! + * \ingroup action_functions + * + * \brief + * Opens a browser dialog to choose and parametrize an action. + * + * \ex CAND_vOpenActionBrowser.cpp + */ +CANDLL_API void CANDLL_CALL CAND_vOpenActionBrowser(void); + +/*! + * \ingroup action_functions + * + * \brief + * Returns the action with the given index from the action manager. If hInstance + * is set to NULL, the function will iterate over all actions of the action manager. + * + * \param hInstance + * Instance to look for the action. + * + * \param uiIndex + * Index of the action to seek for. + * + * \return + * Pointer to the structure that represents the action. If the end of the action + * list is reached the function will return NULL. + * + * \ex CAND_pstGetAction.cpp + */ +CANDLL_API CAND_tstAction* CANDLL_CALL CAND_pstGetAction(HANDLE hInstance, unsigned int uiIndex); + +/*! + * \ingroup action_functions + * + * \brief + * Retrieves the action with the given name from the action manager. If hInstance + * is set to NULL, the function will iterate over all actions of the action manager. + * + * \param hInstance + * Instance to look for the action. + * + * \param sActionId + * Name of the action to seek for. + * + * \return + * Pointer to the structure that represents the action. If the end of the action + * list is reached the function will return NULL. + * + * \ex CAND_pstGetActionByName.cpp + */ +CANDLL_API CAND_tstAction* CANDLL_CALL CAND_pstGetActionByName(HANDLE hInstance, const char* sActionId); + +/*! + * \ingroup action_functions + * + * \brief + * Executes the specified action with the given set of parameters. If hInstance is set to NULL + * the first matching action will be executed. + * + * \param hInstance + * Instance of the action. + * + * \param sActionId + * Name of the desired action. + * + * \param pstParams + * Set of parameters for the action. (parameters are chained lists) + * + * \retval - ::CAND_nTRUE The action could be found and has been executed. + * \retval - ::CAND_nFALSE The Function did not succeed maybe the action was not found. + * + * \ex CAND_boDoActionId.cpp + */ +CANDLL_API BOOL CANDLL_CALL CAND_boDoActionId(HANDLE hInstance, const char* sActionId, const CAND_tstParam* pstParams); + +/*! + * \ingroup action_functions + * + * \brief + * Executes the specified action with the given set of parameters. + * + * \param pstAction + * Pointer of an action, that will be executed. + * + * \param pstParams + * Set of parameters for the action. (parameters are chained lists) + * + * \retval - ::CAND_nTRUE The action could be found and has been executed. + * \retval - ::CAND_nFALSE The Function did not succeed maybe the action was not found or the parameter set was wrong. + * + * \ex CAND_boDoAction.cpp + */ +CANDLL_API BOOL CANDLL_CALL CAND_boDoAction(CAND_tstAction* pstAction, const CAND_tstParam* pstParams); + +/*! + * \ingroup action_functions + * + * \brief + * Creates a single parameter that accepts a CanEasy database element as string id. The parameter + * has a predefined configuration function that will show the database browsing dialog. + * + * \param nFlags + * Parameter that describes the type of database element that the user is allowed to seek for. + * + * \return + * The function returns an initialized parameter that can be used with an action. The parameter has a + * predefined function that will show the database brwose dialog. + * + * \ex CAND_stGetBrowseParam.cpp + */ +CANDLL_API CAND_tstParam CANDLL_CALL CAND_stGetBrowseParam(CAND_tenBrowseDbFlags nFlags); + +/*! + * \ingroup simulation_functions + * + * \brief + * Returns the current timestamp of simulation. + * + * \returns + * Millisecs since start of simulation. + * + * The function returns the timestamp in milliseconds since stimulation start. + * + * \remarks + * After simulation restart the timestamp starts with 0 again. + * + * \see + * CAND_enRegisterCallback + * + * \ex CAND_qwGetMsTimer.cpp + */ +CANDLL_API QWORD CAND_qwGetMsTimer(void); + +/*! + * \ingroup env_functions + * + * \brief + * Retrieves the handle of the root environment variable which is the top most element. + * + * \return + * The Function returns a valid handle to the root environment variable. If + * there was an error the function will return a invalid handle. You must use the function + * ::CAND_enIsNullHandle to check the result. + * + * \see + * CAND_enIsNullHandle + * + * \ex CAND_hGetRootEnvVar.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetRootEnvVar(void); + +/*! + * \ingroup env_functions + * + * \brief + * Returns the the upper next environment variable element of the object handle. + * + * \param hObject + * Handle of an environment variable object + * + * \return + * The Function returns a valid handle to the upper next environment variable. If + * there was an error the function will return a invalid handle. You must use the function + * ::CAND_enIsNullHandle to check the result. + * + * \ex CAND_hGetEnvVarParent.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetEnvVarParent(CAND_tHandle hObject); + +/*! + * \ingroup env_functions + * + * \brief + * Sets the name of an environment variable object. + * + * \param hObject + * Handle of the object whichs name should be set. + * + * \param sName + * null terminated string of the new name. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified Handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The Function succeded. + * + * \ex CAND_enSetEnvVarName.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetEnvVarName(CAND_tHandle hObject, const char* sName); + +/*! + * \ingroup env_functions + * + * \brief + * Deletes an environment variable object. + * + * \param hObject + * Description of parameter hObject. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified Handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The Function succeded. + * + * \ex CAND_enDeleteEnvVar.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enDeleteEnvVar(CAND_tHandle hObject); + +/*! + * \ingroup env_functions + * + * \brief + * Creates a new environment variable. + * + * \param hObject + * Handle to the environment variable that should hold the new environment variable. + * + * \param sName + * Name if the new variable. + * + * \return + * The Function returns a valid handle of the new environment variable. If + * there was an error the function will return an invalid handle. You must use the function + * ::CAND_enIsNullHandle to check the result. + * + * \ex CAND_hCreateEnvVar.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hCreateEnvVar(CAND_tHandle hObject, const char* sName); + +/*! + * \ingroup env_functions + * + * \brief + * Creates an environment variable. + * + * \param hObject + * Handle of the environment variable. + * + * \param sName + * Name of the environment variable to look for. + * + * \return + * The Function returns a valid handle of the environment variable. If + * there was an error the function will return an invalid handle. You must use the function + * ::CAND_enIsNullHandle to check the result. + * + * \ex CAND_hGetEnvVarByName.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetEnvVarByName(CAND_tHandle hObject, const char* sName); + +/*! + * \ingroup env_functions + * + * \brief + * Returns the first environment variable. + * + * \param hObject + * Handle to parent environment variable. + * + * \return + * The Function returns a valid handle of the first environment variable. If + * there was an error the function will return an invalid handle. You must use the function + * ::CAND_enIsNullHandle to check the result. + * + * \ex CAND_hGetFirstEnvVar.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetFirstEnvVar(CAND_tHandle hObject); + +/*! + * \ingroup env_functions + * + * \brief + * Returns a handle to the next environment variable. + * + * \param hObject + * Handle to an existing environment variable. + * + * \return + * The Function returns a valid handle to the next environment variable after the given one. If + * there was an error the function will return an invalid handle. You must use the function + * ::CAND_enIsNullHandle to check the result. + * + * \ex CAND_hGetNextEnvVar.cpp + */ +CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetNextEnvVar(CAND_tHandle hObject); + +/*! + * \ingroup env_functions + * + * \brief + * Returns the type (int, double, string, ...) of an environment variable. + * + * \param hObject + * Handle to an existing environment variable. + * + * \return + * The Function returns a struct containing the type information. + * + * \ex CAND_enGetEnvVarValue.cpp + */ +CANDLL_API CAND_tstEnvVarType CANDLL_CALL CAND_stGetEnvVarType(CAND_tHandle hObject); + +/*! + * \ingroup env_functions + * + * \brief + * Sets the value of an environment variable. + * + * \param hObject + * Handle to an existing environment variable. + * \param stType + * Struct containing the type information to be set. + * \param pData + * Pointer to source memory data + * \param dwLength + * Size in bytes of pData. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified Handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The Function succeded. + * + * \ex CAND_enSetEnvVarValue.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetEnvVarValue(CAND_tHandle hObject, CAND_tstEnvVarType stType, const void* pData, DWORD dwLength); + +/*! + * \ingroup env_functions + * + * \brief + * Returns the value of an environment variable. + * + * \param hObject + * Handle to an existing environment variable. + * \param pData + * Pointer to destination memory data. + * \param dwLength + * Size in bytes of pData. + * + * \retval - ::CAND_nERR_INVALID_HANDLE The specified Handle is not valid. + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_OK The Function succeded. + * + * \ex CAND_enGetEnvVarValue.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetEnvVarValue(CAND_tHandle hObject, void* pData, DWORD dwLength); + +/*! + * \ingroup replay_functions + * + * \brief + * Starts the replay with the corresponding name. + * + * \param sName + * Name of the replay. + * + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_NOT_POSSIBLE Simulation need to be startet. + * \retval - ::CAND_nERR_OK The Function succeded. + * + * \ex CAND_enStartReplay.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enStartReplay(const char* sName); + +/*! + * \ingroup replay_functions + * + * \brief + * Stops the replay with the corresponding name. + * + * \param sName + * Name of the replay. + * + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_NOT_POSSIBLE Simulation need to be startet. + * \retval - ::CAND_nERR_OK The Function succeded. + * + * \ex CAND_enStopReplay.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enStopReplay(const char* sName); + +/*! + * \ingroup replay_functions + * + * \brief + * Suspends the replay with the corresponding name. + * + * \param sName + * Name of the replay. + * + * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct. + * \retval - ::CAND_nERR_NOT_POSSIBLE Simulation need to be startet. + * \retval - ::CAND_nERR_OK The Function succeded. + * + * \ex CAND_enSuspendReplay.cpp + */ +CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSuspendReplay(const char* sName); + +#ifdef __cplusplus +} +#endif /* extern "C" */ + +#endif /* CAND_USER_API_H */ + + diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/lib/CanDll.lib b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/lib/CanDll.lib new file mode 100644 index 0000000..b674db0 Binary files /dev/null and b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/lib/CanDll.lib differ diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/res/CanEasy_Xoraya_PluginDll.rc2 b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/res/CanEasy_Xoraya_PluginDll.rc2 new file mode 100644 index 0000000..96e319e --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/res/CanEasy_Xoraya_PluginDll.rc2 @@ -0,0 +1,13 @@ +// +// CanEasy_Xoraya_Plugin.RC2 +// + +#ifdef APSTUDIO_INVOKED + #error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// Add here manually edited resources.. + +///////////////////////////////////////////////////////////////////////////// diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/resource.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/resource.h new file mode 100644 index 0000000..17a050b --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/resource.h @@ -0,0 +1,42 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by CanEasy_Xoraya_PluginDll.rc +// +#define ID_POPUP_TREE_MENU 1001 +#define IDD_PLUGIN_MAIN_DIALOG 6000 +#define IDC_SLIDER1 6003 +#define IDC_EDIT1 6004 +#define IDC_LOG 6004 +#define IDI_ICON1 6005 +#define IDC_GRP_XORAYA_CONNECTION 6005 +#define IDC_XORAYA_IPADDRESS 6006 +#define IDC_CONNECTION_STATUS 6007 +#define IDC_BUTTON_CONNECT 6008 +#define IDC_BUTTON_DISCONNECT 6009 +#define IDC_INTERFACE_COMBO 6011 +#define IDC_BUS_COMBO 6012 +#define IDC_MAP_BUTTON 6013 +#define IDC_UNMAP_BUTTON 6014 +#define IDC_IMPORTLOG_BUTTON 6016 +#define IDC_MAPPEDBUS_COMBO 6017 +#define IDC_START_BUTTON 6018 +#define IDC_STOP_BUTTON 6019 +#define IDC_GETINTERFACES_BUTTON 6021 +#define IDC_BUTTON_SHUTDOWN 6022 +#define IDC_CHECK_AUTOLOAD 6023 +#define IDC_BUTTON_ENUMLOGS 6024 +#define IDC_COMBO1 6025 +#define IDC_LOGS_COMBO 6025 +#define ID_POPUP_REMOVE 50000 +#define ID_POPUP_SHOW 50001 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 6006 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 6026 +#define _APS_NEXT_SYMED_VALUE 6000 +#endif +#endif diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/x2e.ico b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/x2e.ico new file mode 100644 index 0000000..c8922bd Binary files /dev/null and b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/x2e.ico differ diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/doc/Doxyfile b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/doc/Doxyfile new file mode 100644 index 0000000..fcdda13 --- /dev/null +++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/doc/Doxyfile @@ -0,0 +1,1604 @@ +# Doxyfile 1.6.2 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = "CanEasy Xoraya Plugin" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = . + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = YES + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it parses. +# With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this tag. +# The format is ext=language, where ext is a file extension, and language is one of +# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, +# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat +# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. Note that for custom extensions you also need to set +# FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen to replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penality. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will rougly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by +# doxygen. The layout file controls the global structure of the generated output files +# in an output format independent way. The create the layout file that represents +# doxygen's defaults, run doxygen with the -l option. You can optionally specify a +# file name after the option, if omitted DoxygenLayout.xml will be used as the name +# of the layout file. + +LAYOUT_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = ../CanEasy_Xoraya_Plugin + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py \ + *.f90 \ + *.f \ + *.vhd \ + *.vhdl + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = */.svn/* \ + *.svn* \ + */\.svn/* \ + *\.svn* \ + */asf/* + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = NO + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER +# are set, an additional index file will be generated that can be used as input for +# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated +# HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. +# For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's +# filter section matches. +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = YES + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = NO + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvances is that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# By default doxygen will write a font called FreeSans.ttf to the output +# directory and reference it in all dot files that doxygen generates. This +# font does not include all possible unicode characters however, so when you need +# these (or just want a differently looking font) you can specify the font name +# using DOT_FONTNAME. You need need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = FreeSans + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES -- cgit v1.2.3