Package me.nabdev.oxconfig.sampleClasses
Class ConfigurableLinearInterpolation
java.lang.Object
me.nabdev.oxconfig.sampleClasses.ConfigurableLinearInterpolation
- All Implemented Interfaces:
ConfigurableClass
A configurable linear interpolation function.
This class is an example of implementing ConfigurableClass, but is safe for
competition use.
-
Constructor Summary
ConstructorsConstructorDescriptionAllocates a ConfigurableLinearInterpolation and registers it to OxConfig -
Method Summary
Modifier and TypeMethodDescriptiondouble
calculate
(double x) Calculates the y value of the linear interpolation function at the given xgetKey()
Gets the key of the configurable class (e.g.Gets the parameters of the configurable classGets the pretty name of the configurable class (e.g.double
getX1()
Gets the x1 valuedouble
getX2()
Gets the x2 valuedouble
getY1()
Gets the y1 valuedouble
getY2()
Gets the y2 value
-
Constructor Details
-
ConfigurableLinearInterpolation
Allocates a ConfigurableLinearInterpolation and registers it to OxConfig- Parameters:
key
- The json key for the controller to be stored in
-
-
Method Details
-
getParameters
Description copied from interface:ConfigurableClass
Gets the parameters of the configurable class- Specified by:
getParameters
in interfaceConfigurableClass
- Returns:
- The parameters of the configurable class
-
getKey
Description copied from interface:ConfigurableClass
Gets the key of the configurable class (e.g. "Arm"), must not include commas- Specified by:
getKey
in interfaceConfigurableClass
- Returns:
- The key of the configurable class
-
getPrettyName
Description copied from interface:ConfigurableClass
Gets the pretty name of the configurable class (e.g. "Arm")- Specified by:
getPrettyName
in interfaceConfigurableClass
- Returns:
- The pretty name of the configurable class
-
calculate
public double calculate(double x) Calculates the y value of the linear interpolation function at the given x- Parameters:
x
- The x value to calculate- Returns:
- The y value of the linear interpolation function at the given x
-
getY1
public double getY1()Gets the y1 value- Returns:
- The y1 value
-
getY2
public double getY2()Gets the y2 value- Returns:
- The y2 value
-
getX1
public double getX1()Gets the x1 value- Returns:
- The x1 value
-
getX2
public double getX2()Gets the x2 value- Returns:
- The x2 value
-