2010-01-26 22:37:48 +00:00
|
|
|
|
/*
|
|
|
|
|
|
2012-05-27 14:23:31 +00:00
|
|
|
|
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/.
|
2010-01-26 22:37:48 +00:00
|
|
|
|
|
2012-05-27 14:23:31 +00:00
|
|
|
|
Copyright (C) 2009-2012 Michael Möller <mmoeller@openhardwaremonitor.org>
|
|
|
|
|
|
2010-01-26 22:37:48 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2010-08-08 13:57:26 +00:00
|
|
|
|
using OpenHardwareMonitor.Collections;
|
2010-01-26 22:37:48 +00:00
|
|
|
|
|
|
|
|
|
namespace OpenHardwareMonitor.Hardware {
|
|
|
|
|
|
|
|
|
|
public enum SensorType {
|
2011-12-31 17:31:04 +00:00
|
|
|
|
Voltage, // V
|
|
|
|
|
Clock, // MHz
|
|
|
|
|
Temperature, // °C
|
|
|
|
|
Load, // %
|
|
|
|
|
Fan, // RPM
|
|
|
|
|
Flow, // L/h
|
|
|
|
|
Control, // %
|
|
|
|
|
Level, // %
|
2012-02-14 23:07:55 +00:00
|
|
|
|
Factor, // 1
|
2011-12-31 17:31:04 +00:00
|
|
|
|
Power, // W
|
2012-02-14 23:07:55 +00:00
|
|
|
|
Data, // GB = 2^30 Bytes
|
2016-04-28 19:58:59 +02:00
|
|
|
|
SmallData, // MB = 2^20 Bytes
|
2020-02-20 22:07:03 +01:00
|
|
|
|
Throughput, // MB/s = 2^20 Bytes/s
|
2010-01-26 22:37:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-07-27 18:38:11 +00:00
|
|
|
|
public struct SensorValue {
|
2010-09-21 20:32:36 +00:00
|
|
|
|
private readonly float value;
|
|
|
|
|
private readonly DateTime time;
|
2010-07-27 18:38:11 +00:00
|
|
|
|
|
|
|
|
|
public SensorValue(float value, DateTime time) {
|
|
|
|
|
this.value = value;
|
|
|
|
|
this.time = time;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public float Value { get { return value; } }
|
|
|
|
|
public DateTime Time { get { return time; } }
|
2010-01-26 22:37:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-05-09 16:22:13 +00:00
|
|
|
|
public interface ISensor : IElement {
|
2010-02-27 15:55:17 +00:00
|
|
|
|
|
2010-02-07 16:37:15 +00:00
|
|
|
|
IHardware Hardware { get; }
|
2010-02-27 15:55:17 +00:00
|
|
|
|
|
2010-01-26 22:37:48 +00:00
|
|
|
|
SensorType SensorType { get; }
|
2010-05-06 19:20:38 +00:00
|
|
|
|
Identifier Identifier { get; }
|
|
|
|
|
|
2010-01-26 22:37:48 +00:00
|
|
|
|
string Name { get; set; }
|
|
|
|
|
int Index { get; }
|
2010-02-27 15:55:17 +00:00
|
|
|
|
|
2010-05-06 19:20:38 +00:00
|
|
|
|
bool IsDefaultHidden { get; }
|
|
|
|
|
|
2010-02-27 15:55:17 +00:00
|
|
|
|
IReadOnlyArray<IParameter> Parameters { get; }
|
|
|
|
|
|
2010-01-26 22:37:48 +00:00
|
|
|
|
float? Value { get; }
|
|
|
|
|
float? Min { get; }
|
2010-07-04 12:49:16 +00:00
|
|
|
|
float? Max { get; }
|
|
|
|
|
|
|
|
|
|
void ResetMin();
|
|
|
|
|
void ResetMax();
|
2010-02-27 15:55:17 +00:00
|
|
|
|
|
2010-07-27 18:38:11 +00:00
|
|
|
|
IEnumerable<SensorValue> Values { get; }
|
2011-01-20 21:31:54 +00:00
|
|
|
|
|
|
|
|
|
IControl Control { get; }
|
2010-01-26 22:37:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|