RomRep::Map Class Reference

Inheritance diagram for RomRep::Map:

RomRep::ByteChangeNotify RomRep::AfrMap RomRep::FuelMap RomRep::Obd0IgnMap RomRep::Obd0FuelMap RomRep::NGIgnMap RomRep::VT0IgnMap RomRep::NGFuelMap RomRep::VT0FuelMap RomRep::DevIgnMap RomRep::DevFuelMap List of all members.

Public Member Functions

void SendByteChangeRequest (int loc, unsigned char byte)
void SendByteChangeRequest (ByteChange *ch)
void SendByteChangeRequest (ByteChange *changes[])
 Map ()
 Map (int x, int y, unsigned int locale, int ind, int mode)
 Map (int x, int y, unsigned int locale, unsigned char fil __gc[], int ind, int mode)
 Normal Constructor.
virtual ~Map ()
 useless destructor
float getMap () __gc[
float virtual float getVal (int x, int y)
 Gets the RealWorld value at a location in the map. Indexed from 0.
virtual RomRep::ByteChangesetVal (int x, int y, float val)
 Sets a value in the map.
virtual float calculate (int x, int y, int intval)=0
virtual int calculate (int x, int y, float mapval)=0
virtual void populate (unsigned char mapp __gc[,])
 populates the map with the byte array
virtual int getX ()
 Returns map width.
virtual int getY ()
 Returns map height.
virtual int getIndex ()
 Index is for distinguishing between vtec/non boost/non, etc.
virtual int getMode ()
 Mode is for distinguishing between fuel and ign.
virtual bool isVtec ()
 Returns whether the map is vtec (true) or not (false).
virtual unsigned int getMapLocation ()
 Returns the integer ROM location of the map.
virtual void setMapLocation (unsigned int loc)
 Sets the ROM location of the map.
virtual unsigned int getCellLocation (int x, int y)
 Returns the ROM location of a cell in the map.
virtual RomRep::ByteChangesetMultiplier (int column, int val)=0
 Sets a multiplier (if fuel map; ign maps return null).
virtual int getMultiplierLocation (int column)=0
 Returns the ROM location of the multiplier.
virtual int getRowScalarLoc ()
 Returns the Row Scalar ROM location.
virtual int getColumnScalarLoc ()
 Returns the Column scalar ROM location.
virtual void setRowScalarLoc (int val)
 Sets the Row Scalar ROM location.
virtual void setColumnScalarLoc (int val)
 Sets the Column scalar ROM location.
virtual String * getRowHeader (int row)
 Returns the header text for the specified row.
virtual String * getColumnHeader (int col)
 Returns the header text for the specified column.
virtual String * getName ()
 Returns the name of the map.
virtual void setName (String *n)
 Sets the map's name.
virtual void byteChangeNotify (ByteChange *bc)
virtual void setRowHeaderCalculator (HeaderCalculator *he)
virtual void setColumnHeaderCalculator (HeaderCalculator *he)
virtual HeaderCalculatorgetRowHeaderCalculator ()
virtual HeaderCalculatorgetColumnHeaderCalculator ()
virtual bool canEditHeader (bool column, int columnOrRow)
 Returns true if the column or row can be edited. Calls to the HeaderEditors.
virtual void setRowHeader (int row, String *val)
 Calls the corresponding function in all of the HeaderEditors.
virtual void setColumnHeader (int col, String *val)
 Calls the corresponding function in all of the HeaderEditors.
virtual void mapHeaderChanged (Object *sender, MapHeaderChangeArgs *args)
void notifyHeaderChanged (Object *sender, MapHeaderChangeArgs *args)

Static Public Member Functions

static unsigned int getCellLocation (int x, int y, int cols, int loc)
 Returns the ROM location of a cell in the map (static).

Public Attributes

__event MapByteChangeRequest * OnByteChangeRequest
__event MapChangeHandler * OnMapChanged
__event RealMapChangeHandler * OnRealMapChanged
__event MapHeaderChangeHandler * OnMapHeaderChanged
__event MapHeaderEnableChangeHandler * OnMapHeaderEnableChanged

Static Public Attributes

static const int MODE_IGNITION = 1
static const int MODE_FUEL = 0
static const int HEADER_EVENT_ALL = -2
static const int HEADER_EVENT_NONE = -1

Protected Member Functions

void MapHeaderChanged (int xx, int yy, String *realval[])
void MapHeaderChanged (MapHeaderChangeArgs *args)
void MapHeaderEnableChanged (int xx, int yy, bool enabled)
void MapChanged (int xx, int yy, int byte)
void RealMapChanged (int xx, int yy, int byte)

Protected Attributes

unsigned char thefile __gc []
unsigned char map __gc [,]
String * vac []
 the column headers
String * rpm []
 the row headers
int revscalarloc
int pressscalarloc
int x
int y
unsigned int location
int index
int mode
bool vtec
String * name
HeaderCalculatorPairheaderCalculators

Detailed Description

Idea behind this: Have a base class that all other maps can be derived from. Data will be stored in its byte and will be returned as real world value.

Concrete derived Maps will get passed an integer representation of the map (from the raw file) then will convert the map and store it in this class' 2D array.

The basics of the Map event structure and the way they are used are as follows:


Constructor & Destructor Documentation

RomRep::Map::Map  ) 
 

The Map class

RomRep::Map::Map int  x,
int  y,
unsigned int  locale,
int  ind,
int  mode
 

RomRep::Map::Map int  x,
int  y,
unsigned int  locale,
unsigned char fil  __gc[],
int  ind,
int  mode
 

Normal Constructor.

RomRep::Map::~Map  )  [virtual]
 

useless destructor


Member Function Documentation

virtual void RomRep::Map::byteChangeNotify ByteChange bc  )  [virtual]
 

For each inherited class, this will see if the byte location applies to their object and then make the appropriate updates.

Reimplemented from RomRep::ByteChangeNotify.

Reimplemented in RomRep::FuelMap, RomRep::Obd0IgnMap, RomRep::Obd0FuelMap, RomRep::VT0IgnMap, and RomRep::VT0FuelMap.

virtual int RomRep::Map::calculate int  x,
int  y,
float  mapval
[pure virtual]
 

Takes real world value and returns an integer (0-255 byte)

This must be overridden so this base class can properly convert between bytes and real world values.

Implemented in RomRep::AfrMap, RomRep::FuelMap, RomRep::Obd0IgnMap, RomRep::Obd0FuelMap, and RomRep::VT0FuelMap.

virtual float RomRep::Map::calculate int  x,
int  y,
int  intval
[pure virtual]
 

Takes byte (an integer) and returns real world value

This must be overridden so this base class can properly convert between bytes and real world values.

Implemented in RomRep::AfrMap, RomRep::FuelMap, RomRep::Obd0IgnMap, RomRep::Obd0FuelMap, and RomRep::VT0FuelMap.

virtual bool RomRep::Map::canEditHeader bool  column,
int  columnOrRow
[virtual]
 

Returns true if the column or row can be edited. Calls to the HeaderEditors.

static unsigned int RomRep::Map::getCellLocation int  x,
int  y,
int  cols,
int  loc
[static]
 

Returns the ROM location of a cell in the map (static).

virtual unsigned int RomRep::Map::getCellLocation int  x,
int  y
[virtual]
 

Returns the ROM location of a cell in the map.

virtual String* RomRep::Map::getColumnHeader int  col  )  [virtual]
 

Returns the header text for the specified column.

virtual HeaderCalculator* RomRep::Map::getColumnHeaderCalculator  )  [virtual]
 

virtual int RomRep::Map::getColumnScalarLoc  )  [virtual]
 

Returns the Column scalar ROM location.

virtual int RomRep::Map::getIndex  )  [virtual]
 

Index is for distinguishing between vtec/non boost/non, etc.

float RomRep::Map::getMap  ) 
 

Gets the real world values of the map.

Returns:
Returns a managed float array (float[,])

virtual unsigned int RomRep::Map::getMapLocation  )  [virtual]
 

Returns the integer ROM location of the map.

virtual int RomRep::Map::getMode  )  [virtual]
 

Mode is for distinguishing between fuel and ign.

virtual int RomRep::Map::getMultiplierLocation int  column  )  [pure virtual]
 

Returns the ROM location of the multiplier.

Implemented in RomRep::AfrMap, RomRep::FuelMap, and RomRep::Obd0IgnMap.

virtual String* RomRep::Map::getName  )  [virtual]
 

Returns the name of the map.

virtual String* RomRep::Map::getRowHeader int  row  )  [virtual]
 

Returns the header text for the specified row.

virtual HeaderCalculator* RomRep::Map::getRowHeaderCalculator  )  [virtual]
 

virtual int RomRep::Map::getRowScalarLoc  )  [virtual]
 

Returns the Row Scalar ROM location.

float virtual float RomRep::Map::getVal int  x,
int  y
[virtual]
 

Gets the RealWorld value at a location in the map. Indexed from 0.

virtual int RomRep::Map::getX  )  [virtual]
 

Returns map width.

virtual int RomRep::Map::getY  )  [virtual]
 

Returns map height.

virtual bool RomRep::Map::isVtec  )  [virtual]
 

Returns whether the map is vtec (true) or not (false).

void RomRep::Map::MapChanged int  xx,
int  yy,
int  byte
[protected]
 

virtual void RomRep::Map::mapHeaderChanged Object *  sender,
MapHeaderChangeArgs args
[virtual]
 

void RomRep::Map::MapHeaderChanged MapHeaderChangeArgs args  )  [protected]
 

void RomRep::Map::MapHeaderChanged int  xx,
int  yy,
String *  realval[]
[protected]
 

void RomRep::Map::MapHeaderEnableChanged int  xx,
int  yy,
bool  enabled
[protected]
 

void RomRep::Map::notifyHeaderChanged Object *  sender,
MapHeaderChangeArgs args
 

virtual void RomRep::Map::populate unsigned char mapp  __gc[,]  )  [virtual]
 

populates the map with the byte array

void RomRep::Map::RealMapChanged int  xx,
int  yy,
int  byte
[protected]
 

void RomRep::Map::SendByteChangeRequest ByteChange changes[]  ) 
 

void RomRep::Map::SendByteChangeRequest ByteChange ch  ) 
 

void RomRep::Map::SendByteChangeRequest int  loc,
unsigned char  byte
 

virtual void RomRep::Map::setColumnHeader int  col,
String *  val
[virtual]
 

Calls the corresponding function in all of the HeaderEditors.

virtual void RomRep::Map::setColumnHeaderCalculator HeaderCalculator he  )  [virtual]
 

virtual void RomRep::Map::setColumnScalarLoc int  val  )  [virtual]
 

Sets the Column scalar ROM location.

virtual void RomRep::Map::setMapLocation unsigned int  loc  )  [virtual]
 

Sets the ROM location of the map.

virtual RomRep::ByteChange* RomRep::Map::setMultiplier int  column,
int  val
[pure virtual]
 

Sets a multiplier (if fuel map; ign maps return null).

Implemented in RomRep::AfrMap, RomRep::FuelMap, and RomRep::Obd0IgnMap.

virtual void RomRep::Map::setName String *  n  )  [virtual]
 

Sets the map's name.

virtual void RomRep::Map::setRowHeader int  row,
String *  val
[virtual]
 

Calls the corresponding function in all of the HeaderEditors.

virtual void RomRep::Map::setRowHeaderCalculator HeaderCalculator he  )  [virtual]
 

virtual void RomRep::Map::setRowScalarLoc int  val  )  [virtual]
 

Sets the Row Scalar ROM location.

virtual RomRep::ByteChange* RomRep::Map::setVal int  x,
int  y,
float  val
[virtual]
 

Sets a value in the map.

Reimplemented in RomRep::FuelMap.


Member Data Documentation

unsigned char map RomRep::Map::__gc[,] [protected]
 

Reimplemented in RomRep::FuelMap.

unsigned char thefile RomRep::Map::__gc[] [protected]
 

Reimplemented in RomRep::FuelMap.

const int RomRep::Map::HEADER_EVENT_ALL = -2 [static]
 

const int RomRep::Map::HEADER_EVENT_NONE = -1 [static]
 

HeaderCalculatorPair* RomRep::Map::headerCalculators [protected]
 

int RomRep::Map::index [protected]
 

unsigned int RomRep::Map::location [protected]
 

int RomRep::Map::mode [protected]
 

const int RomRep::Map::MODE_FUEL = 0 [static]
 

const int RomRep::Map::MODE_IGNITION = 1 [static]
 

String* RomRep::Map::name [protected]
 

__event MapByteChangeRequest* RomRep::Map::OnByteChangeRequest
 

Sent when the map wants to change a byte in the rom. It is assumed that the HondaEcu object containing this map is subscribed to the event. The special maps call this when a map header is changed.

__event MapChangeHandler* RomRep::Map::OnMapChanged
 

Event fired when this map is Changed in that something called setVal(). So really this is just issuing a byte change request to the HondaEcu object.

__event MapHeaderChangeHandler* RomRep::Map::OnMapHeaderChanged
 

Called when a header in the map has been changed. In the resulting MapHeaderChangeArgs, you will receive both the row or column that this change took place in and the data (string) to use in that area. For instance say column header 14 is changed to "1.3psi". The column variable would have 14, the row variable would have Map::HEADER_EVENT_NONE, and the data would be a string array with "1.3psi" as its only element. Additionally, it is possible to receive a Map::HEADER_EVENT_ALL in place of the row or column. The data would then have a string array with all of the headers.

__event MapHeaderEnableChangeHandler* RomRep::Map::OnMapHeaderEnableChanged
 

Called when the editable state of a header has changed. i.e. Only the TPS portion of an ITB map is editable and the user changes the xover column. In that case, OnMapHeaderEnableChanged would be called for each column that changed from map->tps or vice versa with Map::HEADER_EVENT_NONE as the y component. A situation like that is sort of a rarity, as most of the maps are all or nothing with no changes that will ever happen.

__event RealMapChangeHandler* RomRep::Map::OnRealMapChanged
 

This works in conjunction with OnMapChanged event. OnMapChanged will send a byte requst to the HondaEcu object, which will set the byte then notify all of its maps of the byte change (via the byteChangeNotify method). If the byte change is within the map, the map will fire the OnRealMapChanged event with the real value of the map to signal that a byte change has taken place.

int RomRep::Map::pressscalarloc [protected]
 

int RomRep::Map::revscalarloc [protected]
 

String* RomRep::Map::rpm[] [protected]
 

the row headers

String* RomRep::Map::vac[] [protected]
 

the column headers

bool RomRep::Map::vtec [protected]
 

int RomRep::Map::x [protected]
 

int RomRep::Map::y [protected]
 




BRE Documentation Home