Changeset 35
- Timestamp:
- 04/18/08 10:38:42 (5 years ago)
- Location:
- trunk/src/enginuity/logger/ecu/ui
- Files:
-
- 7 edited
-
handler/injector/InjectorUpdateHandler.java (modified) (3 diffs)
-
handler/maf/MafUpdateHandler.java (modified) (3 diffs)
-
tab/Tab.java (modified) (1 diff)
-
tab/injector/InjectorControlPanel.java (modified) (6 diffs)
-
tab/injector/InjectorTabImpl.java (modified) (1 diff)
-
tab/maf/MafControlPanel.java (modified) (4 diffs)
-
tab/maf/MafTabImpl.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/enginuity/logger/ecu/ui/handler/injector/InjectorUpdateHandler.java
r27 r35 7 7 import org.apache.log4j.Logger; 8 8 import javax.swing.SwingUtilities; 9 import static java.lang.Math.abs; 10 import static java.lang.System.currentTimeMillis; 9 11 import java.util.Set; 10 12 … … 16 18 private static final String ENGINE_LOAD_32 = "E32"; 17 19 private InjectorTab injectorTab; 20 private double lastMafv; 21 private long lastUpdate; 18 22 19 23 public synchronized void registerData(LoggerData loggerData) { … … 79 83 valid = injectorTab.isValidCoolantTemp(temp); 80 84 LOGGER.trace("INJ:[CT]: " + valid); 85 } 86 87 // dMAFv/dt check 88 if (valid && containsData(response, "P18")) { 89 double mafv = findValue(response, "P18"); 90 long now = currentTimeMillis(); 91 double mafvChange = abs((mafv - lastMafv) / (now - lastUpdate) * 1000); 92 LOGGER.trace("INJ:[dMAFv/dt]: " + mafvChange); 93 valid = injectorTab.isValidMafvChange(mafvChange); 94 LOGGER.trace("INJ:[dMAFv/dt]: " + valid); 95 lastMafv = mafv; 96 lastUpdate = now; 81 97 } 82 98 -
trunk/src/enginuity/logger/ecu/ui/handler/maf/MafUpdateHandler.java
r25 r35 7 7 import org.apache.log4j.Logger; 8 8 import javax.swing.SwingUtilities; 9 import static java.lang.Math.abs; 10 import static java.lang.System.currentTimeMillis; 9 11 import java.util.Set; 10 12 … … 15 17 private static final String AF_CORRECTION_1 = "P3"; 16 18 private MafTab mafTab; 19 private double lastMafv; 20 private long lastUpdate; 17 21 18 22 public synchronized void registerData(LoggerData loggerData) { … … 76 80 valid = mafTab.isValidCoolantTemp(temp); 77 81 LOGGER.trace("MAF:[CT]: " + valid); 82 } 83 84 // dMAFv/dt check 85 if (valid && containsData(response, "P18")) { 86 double mafv = findValue(response, "P18"); 87 long now = currentTimeMillis(); 88 double mafvChange = abs((mafv - lastMafv) / (now - lastUpdate) * 1000); 89 LOGGER.trace("MAF:[dMAFv/dt]: " + mafvChange); 90 valid = mafTab.isValidMafvChange(mafvChange); 91 LOGGER.trace("MAF:[dMAFv/dt]: " + valid); 92 lastMafv = mafv; 93 lastUpdate = now; 78 94 } 79 95 -
trunk/src/enginuity/logger/ecu/ui/tab/Tab.java
r16 r35 5 5 public interface Tab { 6 6 JPanel getPanel(); 7 8 boolean isValidMafvChange(double value); 7 9 } -
trunk/src/enginuity/logger/ecu/ui/tab/injector/InjectorControlPanel.java
r32 r35 48 48 private static final String INTAKE_AIR_TEMP = "P11"; 49 49 private static final String MASS_AIR_FLOW = "P12"; 50 private static final String MASS_AIR_FLOW_V = "P18"; 50 51 private static final String AFR = "P58"; 51 52 private static final String CL_OL_16 = "E3"; … … 66 67 private final JTextField mafMin = new JTextField("20", 3); 67 68 private final JTextField mafMax = new JTextField("100", 3); 68 private final JTextField iatMin = new JTextField("25", 3);69 69 private final JTextField iatMax = new JTextField("35", 3); 70 70 private final JTextField coolantMin = new JTextField("70", 3); 71 private final JTextField mafvChangeMax = new JTextField("0.3", 3); 71 72 private final JTextField fuelStoichAfr = new JTextField("14.7", 5); 72 73 private final JTextField fuelDensity = new JTextField("732", 5); … … 129 130 130 131 public boolean isValidIntakeAirTemp(double value) { 131 return checkInRange("Intake Air Temp.", iatMin, iatMax, value); 132 return checkLessThan("Intake Air Temp.", iatMax, value); 133 } 134 135 public boolean isValidMafvChange(double value) { 136 return checkLessThan("dMAFv/dt", mafvChangeMax, value); 132 137 } 133 138 … … 163 168 } 164 169 170 private boolean checkLessThan(String name, JTextField max, double value) { 171 if (isNumber(max)) { 172 return value <= parseDouble(max); 173 } else { 174 showMessageDialog(parent, "Invalid " + name + " specified.", "Error", ERROR_MESSAGE); 175 recordDataButton.setSelected(false); 176 return false; 177 } 178 } 179 165 180 private void addControls() { 166 181 JPanel panel = new JPanel(); … … 251 266 addMinMaxFilter(panel, gridBagLayout, "RPM Range", rpmMin, rpmMax, 3); 252 267 addMinMaxFilter(panel, gridBagLayout, "MAF Range (g/s)", mafMin, mafMax, 6); 253 addMinMaxFilter(panel, gridBagLayout, "IAT Range", iatMin, iatMax, 9); 254 addLabeledComponent(panel, gridBagLayout, "Min. Coolant Temp.", coolantMin, 12); 255 addComponent(panel, gridBagLayout, buildRecordDataButton(), 15); 268 addLabeledComponent(panel, gridBagLayout, "Min. Coolant Temp.", coolantMin, 9); 269 addLabeledComponent(panel, gridBagLayout, "Max. Intake Temp.", iatMax, 12); 270 addLabeledComponent(panel, gridBagLayout, "Max. dMAFv/dt (V/s)", mafvChangeMax, 15); 271 addComponent(panel, gridBagLayout, buildRecordDataButton(), 18); 256 272 257 273 return panel; … … 262 278 public void actionPerformed(ActionEvent actionEvent) { 263 279 if (recordDataButton.isSelected()) { 264 registerData(COOLANT_TEMP, ENGINE_SPEED, INTAKE_AIR_TEMP, MASS_AIR_FLOW, AFR, CL_OL_16, CL_OL_32, TIP_IN_THROTTLE_16, TIP_IN_THROTTLE_32, PULSE_WIDTH_16, PULSE_WIDTH_32, ENGINE_LOAD_16, ENGINE_LOAD_32);280 registerData(COOLANT_TEMP, ENGINE_SPEED, INTAKE_AIR_TEMP, MASS_AIR_FLOW, MASS_AIR_FLOW_V, AFR, CL_OL_16, CL_OL_32, TIP_IN_THROTTLE_16, TIP_IN_THROTTLE_32, PULSE_WIDTH_16, PULSE_WIDTH_32, ENGINE_LOAD_16, ENGINE_LOAD_32); 265 281 } else { 266 deregisterData(COOLANT_TEMP, ENGINE_SPEED, INTAKE_AIR_TEMP, MASS_AIR_FLOW, AFR, CL_OL_16, CL_OL_32, TIP_IN_THROTTLE_16, TIP_IN_THROTTLE_32, PULSE_WIDTH_16, PULSE_WIDTH_32, ENGINE_LOAD_16, ENGINE_LOAD_32);282 deregisterData(COOLANT_TEMP, ENGINE_SPEED, INTAKE_AIR_TEMP, MASS_AIR_FLOW, MASS_AIR_FLOW_V, AFR, CL_OL_16, CL_OL_32, TIP_IN_THROTTLE_16, TIP_IN_THROTTLE_32, PULSE_WIDTH_16, PULSE_WIDTH_32, ENGINE_LOAD_16, ENGINE_LOAD_32); 267 283 } 268 284 } -
trunk/src/enginuity/logger/ecu/ui/tab/injector/InjectorTabImpl.java
r15 r35 63 63 } 64 64 65 public boolean isValidMafvChange(double value) { 66 return controlPanel.isValidMafvChange(value); 67 } 68 65 69 public boolean isValidTipInThrottle(double value) { 66 70 return controlPanel.isValidTipInThrottle(value); -
trunk/src/enginuity/logger/ecu/ui/tab/maf/MafControlPanel.java
r32 r35 64 64 private final JTextField mafMin = new JTextField("0", 3); 65 65 private final JTextField mafMax = new JTextField("100", 3); 66 private final JTextField iatMin = new JTextField("25", 3);67 66 private final JTextField iatMax = new JTextField("35", 3); 68 67 private final JTextField coolantMin = new JTextField("70", 3); 68 private final JTextField mafvChangeMax = new JTextField("0.3", 3); 69 69 private final Component parent; 70 70 private final XYTrendline trendline; … … 115 115 116 116 public boolean isValidIntakeAirTemp(double value) { 117 return checkInRange("Intake Air Temp.", iatMin, iatMax, value); 117 return checkLessThan("Intake Air Temp.", iatMax, value); 118 } 119 120 public boolean isValidMafvChange(double value) { 121 return checkLessThan("dMAFv/dt", mafvChangeMax, value); 118 122 } 119 123 … … 142 146 } 143 147 148 private boolean checkLessThan(String name, JTextField max, double value) { 149 if (isNumber(max)) { 150 return value <= parseDouble(max); 151 } else { 152 showMessageDialog(parent, "Invalid " + name + " specified.", "Error", ERROR_MESSAGE); 153 recordDataButton.setSelected(false); 154 return false; 155 } 156 } 157 144 158 private void addControls() { 145 159 JPanel panel = new JPanel(); … … 212 226 addMinMaxFilter(panel, gridBagLayout, "RPM Range", rpmMin, rpmMax, 3); 213 227 addMinMaxFilter(panel, gridBagLayout, "MAF Range (g/s)", mafMin, mafMax, 6); 214 addMinMaxFilter(panel, gridBagLayout, "IAT Range", iatMin, iatMax, 9); 215 addLabeledComponent(panel, gridBagLayout, "Min. Coolant Temp.", coolantMin, 12); 216 addComponent(panel, gridBagLayout, buildRecordDataButton(), 15); 228 addLabeledComponent(panel, gridBagLayout, "Min. Coolant Temp.", coolantMin, 9); 229 addLabeledComponent(panel, gridBagLayout, "Max. Intake Temp.", iatMax, 12); 230 addLabeledComponent(panel, gridBagLayout, "Max. dMAFv/dt (V/s)", mafvChangeMax, 15); 231 addComponent(panel, gridBagLayout, buildRecordDataButton(), 18); 217 232 218 233 return panel; -
trunk/src/enginuity/logger/ecu/ui/tab/maf/MafTabImpl.java
r10 r35 63 63 } 64 64 65 public boolean isValidMafvChange(double value) { 66 return controlPanel.isValidMafvChange(value); 67 } 68 65 69 public boolean isValidTipInThrottle(double value) { 66 70 return controlPanel.isValidTipInThrottle(value);
Note: See TracChangeset
for help on using the changeset viewer.