Class ControllerAccess

java.lang.Object
com.efiAnalytics.plugin.ecu.ControllerAccess

public class ControllerAccess extends Object
This is a Singleton that acts as a gateway to the Controller for the plugin. It is will be initialized by the host application TunerStudio with valid implementations of ControllerParameterServer and OutputChannelServer.
Author:
Phil Tobin
  • Method Details

    • initialize

      public static void initialize(OutputChannelServer outputServer, ControllerParameterServer parameterServer)
      Initializes this ControllerAccess with valid implementations of ControllerParameterServer and OutputChannelServer. This should only be called by the host application, not the plugin Plug ins will access this via getInstance() or as it is passed into ApplicationPlugin initialize.
      Parameters:
      outputServer - A instance of a OutputChannelServer
      parameterServer - An instance of ControllerParameterServer
    • getInstance

      public static ControllerAccess getInstance()
      This will provide add hock access to the ControllerAccess. initialize must have been called first by the host application. This would normally happen during application start up.
      Returns:
      A reference to the Singleton instance of this
    • getOutputChannelServer

      public OutputChannelServer getOutputChannelServer()
      Provides access to the OuputChannelServer.
      Returns:
      An instance of OutputChannelServer for access to the currently loaded controller configuration.
    • getControllerParameterServer

      public ControllerParameterServer getControllerParameterServer()
      Provides access to ControllerParameterServer
      Returns:
      An instance of ControllerParemeterServer that was initialized by the host application
    • getEcuConfigurationNames

      public String[] getEcuConfigurationNames()
      Provides visibility to the currently loaded Configuration Names. In a typical 1 controller configuration this will be an array length of 1 containing only the loaded project name. However if you have multiple controllers loaded as in a project with CAN devices, all configuration names will be supplied.
      Returns:
      the names of all loaded configurations.
    • setConfigurationNameProvider

      public void setConfigurationNameProvider(EcuConfigurationNameServer configurationNameProvider)
      Parameters:
      configurationNameProvider - the configurationNameProvider to set
    • evaluateExpression

      public double evaluateExpression(String configurationName, String expression) throws MathException
      evaluates any mathematical expression made up of numbers, OutputChannel names and Constant/ControllerParameter names. If you are familiar with the expressions that can be implemented in the ini file, these expressions would follow the same rules and format, but can be generated at runtime. Constant names will be resolved using the current known value OutputChannel names will be resolved to the last known value.
      Parameters:
      configurationName -
      expression -
      Returns:
      the evaluated expression.
      Throws:
      MathException
    • sendBurnCommand

      public void sendBurnCommand(String configurationName) throws ControllerException
      sends a Burn Command to the named ECU Configuration instructing it to persist setting data from RAM to FLASH
      Parameters:
      configurationName -
      Throws:
      ControllerException
    • setMathExpressionEvaluator

      public void setMathExpressionEvaluator(MathExpressionEvaluator mathExpressionEvaluator)
      Parameters:
      mathExpressionEvaluator - the mathExpressionEvaluator to set
    • getUiComponentServer

      public UiSettingServer getUiComponentServer(String configurationName) throws ControllerException
      Returns:
      the uiComponentServer
      Throws:
      ControllerException
    • setUiComponentServerProvider

      public void setUiComponentServerProvider(UiSettingServerProvider uiComponentServer)
      Parameters:
      uiComponentServer - the uiComponentServer to set
    • setBurnExecutor

      public void setBurnExecutor(BurnExecutor burnExecutor)
      Parameters:
      burnExecutor - the burnExecutor to set
    • setOnlineExecutor

      public void setOnlineExecutor(OnlineExecution onlineExecutor)
      Parameters:
      onlineExecutor - the onlineExecutor to set
    • isOnline

      public boolean isOnline()
    • goOnline

      public void goOnline()
    • goOffline

      public void goOffline()