//----------------------------------------------------------------------------
//
// Copyright (c) Intel Corporation, 2003 - 2012 All Rights Reserved.
//
// File: CIM_Sensor.cs
//
// Contents: A Sensor is an entity capable of measuring or reporting the characteristics of some physical property - for example, the temperature or voltage characteristics of a Computer System.
// This file was automatically generated from CIM_Sensor.mof
//
//----------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
using System.Globalization;
using System.Xml.Serialization;
using System.IO;
using Intel.Manageability.WSManagement;
using Intel.Manageability.Cim.Untyped;
namespace Intel.Manageability.Cim.Typed
{
///
///A Sensor is an entity capable of measuring or reporting the characteristics of some physical property - for example, the temperature or voltage characteristics of a Computer System.
///
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_Sensor")]
[System.Xml.Serialization.XmlRootAttribute("CIM_Sensor", Namespace="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_Sensor", IsNullable=false)]
public class CIM_Sensor : CIM_LogicalDevice
{
///
/// Default constructor.
///
public CIM_Sensor() :base()
{
}
///
/// Constructor that recieves an xml string for deserialization.
///
/// xml string to deserialize
public CIM_Sensor(string xml): base((IWSManClient)null)
{
this.Deserialize(xml);
}
///
/// Constructor which recieves a Ws-Management client object.
///
/// Ws-Management client
public CIM_Sensor(IWSManClient client): base(client)
{
}
///
/// Remove CurrentState field.
/// Note: This method will succeed only if this field is optional in the concrete object.
///
public virtual void RemoveCurrentState()
{
RemoveField("CurrentState");
}
///
/// Is true if the field CurrentState exists in the current object,
/// otherwise is false.
///
public virtual bool CurrentStateExist
{
get
{
return ContainsField("CurrentState");
}
}
///
/// Optional, The current state indicated by the Sensor. This is always one of the "PossibleStates".
///
[CimField(false, false)]
public virtual string CurrentState
{
get
{
return this.GetField("CurrentState")[0];
}
set
{
this.SetOrAddField("CurrentState",value);
}
}
///
/// Remove OtherSensorTypeDescription field.
/// Note: This method will succeed only if this field is optional in the concrete object.
///
public virtual void RemoveOtherSensorTypeDescription()
{
RemoveField("OtherSensorTypeDescription");
}
///
/// Is true if the field OtherSensorTypeDescription exists in the current object,
/// otherwise is false.
///
public virtual bool OtherSensorTypeDescriptionExist
{
get
{
return ContainsField("OtherSensorTypeDescription");
}
}
///
/// Optional, A string describing the Sensor type - used when the SensorType property is set to "Other".
///
[CimField(false, false)]
public virtual string OtherSensorTypeDescription
{
get
{
return this.GetField("OtherSensorTypeDescription")[0];
}
set
{
this.SetOrAddField("OtherSensorTypeDescription",value);
}
}
///
/// Remove PollingInterval field.
/// Note: This method will succeed only if this field is optional in the concrete object.
///
public virtual void RemovePollingInterval()
{
RemoveField("PollingInterval");
}
///
/// Is true if the field PollingInterval exists in the current object,
/// otherwise is false.
///
public virtual bool PollingIntervalExist
{
get
{
return ContainsField("PollingInterval");
}
}
///
/// Optional, The polling interval that the Sensor hardware or the instrumentation uses to determine the current state of the Sensor.
///
[CimField(false, false)]
public virtual ulong PollingInterval
{
get
{
return ulong.Parse(this["PollingInterval"][0], CultureInfo.InvariantCulture);
}
set
{
this.SetOrAddField("PollingInterval",value.ToString(CultureInfo.InvariantCulture));
}
}
///
/// Remove PossibleStates field.
/// Note: This method will succeed only if this field is optional in the concrete object.
///
public virtual void RemovePossibleStates()
{
RemoveField("PossibleStates");
}
///
/// Is true if the field PossibleStates exists in the current object,
/// otherwise is false.
///
public virtual bool PossibleStatesExist
{
get
{
return ContainsField("PossibleStates");
}
}
///
/// Optional, PossibleStates enumerates the string outputs of the Sensor. For example, a "Switch" Sensor may output the states "On", or "Off". Another implementation of the Switch may output the states "Open", and "Close". Another example is a NumericSensor supporting thresholds. This Sensor can report the states like "Normal", "Upper Fatal", "Lower Non-Critical", etc. A NumericSensor that does not publish readings and thresholds, but stores this data internally, can still report its states.
///
[CimField(false, false)]
public virtual string[] PossibleStates
{
get
{
return CimTypesUtils.StringArrayToArray(this["PossibleStates"]);
}
set
{
string[] arr = CimTypesUtils.ArrayToStringArray(value);
this.SetOrAddField("PossibleStates", arr);
}
}
///
/// Remove SensorContext field.
/// Note: This method will succeed only if this field is optional in the concrete object.
///
public virtual void RemoveSensorContext()
{
RemoveField("SensorContext");
}
///
/// Is true if the field SensorContext exists in the current object,
/// otherwise is false.
///
public virtual bool SensorContextExist
{
get
{
return ContainsField("SensorContext");
}
}
///
/// Optional, SensorContext indicates the purpose and context of the sensor. For example, the property may indicate what entity is being monitored or where the sensor is installed. Contextual and location information should be provided using associations to existing model elements. This property may be used if additional differentiation is necessary beyond that which is possible to convey using associations or values of SensorType. The value shall be formatted using the following algorithm:
/// <OrgID>:<LocalID>
/// Where <OrgID> and <LocalID> are separated by a colon (:), and where <OrgID> shall include a copyrighted, trademarked, or otherwise unique name that is owned by the business entity that is creating or defining the SensorContext or that is a registered ID assigned to the business entity by a recognized global authority. In addition, to ensure uniqueness, <OrgID> shall not contain a colon (:).
/// <LocalID> is chosen by the business entity and should not be reused to identify different underlying (real-world) elements.
///
[CimField(false, false)]
public virtual string SensorContext
{
get
{
return this.GetField("SensorContext")[0];
}
set
{
this.SetOrAddField("SensorContext",value);
}
}
///
/// Remove SensorType field.
/// Note: This method will succeed only if this field is optional in the concrete object.
///
public virtual void RemoveSensorType()
{
RemoveField("SensorType");
}
///
/// Is true if the field SensorType exists in the current object,
/// otherwise is false.
///
public virtual bool SensorTypeExist
{
get
{
return ContainsField("SensorType");
}
}
///
/// Optional, The Type of the Sensor, e.g. Voltage or Temperature Sensor. If the type is set to "Other", then the OtherSensorType Description can be used to further identify the type, or if the Sensor has numeric readings, then the type of the Sensor can be implicitly determined by the Units. A description of the different Sensor types is as follows: A Temperature Sensor measures the environmental temperature. Voltage and Current Sensors measure electrical voltage and current readings. A Tachometer measures speed/revolutions of a Device. For example, a Fan Device can have an associated Tachometer which measures its speed. A Counter is a general purpose Sensor that measures some numerical property of a Device. A Counter value can be cleared, but it never decreases. A Switch Sensor has states like Open/Close, On/Off, or Up/Down. A Lock has states of Locked/Unlocked. Humidity, Smoke Detection and Air Flow Sensors measure the equivalent environmental characteristics. A Presence Sensor detects the presence of a PhysicalElement. A Power Consumption Sensor measures the instantaneous power consumed by a managed element. A Power Production Sensor measures the instantaneous power produced by a managed element such as a power supply or a voltage regulator. A pressure sensor is used to report pressure. Intrusion sensor reports an intrusion of an enclosure regardless whether it was authorized or not.
///
[CimField(false, false)]
public virtual ushort SensorType
{
get
{
return ushort.Parse(this["SensorType"][0], CultureInfo.InvariantCulture);
}
set
{
this.SetOrAddField("SensorType",value.ToString(CultureInfo.InvariantCulture));
}
}
///
/// Enumerate instances of CIM_Sensor class at an endpoint.
///
/// WS-Management client
/// Keys for selecting the instances
/// Collection of CIM_Sensor objects
public static new Collection Enumerate(IWSManClient client, CimBase.CimKeys cimKeys)
{
List ret = CimBase.Enumerate(client, cimKeys);
return new Collection(ret);
}
///
/// Enumerate instances of CIM_Sensor class at an endpoint.
///
/// WS-Management client
/// Collection of CIM_Sensor objects
public static new Collection Enumerate(IWSManClient client)
{
List ret = CimBase.Enumerate(client);
return new Collection(ret);
}
///
/// Delete the instance of CIM_Sensor if it is singular.
/// Note: This method will succeed only if a single instance of the class exists.
///
/// WS-Management client
public static new void Delete(IWSManClient client)
{
CimBase.Delete(client);
}
///
/// Represents the keys of the CIM_Sensor class.
///
public new class CimKeys : CIM_LogicalDevice.CimKeys
{
}
}
}