org.opengts.db
Class FuelLevelProfile

java.lang.Object
  extended by org.opengts.db.FuelLevelProfile

public class FuelLevelProfile
extends java.lang.Object


Field Summary
static java.lang.String[] ARG_FUEL_HEIGHT
           
static java.lang.String[] ARG_FUEL_LEVEL
           
static java.lang.String[] ARG_PROFILE
           
static java.lang.String[] ARG_ROD_HEIGHT
           
static java.lang.String[] ARG_TANK_HEIGHT
           
static java.lang.String FLP_CYLINDER_ID_percent
           
static java.lang.String FLP_CYLINDER_NAME
           
static java.lang.String FLP_LINEAR_ID_percent
           
static java.lang.String FLP_LINEAR_NAME
           
static java.lang.String FLP_NONE_ID
           
static java.lang.String FLP_NONE_NAME
           
static java.lang.String FLP_PROFILE_ID
           
static java.lang.String FLP_PROFILE_NAME
           
 
Constructor Summary
FuelLevelProfile(java.lang.String profile, I18N.Text desc)
          Constructor
 
Method Summary
static FuelLevelProfile AddFuelLevelProfile(java.lang.String ID, double scale, org.opengts.db.FuelLevelProfile.ProfileItem[] prof, I18N.Text desc)
          Add a FuelLevelProfile
static FuelLevelProfile AddFuelLevelProfile(java.lang.String ID, java.lang.String profile, I18N.Text desc)
          Add a FuelLevelProfile
 double getActualFuelLevel(double fuelLevelVal)
          Gets the actual fuel level from the event specified fuel level
 java.lang.String getDescription(java.util.Locale locale)
          Gets the Description of this FuelLevelProfile
static FuelLevelProfile GetFuelLevelProfile(java.lang.String profID)
          Gets the FuelLevelProfile for the specified name.
static FuelLevelProfile GetFuelLevelProfile(java.lang.String profID, FuelLevelProfile dft)
          Gets the FuelLevelProfile for the specified name.
static OrderedMap<java.lang.String,java.lang.String> GetFuelLevelProfiles(java.util.Locale locale, boolean inclNone)
          Returns a list of FuelLevelProfile IDs
 java.lang.String getID()
          Gets the ID of this FuelLevelProfile
 java.lang.String getName()
          Gets the ID of this FuelLevelProfile
 double getOffset()
          Gets the profile offset
 double getScale()
          Gets the profile scale
 boolean hasCurveFit()
          Returns true if CurveFit is enabled
static boolean IsCylinder(java.lang.String flpn)
          Convenience for checking the FuelLevelProfile name "CYLINDER"
static boolean IsLinear(java.lang.String flpn)
          Convenience for checking the FuelLevelProfile name "LINEAR"
static boolean IsNone(java.lang.String flpn)
          Convenience for checking the FuelLevelProfile name "NONE"
static boolean IsProfile(java.lang.String flpn)
          Convenience for checking the FuelLevelProfile name "PROFILE"
 boolean isValid()
          Returns true if this FuelLevelProfile is valid
static void main(java.lang.String[] argv)
           
static void printFuelLevelProfile(DCServerConfig dcs, int width)
          Prints the defined FuelLevelProfile headers
 double scaleValue(double val)
          Adjusts the input value with the profile offset and scale
 void setDescription(I18N.Text desc)
          Sets the Description of this FuelLevelProfile
 void setID(java.lang.String ID)
          Gets the ID of this FuelLevelProfile
 java.lang.String toString()
          Returns a String representation of this instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FLP_NONE_NAME

public static java.lang.String FLP_NONE_NAME

FLP_NONE_ID

public static java.lang.String FLP_NONE_ID

FLP_LINEAR_NAME

public static java.lang.String FLP_LINEAR_NAME

FLP_LINEAR_ID_percent

public static java.lang.String FLP_LINEAR_ID_percent

FLP_CYLINDER_NAME

public static java.lang.String FLP_CYLINDER_NAME

FLP_CYLINDER_ID_percent

public static java.lang.String FLP_CYLINDER_ID_percent

FLP_PROFILE_NAME

public static java.lang.String FLP_PROFILE_NAME

FLP_PROFILE_ID

public static java.lang.String FLP_PROFILE_ID

ARG_PROFILE

public static final java.lang.String[] ARG_PROFILE

ARG_FUEL_LEVEL

public static final java.lang.String[] ARG_FUEL_LEVEL

ARG_TANK_HEIGHT

public static final java.lang.String[] ARG_TANK_HEIGHT

ARG_FUEL_HEIGHT

public static final java.lang.String[] ARG_FUEL_HEIGHT

ARG_ROD_HEIGHT

public static final java.lang.String[] ARG_ROD_HEIGHT
Constructor Detail

FuelLevelProfile

public FuelLevelProfile(java.lang.String profile,
                        I18N.Text desc)
Constructor

Method Detail

IsNone

public static boolean IsNone(java.lang.String flpn)
Convenience for checking the FuelLevelProfile name "NONE"

Returns:
True if the specified name is equivalent to "NONE"

IsLinear

public static boolean IsLinear(java.lang.String flpn)
Convenience for checking the FuelLevelProfile name "LINEAR"

Returns:
True if the specified name is equivalent to "LINEAR"

IsCylinder

public static boolean IsCylinder(java.lang.String flpn)
Convenience for checking the FuelLevelProfile name "CYLINDER"

Returns:
True if the specified name is equivalent to "CYLINDER"

IsProfile

public static boolean IsProfile(java.lang.String flpn)
Convenience for checking the FuelLevelProfile name "PROFILE"

Returns:
True if the specified name is equivalent to "PROFILE"

GetFuelLevelProfiles

public static OrderedMap<java.lang.String,java.lang.String> GetFuelLevelProfiles(java.util.Locale locale,
                                                                                 boolean inclNone)
Returns a list of FuelLevelProfile IDs


AddFuelLevelProfile

public static FuelLevelProfile AddFuelLevelProfile(java.lang.String ID,
                                                   java.lang.String profile,
                                                   I18N.Text desc)
Add a FuelLevelProfile


AddFuelLevelProfile

public static FuelLevelProfile AddFuelLevelProfile(java.lang.String ID,
                                                   double scale,
                                                   org.opengts.db.FuelLevelProfile.ProfileItem[] prof,
                                                   I18N.Text desc)
Add a FuelLevelProfile


GetFuelLevelProfile

public static FuelLevelProfile GetFuelLevelProfile(java.lang.String profID)
Gets the FuelLevelProfile for the specified name. Does not return null. If the profile name is not found, the LINEAR(percent) profile will be returned.


GetFuelLevelProfile

public static FuelLevelProfile GetFuelLevelProfile(java.lang.String profID,
                                                   FuelLevelProfile dft)
Gets the FuelLevelProfile for the specified name. Does not return null. If the profile name is not found, the LINEAR profile will be returned.


printFuelLevelProfile

public static void printFuelLevelProfile(DCServerConfig dcs,
                                         int width)
Prints the defined FuelLevelProfile headers


setID

public void setID(java.lang.String ID)
Gets the ID of this FuelLevelProfile


getID

public java.lang.String getID()
Gets the ID of this FuelLevelProfile


getName

public java.lang.String getName()
Gets the ID of this FuelLevelProfile


setDescription

public void setDescription(I18N.Text desc)
Sets the Description of this FuelLevelProfile


getDescription

public java.lang.String getDescription(java.util.Locale locale)
Gets the Description of this FuelLevelProfile


getScale

public double getScale()
Gets the profile scale


getOffset

public double getOffset()
Gets the profile offset


scaleValue

public double scaleValue(double val)
Adjusts the input value with the profile offset and scale


isValid

public boolean isValid()
Returns true if this FuelLevelProfile is valid


hasCurveFit

public boolean hasCurveFit()
Returns true if CurveFit is enabled


getActualFuelLevel

public double getActualFuelLevel(double fuelLevelVal)
Gets the actual fuel level from the event specified fuel level

Parameters:
fuelLevelVal - The event specified fuel level
Returns:
The actual fuel level

toString

public java.lang.String toString()
Returns a String representation of this instance

Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] argv)