Show / Hide Table of Contents

Class Datapoint

Data point abstraction. Consists of a timestamp and a double or string value

Inheritance
object
Datapoint
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Cognite.Extensions
Assembly: Cognite.Extensions.dll
Syntax
public class Datapoint

Constructors

| Edit this page View Source

Datapoint(DateTime, bool, StatusCode?)

Creates a data point without a value. You still need to specify whether the time series it is being written to is a string or numeric time series. Default quality is bad.

Declaration
public Datapoint(DateTime timestamp, bool isString, StatusCode? statusCode = null)
Parameters
Type Name Description
DateTime timestamp

Timestamp

bool isString

Whether the time series is string.

StatusCode? statusCode

BETA: set the data point status code. This is only used if the beta datapoints endpoint is used.

| Edit this page View Source

Datapoint(DateTime, double, StatusCode?)

Creates a numeric data point

Declaration
public Datapoint(DateTime timestamp, double numericValue, StatusCode? statusCode = null)
Parameters
Type Name Description
DateTime timestamp

Timestamp

double numericValue

double value

StatusCode? statusCode

BETA: set the data point status code. This is only used if the beta datapoints endpoint is used.

| Edit this page View Source

Datapoint(DateTime, string?, StatusCode?)

Creates a string data point

Declaration
public Datapoint(DateTime timestamp, string? stringValue, StatusCode? statusCode = null)
Parameters
Type Name Description
DateTime timestamp

Timestamp

string stringValue

string value

StatusCode? statusCode

BETA: set the data point status code. This is only used if the beta datapoints endpoint is used.

| Edit this page View Source

Datapoint(long, bool, StatusCode?)

Creates a data point without a value. You still need to specify whether the time series it is being written to is a string or numeric time series.

Declaration
public Datapoint(long timestamp, bool isString, StatusCode? statusCode = null)
Parameters
Type Name Description
long timestamp

Timestamp

bool isString

Whether the time series is string.

StatusCode? statusCode

BETA: set the data point status code. This is only used if the beta datapoints endpoint is used.

| Edit this page View Source

Datapoint(long, double, StatusCode?)

Creates a numeric data point

Declaration
public Datapoint(long timestamp, double numericValue, StatusCode? statusCode = null)
Parameters
Type Name Description
long timestamp

Timestamp

double numericValue

double value

StatusCode? statusCode

BETA: set the data point status code. This is only used if the beta datapoints endpoint is used.

| Edit this page View Source

Datapoint(long, string?, StatusCode?)

Creates a string data point

Declaration
public Datapoint(long timestamp, string? stringValue, StatusCode? statusCode = null)
Parameters
Type Name Description
long timestamp

Timestamp

string stringValue

string value

StatusCode? statusCode

BETA: set the data point status code. This is only used if the beta datapoints endpoint is used.

Properties

| Edit this page View Source

IsString

True if datapoint is string

Declaration
public bool IsString { get; }
Property Value
Type Description
bool
| Edit this page View Source

NumericValue

Optional double value

Declaration
public double? NumericValue { get; }
Property Value
Type Description
double?
| Edit this page View Source

Status

Datapoint status code.

Declaration
public StatusCode Status { get; }
Property Value
Type Description
StatusCode
| Edit this page View Source

StringValue

Optional string value

Declaration
public string? StringValue { get; }
Property Value
Type Description
string
| Edit this page View Source

Timestamp

Timestamp in Unix time milliseconds

Declaration
public long Timestamp { get; }
Property Value
Type Description
long

Methods

| Edit this page View Source

FromStream(Stream)

Initializes Datapoint by reading from a stream. Requires that the next bytes in the stream represent a datapoint.

Declaration
public static Datapoint? FromStream(Stream stream)
Parameters
Type Name Description
Stream stream

Stream to read from

Returns
Type Description
Datapoint
| Edit this page View Source

ToStorableBytes()

Convert datapoint into an array of bytes on the form [long timestamp][boolean isString]{Either [ushort length][string value] or [double value]}

Declaration
public byte[] ToStorableBytes()
Returns
Type Description
byte[]

Extension Methods

DataModelUtils.GetOrCreateResourcesAsync<T, T2>(T2, IEnumerable<InstanceIdentifier>, Func<IEnumerable<InstanceIdentifier>, IEnumerable<SourcedNodeWrite<T>>>, Func<IEnumerable<SourcedNodeWrite<T>>, SanitationMode, (IEnumerable<SourcedNodeWrite<T>>, IEnumerable<CogniteError<SourcedNodeWrite<T>>>)>, int, int, RetryMode, SanitationMode, CancellationToken)
Sanitation.Sanitize(Datapoint, double?)
Sanitation.Verify(Datapoint)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX