31 lines
929 B
C++
31 lines
929 B
C++
|
|
#pragma once
|
|||
|
|
|
|||
|
|
#include <cstdint>
|
|||
|
|
#include <string>
|
|||
|
|
#include <map>
|
|||
|
|
#include <memory>
|
|||
|
|
#include "profinet_parameter.hpp"
|
|||
|
|
|
|||
|
|
#include "../../libs/include/pnet_api.h"
|
|||
|
|
|
|||
|
|
|
|||
|
|
class ProfinetSubmodule {
|
|||
|
|
public:
|
|||
|
|
ProfinetSubmodule(uint16_t submodule_id,
|
|||
|
|
std::string submodule_name,
|
|||
|
|
pnet_data_cfg_t& submodule_data_cfg);
|
|||
|
|
|
|||
|
|
bool addParameter(std::shared_ptr<ProfinetParameter>& param);
|
|||
|
|
|
|||
|
|
std::shared_ptr<ProfinetParameter> getParameterPtr(uint32_t index);
|
|||
|
|
|
|||
|
|
public:
|
|||
|
|
const uint16_t m_id; /// Идентификатор подмодуля
|
|||
|
|
const std::string m_name; /// Имя подмодуля
|
|||
|
|
const pnet_data_cfg_t m_data_cfg; /// Конфигурация циклических данных подмодуля
|
|||
|
|
|
|||
|
|
private:
|
|||
|
|
/// Набор параметров подмодуля
|
|||
|
|
std::map<uint32_t, std::shared_ptr<ProfinetParameter>> m_params;
|
|||
|
|
|
|||
|
|
};
|