refactoring: better method name
This commit is contained in:
parent
b34bdf5bcb
commit
aefcbe0895
|
@ -149,7 +149,7 @@ angle_t TriggerShape::getAngle(int index) const {
|
|||
return getCycleDuration() * crankCycle + getSwitchAngle(remainder);
|
||||
}
|
||||
|
||||
void TriggerShape::addEvent3(angle_t angle, trigger_wheel_e const channelIndex, trigger_value_e const stateParam, float filterLeft, float filterRight) {
|
||||
void TriggerShape::addEventClamped(angle_t angle, trigger_wheel_e const channelIndex, trigger_value_e const stateParam, float filterLeft, float filterRight) {
|
||||
if (angle > filterLeft && angle < filterRight)
|
||||
addEvent(angle / getEngineCycle(operationMode), channelIndex, stateParam);
|
||||
}
|
||||
|
|
|
@ -220,7 +220,7 @@ public:
|
|||
/* 0..720 angle range
|
||||
* Deprecated?
|
||||
*/
|
||||
void addEvent3(angle_t angle, trigger_wheel_e const channelIndex, trigger_value_e const stateParam, float filterLeft, float filterRight);
|
||||
void addEventClamped(angle_t angle, trigger_wheel_e const channelIndex, trigger_value_e const stateParam, float filterLeft, float filterRight);
|
||||
operation_mode_e getOperationMode();
|
||||
|
||||
void initialize(operation_mode_e operationMode, bool needSecondTriggerInput);
|
||||
|
|
|
@ -15,30 +15,30 @@ void initialize2jzGE1_12(TriggerShape *s) {
|
|||
float crankD = 360 / 12 / 2; // 15
|
||||
|
||||
float crankAngle = 10;
|
||||
s->addEvent3(crankAngle, T_SECONDARY, TV_FALL, -1, 721); // 120
|
||||
s->addEventClamped(crankAngle, T_SECONDARY, TV_FALL, -1, 721); // 120
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
s->addEvent3(crankAngle + crankD, T_SECONDARY, TV_RISE, -1, 721);
|
||||
s->addEventClamped(crankAngle + crankD, T_SECONDARY, TV_RISE, -1, 721);
|
||||
crankAngle += crankD;
|
||||
s->addEvent3(crankAngle + crankD, T_SECONDARY, TV_FALL, -1, 721); // 120
|
||||
s->addEventClamped(crankAngle + crankD, T_SECONDARY, TV_FALL, -1, 721); // 120
|
||||
crankAngle += crankD;
|
||||
}
|
||||
|
||||
|
||||
s->addEvent3(75, T_PRIMARY, TV_FALL, -1, 721);
|
||||
s->addEventClamped(75, T_PRIMARY, TV_FALL, -1, 721);
|
||||
|
||||
for (int i = 0; i < 21; i++) {
|
||||
s->addEvent3(crankAngle + crankD, T_SECONDARY, TV_RISE, -1, 721);
|
||||
s->addEventClamped(crankAngle + crankD, T_SECONDARY, TV_RISE, -1, 721);
|
||||
crankAngle += crankD;
|
||||
s->addEvent3(crankAngle + crankD, T_SECONDARY, TV_FALL, -1, 721); // 120
|
||||
s->addEventClamped(crankAngle + crankD, T_SECONDARY, TV_FALL, -1, 721); // 120
|
||||
crankAngle += crankD;
|
||||
}
|
||||
|
||||
s->addEvent3(crankAngle + crankD, T_SECONDARY, TV_RISE, -1, 721);
|
||||
s->addEventClamped(crankAngle + crankD, T_SECONDARY, TV_RISE, -1, 721);
|
||||
crankAngle += crankD;
|
||||
|
||||
|
||||
s->addEvent3(720, T_PRIMARY, TV_RISE, -1, 721);
|
||||
s->addEventClamped(720, T_PRIMARY, TV_RISE, -1, 721);
|
||||
|
||||
s->isSynchronizationNeeded = false;
|
||||
}
|
||||
|
|
|
@ -19,13 +19,13 @@ void addSkippedToothTriggerEvents(trigger_wheel_e wheel, TriggerShape *s, int to
|
|||
for (int i = 0; i < totalTeethCount - skippedCount - 1; i++) {
|
||||
float angleDown = engineCycle / totalTeethCount * (i + (1 - toothWidth));
|
||||
float angleUp = engineCycle / totalTeethCount * (i + 1);
|
||||
s->addEvent3(offset + angleDown, wheel, TV_RISE, filterLeft, filterRight);
|
||||
s->addEvent3(offset + angleUp, wheel, TV_FALL, filterLeft, filterRight);
|
||||
s->addEventClamped(offset + angleDown, wheel, TV_RISE, filterLeft, filterRight);
|
||||
s->addEventClamped(offset + angleUp, wheel, TV_FALL, filterLeft, filterRight);
|
||||
}
|
||||
|
||||
float angleDown = engineCycle / totalTeethCount * (totalTeethCount - skippedCount - 1 + (1 - toothWidth));
|
||||
s->addEvent3(offset + angleDown, wheel, TV_RISE, filterLeft, filterRight);
|
||||
s->addEvent3(offset + engineCycle, wheel, TV_FALL, filterLeft, filterRight);
|
||||
s->addEventClamped(offset + angleDown, wheel, TV_RISE, filterLeft, filterRight);
|
||||
s->addEventClamped(offset + engineCycle, wheel, TV_FALL, filterLeft, filterRight);
|
||||
}
|
||||
|
||||
void initializeSkippedToothTriggerShapeExt(TriggerShape *s, int totalTeethCount, int skippedCount,
|
||||
|
|
|
@ -26,8 +26,8 @@ void setVwConfiguration(TriggerShape *s) {
|
|||
NO_LEFT_FILTER, 690);
|
||||
|
||||
float angleDown = engineCycle / totalTeethCount * (totalTeethCount - skippedCount - 1 + (1 - toothWidth) );
|
||||
s->addEvent3(0 + angleDown + 12, T_PRIMARY, TV_RISE, NO_LEFT_FILTER, NO_RIGHT_FILTER);
|
||||
s->addEvent3(0 + engineCycle, T_PRIMARY, TV_FALL, NO_LEFT_FILTER, NO_RIGHT_FILTER);
|
||||
s->addEventClamped(0 + angleDown + 12, T_PRIMARY, TV_RISE, NO_LEFT_FILTER, NO_RIGHT_FILTER);
|
||||
s->addEventClamped(0 + engineCycle, T_PRIMARY, TV_FALL, NO_LEFT_FILTER, NO_RIGHT_FILTER);
|
||||
|
||||
s->setTriggerSynchronizationGap2(1.6, 4);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue