PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
Loading...
Searching...
No Matches
profinet::gsdml::GSDMLDevice Struct Reference

Complete parsed GSDML device profile. More...

#include <gsdml.h>

+ Collaboration diagram for profinet::gsdml::GSDMLDevice:

Public Member Functions

const GSDMLModule * FindModule (const std::string &moduleId) const
 Look up a module by its GSDML ID.
 
const GSDMLSubmodule * FindSubmodule (const std::string &submoduleId) const
 Look up a globally defined submodule.
 
std::vector< rpc::IOSlot > BuildIoSlots (const std::vector< std::tuple< int, std::string, int, std::string > > &plugged={}) const
 Build I/O slot descriptions from the parsed GSDML configuration.
 

Public Attributes

std::string vendorName
 Vendor name from the GSDML's DeviceIdentity.
 
std::string deviceName
 Device name from the GSDML's DeviceIdentity / DeviceFunction.
 
std::uint16_t vendorId = 0
 PROFINET vendor ID from the GSDML's DeviceIdentity (VendorID attribute).
 
std::uint16_t deviceId = 0
 PROFINET device ID from the GSDML's DeviceIdentity (DeviceID attribute).
 
std::string dapModuleId
 The device access point's own (built-in) identifier to matchs with the submodule.
 
std::string dapModuleName
 The device access point's own (built-in) module name.
 
std::string dapModuleInfo
 The device access point's own (built-in) module info text.
 
std::uint32_t dapSubmoduleIdentNumber = 0
 The device access point's own (built-in) submodule ident number.
 
std::uint32_t dapModuleIdentNumber = 0
 The device access point's own module ident number.
 
std::vector< int > dapSlots
 Slot numbers where the DAP may be fixed/plugged (from UseableModules/PlugSlots).
 
std::vector< GSDMLSubmodule > dapSubmodules
 DAP virtual submodules.
 
std::vector< GSDMLSystemSubmodule > systemSubmodules
 System-defined submodules built into the DAP (e.g. interface, port 1).
 
std::map< std::string, GSDMLModule > modules
 Every module declared in the GSDML's ModuleList, keyed by GSDML ID.
 
std::map< std::string, GSDMLSubmodule > submodules
 Every globally defined SubmoduleItem, keyed by GSDML ID.
 
std::vector< GSDMLModuleReference > moduleReferences
 Modules referenced by the DAP's UseableModules list.
 
rpc::ApplicationRelations applicationRelations
 

Detailed Description

Complete parsed GSDML device profile.

Definition at line 165 of file gsdml.h.

Member Function Documentation

◆ BuildIoSlots()

std::vector< rpc::IOSlot > profinet::gsdml::GSDMLDevice::BuildIoSlots ( const std::vector< std::tuple< int, std::string, int, std::string > > &  plugged = {}) const

Build I/O slot descriptions from the parsed GSDML configuration.

  • DAP virtual submodules are added at slot 0 using subslots 1..N.
  • DAP system-defined submodules are added at their configured subslots.
  • An explicit plugged configuration overrides the GSDML-selected module/submodule configuration.
  • Without an explicit configuration, FixedInSlots/FixedInSubslots are used where present, otherwise UsedInSlots/UsedInSubslots are used.
  • AllowedInSlots/AllowedInSubslots constrain valid explicit assignments but do not themselves select a module or submodule.
  • All inline module submodules are included.
  • Module and submodule references are validated.
Parameters
pluggedExplicit module/submodule assignment. Each tuple contains: slot number, module ID, subslot number, and submodule ID. If empty, the configuration selected by FixedInSlots/UsedInSlots and FixedInSubslots/UsedInSubslots is resolved from the GSDML.
Returns
I/O slots suitable for cyclic I/O configuration.
Exceptions
std::invalid_argumentIf a module or submodule is unknown, or if a module is not allowed in the requested slot.

Definition at line 728 of file gsdml.cpp.

References dapModuleIdentNumber, dapSubmodules, FindSubmodule(), profinet::gsdml::GSDMLModule::id, profinet::gsdml::GSDMLSubmodule::inputLength, profinet::rpc::IOSlot::inputLength, profinet::rpc::IOSlot::moduleIdent, moduleReferences, profinet::gsdml::GSDMLSubmodule::outputLength, profinet::rpc::IOSlot::outputLength, profinet::rpc::IOSlot::slot, profinet::rpc::IOSlot::submoduleIdent, profinet::gsdml::GSDMLSubmodule::submoduleIdentNumber, profinet::gsdml::GSDMLModule::submoduleReferences, profinet::gsdml::GSDMLModule::submodules, profinet::rpc::IOSlot::subslot, and systemSubmodules.

+ Here is the call graph for this function:

◆ FindModule()

const GSDMLModule * profinet::gsdml::GSDMLDevice::FindModule ( const std::string &  moduleId) const

Look up a module by its GSDML ID.

Parameters
moduleIdGSDML ID attribute of the module.
Returns
A pointer to the module, or nullptr if not found (valid as long as this GSDMLDevice is alive).

Definition at line 631 of file gsdml.cpp.

References modules.

Referenced by profinet::sim::MakeVirtualAumaIocrConfiguration().

+ Here is the caller graph for this function:

◆ FindSubmodule()

const GSDMLSubmodule * profinet::gsdml::GSDMLDevice::FindSubmodule ( const std::string &  submoduleId) const

Look up a globally defined submodule.

Parameters
submoduleIdGSDML ID attribute of the submodule.
Returns
A pointer to the submodule, or nullptr if not found (valid as long as this GSDMLDevice is alive).

Definition at line 636 of file gsdml.cpp.

References submodules.

Referenced by BuildIoSlots().

+ Here is the caller graph for this function:

Member Data Documentation

◆ applicationRelations

rpc::ApplicationRelations profinet::gsdml::GSDMLDevice::applicationRelations

Definition at line 204 of file gsdml.h.

Referenced by profinet::gsdml::ParseGsdmlString().

◆ dapModuleId

std::string profinet::gsdml::GSDMLDevice::dapModuleId

The device access point's own (built-in) identifier to matchs with the submodule.

Definition at line 177 of file gsdml.h.

Referenced by profinet::sim::test::MakeAumaGsdml(), profinet::sim::test::MakePhoenixGsdml(), profinet::gsdml::ParseGsdmlString(), and profinet::io::TEST().

◆ dapModuleIdentNumber

std::uint32_t profinet::gsdml::GSDMLDevice::dapModuleIdentNumber = 0

The device access point's own module ident number.

Definition at line 185 of file gsdml.h.

Referenced by BuildIoSlots(), profinet::gsdml::ParseGsdmlString(), and profinet::io::TEST().

◆ dapModuleInfo

std::string profinet::gsdml::GSDMLDevice::dapModuleInfo

The device access point's own (built-in) module info text.

Definition at line 181 of file gsdml.h.

Referenced by profinet::gsdml::ParseGsdmlString().

◆ dapModuleName

std::string profinet::gsdml::GSDMLDevice::dapModuleName

The device access point's own (built-in) module name.

Definition at line 179 of file gsdml.h.

Referenced by profinet::gsdml::ParseGsdmlString(), and profinet::io::TEST().

◆ dapSlots

std::vector<int> profinet::gsdml::GSDMLDevice::dapSlots

Slot numbers where the DAP may be fixed/plugged (from UseableModules/PlugSlots).

Definition at line 187 of file gsdml.h.

Referenced by profinet::gsdml::ParseGsdmlString().

◆ dapSubmoduleIdentNumber

std::uint32_t profinet::gsdml::GSDMLDevice::dapSubmoduleIdentNumber = 0

The device access point's own (built-in) submodule ident number.

Definition at line 183 of file gsdml.h.

Referenced by profinet::gsdml::ParseGsdmlString().

◆ dapSubmodules

std::vector<GSDMLSubmodule> profinet::gsdml::GSDMLDevice::dapSubmodules

DAP virtual submodules.

Definition at line 190 of file gsdml.h.

Referenced by BuildIoSlots(), profinet::gsdml::ParseGsdmlString(), and profinet::io::TEST().

◆ deviceId

std::uint16_t profinet::gsdml::GSDMLDevice::deviceId = 0

PROFINET device ID from the GSDML's DeviceIdentity (DeviceID attribute).

Definition at line 174 of file gsdml.h.

Referenced by profinet::sim::test::MakeAumaGsdml(), profinet::sim::test::MakePhoenixGsdml(), and profinet::gsdml::ParseGsdmlString().

◆ deviceName

std::string profinet::gsdml::GSDMLDevice::deviceName

Device name from the GSDML's DeviceIdentity / DeviceFunction.

Definition at line 170 of file gsdml.h.

Referenced by profinet::sim::test::MakeAumaGsdml(), profinet::sim::test::MakePhoenixGsdml(), and profinet::gsdml::ParseGsdmlString().

◆ moduleReferences

◆ modules

◆ submodules

std::map<std::string, GSDMLSubmodule> profinet::gsdml::GSDMLDevice::submodules

Every globally defined SubmoduleItem, keyed by GSDML ID.

Definition at line 199 of file gsdml.h.

Referenced by FindSubmodule(), profinet::gsdml::ParseGsdmlString(), profinet::io::TEST(), profinet::io::TEST(), and profinet::io::TEST().

◆ systemSubmodules

std::vector<GSDMLSystemSubmodule> profinet::gsdml::GSDMLDevice::systemSubmodules

System-defined submodules built into the DAP (e.g. interface, port 1).

Definition at line 193 of file gsdml.h.

Referenced by BuildIoSlots(), and profinet::gsdml::ParseGsdmlString().

◆ vendorId

std::uint16_t profinet::gsdml::GSDMLDevice::vendorId = 0

PROFINET vendor ID from the GSDML's DeviceIdentity (VendorID attribute).

Definition at line 172 of file gsdml.h.

Referenced by profinet::sim::test::MakeAumaGsdml(), profinet::sim::test::MakePhoenixGsdml(), and profinet::gsdml::ParseGsdmlString().

◆ vendorName

std::string profinet::gsdml::GSDMLDevice::vendorName

Vendor name from the GSDML's DeviceIdentity.

Definition at line 168 of file gsdml.h.

Referenced by profinet::gsdml::ParseGsdmlString().


The documentation for this struct was generated from the following files: