C# Class GSF.TimeSeries.MeasurementKey

显示文件 Open project: GridProtectionAlliance/gsf Class Usage Examples

Public Properties

Property Type Description
Undefined MeasurementKey

Public Methods

Method Description
CreateOrUpdate ( System.Guid signalID, string value ) : MeasurementKey

Constructs a new MeasurementKey given the specified parameters.

CreateOrUpdate ( System.Guid signalID, string source, uint id ) : MeasurementKey

Constructs a new MeasurementKey given the specified parameters.

EstablishDefaultCache ( IDbConnection connection, Type adapterType, string measurementTable = "ActiveMeasurement" ) : void

Establish default MeasurementKey cache.

Source tables are expected to have at least the following fields: ID NVARCHAR Measurement key formatted as: ArchiveSource:PointID SignalID GUID Unique identification for measurement

GetHashCode ( ) : int

Serves as a hash function for the current MeasurementKey.

LookUpBySignalID ( System.Guid signalID ) : MeasurementKey

Looks up the measurement key associated with the given signal ID.

If no measurement key is found with the given signal ID, this method returns Undefined.

LookUpBySource ( string source, uint id ) : MeasurementKey

Looks up the measurement key associated with the given source and ID.

If no measurement key is found with the given source and ID, this method returns Undefined.

LookUpOrCreate ( System.Guid signalID, string value ) : MeasurementKey

Performs a lookup by signal ID and, failing that, attempts to create the key using the given signal ID and the parsed source, and ID.

LookUpOrCreate ( System.Guid signalID, string source, uint id ) : MeasurementKey

Performs a lookup by signal ID and, failing that, attempts to create the key using the given signal ID, source, and ID.

LookUpOrCreate ( string value ) : MeasurementKey

Performs a lookup by source and, failing that, attempts to create the key using a newly generated signal ID and the parsed source and ID.

LookUpOrCreate ( string source, uint id ) : MeasurementKey

Performs a lookup by source and, failing that, attempts to create the key using a newly generated signal ID and the given source and ID.

Parse ( string value ) : MeasurementKey

Converts the string representation of a MeasurementKey into its value equivalent.

SetMeasurementMetadata ( string tagName, double adder, double multiplier, MeasurementValueFilterFunction valueFilter ) : void

Updates the values of the Metadata.

ToString ( ) : string

Returns a string that represents the current MeasurementKey.

TryCreateOrUpdate ( System.Guid signalID, string value, MeasurementKey &key ) : bool

Constructs a new MeasurementKey given the specified parameters.

TryCreateOrUpdate ( System.Guid signalID, string source, uint id, MeasurementKey &key ) : bool

Constructs a new MeasurementKey given the specified parameters.

TryParse ( string value, MeasurementKey &key ) : bool

Attempts to convert the string representation of a MeasurementKey into its value equivalent.

Private Methods

Method Description
CreateUndefinedMeasurementKey ( ) : MeasurementKey

Creates the undefined measurement key. Used to initialize Undefined.

MeasurementKey ( ) : System
MeasurementKey ( System.Guid signalID, uint id, string source ) : System
TrySplit ( string value, string &source, uint &id ) : bool

Attempts to split the given string representation of a measurement key into a source and ID pair.

Method Details

CreateOrUpdate() public static method

Constructs a new MeasurementKey given the specified parameters.
cannot be empty The value is not in the correct format for a value.
public static CreateOrUpdate ( System.Guid signalID, string value ) : MeasurementKey
signalID System.Guid ID of associated signal, if defined.
value string A string representation of the .
return MeasurementKey

CreateOrUpdate() public static method

Constructs a new MeasurementKey given the specified parameters.
cannot be empty. cannot be null.
public static CreateOrUpdate ( System.Guid signalID, string source, uint id ) : MeasurementKey
signalID System.Guid ID of associated signal, if defined.
source string Source of the measurement that this represents (e.g., name of archive).
id uint Numeric ID of the measurement that this represents.
return MeasurementKey

EstablishDefaultCache() public static method

Establish default MeasurementKey cache.
Source tables are expected to have at least the following fields: ID NVARCHAR Measurement key formatted as: ArchiveSource:PointID SignalID GUID Unique identification for measurement
public static EstablishDefaultCache ( IDbConnection connection, Type adapterType, string measurementTable = "ActiveMeasurement" ) : void
connection IDbConnection The database connection.
adapterType System.Type The database adapter type.
measurementTable string Measurement table name used to load measurement key cache.
return void

GetHashCode() public method

Serves as a hash function for the current MeasurementKey.
public GetHashCode ( ) : int
return int

LookUpBySignalID() public static method

Looks up the measurement key associated with the given signal ID.
If no measurement key is found with the given signal ID, this method returns Undefined.
public static LookUpBySignalID ( System.Guid signalID ) : MeasurementKey
signalID System.Guid The signal ID of the measurement key.
return MeasurementKey

LookUpBySource() public static method

Looks up the measurement key associated with the given source and ID.
If no measurement key is found with the given source and ID, this method returns Undefined.
public static LookUpBySource ( string source, uint id ) : MeasurementKey
source string The source of the signal.
id uint The source-specific unique integer identifier.
return MeasurementKey

LookUpOrCreate() public static method

Performs a lookup by signal ID and, failing that, attempts to create the key using the given signal ID and the parsed source, and ID.
public static LookUpOrCreate ( System.Guid signalID, string value ) : MeasurementKey
signalID System.Guid The signal ID of the key to be looked up.
value string A string representation of the .
return MeasurementKey

LookUpOrCreate() public static method

Performs a lookup by signal ID and, failing that, attempts to create the key using the given signal ID, source, and ID.
public static LookUpOrCreate ( System.Guid signalID, string source, uint id ) : MeasurementKey
signalID System.Guid The signal ID of the key to be looked up.
source string The source to use for the key if the lookup fails.
id uint The ID to use for the key if the lookup fails.
return MeasurementKey

LookUpOrCreate() public static method

Performs a lookup by source and, failing that, attempts to create the key using a newly generated signal ID and the parsed source and ID.
public static LookUpOrCreate ( string value ) : MeasurementKey
value string A string representation of the .
return MeasurementKey

LookUpOrCreate() public static method

Performs a lookup by source and, failing that, attempts to create the key using a newly generated signal ID and the given source and ID.
public static LookUpOrCreate ( string source, uint id ) : MeasurementKey
source string The source to use for the key if the lookup fails.
id uint The ID to use for the key if the lookup fails.
return MeasurementKey

Parse() public static method

Converts the string representation of a MeasurementKey into its value equivalent.
The value is not in the correct format for a value.
public static Parse ( string value ) : MeasurementKey
value string A string representing the to convert.
return MeasurementKey

SetMeasurementMetadata() public method

Updates the values of the Metadata.
public SetMeasurementMetadata ( string tagName, double adder, double multiplier, MeasurementValueFilterFunction valueFilter ) : void
tagName string Gets or sets the text based tag name.
adder double Defines an offset to add to the value.
multiplier double Defines a multiplicative offset to apply to the value.
valueFilter MeasurementValueFilterFunction Defines the to use when downsampling this type of value.
return void

ToString() public method

Returns a string that represents the current MeasurementKey.
public ToString ( ) : string
return string

TryCreateOrUpdate() public static method

Constructs a new MeasurementKey given the specified parameters.
cannot be empty. Measurement key Source cannot be null.
public static TryCreateOrUpdate ( System.Guid signalID, string value, MeasurementKey &key ) : bool
signalID System.Guid ID of associated signal, if defined.
value string A string representation of the .
key MeasurementKey The measurement key that was created or updated or .
return bool

TryCreateOrUpdate() public static method

Constructs a new MeasurementKey given the specified parameters.
cannot be empty. cannot be null.
public static TryCreateOrUpdate ( System.Guid signalID, string source, uint id, MeasurementKey &key ) : bool
signalID System.Guid ID of associated signal, if defined.
source string Source of the measurement that this represents (e.g., name of archive).
id uint Numeric ID of the measurement that this represents.
key MeasurementKey The measurement key that was created or updated or .
return bool

TryParse() public static method

Attempts to convert the string representation of a MeasurementKey into its value equivalent.
public static TryParse ( string value, MeasurementKey &key ) : bool
value string A string representing the to convert.
key MeasurementKey Output in which to stored parsed value.
return bool

Property Details

Undefined public_oe static_oe property

Represents an undefined measurement key.
public static MeasurementKey,GSF.TimeSeries Undefined
return MeasurementKey