mirror of https://github.com/rusefi/rusefi.git
auto-sync
This commit is contained in:
parent
06a80fb2a6
commit
6bca6979c2
|
@ -68,30 +68,12 @@ public:
|
||||||
*/
|
*/
|
||||||
uint32_t expectedEventCount[PWM_PHASE_MAX_WAVE_PER_PWM];
|
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;
|
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
|
// todo: add a runtime validation which would verify that this field was set properly
|
||||||
// tood: maybe even automate this flag calculation?
|
// tood: maybe even automate this flag calculation?
|
||||||
int initialState[PWM_PHASE_MAX_WAVE_PER_PWM];
|
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 angles are in event coordinates - with synchronization point located at angle zero.
|
||||||
* These values are pre-calculated for performance reasons.
|
* These values are pre-calculated for performance reasons.
|
||||||
|
@ -105,6 +87,25 @@ public:
|
||||||
* TODO with eliminating RPM_MULT magic constant
|
* TODO with eliminating RPM_MULT magic constant
|
||||||
*/
|
*/
|
||||||
int size;
|
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:
|
private:
|
||||||
|
|
||||||
trigger_shape_helper h;
|
trigger_shape_helper h;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.rusefi;
|
package com.rusefi;
|
||||||
|
|
||||||
|
|
||||||
import com.rusefi.FileLog;
|
|
||||||
import com.rusefi.waves.WaveChart;
|
import com.rusefi.waves.WaveChart;
|
||||||
|
|
||||||
import static com.rusefi.IoUtil.nextChart;
|
import static com.rusefi.IoUtil.nextChart;
|
||||||
|
@ -18,6 +17,7 @@ import static com.rusefi.TestingUtils.*;
|
||||||
*/
|
*/
|
||||||
public class AutoTest {
|
public class AutoTest {
|
||||||
private static void mainTestBody() {
|
private static void mainTestBody() {
|
||||||
|
test2003DodgeNeon();
|
||||||
testFordAspire();
|
testFordAspire();
|
||||||
testMazdaProtege();
|
testMazdaProtege();
|
||||||
test1995DodgeNeon();
|
test1995DodgeNeon();
|
||||||
|
@ -25,6 +25,19 @@ public class AutoTest {
|
||||||
testFordFiesta();
|
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() {
|
private static void testMazdaProtege() {
|
||||||
sendCommand("set_engine_type 14");
|
sendCommand("set_engine_type 14");
|
||||||
WaveChart chart;
|
WaveChart chart;
|
||||||
|
|
Loading…
Reference in New Issue