// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. // Copyright (C) LibreHardwareMonitor and Contributors. // Partial Copyright (C) Michael Möller and Contributors. // All Rights Reserved. using System; using System.Collections.Generic; namespace LibreHardwareMonitor.Hardware; /// /// Category of what type the selected sensor is. /// public enum SensorType { Voltage, // V Current, // A Power, // W Clock, // MHz Temperature, // °C Load, // % Frequency, // Hz Fan, // RPM Flow, // L/h Control, // % Level, // % Factor, // 1 Data, // GB = 2^30 Bytes SmallData, // MB = 2^20 Bytes Throughput, // B/s TimeSpan, // Seconds Energy, // milliwatt-hour (mWh) Noise, // dBA Conductivity, // µS/cm Humidity // % } /// /// Stores the readed value and the time in which it was recorded. /// public struct SensorValue { /// of the sensor. /// The time code during which the was recorded. public SensorValue(float value, DateTime time) { Value = value; Time = time; } /// /// Gets the value of the sensor /// public float Value { get; } /// /// Gets the time code during which the was recorded. /// public DateTime Time { get; } } /// /// Stores information about the readed values and the time in which they were collected. /// public interface ISensor : IElement { IControl Control { get; } /// /// /// IHardware Hardware { get; } Identifier Identifier { get; } /// /// Gets the unique identifier of this sensor for a given . /// int Index { get; } bool IsDefaultHidden { get; } /// /// Gets a maximum value recorded for the given sensor. /// float? Max { get; } /// /// Gets a minimum value recorded for the given sensor. /// float? Min { get; } /// /// Gets or sets a sensor name. /// By default determined by the library. /// string Name { get; set; } IReadOnlyList Parameters { get; } /// /// /// SensorType SensorType { get; } /// /// Gets the last recorded value for the given sensor. /// float? Value { get; } /// /// Gets a list of recorded values for the given sensor. /// IEnumerable Values { get; } TimeSpan ValuesTimeWindow { get; set; } /// /// Resets a value stored in . /// void ResetMin(); /// /// Resets a value stored in . /// void ResetMax(); /// /// Clears the values stored in . /// void ClearValues(); }