using System.Linq; using System.Runtime.InteropServices; using NvAPIWrapper.Native.Attributes; using NvAPIWrapper.Native.General.Structures; using NvAPIWrapper.Native.Interfaces; namespace NvAPIWrapper.Native.GPU.Structures { /// /// Contains information regarding GPU cooler settings /// [StructLayout(LayoutKind.Sequential, Pack = 8)] [StructureVersion(1)] public struct PrivateCoolerSettingsV1 : IInitializable { internal const int MaxNumberOfCoolersPerGPU = 3; internal StructureVersion _Version; internal readonly uint _CoolerSettingsCount; [MarshalAs(UnmanagedType.ByValArray, SizeConst = MaxNumberOfCoolersPerGPU)] internal readonly CoolerSetting[] _CoolerSettings; /// /// Gets the list of cooler settings /// public CoolerSetting[] CoolerSettings { get => _CoolerSettings.Take((int) _CoolerSettingsCount).ToArray(); } /// /// Contains information regarding a cooler settings /// [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct CoolerSetting { internal CoolerType _CoolerType; internal CoolerController _CoolerController; internal uint _DefaultMinimumLevel; internal uint _DefaultMaximumLevel; internal uint _CurrentMinimumLevel; internal uint _CurrentMaximumLevel; internal uint _CurrentLevel; internal CoolerPolicy _DefaultPolicy; internal CoolerPolicy _CurrentPolicy; internal CoolerTarget _Target; internal CoolerControlMode _ControlMode; internal uint _IsActive; /// /// Gets the current cooler level in percentage. /// public uint CurrentLevel { get => _CurrentLevel; } /// /// Gets the default minimum cooler level in percentage. /// public uint DefaultMinimumLevel { get => _DefaultMinimumLevel; } /// /// Gets the default maximum cooler level in percentage. /// public uint DefaultMaximumLevel { get => _DefaultMaximumLevel; } /// /// Gets the current minimum cooler level in percentage. /// public uint CurrentMinimumLevel { get => _CurrentMinimumLevel; } /// /// Gets the current maximum cooler level in percentage. /// public uint CurrentMaximumLevel { get => _CurrentMaximumLevel; } /// /// Gets the cooler type. /// public CoolerType CoolerType { get => _CoolerType; } /// /// Gets the cooler controller. /// public CoolerController CoolerController { get => _CoolerController; } /// /// Gets the cooler default policy. /// public CoolerPolicy DefaultPolicy { get => _DefaultPolicy; } /// /// Gets the cooler current policy. /// public CoolerPolicy CurrentPolicy { get => _CurrentPolicy; } /// /// Gets the cooler target. /// public CoolerTarget Target { get => _Target; } /// /// Gets the cooler control mode. /// public CoolerControlMode ControlMode { get => _ControlMode; } } } }