Initial internal documentation (#391)

Thanks to @Pomianowski
This commit is contained in:
Pomian
2021-06-01 13:31:55 +02:00
committed by GitHub
parent 5dc6cb95c8
commit 694b5db58c
8 changed files with 413 additions and 38 deletions
@@ -9,6 +9,9 @@ using System.Collections.Generic;
namespace LibreHardwareMonitor.Hardware
{
/// <summary>
/// Category of what type the selected sensor is.
/// </summary>
public enum SensorType
{
Voltage, // V
@@ -28,49 +31,94 @@ namespace LibreHardwareMonitor.Hardware
Throughput // B/s
}
/// <summary>
/// Stores the readed value and the time in which it was recorded.
/// </summary>
public struct SensorValue
{
/// <param name="value"><see cref="Value"/> of the sensor.</param>
/// <param name="time">The time code during which the <see cref="Value"/> was recorded.</param>
public SensorValue(float value, DateTime time)
{
Value = value;
Time = time;
}
/// <summary>
/// Gets the value of the sensor
/// </summary>
public float Value { get; }
/// <summary>
/// Gets the time code during which the <see cref="Value"/> was recorded.
/// </summary>
public DateTime Time { get; }
}
/// <summary>
/// Stores information about the readed values and the time in which they were collected.
/// </summary>
public interface ISensor : IElement
{
IControl Control { get; }
/// <summary>
/// <inheritdoc cref="IHardware"/>
/// </summary>
IHardware Hardware { get; }
Identifier Identifier { get; }
/// <summary>
/// Gets the unique identifier of this sensor for a given <see cref="IHardware"/>.
/// </summary>
int Index { get; }
bool IsDefaultHidden { get; }
/// <summary>
/// Gets a maximum value recorded for the given sensor.
/// </summary>
float? Max { get; }
/// <summary>
/// Gets a minimum value recorded for the given sensor.
/// </summary>
float? Min { get; }
/// <summary>
/// Gets or sets a sensor name.
/// <para>By default determined by the library.</para>
/// </summary>
string Name { get; set; }
IReadOnlyList<IParameter> Parameters { get; }
/// <summary>
/// <inheritdoc cref="LibreHardwareMonitor.Hardware.SensorType"/>
/// </summary>
SensorType SensorType { get; }
/// <summary>
/// Gets the last recorded value for the given sensor.
/// </summary>
float? Value { get; }
/// <summary>
/// Gets a list of recorded values for the given sensor.
/// </summary>
IEnumerable<SensorValue> Values { get; }
TimeSpan ValuesTimeWindow { get; set; }
/// <summary>
/// Resets a value stored in <see cref="Min"/>.
/// </summary>
void ResetMin();
/// <summary>
/// Resets a value stored in <see cref="Max"/>.
/// </summary>
void ResetMax();
}
}