auto-sync

This commit is contained in:
rusEfi 2015-02-16 19:09:39 -06:00
parent 06a80fb2a6
commit 6bca6979c2
2 changed files with 33 additions and 19 deletions

View File

@ -68,30 +68,12 @@ public:
*/
uint32_t expectedEventCount[PWM_PHASE_MAX_WAVE_PER_PWM];
void addEvent(float angle, trigger_wheel_e const waveIndex, trigger_value_e const state);
// todo: these two methods here, something could be improved
void clear();
void reset(operation_mode_e operationMode, bool needSecondTriggerInput);
void setTriggerSynchronizationGap2(float syncRatioFrom, float syncRatioTo);
void setTriggerSynchronizationGap(float synchRatio);
int getSize() const;
multi_wave_s wave;
/**
* this one is per CRANKshaft revolution
*/
uint32_t getLength() const;
// todo: add a runtime validation which would verify that this field was set properly
// tood: maybe even automate this flag calculation?
int initialState[PWM_PHASE_MAX_WAVE_PER_PWM];
int getTriggerShapeSynchPointIndex();
void calculateTriggerSynchPoint(engine_configuration_s *engineConfiguration, Engine *engine);
void setTriggerShapeSynchPointIndex(engine_configuration_s *engineConfiguration, int triggerShapeSynchPointIndex, Engine *engine);
/**
* These angles are in event coordinates - with synchronization point located at angle zero.
* These values are pre-calculated for performance reasons.
@ -105,6 +87,25 @@ public:
* TODO with eliminating RPM_MULT magic constant
*/
int size;
void addEvent(float angle, trigger_wheel_e const waveIndex, trigger_value_e const state);
// todo: these two methods here, something could be improved
void clear();
void reset(operation_mode_e operationMode, bool needSecondTriggerInput);
void setTriggerSynchronizationGap2(float syncRatioFrom, float syncRatioTo);
void setTriggerSynchronizationGap(float synchRatio);
/**
* this one is per CRANKshaft revolution
*/
uint32_t getLength() const;
int getSize() const;
int getTriggerShapeSynchPointIndex();
void calculateTriggerSynchPoint(engine_configuration_s *engineConfiguration, Engine *engine);
void setTriggerShapeSynchPointIndex(engine_configuration_s *engineConfiguration, int triggerShapeSynchPointIndex, Engine *engine);
private:
trigger_shape_helper h;

View File

@ -1,7 +1,6 @@
package com.rusefi;
import com.rusefi.FileLog;
import com.rusefi.waves.WaveChart;
import static com.rusefi.IoUtil.nextChart;
@ -18,6 +17,7 @@ import static com.rusefi.TestingUtils.*;
*/
public class AutoTest {
private static void mainTestBody() {
test2003DodgeNeon();
testFordAspire();
testMazdaProtege();
test1995DodgeNeon();
@ -25,6 +25,19 @@ public class AutoTest {
testFordFiesta();
}
private static void test2003DodgeNeon() {
// sendCommand("set_engine_type 23");
// let's give some time to change engine type
// nextChart();
// nextChart();
// WaveChart chart;
// String msg = "2003 Neon cranking";
// IoUtil.changeRpm(200);
// chart = nextChart();
// double x = 107;
// assertWave(msg, chart, WaveChart.SPARK_1, 0.194433, x, x + 180, x + 360, x + 540);
}
private static void testMazdaProtege() {
sendCommand("set_engine_type 14");
WaveChart chart;