RomRep::HondaEcu Class Reference

Inheritance diagram for RomRep::HondaEcu:

RomRep::Obd0Ecu RomRep::Pm6Ng RomRep::VT0Ecu RomRep::Pm6 RomRep::EuroPw0 RomRep::JdmPr3 RomRep::JdmPr3Boost RomRep::JdmPw0 RomRep::JdmPw0Boost RomRep::Obd0Pr3 RomRep::GhdPm6 RomRep::EuroPw0Boost RomRep::EuroPw0Dev RomRep::EuroPw0ITB RomRep::JdmPr3Dev RomRep::JdmPr3ITB RomRep::JdmPw0Dev RomRep::JdmPw0ITB List of all members.

Public Member Functions

 HondaEcu (String *type)
 HondaEcu (unsigned char rom __gc[], int length, int obd, bool vtec, int nummaps, String *type)
virtual ~HondaEcu ()
virtual int addMapPair (MapLocs *fmap, MapLocs *imap, String *fuelName, String *ignName, int x, int y, int copyIndex, bool copyContents)
virtual void setTwoByteRpm (int highloc, int lowloc, int rpm)=0
virtual int getTwoByteRpm (int highloc, int lowloc)=0
 Gets the RPM that adheres to revcount/dec.
virtual void setByte (int loc, int val)
 Sets the byte.
virtual ByteChangesetByteEx (int loc, int val)
 Sets the byte and returns the RomRep.ByteChange.
virtual unsigned char getByte (int loc)
 Gets the byte at the address.
virtual int setChecksum ()
virtual int getWidth ()
 Returns the width of the maps.
virtual int getHeight ()
 Returns the height of the maps.
virtual int getNumMaps ()
 Returns the number of maps. 1 means there is 1 fuel and 1 ignition map.
virtual FuelMapgetFuelMap (int index)
virtual MapgetIgnitionMap (int index)
virtual MapgetMap (int mode, int index)
virtual HeaderCalculatorgetHeaderCalculator (int mode, int index, bool column)
virtual ByteChangesetMultiplierEx (int mapnum, int column, int val)
 Sets a multiplier in the specified mapnum (index).
virtual void setMultiplier (int mapnum, int column, int val)
 Sets a multiplier in the specified mapnum (index).
virtual String * getRowHeader (int mode, int mapindex, int row)
virtual String * getColHeader (int mode, int map, int column)
virtual int getChecksumAddy ()
 Gets CheckSum Address.
virtual int getChecksumLen ()
unsigned char get2DArray (unsigned char array __gc[], int loc, int x, int y) __gc[
unsigned char unsigned char getArray (unsigned char array __gc[], int loc, int len) __gc[]
virtual int getRpmScalarValue (int row, bool fuel, bool vtec)
 Returns value in the rpm scalar (usually contained in each map).
virtual String * getType ()
 Gets the name of the ROM file (i.e. JDM Pr3-58).
virtual unsigned char getFile () __gc[]
virtual int getLength ()
 gets the length of the file
virtual int getLastNaCol ()
virtual float getLambdaMap (int index) __gc[
 Returns the float (afr) representation of the target afr map.
virtual float virtual RomRep::ByteChangesetAfrCellEx (int x, int y, float val, int index)
 Sets the target afr.
virtual float getAfrCell (int x, int y, int index)
 Gets the target afr.
int getAfrMapLoc (int index)
 gets the afr map's location
virtual float calcTPS (int raw)=0
virtual int calcTPS (float percentage)=0
virtual float calcTemp (int raw, bool sae)=0
virtual int calcTemp (float temp, bool sae)=0
virtual float calcRpm (int raw)=0
virtual int calcRpm (float rpm)=0

Public Attributes

__event ByteChangeHandler * OnByteChanged
__event TargetAfrChangeHandler * OnTargetAfrChanged

Static Public Attributes

static int headlen = 10

Protected Member Functions

void setArray (unsigned char array __gc[], int loc, int len)
 sets an array of bytes
virtual int Checksum ()
 returns the checksum
virtual HeaderCalculatorGetRowHeaderCalculator (RomRep::Map *map)=0
virtual HeaderCalculatorGetColumnHeaderCalculator (RomRep::Map *map)=0
virtual void edit_MapEvent (Object *sender, MapChangeArgs *args)
 called when there is a MapEvent (user edits a map)
virtual FuelMapcreateFuelMap (int xx, int yy, int index, String *mapname, RomRep::MapLocs *maploc, unsigned char map __gc[,], unsigned char mlt __gc[], bool vtec)=0
virtual MapcreateIgnitionMap (int xx, int yy, int index, String *mapname, RomRep::MapLocs *maploc, unsigned char map __gc[,], bool vtec)=0
virtual void setupMaps (MapLocs *mapinfo[])
void ByteChanged (RomRep::ByteChange *bc)
void AfrChanged (int xx, int yy, float afr, int index)
virtual float calculateAfr (unsigned char raw)=0
virtual unsigned char calculateAfr (float afr)=0

Protected Attributes

unsigned char thefile __gc []
int flen
int x
int y
FuelMapfuelmaps []
Mapignmaps []
ByteChangeNotifyListbcList
int target_afr_loc __gc []
String * type
int obd
int nummaps
bool vtec
int checksumaddy
int checksumlen
int lastNACol
 The inde of the last NA column for the dev roms.

Detailed Description

Base class for ALL ROMs will be derived from this


Constructor & Destructor Documentation

RomRep::HondaEcu::HondaEcu String *  type  ) 
 

RomRep::HondaEcu::HondaEcu unsigned char rom  __gc[],
int  length,
int  obd,
bool  vtec,
int  nummaps,
String *  type
 

Child classes will deal with setting up the maps in their constructor because we dont know what type of maps must be set up.

Basic Constructor

RomRep::HondaEcu::~HondaEcu  )  [virtual]
 


Member Function Documentation

int RomRep::HondaEcu::addMapPair MapLocs fmap,
MapLocs imap,
String *  fuelName,
String *  ignName,
int  x,
int  y,
int  copyIndex,
bool  copyContents
[virtual]
 

void RomRep::HondaEcu::AfrChanged int  xx,
int  yy,
float  afr,
int  index
[protected]
 

void RomRep::HondaEcu::ByteChanged RomRep::ByteChange bc  )  [protected]
 

virtual int RomRep::HondaEcu::calcRpm float  rpm  )  [pure virtual]
 

Calculates the raw value fromf RPM. If there are more than one format of rpm value, assume it is the most common format (i.e. the 2 byte value)

Implemented in RomRep::VT0Ecu, and RomRep::Pm6Ng.

virtual float RomRep::HondaEcu::calcRpm int  raw  )  [pure virtual]
 

Calculates the RPM. If there are more than one format of rpm value, assume it is the most common format (i.e. the 2 byte value)

Implemented in RomRep::VT0Ecu, and RomRep::Pm6Ng.

virtual int RomRep::HondaEcu::calcTemp float  temp,
bool  sae
[pure virtual]
 

Parameters:
temp the real world temp value
sae true if sae, false if metric
Returns:
the raw temp.

Implemented in RomRep::VT0Ecu, and RomRep::Pm6Ng.

virtual float RomRep::HondaEcu::calcTemp int  raw,
bool  sae
[pure virtual]
 

Parameters:
raw the raw value
sae true if sae, false if metric
Returns:
the real temp.

Implemented in RomRep::VT0Ecu, and RomRep::Pm6Ng.

virtual int RomRep::HondaEcu::calcTPS float  percentage  )  [pure virtual]
 

Returns:
raw value

Implemented in RomRep::VT0Ecu, and RomRep::Pm6Ng.

virtual float RomRep::HondaEcu::calcTPS int  raw  )  [pure virtual]
 

Returns:
Percentage

Implemented in RomRep::VT0Ecu, and RomRep::Pm6Ng.

virtual unsigned char RomRep::HondaEcu::calculateAfr float  afr  )  [protected, pure virtual]
 

Implemented in RomRep::VT0Ecu, and RomRep::Pm6Ng.

virtual float RomRep::HondaEcu::calculateAfr unsigned char  raw  )  [protected, pure virtual]
 

Implemented in RomRep::VT0Ecu, and RomRep::Pm6Ng.

virtual int RomRep::HondaEcu::Checksum  )  [protected, virtual]
 

returns the checksum

virtual FuelMap* RomRep::HondaEcu::createFuelMap int  xx,
int  yy,
int  index,
String *  mapname,
RomRep::MapLocs maploc,
unsigned char map  __gc[,],
unsigned char mlt  __gc[],
bool  vtec
[protected, pure virtual]
 

You must override this method so this base class can properly setup the maps.

If mapname == null, the function must give the map a name.

C++ Example from the VT0Ecu class:

                RomRep::FuelMap* RomRep::VT0Ecu::createFuelMap(int xx, int yy, int index, String* mapname,
                                                        RomRep::MapLocs* maploc,unsigned char map __gc[,],
                                                        unsigned char mlt __gc[], bool vtec)
                {
                        if(index == 0)
                                vtec = false;
                        else if(index == 1)
                                vtec = true;

                        //now call the constructor to the map you need to create
                        FuelMap* fm = new VT0FuelMap(xx, yy, maploc, map, maploc->mapLoc+(xx*yy), 
                                mlt,thefile,0, maploc->mapRevScalarLoc,vtec);
                        
                        if(mapname != NULL)
                                fm->setName(mapname);
                        else if(index == 0)
                                fm->setName("Low Fuel");
                        else if(index == 1)
                                fm->setName("VTEC Fuel");
                        else //if(index >1)
                                fm->setName(String::Concat("Fuel: ",index.ToString()));

                        return fm;
                }

Implemented in RomRep::EuroPw0Dev, RomRep::EuroPw0ITB, RomRep::JdmPr3Dev, RomRep::JdmPr3ITB, RomRep::JdmPw0Dev, RomRep::JdmPw0ITB, RomRep::VT0Ecu, and RomRep::Pm6Ng.

virtual Map* RomRep::HondaEcu::createIgnitionMap int  xx,
int  yy,
int  index,
String *  mapname,
RomRep::MapLocs maploc,
unsigned char map  __gc[,],
bool  vtec
[protected, pure virtual]
 

must override this method so this base class can properly setup the maps.

If mapname == null, the function must give the map a name.

see createFuelMap() for an example

Implemented in RomRep::EuroPw0Dev, RomRep::EuroPw0ITB, RomRep::JdmPr3Dev, RomRep::JdmPr3ITB, RomRep::JdmPw0Dev, RomRep::JdmPw0ITB, RomRep::VT0Ecu, and RomRep::Pm6Ng.

virtual void RomRep::HondaEcu::edit_MapEvent Object *  sender,
MapChangeArgs args
[protected, virtual]
 

called when there is a MapEvent (user edits a map)

unsigned char RomRep::HondaEcu::get2DArray unsigned char array  __gc[],
int  loc,
int  x,
int  y
 

Gets 2D array from the ROM file. loc is the location of the first byte in the array

virtual float RomRep::HondaEcu::getAfrCell int  x,
int  y,
int  index
[virtual]
 

Gets the target afr.

int RomRep::HondaEcu::getAfrMapLoc int  index  ) 
 

gets the afr map's location

unsigned char unsigned char RomRep::HondaEcu::getArray unsigned char array  __gc[],
int  loc,
int  len
 

Gets a 1D array loc is the location of the first byte in the array

virtual unsigned char RomRep::HondaEcu::getByte int  loc  )  [virtual]
 

Gets the byte at the address.

virtual int RomRep::HondaEcu::getChecksumAddy  )  [virtual]
 

Gets CheckSum Address.

virtual int RomRep::HondaEcu::getChecksumLen  )  [virtual]
 

String * RomRep::HondaEcu::getColHeader int  mode,
int  map,
int  column
[virtual]
 

Gets a column header. map == 0 for non vtec, 1 for vtec

virtual HeaderCalculator* RomRep::HondaEcu::GetColumnHeaderCalculator RomRep::Map map  )  [protected, pure virtual]
 

Implemented in RomRep::EuroPw0Dev, RomRep::EuroPw0ITB, RomRep::JdmPr3Dev, RomRep::JdmPr3ITB, RomRep::JdmPw0Dev, RomRep::JdmPw0ITB, RomRep::VT0Ecu, and RomRep::Pm6Ng.

virtual unsigned char RomRep::HondaEcu::getFile  )  [virtual]
 

virtual FuelMap* RomRep::HondaEcu::getFuelMap int  index  )  [virtual]
 

Returns the RomRep.FuelMap of your choosing. Indexed from 0. Number of elements is getNumMaps(); Index of maps can be found by looking at the tabs in the main rom window. Left most map is index 0 and so on.

virtual HeaderCalculator* RomRep::HondaEcu::getHeaderCalculator int  mode,
int  index,
bool  column
[virtual]
 

virtual int RomRep::HondaEcu::getHeight  )  [virtual]
 

Returns the height of the maps.

virtual Map* RomRep::HondaEcu::getIgnitionMap int  index  )  [virtual]
 

Returns the ignition map: RomRep.Map of your choosing. Indexed from 0. Number of elements is getNumMaps(); Index of maps can be found by looking at the tabs in the main rom window. Left most map is index 0 and so on.

virtual float RomRep::HondaEcu::getLambdaMap int  index  )  [virtual]
 

Returns the float (afr) representation of the target afr map.

virtual int RomRep::HondaEcu::getLastNaCol  )  [virtual]
 

gets the length of the last non-boost column in the maps. Only really functional on dev roms

Reimplemented in RomRep::EuroPw0ITB, RomRep::JdmPr3ITB, and RomRep::JdmPw0ITB.

virtual int RomRep::HondaEcu::getLength  )  [virtual]
 

gets the length of the file

virtual Map* RomRep::HondaEcu::getMap int  mode,
int  index
[virtual]
 

virtual int RomRep::HondaEcu::getNumMaps  )  [virtual]
 

Returns the number of maps. 1 means there is 1 fuel and 1 ignition map.

String * RomRep::HondaEcu::getRowHeader int  mode,
int  mapindex,
int  row
[virtual]
 

Gets a row header. map == 0 for non vtec, 1 for vtec

virtual HeaderCalculator* RomRep::HondaEcu::GetRowHeaderCalculator RomRep::Map map  )  [protected, pure virtual]
 

Implemented in RomRep::VT0Ecu, and RomRep::Pm6Ng.

virtual int RomRep::HondaEcu::getRpmScalarValue int  row,
bool  fuel,
bool  vtec
[virtual]
 

Returns value in the rpm scalar (usually contained in each map).

Reimplemented in RomRep::VT0Ecu.

virtual int RomRep::HondaEcu::getTwoByteRpm int  highloc,
int  lowloc
[pure virtual]
 

Gets the RPM that adheres to revcount/dec.

Implemented in RomRep::VT0Ecu, and RomRep::Pm6Ng.

virtual String* RomRep::HondaEcu::getType  )  [virtual]
 

Gets the name of the ROM file (i.e. JDM Pr3-58).

virtual int RomRep::HondaEcu::getWidth  )  [virtual]
 

Returns the width of the maps.

virtual float virtual RomRep::ByteChange* RomRep::HondaEcu::setAfrCellEx int  x,
int  y,
float  val,
int  index
[virtual]
 

Sets the target afr.

Reimplemented in RomRep::GhdPm6, and RomRep::Pm6.

void RomRep::HondaEcu::setArray unsigned char array  __gc[],
int  loc,
int  len
[protected]
 

sets an array of bytes

virtual void RomRep::HondaEcu::setByte int  loc,
int  val
[virtual]
 

Sets the byte.

virtual ByteChange* RomRep::HondaEcu::setByteEx int  loc,
int  val
[virtual]
 

Sets the byte and returns the RomRep.ByteChange.

virtual int RomRep::HondaEcu::setChecksum  )  [virtual]
 

virtual void RomRep::HondaEcu::setMultiplier int  mapnum,
int  column,
int  val
[virtual]
 

Sets a multiplier in the specified mapnum (index).

virtual ByteChange* RomRep::HondaEcu::setMultiplierEx int  mapnum,
int  column,
int  val
[virtual]
 

Sets a multiplier in the specified mapnum (index).

virtual void RomRep::HondaEcu::setTwoByteRpm int  highloc,
int  lowloc,
int  rpm
[pure virtual]
 

loc is the location of the FIRST (low) byte in the value. Sets the RPM into ROM

Implemented in RomRep::VT0Ecu, and RomRep::Pm6Ng.

void RomRep::HondaEcu::setupMaps MapLocs mapinfo[]  )  [protected, virtual]
 

Sets up the fuel and ignition maps for the ROM. This MUST be called by any class that directly extends HondaEcu or the maps will not get set up.

Parameters:
mapinfo array of objects which store the information about the maps. It is assumed that the first half of the objects are the info for the fuel maps, and the last half for the ignition maps. So nummaps will reflect this by being mapinfo.Length/2.


Member Data Documentation

int target_afr_loc RomRep::HondaEcu::__gc[] [protected]
 

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

ByteChangeNotifyList* RomRep::HondaEcu::bcList [protected]
 

int RomRep::HondaEcu::checksumaddy [protected]
 

int RomRep::HondaEcu::checksumlen [protected]
 

int RomRep::HondaEcu::flen [protected]
 

FuelMap* RomRep::HondaEcu::fuelmaps[] [protected]
 

int RomRep::HondaEcu::headlen = 10 [static]
 

Map* RomRep::HondaEcu::ignmaps[] [protected]
 

int RomRep::HondaEcu::lastNACol [protected]
 

The inde of the last NA column for the dev roms.

the column and row header strings x = nummaps; x == 0 is the nonvtec maps, x == 1 is the vtec maps

int RomRep::HondaEcu::nummaps [protected]
 

int RomRep::HondaEcu::obd [protected]
 

__event ByteChangeHandler* RomRep::HondaEcu::OnByteChanged
 

__event TargetAfrChangeHandler* RomRep::HondaEcu::OnTargetAfrChanged
 

String* RomRep::HondaEcu::type [protected]
 

bool RomRep::HondaEcu::vtec [protected]
 

Reimplemented in RomRep::VT0Ecu.

int RomRep::HondaEcu::x [protected]
 

int RomRep::HondaEcu::y [protected]
 




BRE Documentation Home