2022-07-21 17:00:41 +03:00
|
|
|
#include "profinet_submodule.hpp"
|
|
|
|
|
|
2022-07-27 13:39:58 +03:00
|
|
|
ProfinetSubmodule::ProfinetSubmodule(uint32_t submodule_id,
|
2022-07-21 17:00:41 +03:00
|
|
|
std::string submodule_name,
|
2022-07-26 13:36:54 +03:00
|
|
|
pnet_data_cfg_t& submodule_data_cfg,
|
|
|
|
|
void * const inp_data_ptr,
|
|
|
|
|
void * const out_data_ptr) :
|
2022-07-21 17:00:41 +03:00
|
|
|
m_id(submodule_id),
|
|
|
|
|
m_name(submodule_name),
|
2022-07-26 13:36:54 +03:00
|
|
|
m_data_cfg(submodule_data_cfg),
|
|
|
|
|
m_inp_data_ptr(inp_data_ptr),
|
2022-07-27 09:12:31 +03:00
|
|
|
m_out_data_ptr(out_data_ptr),
|
|
|
|
|
m_indata_iocs(0),
|
|
|
|
|
m_outdata_iops(0)
|
2022-07-21 17:00:41 +03:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool ProfinetSubmodule::addParameter(std::shared_ptr<ProfinetParameter>& param)
|
|
|
|
|
{
|
|
|
|
|
auto ret = m_params.emplace(param->index, param);
|
|
|
|
|
|
|
|
|
|
return ret.second;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<ProfinetParameter> ProfinetSubmodule::getParameterPtr(uint32_t index)
|
|
|
|
|
{
|
|
|
|
|
if (!m_params.count(index))
|
|
|
|
|
{
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return m_params[index];
|
|
|
|
|
}
|