C# Class OpenHardwareMonitor.DAL.DataManager

Show file Open project: pklinef/open-hardware-monitor

Public Methods

Method Description
AddHardware ( OpenHardwareMonitor.Hardware.Hardware hardware ) : void
AggregateHistoricalData ( object unused ) : void
BeginTransaction ( ) : void
EndTransaction ( ) : void
GetAggregateData ( long componentSensorId, double &min, double &max, double &avg, double &stddev, string &componentType, SensorType &sensorName ) : bool
GetAlerts ( ) : List
GetComponentId ( string name, string type ) : long
GetComponentSensorId ( String fullSensorPath ) : long
GetComputerComponentId ( long componentId, long parentComponentId ) : long
GetComputerId ( long macAddress ) : long
GetData ( string name, string type, SensorType sensorType, double &average, double &min, double &max, double &stddev ) : bool

Gets the data from the server to return to the client. Null is allowed for the name only

GetDataForSensor ( long componentSensorId, System.DateTime startTime, System.TimeSpan timeRange, DateRangeType minResolution, DateRangeType maxResolution, double &average, double &min, double &max, double &stddev ) : List
GetEmailSettings ( string &SMTPServer, string &EmailAddress ) : void
GetLastAccessTime ( ) : System.DateTime
GetSensorTypeId ( string name, string units ) : long
Initialize ( ) : void
InsertData ( List dataToInsert ) : bool

Inserts data into the server database. Nothing is allowed to be null

InsertSensorData ( String computerComponentId, String sensorID, int sensorTypeID, double value ) : void
InsertUser ( string userName, string name ) : void
RegisterSensor ( string computerComponentId, string sensorId, string sensorName, int sensorTypeId ) : void
SetEmailSettings ( string SMTPServer, string EmailAddress ) : void
UpdateLastAccessTime ( ) : void

Private Methods

Method Description
CreateTables ( ) : void
DataManager ( ) : System
GetComponentId ( OpenHardwareMonitor.Hardware.Hardware hardware ) : System.Int64
GetComponentSensorList ( ) : List
GetDataInRegistry ( string registryKey ) : string
GetTimeSpanFromDateRangeType ( DateRangeType drt ) : System.TimeSpan
InitializeSensorTypeTable ( ) : void
InsertHistoricalData ( long componentSensorId, System.DateTime measureTime, DateRangeType dateRangeType, long count, double sum, double sumOfSquares, double min, double max ) : void
RoundDownToDateRangeType ( System.DateTime dt, DateRangeType drt ) : System.DateTime
RoundDownToDay ( System.DateTime dt ) : System.DateTime
RoundDownToHour ( System.DateTime dt ) : System.DateTime
RoundDownToMinute ( System.DateTime dt ) : System.DateTime
RoundDownToSecond ( System.DateTime dt ) : System.DateTime
SetDataInRegistry ( string registryKey, string registryValue ) : void

Method Details

AddHardware() public static method

public static AddHardware ( OpenHardwareMonitor.Hardware.Hardware hardware ) : void
hardware OpenHardwareMonitor.Hardware.Hardware
return void

AggregateHistoricalData() public static method

public static AggregateHistoricalData ( object unused ) : void
unused object
return void

BeginTransaction() public static method

public static BeginTransaction ( ) : void
return void

EndTransaction() public static method

public static EndTransaction ( ) : void
return void

GetAggregateData() public static method

public static GetAggregateData ( long componentSensorId, double &min, double &max, double &avg, double &stddev, string &componentType, SensorType &sensorName ) : bool
componentSensorId long
min double
max double
avg double
stddev double
componentType string
sensorName SensorType
return bool

GetAlerts() public static method

public static GetAlerts ( ) : List
return List

GetComponentId() public static method

public static GetComponentId ( string name, string type ) : long
name string
type string
return long

GetComponentSensorId() public static method

public static GetComponentSensorId ( String fullSensorPath ) : long
fullSensorPath String
return long

GetComputerComponentId() public static method

public static GetComputerComponentId ( long componentId, long parentComponentId ) : long
componentId long
parentComponentId long
return long

GetComputerId() public static method

public static GetComputerId ( long macAddress ) : long
macAddress long
return long

GetData() public static method

Gets the data from the server to return to the client. Null is allowed for the name only
public static GetData ( string name, string type, SensorType sensorType, double &average, double &min, double &max, double &stddev ) : bool
name string
type string
sensorType SensorType
average double
min double
max double
stddev double
return bool

GetDataForSensor() public static method

public static GetDataForSensor ( long componentSensorId, System.DateTime startTime, System.TimeSpan timeRange, DateRangeType minResolution, DateRangeType maxResolution, double &average, double &min, double &max, double &stddev ) : List
componentSensorId long
startTime System.DateTime
timeRange System.TimeSpan
minResolution DateRangeType
maxResolution DateRangeType
average double
min double
max double
stddev double
return List

GetEmailSettings() public static method

public static GetEmailSettings ( string &SMTPServer, string &EmailAddress ) : void
SMTPServer string
EmailAddress string
return void

GetLastAccessTime() public static method

public static GetLastAccessTime ( ) : System.DateTime
return System.DateTime

GetSensorTypeId() public static method

public static GetSensorTypeId ( string name, string units ) : long
name string
units string
return long

Initialize() public static method

public static Initialize ( ) : void
return void

InsertData() public static method

Inserts data into the server database. Nothing is allowed to be null
public static InsertData ( List dataToInsert ) : bool
dataToInsert List
return bool

InsertSensorData() public static method

public static InsertSensorData ( String computerComponentId, String sensorID, int sensorTypeID, double value ) : void
computerComponentId String
sensorID String
sensorTypeID int
value double
return void

InsertUser() public static method

public static InsertUser ( string userName, string name ) : void
userName string
name string
return void

RegisterSensor() public static method

public static RegisterSensor ( string computerComponentId, string sensorId, string sensorName, int sensorTypeId ) : void
computerComponentId string
sensorId string
sensorName string
sensorTypeId int
return void

SetEmailSettings() public static method

public static SetEmailSettings ( string SMTPServer, string EmailAddress ) : void
SMTPServer string
EmailAddress string
return void

UpdateLastAccessTime() public static method

public static UpdateLastAccessTime ( ) : void
return void