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 --- Master/Masterarbeit/src/XorayaTestPlugin/.cproject | 219 +++++++++++++++++++++ Master/Masterarbeit/src/XorayaTestPlugin/.project | 84 ++++++++ .../src/XorayaTestPlugin/xoraya_test_plugin.cpp | 127 ++++++++++++ 3 files changed, 430 insertions(+) create mode 100644 Master/Masterarbeit/src/XorayaTestPlugin/.cproject create mode 100644 Master/Masterarbeit/src/XorayaTestPlugin/.project create mode 100644 Master/Masterarbeit/src/XorayaTestPlugin/xoraya_test_plugin.cpp (limited to 'Master/Masterarbeit/src/XorayaTestPlugin') diff --git a/Master/Masterarbeit/src/XorayaTestPlugin/.cproject b/Master/Masterarbeit/src/XorayaTestPlugin/.cproject new file mode 100644 index 0000000..2a4f6a3 --- /dev/null +++ b/Master/Masterarbeit/src/XorayaTestPlugin/.cproject @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Master/Masterarbeit/src/XorayaTestPlugin/.project b/Master/Masterarbeit/src/XorayaTestPlugin/.project new file mode 100644 index 0000000..645a4e1 --- /dev/null +++ b/Master/Masterarbeit/src/XorayaTestPlugin/.project @@ -0,0 +1,84 @@ + + + xoraya_test_plugin + + + xoraya_plugin_executor + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + ?name? + + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.autoBuildTarget + all + + + org.eclipse.cdt.make.core.buildArguments + + + + org.eclipse.cdt.make.core.buildCommand + make + + + org.eclipse.cdt.make.core.buildLocation + ${workspace_loc:/xoraya_test_plugin/Debug} + + + org.eclipse.cdt.make.core.cleanBuildTarget + clean + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.enableAutoBuild + false + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.fullBuildTarget + all + + + org.eclipse.cdt.make.core.stopOnError + true + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + true + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + diff --git a/Master/Masterarbeit/src/XorayaTestPlugin/xoraya_test_plugin.cpp b/Master/Masterarbeit/src/XorayaTestPlugin/xoraya_test_plugin.cpp new file mode 100644 index 0000000..c2b0165 --- /dev/null +++ b/Master/Masterarbeit/src/XorayaTestPlugin/xoraya_test_plugin.cpp @@ -0,0 +1,127 @@ +/* + * xoraya_test_plugin.cpp + * + * Created on: 31.08.2011 + * Author: Eisenhauer + */ + +#include "plugin_api.h" +#include "global.h" +#include "interface_manager.h" + +class XorayaTestPlugin : public IPlugin +{ +private: + IInterfaceManager& m_xInterfaceManager; + int32_t m_i32InterfaceHandle; + uint32_t m_u32TxMsgId; + tCanTxMessageList m_axCanTxMessages; + uint32_t m_u32PluginId; + uint32_t m_u32Loopcounter; + + static uint32_t su32InstanceCount; + +public: + + XorayaTestPlugin( IInterfaceManager& xIfMan, + int32_t i32Interface, + uint32_t u32PluginId + ) + :m_xInterfaceManager( xIfMan ), + m_i32InterfaceHandle( i32Interface ), + m_u32TxMsgId(0x100*(1+XorayaTestPlugin::su32InstanceCount)), + m_u32PluginId(u32PluginId), + m_u32Loopcounter(0) + { + DEBUG_PRINT("constructor"); + boost::shared_ptr pstCanMsg1(new tstCanTxMessage); + pstCanMsg1->u32CanId = m_u32TxMsgId+2; + pstCanMsg1->u8Dlc = 5; + pstCanMsg1->u32TxCycleMilliseconds = 500; + pstCanMsg1->u32MillisecondCounter = 0; + pstCanMsg1->au8Data = {0,0,0,0,0,0,0,0}; + m_axCanTxMessages.push_back(pstCanMsg1); + boost::shared_ptr pstCanMsg2(new tstCanTxMessage); + pstCanMsg2->u32CanId = m_u32TxMsgId+1; + pstCanMsg2->u8Dlc = 5; + pstCanMsg2->u32TxCycleMilliseconds = 1000; + pstCanMsg2->u32MillisecondCounter = 0; + pstCanMsg2->au8Data = {0,0,0,0,0,0,0,0}; + m_axCanTxMessages.push_back(pstCanMsg2); + boost::shared_ptr pstCanMsg3(new tstCanTxMessage); + pstCanMsg3->u32CanId = m_u32TxMsgId; + pstCanMsg3->u8Dlc = 5; + pstCanMsg3->u32TxCycleMilliseconds = 500; + pstCanMsg3->u32MillisecondCounter = 0; + pstCanMsg3->au8Data = {0,0,0,0,0,0,0,0}; + m_axCanTxMessages.push_back(pstCanMsg3); + DEBUG_PRINT("Plg Id: %d msg 1: 0x%X", m_u32PluginId, (uint32_t) pstCanMsg1.get()); + DEBUG_PRINT("Plg Id: %d msg 2: 0x%X", m_u32PluginId, (uint32_t) pstCanMsg2.get()); + DEBUG_PRINT("Plg Id: %d msg 3: 0x%X", m_u32PluginId, (uint32_t) pstCanMsg3.get()); + XorayaTestPlugin::su32InstanceCount++; + } + + virtual ~XorayaTestPlugin() + { + DEBUG_PRINT("destructor"); + XorayaTestPlugin::su32InstanceCount--; + } + + + + virtual void vRun( void ) + { +// DEBUG_PRINT("entry"); + m_u32Loopcounter++; + tCanTxMessageList::iterator xMsgIter; + for( xMsgIter = m_axCanTxMessages.begin(); xMsgIter != m_axCanTxMessages.end(); xMsgIter++ ) + { + tpstCanTxMessage pxMsg = *xMsgIter; + pxMsg->au8Data[0] = m_u32PluginId; + if( xMsgIter == m_axCanTxMessages.begin() ) + { + pxMsg->au8Data[4] = (uint8_t) (m_u32Loopcounter>>24); + pxMsg->au8Data[3] = (uint8_t) (m_u32Loopcounter>>16); + pxMsg->au8Data[2] = (uint8_t) (m_u32Loopcounter>>8); + pxMsg->au8Data[1] = (uint8_t) m_u32Loopcounter; + } + else + { + pxMsg->au8Data[1] = (uint8_t) (m_u32Loopcounter>>24); + pxMsg->au8Data[2] = (uint8_t) (m_u32Loopcounter>>16); + pxMsg->au8Data[3] = (uint8_t) (m_u32Loopcounter>>8); + pxMsg->au8Data[4] = (uint8_t) m_u32Loopcounter; + } + } +// DEBUG_PRINT("exit"); + } + + virtual tCanTxMessageList& xGetCanTxMessages( void ) + { + return m_axCanTxMessages; + } + + virtual int32_t i32GetCanInterfaceHandle( void ) + { + return m_i32InterfaceHandle; + } +}; + +uint32_t XorayaTestPlugin::su32InstanceCount = 0; + +extern "C" IPlugin* pxCreatePlugin( + IInterfaceManager& xIfMan, + int32_t i32Interface, + uint32_t u32PluginId + ) +{ + DEBUG_PRINT("entry"); + return new XorayaTestPlugin(xIfMan, i32Interface, u32PluginId); +} + +extern "C" void vDestroyPlugin(IPlugin* pxPlugin) +{ + DEBUG_PRINT("entry"); + delete pxPlugin; + DEBUG_PRINT("exit"); +} -- cgit v1.2.3