Version 3.1

This commit is contained in:
Gary Scavone
2013-09-25 14:44:17 +02:00
committed by Stephen Sinclair
parent 868787a5f9
commit 4b6500d3de
140 changed files with 5171 additions and 632 deletions

View File

@@ -10,8 +10,8 @@
ReedTabl :: ReedTabl() : Object()
{
offSet = (MY_FLOAT) 0.6; /* Offset is a bias, related to reed rest position */
slope = (MY_FLOAT) -0.8; /* Slope corresponds loosely to reed stiffness */
offSet = (MY_FLOAT) 0.6; /* Offset is a bias, related to reed rest position */
slope = (MY_FLOAT) -0.8; /* Slope corresponds loosely to reed stiffness */
}
ReedTabl :: ~ReedTabl()
@@ -21,22 +21,27 @@ ReedTabl :: ~ReedTabl()
void ReedTabl :: setOffset(MY_FLOAT aValue)
{
offSet = aValue; /* Offset is a bias, related to reed rest position */
offSet = aValue; /* Offset is a bias, related to reed rest position */
}
void ReedTabl :: setSlope(MY_FLOAT aValue)
{
slope = aValue; /* Slope corresponds loosely to reed stiffness */
slope = aValue; /* Slope corresponds loosely to reed stiffness */
}
MY_FLOAT ReedTabl :: lookup(MY_FLOAT deltaP)
{
return this->tick(deltaP);
}
MY_FLOAT ReedTabl :: tick(MY_FLOAT deltaP)
/* Perform "Table Lookup" by direct clipped */
/* linear function calculation */
{ /* deltaP is differential reed pressure */
lastOutput = offSet + (slope * deltaP); /* compute basic non-linearity */
if (lastOutput > 1.0) lastOutput = (MY_FLOAT) 1.0; /* if other way, reed slams shut */
if (lastOutput < -1.0) lastOutput = (MY_FLOAT) -1.0; /* if all the way open, acts like open end */
return lastOutput;
lastOutput = offSet + (slope * deltaP); /* compute basic non-linearity */
if (lastOutput > 1.0) lastOutput = (MY_FLOAT) 1.0; /* if other way, reed slams shut */
if (lastOutput < -1.0) lastOutput = (MY_FLOAT) -1.0; /* if all the way open, acts like open end */
return lastOutput;
}
MY_FLOAT ReedTabl :: lastOut()