7/include/odf_unit.hpp

66 lines
1.9 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef ODF_MANAGEMENT_ODF_UNIT_HPP
#define ODF_MANAGEMENT_ODF_UNIT_HPP
#include <string>
#include <cstdint>
/// @brief ODF 单元类型枚举
enum class OdfUnitType : uint8_t {
Splicing = 0, ///< 熔接型
Patching = 1, ///< 配线型
Hybrid = 2 ///< 混合型
};
/// @brief 安装方式枚举
enum class MountType : uint8_t {
Rack19Inch = 0, ///< 19英寸机架式
WallMounted = 1 ///< 壁挂式
};
/**
* @brief ODF 光纤配线单元基本信息
*
* 存储 ODF 单元的编号、类型、容量、尺寸及安装方式等核心属性。
*/
struct OdfUnit {
std::string id; ///< 编号(按命名规则生成)
OdfUnitType type; ///< 单元类型
uint32_t maxPorts; ///< 最大端口数(容量)
uint32_t heightMm; ///< 高度mm
uint32_t widthMm; ///< 宽度mm
uint32_t depthMm; ///< 深度mm
MountType mountType; ///< 安装方式
/**
* @brief 构造 ODF 单元
* @param id 单元编号
* @param type 单元类型
* @param maxPorts 最大端口数
* @param heightMm 高度mm
* @param widthMm 宽度mm
* @param depthMm 深度mm
* @param mountType 安装方式
*/
OdfUnit(std::string id,
OdfUnitType type,
uint32_t maxPorts,
uint32_t heightMm,
uint32_t widthMm,
uint32_t depthMm,
MountType mountType);
/// @brief 默认构造函数
OdfUnit() = default;
/// @brief 返回类型字符串表示
[[nodiscard]] std::string typeString() const;
/// @brief 返回安装方式字符串表示
[[nodiscard]] std::string mountString() const;
/// @brief 返回属性摘要
[[nodiscard]] std::string summary() const;
};
#endif // ODF_MANAGEMENT_ODF_UNIT_HPP