Class Channel
Represents a measurement channel with sample and reference values, measured in mV.
public class Channel : IJsonSerializable
- Inheritance
-
Channel
- Implements
- Inherited Members
Constructors
Channel(double, double, int)
Initializes a new instance of the Channel class with optional dark and value values.
public Channel(double dark = 0, double value = 0, int ledPower = 0)
Parameters
dark
doubleThe dark value in mV (default: 0.0).
value
doubleThe value in mV (default: 0.0).
ledPower
intThe led power, no unit, range 0..255 (default: 0).
Properties
Dark
Gets or sets the dark value in mV.
public double Dark { get; set; }
Property Value
LedPower
Gets or sets the led power. No unit, range 0..255..
public int LedPower { get; set; }
Property Value
Value
Gets or sets the value in mV.
public double Value { get; set; }
Property Value
Methods
Delta()
Calculates the difference between value and dark.
public double Delta()
Returns
- double
difference in mV
FromJson(JsonNode)
Creates a Channel instance from a JSON node.
public static Channel FromJson(JsonNode node)
Parameters
node
JsonNodeThe JSON node containing the channel data.
Returns
Exceptions
- ArgumentException
Thrown when the JSON node is invalid.
ToJson()
Converts the channel values to a JSON representation.
public JsonNode ToJson()
Returns
- JsonNode
A JsonNode representing the channel values.
ToString()
Returns a string representation of the channel values.
public override string ToString()
Returns
- string
A string in the format "Sample: [value] Reference: [value]".