bre20::Rule Class Reference

Inheritance diagram for bre20::Rule:

bre20::AfrRule bre20::DynoRule List of all members.

Public Member Functions

 Rule ()
virtual void setupRule (Form *frm)=0
virtual void finishRule (Form *frm)
virtual bool executeRule (Form *frm)=0
virtual bool updateRule (Form *frm)=0
virtual bool executeReplay (String *keys[], Hashtable *values)=0
virtual String * modifiedFields ()=0

Detailed Description

This is the interface for all Rules used by the datalogger and the log analyzer.

A rule is an object that enables the programmer to easily extend both the dataloger and the log analyzer. You would be able to define a rule that, say, converted the raw RPM into a real world RPM value. Or if a new command is added to the logging code (and the list that the logger uses to send commands to the ecu), you can define a new rule that properly converts the raw value to an acceptable value.

This is an abstract class so you obviously must define the functions contained within in order to extend it.


Constructor & Destructor Documentation

bre20::Rule::Rule  ) 
 


Member Function Documentation

virtual bool bre20::Rule::executeReplay String *  keys[],
Hashtable *  values
[pure virtual]
 

This function is the same as executeRule() but happens when a log is being replayed. It is necessary for updating gauges when replaying. The text based values are automatically put into their respective places when replaying.

Parameters:
keys The labels from the log file.
values has values from the file mapped to each key.
Returns:
true if executed properly

Implemented in bre20::DynoRule, and bre20::AfrRule.

virtual bool bre20::Rule::executeRule Form *  frm  )  [pure virtual]
 

This function is called when a rule needs to be executed.

In the context of the Datalogger, it will be called each time the logger gets data back from an ECU. You are passed the Datalogger and will then be able to modify the data from the ecu before its displayed.

Additionally if your rule needs to deal with a gauge you must update that gauge in this function.

Parameters:
frm The form you will be given to grab values from or act on
Returns:
true if it executed properly, false if otherwise

Implemented in bre20::DynoRule, and bre20::AfrRule.

virtual void bre20::Rule::finishRule Form *  frm  )  [virtual]
 

Called after all the execute functions have been called.

Reimplemented in bre20::DynoRule.

virtual String* bre20::Rule::modifiedFields  )  [pure virtual]
 

A string that explains what fields you are modifying. see the rule field explanation.

If you only modify one field just return the name of that field. If concatination is necessary, the fields will be separated by colons ( : ). i.e.

                return "rpm:index:tps";

Returns:
A string that explains what fields you are modifying.

Implemented in bre20::DynoRule, and bre20::AfrRule.

virtual void bre20::Rule::setupRule Form *  frm  )  [pure virtual]
 

Called the first time the FormWithRules form knows about your rule.

Parameters:
frm The form you will be given to grab values from or act on

Implemented in bre20::DynoRule, and bre20::AfrRule.

virtual bool bre20::Rule::updateRule Form *  frm  )  [pure virtual]
 

This function is called when a rule needs to be updated.

In the context of the Datalogger, it will be called each time the DatalogOptions dialog is opened and closed. You are passed the Datalogger and will update the rule's display as necessary (such as with a change in the units).

Additionally if your rule needs to deal with a gauge you must update that gauge in this function.

Implemented in bre20::DynoRule, and bre20::AfrRule.




BRE Documentation Home