Class MapBase
Represents the base class for all map types.
Namespace: MESL.SqlRace.Domain
Assembly: MESL.SqlRace.Domain.dll
Syntax
public abstract class MapBase : EntityBase
Constructors
MapBase(String, String, String, String, String, String)
Initialises a new instance of the MapBase class. This constructor used when map is instantiated internally (i.e. from persistence or deserialized), and data points are not populated (they become populated on demand)
Declaration
protected MapBase(string name, string description, string units, string format, string conversionXFunctionName, string conversionValueFunctionName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name of the map. |
| System.String | description | The description. |
| System.String | units | The units used by the map. |
| System.String | format | The format of the map. |
| System.String | conversionXFunctionName | Name of the conversion X function. |
| System.String | conversionValueFunctionName | Name of the conversion value function. |
Properties
BreakXPoints
Gets an array of doubles for the BreakXPoints.
Declaration
public double[] BreakXPoints { get; }
Property Value
| Type | Description |
|---|---|
| System.Double[] |
ConversionValueFunctionName
Gets the name of the ConversionValueFunction.
Declaration
public string ConversionValueFunctionName { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
ConversionXFunctionName
Gets the name of the ConversionXFunction.
Declaration
public string ConversionXFunctionName { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Description
Gets the description of the map.
Declaration
public string Description { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Format
Gets the format of the map.
Declaration
public string Format { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Name
Gets the name of the map.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Units
Gets the units of the map.
Declaration
public string Units { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Values
Gets an array of doubles for the values.
Declaration
public double[] Values { get; }
Property Value
| Type | Description |
|---|---|
| System.Double[] |
Methods
GetBytes(Double[])
Gets the bytes for a specified set of double values.
Declaration
protected static byte[] GetBytes(double[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double[] | values | The values. |
Returns
| Type | Description |
|---|---|
| System.Byte[] | Byte array of map value |
GetValuesFromBytes(Byte[])
Gets the double values from an array of bytes.
Declaration
protected static double[] GetValuesFromBytes(byte[] data)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | data | The data to get values from. |
Returns
| Type | Description |
|---|---|
| System.Double[] | Double array of values |
LocateValueCell(Double[], Int32, Int32, Double)
Locate the cell using a binary chop method
Declaration
protected int LocateValueCell(double[] breakpoints, int start, int end, double value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double[] | breakpoints | Breakpoint array. |
| System.Int32 | start | Start cell value. |
| System.Int32 | end | End cell value. |
| System.Double | value | Data value |
Returns
| Type | Description |
|---|---|
| System.Int32 | Cell value |
ToString()
Returns a System.String that represents this instance.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | A System.String that represents this instance. |
ValidateBaseArguments(String, String, String, String, String, String)
Validates the arguments.
Declaration
protected static void ValidateBaseArguments(string name, string description, string units, string format, string conversionXFunctionName, string conversionValueFunctionName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name of the map. |
| System.String | description | The description. |
| System.String | units | The units used by the map. |
| System.String | format | The format of the map. |
| System.String | conversionXFunctionName | The conversion X function. |
| System.String | conversionValueFunctionName | The conversion value function. |
ValidateBilinearMapArguments(ICollection<Double>, String, ICollection<Double>, ICollection<Double>)
Validates the arguments.
Declaration
protected void ValidateBilinearMapArguments(ICollection<double> values, string conversionYFunctionName, ICollection<double> breakXPoints, ICollection<double> breakYPoints)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.ICollection<System.Double> | values | The values. |
| System.String | conversionYFunctionName | The conversion Y function. |
| System.Collections.Generic.ICollection<System.Double> | breakXPoints | The break X points. |
| System.Collections.Generic.ICollection<System.Double> | breakYPoints | The break Y points. |
ValidateDataPoints(ICollection<Double>, ICollection<Double>)
Validates the data points.
Declaration
protected static void ValidateDataPoints(ICollection<double> values, ICollection<double> breakXPoints)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.ICollection<System.Double> | values | The values. |
| System.Collections.Generic.ICollection<System.Double> | breakXPoints | The break X points. |
ValidateLinearMapArguments(Double[], Double[])
Validates the arguments.
Declaration
protected void ValidateLinearMapArguments(double[] breakXPoints, double[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double[] | breakXPoints | The break X points. |
| System.Double[] | values | The values. |