Hardware/ISensor.cs
author moel.mich
Tue, 30 Dec 2014 21:04:54 +0000
changeset 430 6b24e39f1b84
parent 340 600962f8a298
permissions -rw-r--r--
Fixed Issue 651.
moel@1
     1
/*
moel@1
     2
 
moel@344
     3
  This Source Code Form is subject to the terms of the Mozilla Public
moel@344
     4
  License, v. 2.0. If a copy of the MPL was not distributed with this
moel@344
     5
  file, You can obtain one at http://mozilla.org/MPL/2.0/.
moel@1
     6
 
moel@344
     7
  Copyright (C) 2009-2012 Michael Möller <mmoeller@openhardwaremonitor.org>
moel@344
     8
	
moel@1
     9
*/
moel@1
    10
moel@1
    11
using System;
moel@1
    12
using System.Collections.Generic;
moel@165
    13
using OpenHardwareMonitor.Collections;
moel@1
    14
moel@1
    15
namespace OpenHardwareMonitor.Hardware {
moel@1
    16
moel@1
    17
  public enum SensorType {
moel@324
    18
    Voltage, // V
moel@324
    19
    Clock, // MHz
moel@324
    20
    Temperature, // °C
moel@324
    21
    Load, // %
moel@324
    22
    Fan, // RPM
moel@324
    23
    Flow, // L/h
moel@324
    24
    Control, // %
moel@324
    25
    Level, // %
moel@340
    26
    Factor, // 1
moel@324
    27
    Power, // W
moel@340
    28
    Data, // GB = 2^30 Bytes    
moel@1
    29
  }
moel@1
    30
moel@159
    31
  public struct SensorValue {
moel@195
    32
    private readonly float value;
moel@195
    33
    private readonly DateTime time;
moel@159
    34
moel@159
    35
    public SensorValue(float value, DateTime time) {
moel@159
    36
      this.value = value;
moel@159
    37
      this.time = time;
moel@159
    38
    }
moel@159
    39
moel@159
    40
    public float Value { get { return value; } }
moel@159
    41
    public DateTime Time { get { return time; } }
moel@1
    42
  }
moel@1
    43
moel@110
    44
  public interface ISensor : IElement {
moel@63
    45
moel@28
    46
    IHardware Hardware { get; }
moel@63
    47
moel@1
    48
    SensorType SensorType { get; }
moel@109
    49
    Identifier Identifier { get; }
moel@109
    50
moel@1
    51
    string Name { get; set; }
moel@1
    52
    int Index { get; }
moel@63
    53
moel@109
    54
    bool IsDefaultHidden { get; }
moel@109
    55
moel@63
    56
    IReadOnlyArray<IParameter> Parameters { get; }
moel@63
    57
moel@1
    58
    float? Value { get; }
moel@1
    59
    float? Min { get; }
moel@151
    60
    float? Max { get; }
moel@151
    61
moel@151
    62
    void ResetMin();
moel@151
    63
    void ResetMax();
moel@63
    64
moel@159
    65
    IEnumerable<SensorValue> Values { get; }
moel@247
    66
moel@247
    67
    IControl Control { get; }
moel@1
    68
  }
moel@1
    69
moel@1
    70
}