Hardware/ISensor.cs
author StephaneLenclud
Thu, 18 Apr 2013 23:25:10 +0200
branchMiniDisplay
changeset 444 9b09e2ee0968
parent 340 600962f8a298
permissions -rw-r--r--
Front View plug-in does not init if no sensor added.
Fixing some format to make strings shorter.
Now trying to start SoundGraphAccess.exe process from same directory.
Packed mode now can display three sensors along with the current time.
     1 /*
     2  
     3   This Source Code Form is subject to the terms of the Mozilla Public
     4   License, v. 2.0. If a copy of the MPL was not distributed with this
     5   file, You can obtain one at http://mozilla.org/MPL/2.0/.
     6  
     7   Copyright (C) 2009-2012 Michael Möller <mmoeller@openhardwaremonitor.org>
     8 	
     9 */
    10 
    11 using System;
    12 using System.Collections.Generic;
    13 using OpenHardwareMonitor.Collections;
    14 
    15 namespace OpenHardwareMonitor.Hardware {
    16 
    17   public enum SensorType {
    18     Voltage, // V
    19     Clock, // MHz
    20     Temperature, // °C
    21     Load, // %
    22     Fan, // RPM
    23     Flow, // L/h
    24     Control, // %
    25     Level, // %
    26     Factor, // 1
    27     Power, // W
    28     Data, // GB = 2^30 Bytes    
    29   }
    30 
    31   public struct SensorValue {
    32     private readonly float value;
    33     private readonly DateTime time;
    34 
    35     public SensorValue(float value, DateTime time) {
    36       this.value = value;
    37       this.time = time;
    38     }
    39 
    40     public float Value { get { return value; } }
    41     public DateTime Time { get { return time; } }
    42   }
    43 
    44   public interface ISensor : IElement {
    45 
    46     IHardware Hardware { get; }
    47 
    48     SensorType SensorType { get; }
    49     Identifier Identifier { get; }
    50 
    51     string Name { get; set; }
    52     int Index { get; }
    53 
    54     bool IsDefaultHidden { get; }
    55 
    56     IReadOnlyArray<IParameter> Parameters { get; }
    57 
    58     float? Value { get; }
    59     float? Min { get; }
    60     float? Max { get; }
    61 
    62     void ResetMin();
    63     void ResetMax();
    64 
    65     IEnumerable<SensorValue> Values { get; }
    66 
    67     IControl Control { get; }
    68   }
    69 
    70 }