Package com.efiAnalytics.plugin.ecu
Class ControllerAccess
java.lang.Object
com.efiAnalytics.plugin.ecu.ControllerAccess
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 Summary
Modifier and TypeMethodDescriptiondoubleevaluateExpression(String configurationName, String expression) evaluates any mathematical expression made up of numbers, OutputChannel names and Constant/ControllerParameter names.Provides access to ControllerParameterServerString[]Provides visibility to the currently loaded Configuration Names.static ControllerAccessThis will provide add hock access to the ControllerAccess.Provides access to the OuputChannelServer.getUiComponentServer(String configurationName) voidvoidgoOnline()static voidinitialize(OutputChannelServer outputServer, ControllerParameterServer parameterServer) Initializes this ControllerAccess with valid implementations ofControllerParameterServerandOutputChannelServer.booleanisOnline()voidsendBurnCommand(String configurationName) sends a Burn Command to the named ECU Configuration instructing it to persist setting data from RAM to FLASHvoidsetBurnExecutor(BurnExecutor burnExecutor) voidsetConfigurationNameProvider(EcuConfigurationNameServer configurationNameProvider) voidsetMathExpressionEvaluator(MathExpressionEvaluator mathExpressionEvaluator) voidsetOnlineExecutor(OnlineExecution onlineExecutor) voidsetUiComponentServerProvider(UiSettingServerProvider uiComponentServer)
-
Method Details
-
initialize
public static void initialize(OutputChannelServer outputServer, ControllerParameterServer parameterServer) Initializes this ControllerAccess with valid implementations ofControllerParameterServerandOutputChannelServer. This should only be called by the host application, not the plugin Plug ins will access this via getInstance() or as it is passed intoApplicationPlugininitialize.- Parameters:
outputServer- A instance of a OutputChannelServerparameterServer- An instance of ControllerParameterServer
-
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
Provides access to the OuputChannelServer.- Returns:
- An instance of
OutputChannelServerfor access to the currently loaded controller configuration.
-
getControllerParameterServer
Provides access to ControllerParameterServer- Returns:
- An instance of
ControllerParemeterServerthat was initialized by the host application
-
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
- Parameters:
configurationNameProvider- the configurationNameProvider to set
-
evaluateExpression
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
sends a Burn Command to the named ECU Configuration instructing it to persist setting data from RAM to FLASH- Parameters:
configurationName-- Throws:
ControllerException
-
setMathExpressionEvaluator
- Parameters:
mathExpressionEvaluator- the mathExpressionEvaluator to set
-
getUiComponentServer
- Returns:
- the uiComponentServer
- Throws:
ControllerException
-
setUiComponentServerProvider
- Parameters:
uiComponentServer- the uiComponentServer to set
-
setBurnExecutor
- Parameters:
burnExecutor- the burnExecutor to set
-
setOnlineExecutor
- Parameters:
onlineExecutor- the onlineExecutor to set
-
isOnline
public boolean isOnline() -
goOnline
public void goOnline() -
goOffline
public void goOffline()
-