mock PPS voltage command in addition to mock PPS position

ETB pane progress
This commit is contained in:
rusEfi 2019-09-01 17:35:43 -04:00
parent 3e852bfb1e
commit daec071b6b
18 changed files with 84 additions and 37 deletions

View File

@ -280,6 +280,9 @@ DISPLAY(DISPLAY_IF(hasEtbPedalPositionSensor))
DISPLAY(DISPLAY_CONFIG(ETB_PFACTOR));
DISPLAY(DISPLAY_CONFIG(ETB_IFACTOR));
DISPLAY(DISPLAY_CONFIG(ETB_DFACTOR));
DISPLAY_TEXT(eol);
DISPLAY(DISPLAY_CONFIG(ETB_OFFSET));
DISPLAY(DISPLAY_CONFIG(ETB_PERIODMS));
/* DISPLAY_ELSE */
DISPLAY_TEXT(No_Pedal_Sensor);
/* DISPLAY_ENDIF */

View File

@ -590,7 +590,11 @@ void setMockAfrVoltage(float voltage) {
setMockVoltage(engineConfiguration->afr.hwChannel, voltage);
}
void setMockTpsVoltage(float voltage) {
void setMockThrottlePedalSensorVoltage(float voltage) {
setMockVoltage(engineConfiguration->throttlePedalPositionAdcChannel, voltage);
}
void setMockThrottlePositionSensorVoltage(float voltage) {
setMockVoltage(engineConfiguration->tps1_1AdcChannel, voltage);
}

View File

@ -22,7 +22,9 @@ void mostCommonInitEngineController(Logging *sharedLogger DECLARE_ENGINE_PARAMET
void setMockVBattVoltage(float voltage);
void setMockMapVoltage(float voltage);
void setMockTpsVoltage(float voltage);
// throttle body sensor
void setMockThrottlePositionSensorVoltage(float voltage);
void setMockThrottlePedalSensorVoltage(float voltage);
void setMockAfrVoltage(float voltage);
void setMockMafVoltage(float voltage);
void setMockIatVoltage(float voltage);

View File

@ -1461,7 +1461,14 @@
#define miataNb2VVTRatioFrom_offset_hex 334
#define miataNb2VVTRatioTo_offset 824
#define miataNb2VVTRatioTo_offset_hex 338
#define MOCK_AFR_COMMAND "mock_afr_voltage"
#define MOCK_CLT_COMMAND "mock_clt_voltage"
#define MOCK_IAT_COMMAND "mock_iat_voltage"
#define MOCK_MAF_COMMAND "mock_maf_voltage"
#define MOCK_MAP_COMMAND "mock_map_voltage"
#define MOCK_PPS_POSITION_COMMAND "mock_pps_position"
#define MOCK_PPS_VOLTAGE_COMMAND "mock_pps_voltage"
#define MOCK_TPS_COMMAND "mock_tps_voltage"
#define NARROW_BAND_WIDE_BAND_CONVERSION_SIZE 8
#define narrowToWideOxygen_offset 2296
#define narrowToWideOxygen_offset_hex 8f8

View File

@ -30,7 +30,8 @@ void setMockTpsValue(percent_t tpsPosition DECLARE_ENGINE_PARAMETER_SUFFIX) {
}
#endif /* EFI_PROD_CODE */
void setMockPedalPosition(percent_t value DECLARE_ENGINE_PARAMETER_SUFFIX) {
// see also setMockThrottlePedalSensorVoltage
void setMockThrottlePedalPosition(percent_t value DECLARE_ENGINE_PARAMETER_SUFFIX) {
mockPedalPosition = value;
}

View File

@ -33,7 +33,7 @@ percent_t getTpsValue(int adc DECLARE_ENGINE_PARAMETER_SUFFIX);
void setBosch0280750009(DECLARE_ENGINE_PARAMETER_SIGNATURE);
void setMockTpsAdc(percent_t tpsPosition DECLARE_ENGINE_PARAMETER_SUFFIX);
void setMockTpsValue(percent_t tpsPosition DECLARE_ENGINE_PARAMETER_SUFFIX);
void setMockPedalPosition(percent_t value DECLARE_ENGINE_PARAMETER_SUFFIX);
void setMockThrottlePedalPosition(percent_t value DECLARE_ENGINE_PARAMETER_SUFFIX);
void grabTPSIsClosed();
void grabTPSIsWideOpen();
void grabPedalIsUp();

View File

@ -1160,13 +1160,14 @@ typedef struct {
const command_f_s commandsF[] = {
#if EFI_ENGINE_CONTROL && EFI_ENABLE_MOCK_ADC
{MOCK_IAT_COMMAND, setMockIatVoltage},
{"mock_pedal_position", setMockPedalPosition},
{"mock_maf_voltage", setMockMafVoltage},
{"mock_afr_voltage", setMockAfrVoltage},
{"mock_tps_voltage", setMockTpsVoltage},
{"mock_map_voltage", setMockMapVoltage},
{MOCK_PPS_POSITION_COMMAND, setMockThrottlePedalPosition},
{MOCK_PPS_VOLTAGE_COMMAND, setMockThrottlePedalSensorVoltage},
{MOCK_TPS_COMMAND, setMockMafVoltage},
{MOCK_AFR_COMMAND, setMockAfrVoltage},
{MOCK_TPS_COMMAND, setMockThrottlePositionSensorVoltage},
{MOCK_MAP_COMMAND, setMockMapVoltage},
{"mock_vbatt_voltage", setMockVBattVoltage},
{"mock_clt_voltage", setMockCltVoltage},
{MOCK_CLT_COMMAND, setMockCltVoltage},
#endif /* EFI_ENGINE_CONTROL && EFI_ENABLE_MOCK_ADC */
{"fsio_curve_1_value", setFsioCurve1Value},
{"fsio_curve_2_value", setFsioCurve2Value},

View File

@ -1146,6 +1146,15 @@ float[FSIO_TABLE_8] fsioTable4RpmBins;RPM is float and not integer in order to u
end_struct
#define MOCK_IAT_COMMAND "mock_iat_voltage"
#define MOCK_CLT_COMMAND "mock_clt_voltage"
#define MOCK_MAP_COMMAND "mock_map_voltage"
#define MOCK_TPS_COMMAND "mock_tps_voltage"
#define MOCK_AFR_COMMAND "mock_afr_voltage"
#define MOCK_MAF_COMMAND "mock_maf_voltage"
! Pedal Position Sensor
#define MOCK_PPS_POSITION_COMMAND "mock_pps_position"
#define MOCK_PPS_VOLTAGE_COMMAND "mock_pps_voltage"
! Live Documentation Structure
#define LDS_CLT_STATE_INDEX 0

View File

@ -13,6 +13,7 @@ import com.rusefi.waves.EngineReport;
import static com.rusefi.TestingUtils.nextChart;
import static com.rusefi.IoUtil.sleep;
import static com.rusefi.TestingUtils.*;
import static com.rusefi.config.generated.Fields.MOCK_MAF_COMMAND;
import static com.rusefi.io.CommandQueue.disableCommand;
import static com.rusefi.waves.EngineReport.isCloseEnough;
@ -380,7 +381,7 @@ public class AutoTest {
sendCommand("set_fuel_map 2200 4.2 15.66");
sendCommand("set_fuel_map 2000 4.2 15.66");
// mock 2 means 4 on the gauge because of the divider. should we simplify this?
sendCommand("set mock_maf_voltage 2");
sendCommand("set " + MOCK_MAF_COMMAND + " 2");
sendComplexCommand("set global_trigger_offset_angle 175");
chart = nextChart();

View File

@ -1,6 +1,6 @@
package com.rusefi.config.generated;
// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Sun Sep 01 12:45:18 EDT 2019
// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Sun Sep 01 17:24:09 EDT 2019
// by class com.rusefi.output.JavaFieldsConsumer
import com.rusefi.config.*;
@ -959,7 +959,14 @@ public class Fields {
public static final int miataNb2VVTRatioFrom_offset_hex = 334;
public static final int miataNb2VVTRatioTo_offset = 824;
public static final int miataNb2VVTRatioTo_offset_hex = 338;
public static final String MOCK_AFR_COMMAND = "mock_afr_voltage";
public static final String MOCK_CLT_COMMAND = "mock_clt_voltage";
public static final String MOCK_IAT_COMMAND = "mock_iat_voltage";
public static final String MOCK_MAF_COMMAND = "mock_maf_voltage";
public static final String MOCK_MAP_COMMAND = "mock_map_voltage";
public static final String MOCK_PPS_POSITION_COMMAND = "mock_pps_position";
public static final String MOCK_PPS_VOLTAGE_COMMAND = "mock_pps_voltage";
public static final String MOCK_TPS_COMMAND = "mock_tps_voltage";
public static final int NARROW_BAND_WIDE_BAND_CONVERSION_SIZE = 8;
public static final int narrowToWideOxygen_offset = 2296;
public static final int narrowToWideOxygenBins_offset = 2264;

View File

@ -3,8 +3,7 @@ package com.rusefi;
import com.rusefi.core.Sensor;
import com.rusefi.ui.GaugesGridElement;
import com.rusefi.ui.etb.CalibrationPanel;
import com.rusefi.ui.etb.CommandsPanel;
import com.rusefi.ui.util.UiUtils;
import com.rusefi.ui.etb.EtbCommandsPanel;
import javax.swing.*;
import java.awt.*;
@ -24,7 +23,7 @@ public class ETBPane {
centerPanel.add(GaugesGridElement.create(Sensor.ETB_CONTROL_QUALITY));
centerPanel.add(GaugesGridElement.create(Sensor.TPS));
content.add(new CommandsPanel().getContent(), BorderLayout.WEST);
content.add(new EtbCommandsPanel().getContent(), BorderLayout.WEST);
content.add(centerPanel, BorderLayout.CENTER);
content.add(new CalibrationPanel().getContent(), BorderLayout.EAST);
}

View File

@ -1,5 +1,6 @@
package com.rusefi.etb;
import com.rusefi.config.generated.Fields;
import com.rusefi.io.CommandQueue;
public class EtbTarget extends TestSequenceStep {
@ -16,7 +17,7 @@ public class EtbTarget extends TestSequenceStep {
}
protected void doJob() {
CommandQueue.getInstance().write("set mock_pedal_position " + position);
CommandQueue.getInstance().write("set " + Fields.MOCK_PPS_POSITION_COMMAND + " " + position);
if (onEachStep != null)
onEachStep.run();
}

View File

@ -25,6 +25,9 @@ public class ElectronicThrottleMeta {
new ConfigRequest("ETB_PFACTOR"),
new ConfigRequest("ETB_IFACTOR"),
new ConfigRequest("ETB_DFACTOR"),
new TextRequest("eol"),
new ConfigRequest("ETB_OFFSET"),
new ConfigRequest("ETB_PERIODMS"),
},
new Request[]{
new TextRequest("No_Pedal_Sensor"),

View File

@ -1,17 +1,24 @@
package com.rusefi.ui.etb;
import com.rusefi.ETBPane;
import com.rusefi.core.Sensor;
import com.rusefi.ldmp.generated.ElectronicThrottleMeta;
import com.rusefi.ui.livedocs.LiveDocPanel;
import com.rusefi.ui.storage.Node;
import com.rusefi.ui.util.UiUtils;
import com.rusefi.ui.widgets.AnyCommand;
import com.rusefi.ui.widgets.DetachedSensor;
import org.putgemin.VerticalFlowLayout;
import javax.swing.*;
public class CommandsPanel {
/**
* Panel for ETB bench testing & research.
*/
public class EtbCommandsPanel {
private final JPanel content = new JPanel(new VerticalFlowLayout());
public CommandsPanel() {
public EtbCommandsPanel() {
content.add(new DirectDrivePanel().getContent());
JPanel spotsPane = new JPanel(new VerticalFlowLayout());
@ -41,9 +48,14 @@ public class CommandsPanel {
content.add(UiUtils.wrap(new EtbMonteCarloSequence().getButton()));
content.add(AnyCommand.createArea(new Node(), ETBPane.SET_ETB + "10", false, false).getContent());
content.add(DetachedSensor.createMockVoltageSlider(Sensor.PPS));
content.add(LiveDocPanel.createPanel("ETB", ElectronicThrottleMeta.CONTENT));
}
public JPanel getContent() {
return content;
public JComponent getContent() {
return new JScrollPane(content, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
}
}

View File

@ -44,7 +44,6 @@ public class EtbTestSequence {
public EtbTestSequence() {
cancelButton.setEnabled(false);
button.addActionListener(e -> {
isCancelled = false;
button.setEnabled(false);
@ -86,8 +85,6 @@ public class EtbTestSequence {
firstStep.execute(executor);
});
cancelButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {

View File

@ -34,12 +34,12 @@ public class LiveDocPanel {
@NotNull
static JPanel createPanel(String title, String settingsInstancePrefix, Request[] content) {
return createPanel(title, settingsInstancePrefix, content, StateDictionary.NONE);
public static JPanel createPanel(String title, Request[] content) {
return createPanel(title, content, "", StateDictionary.NONE);
}
@NotNull
static JPanel createPanel(String title, String settingsInstancePrefix, Request[] content, final int defaultContextId) {
static JPanel createPanel(String title, Request[] content, String settingsInstancePrefix, final int defaultContextId) {
LiveDataContext defaultContext = new LiveDataContext(defaultContextId);
ActionPanel ap = createComponents(title, content, settingsInstancePrefix, defaultContext);
@ -217,13 +217,13 @@ public class LiveDocPanel {
public static JPanel createLiveDocumentationPanel() {
JPanel liveDocs = new JPanel(new MigLayout(LAYOUT));
liveDocs.add(createPanel("Fuel", "", FuelMathMeta.CONTENT), CONSTRAINTS);
liveDocs.add(createPanel("Fuel", FuelMathMeta.CONTENT), CONSTRAINTS);
liveDocs.add(createPanel("tCharge", "", SpeedDensityMeta.CONTENT), CONSTRAINTS);
liveDocs.add(createPanel("tCharge", SpeedDensityMeta.CONTENT), CONSTRAINTS);
liveDocs.add(createPanel("Idle", "", IdleThreadMeta.CONTENT), CONSTRAINTS);
liveDocs.add(createPanel("Idle", IdleThreadMeta.CONTENT), CONSTRAINTS);
liveDocs.add(createPanel("ETB", "", ElectronicThrottleMeta.CONTENT), CONSTRAINTS);
liveDocs.add(createPanel("ETB", ElectronicThrottleMeta.CONTENT), CONSTRAINTS);
return liveDocs;
}
@ -231,15 +231,15 @@ public class LiveDocPanel {
public static JPanel createSensorsLiveDataPanel() {
JPanel liveDocs = new JPanel(new MigLayout(LAYOUT));
liveDocs.add(createPanel("Coolant Sensor", "CLT", ThermistorsMeta.CONTENT, Fields.LDS_CLT_STATE_INDEX
liveDocs.add(createPanel("Coolant Sensor", ThermistorsMeta.CONTENT, "CLT", Fields.LDS_CLT_STATE_INDEX
), CONSTRAINTS);
liveDocs.add(createPanel("Intake Air Sensor", "IAT", ThermistorsMeta.CONTENT, Fields.LDS_IAT_STATE_INDEX
liveDocs.add(createPanel("Intake Air Sensor", ThermistorsMeta.CONTENT, "IAT", Fields.LDS_IAT_STATE_INDEX
), CONSTRAINTS);
liveDocs.add(createPanel("Throttle Position Sensor", "", TpsMeta.TPS_SECTION), CONSTRAINTS);
liveDocs.add(createPanel("Throttle Position Sensor", TpsMeta.TPS_SECTION), CONSTRAINTS);
liveDocs.add(createPanel("Trigger", "", TriggerDecoderMeta.CONTENT), CONSTRAINTS);
liveDocs.add(createPanel("Trigger", TriggerDecoderMeta.CONTENT), CONSTRAINTS);
return liveDocs;
}

View File

@ -20,8 +20,8 @@ public class LiveDocsSandbox {
comment.setForeground(Color.blue);
JPanel panels = new JPanel(new MigLayout("fillx, gap 0, insets 0"));
panels.add(LiveDocPanel.createPanel("Coolant Sensor", "CLT", ThermistorsMeta.CONTENT, LDS_CLT_STATE_INDEX), "wrap");
panels.add(LiveDocPanel.createPanel("Intake Air Sensor", "IAT", ThermistorsMeta.CONTENT, LDS_IAT_STATE_INDEX), "wrap");
panels.add(LiveDocPanel.createPanel("Coolant Sensor", ThermistorsMeta.CONTENT, "CLT", LDS_CLT_STATE_INDEX), "wrap");
panels.add(LiveDocPanel.createPanel("Intake Air Sensor", ThermistorsMeta.CONTENT, "IAT", LDS_IAT_STATE_INDEX), "wrap");
panels.add(getTChargePanel(), "wrap, grow");

View File

@ -122,7 +122,7 @@ public class DetachedSensor {
return MOCKABLE.contains(sensor) && LinkManager.isSimulationMode;
}
private static Component createMockVoltageSlider(final Sensor sensor) {
public static Component createMockVoltageSlider(final Sensor sensor) {
/**
*/
final JSlider slider = new JSlider(0, _5_VOLTS_WITH_DECIMAL);