#pragma once #include "DeviceCommandInfo.h" #include "DeviceChannelCommonInfo.h" #include "EDeviceSeries.h" #include namespace Incart::DevicesInfo { // заполняется из json файла struct DeviceCommonInfo { uint16_t type; std::string name; DevicesInfo::EDeviceSeries series; std::string fileNameTag; float voltageForStartWriting; std::string visFrameFormat; std::vector channels; std::vector functional; DeviceCommandInfo commandDesription; DeviceCommonInfo() : type(0), name(""), series(DevicesInfo::EDeviceSeries::Unknown), fileNameTag(""), voltageForStartWriting(0) { } DeviceCommonInfo(uint16_t type_, const std::string& name_, DevicesInfo::EDeviceSeries series_, const std::string& fileNameTag_, float voltageForStartWriting_, const std::string& visFrameFormat_, const std::vector& channels_) : type(type_), name(name_), series(series_), fileNameTag(fileNameTag_), voltageForStartWriting(voltageForStartWriting_) , visFrameFormat(visFrameFormat_), channels(channels_) { } DeviceChannelCommonInfo getChannelInfo(const std::string& name_) const { for (auto it = channels.begin(); it != channels.end(); ++it) { if (it->name.compare(name_) == 0) { return *it; } } return DeviceChannelCommonInfo{}; } }; } // namespace Incart::DevicesInfo