mirror of https://github.com/rusefi/RomRaider.git
updated maf scaler
git-svn-id: https://svn2.assembla.com/svn/romraider/trunk@3 38686702-15cf-42e4-a595-3071df8bf5ea
This commit is contained in:
parent
a285b62809
commit
49cc37e19e
|
@ -51,19 +51,19 @@ public final class LoggerControllerImpl implements LoggerController {
|
|||
|
||||
public void setFileLoggerSwitchMonitor(FileLoggerControllerSwitchMonitor monitor) {
|
||||
checkNotNull(monitor);
|
||||
LOGGER.debug("Setting file logger switch monitor: " + monitor.getEcuSwitch().getName());
|
||||
LOGGER.debug("Setting file logger switch monitor: [" + monitor.getEcuSwitch().getId() + "] " + monitor.getEcuSwitch().getName());
|
||||
queryManager.setFileLoggerSwitchMonitor(monitor);
|
||||
}
|
||||
|
||||
public void addLogger(String callerId, LoggerData loggerData) {
|
||||
checkNotNull(loggerData);
|
||||
LOGGER.debug("Adding logger: " + loggerData.getName());
|
||||
LOGGER.debug("Adding logger: [" + loggerData.getId() + "] " + loggerData.getName());
|
||||
queryManager.addQuery(callerId, loggerData);
|
||||
}
|
||||
|
||||
public void removeLogger(String callerId, LoggerData loggerData) {
|
||||
checkNotNull(loggerData, "ecuParam");
|
||||
LOGGER.debug("Removing logger: " + loggerData.getName());
|
||||
LOGGER.debug("Removing logger: [" + loggerData.getId() + "] " + loggerData.getName());
|
||||
queryManager.removeQuery(callerId, loggerData);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ import enginuity.logger.ecu.definition.LoggerData;
|
|||
import enginuity.logger.ecu.exception.ConfigurationException;
|
||||
import static enginuity.util.ParamChecker.checkNotNull;
|
||||
import static enginuity.util.ParamChecker.isNullOrEmpty;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public final class UserProfileImpl implements UserProfile {
|
||||
|
@ -83,7 +82,7 @@ public final class UserProfileImpl implements UserProfile {
|
|||
return convertor;
|
||||
}
|
||||
}
|
||||
throw new ConfigurationException("Unknown default units, '" + defaultUnits + "', specified for " + loggerData.getName());
|
||||
throw new ConfigurationException("Unknown default units, '" + defaultUnits + "', specified for [" + loggerData.getId() + "] " + loggerData.getName());
|
||||
}
|
||||
}
|
||||
return loggerData.getSelectedConvertor();
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package enginuity.logger.ecu.ui.handler.maf;
|
||||
|
||||
import java.util.Set;
|
||||
import javax.swing.SwingUtilities;
|
||||
import enginuity.logger.ecu.comms.query.Response;
|
||||
import enginuity.logger.ecu.definition.LoggerData;
|
||||
import enginuity.logger.ecu.ui.handler.DataUpdateHandler;
|
||||
import enginuity.logger.ecu.ui.tab.maf.MafTab;
|
||||
import javax.swing.SwingUtilities;
|
||||
import java.util.Set;
|
||||
|
||||
public final class MafUpdateHandler implements DataUpdateHandler {
|
||||
private static final String MAFV = "P18";
|
||||
|
@ -56,6 +56,12 @@ public final class MafUpdateHandler implements DataUpdateHandler {
|
|||
valid = mafTab.isValidCoolantTemp(temp);
|
||||
}
|
||||
|
||||
// intake air temp check
|
||||
if (valid && containsData(response, "P11")) {
|
||||
double temp = findValue(response, "P11");
|
||||
valid = mafTab.isValidIntakeAirTemp(temp);
|
||||
}
|
||||
|
||||
if (valid) {
|
||||
final double mafv = findValue(response, MAFV);
|
||||
final double learning = findValue(response, AF_LEARNING_1);
|
||||
|
|
|
@ -45,6 +45,7 @@ public final class MafControlPanel extends JPanel {
|
|||
private static final String AF_CORRECTION_1 = "P3";
|
||||
private static final String AF_LEARNING_1 = "P4";
|
||||
private static final String ENGINE_SPEED = "P8";
|
||||
private static final String INTAKE_AIR_TEMP = "P11";
|
||||
private static final String MASS_AIR_FLOW = "P12";
|
||||
private static final String MASS_AIR_FLOW_V = "P18";
|
||||
private static final String AFR = "P58";
|
||||
|
@ -59,6 +60,8 @@ public final class MafControlPanel extends JPanel {
|
|||
private final JTextField rpmMax = new JTextField("4500", 3);
|
||||
private final JTextField mafMin = new JTextField("0", 3);
|
||||
private final JTextField mafMax = new JTextField("100", 3);
|
||||
private final JTextField iatMin = new JTextField("25", 3);
|
||||
private final JTextField iatMax = new JTextField("35", 3);
|
||||
private final JTextField coolantMin = new JTextField("70", 3);
|
||||
private final JCheckBox clCheckbox = new JCheckBox("Closed Loop Only", true);
|
||||
private final Component parent;
|
||||
|
@ -108,6 +111,10 @@ public final class MafControlPanel extends JPanel {
|
|||
return checkGreaterThan("Coolant Temp.", coolantMin, value);
|
||||
}
|
||||
|
||||
public boolean isValidIntakeAirTemp(double value) {
|
||||
return checkInRange("Intake Air Temp.", iatMin, iatMax, value);
|
||||
}
|
||||
|
||||
private boolean checkInRange(String name, JTextField min, JTextField max, double value) {
|
||||
if (isValidRange(min, max)) {
|
||||
return inRange(value, min, max);
|
||||
|
@ -199,8 +206,9 @@ public final class MafControlPanel extends JPanel {
|
|||
addMinMaxFilter(panel, gridBagLayout, "AFR Range", afrMin, afrMax, 1);
|
||||
addMinMaxFilter(panel, gridBagLayout, "RPM Range", rpmMin, rpmMax, 4);
|
||||
addMinMaxFilter(panel, gridBagLayout, "MAF Range (g/s)", mafMin, mafMax, 7);
|
||||
addLabeledComponent(panel, gridBagLayout, "Min. Coolant Temp.", coolantMin, 10);
|
||||
addComponent(panel, gridBagLayout, buildRecordDataButton(), 13);
|
||||
addMinMaxFilter(panel, gridBagLayout, "IAT Range", iatMin, iatMax, 10);
|
||||
addLabeledComponent(panel, gridBagLayout, "Min. Coolant Temp.", coolantMin, 13);
|
||||
addComponent(panel, gridBagLayout, buildRecordDataButton(), 16);
|
||||
|
||||
return panel;
|
||||
}
|
||||
|
@ -209,9 +217,9 @@ public final class MafControlPanel extends JPanel {
|
|||
recordDataButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent actionEvent) {
|
||||
if (recordDataButton.isSelected()) {
|
||||
registerData(COOLANT_TEMP, AF_CORRECTION_1, AF_LEARNING_1, ENGINE_SPEED, MASS_AIR_FLOW, MASS_AIR_FLOW_V, AFR, CL_OL_16, CL_OL_32);
|
||||
registerData(COOLANT_TEMP, AF_CORRECTION_1, AF_LEARNING_1, ENGINE_SPEED, INTAKE_AIR_TEMP, MASS_AIR_FLOW, MASS_AIR_FLOW_V, AFR, CL_OL_16, CL_OL_32);
|
||||
} else {
|
||||
deregisterData(COOLANT_TEMP, AF_CORRECTION_1, AF_LEARNING_1, ENGINE_SPEED, MASS_AIR_FLOW, MASS_AIR_FLOW_V, AFR, CL_OL_16, CL_OL_32);
|
||||
deregisterData(COOLANT_TEMP, AF_CORRECTION_1, AF_LEARNING_1, ENGINE_SPEED, INTAKE_AIR_TEMP, MASS_AIR_FLOW, MASS_AIR_FLOW_V, AFR, CL_OL_16, CL_OL_32);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package enginuity.logger.ecu.ui.tab.maf;
|
||||
|
||||
import java.util.List;
|
||||
import enginuity.logger.ecu.definition.EcuParameter;
|
||||
import enginuity.logger.ecu.definition.EcuSwitch;
|
||||
import enginuity.logger.ecu.definition.ExternalData;
|
||||
import enginuity.logger.ecu.ui.tab.Tab;
|
||||
import java.util.List;
|
||||
|
||||
public interface MafTab extends Tab {
|
||||
boolean isRecordData();
|
||||
|
@ -19,6 +19,8 @@ public interface MafTab extends Tab {
|
|||
|
||||
boolean isValidCoolantTemp(double value);
|
||||
|
||||
boolean isValidIntakeAirTemp(double value);
|
||||
|
||||
void addData(double mafv, double correction);
|
||||
|
||||
void setEcuParams(List<EcuParameter> params);
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
package enginuity.logger.ecu.ui.tab.maf;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import static java.awt.BorderLayout.CENTER;
|
||||
import static java.awt.BorderLayout.WEST;
|
||||
import java.util.List;
|
||||
import javax.swing.JPanel;
|
||||
import enginuity.ECUEditor;
|
||||
import enginuity.logger.ecu.definition.EcuParameter;
|
||||
import enginuity.logger.ecu.definition.EcuSwitch;
|
||||
|
@ -12,6 +7,11 @@ import enginuity.logger.ecu.definition.ExternalData;
|
|||
import enginuity.logger.ecu.ui.DataRegistrationBroker;
|
||||
import enginuity.logger.ecu.ui.handler.maf.XYTrendline;
|
||||
import org.jfree.data.xy.XYSeries;
|
||||
import javax.swing.JPanel;
|
||||
import java.awt.BorderLayout;
|
||||
import static java.awt.BorderLayout.CENTER;
|
||||
import static java.awt.BorderLayout.WEST;
|
||||
import java.util.List;
|
||||
|
||||
public final class MafTabImpl extends JPanel implements MafTab {
|
||||
private final XYSeries series = new XYSeries("MAF Analysis");
|
||||
|
@ -57,6 +57,10 @@ public final class MafTabImpl extends JPanel implements MafTab {
|
|||
return controlPanel.isValidCoolantTemp(value);
|
||||
}
|
||||
|
||||
public boolean isValidIntakeAirTemp(double value) {
|
||||
return controlPanel.isValidIntakeAirTemp(value);
|
||||
}
|
||||
|
||||
public void addData(double mafv, double correction) {
|
||||
series.add(mafv, correction);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue