auto-sync

This commit is contained in:
rusEfi 2015-03-02 08:06:40 -06:00
parent da1bfe693b
commit b14919b989
5 changed files with 44 additions and 24 deletions

View File

@ -0,0 +1,25 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Launcher COM9" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" value="com.rusefi.Launcher" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="COM9" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="ui" />
<envs />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@ -9,7 +9,7 @@ import java.util.ArrayList;
* 2/11/13
*/
public enum Sensor {
RPM("RPM", SensorCategory.SENSOR_INPUTS),
RPM("RPM", SensorCategory.SENSOR_INPUTS, "rpm", 8000),
MAP("MAP", SensorCategory.SENSOR_INPUTS),
MAP_RAW("MAP_RAW", SensorCategory.SENSOR_INPUTS),
BARO("Baro", SensorCategory.SENSOR_INPUTS),

View File

@ -29,7 +29,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
* @see com.rusefi.StartupFrame
*/
public class Launcher extends FrameHelper {
public static final int CONSOLE_VERSION = 20150228;
public static final int CONSOLE_VERSION = 20150302;
public static final boolean SHOW_STIMULATOR = true;
public static final String TAB_INDEX = "main_tab";
private final String port;

View File

@ -2,10 +2,8 @@ package com.rusefi.ui;
import com.rusefi.core.Sensor;
import com.rusefi.ui.util.FrameHelper;
import com.rusefi.ui.widgets.MafCommand;
import com.rusefi.ui.widgets.RpmCommand;
import com.rusefi.ui.widgets.SensorGauge;
import eu.hansolo.steelseries.gauges.Radial;
import javax.swing.*;
import java.awt.*;
@ -15,9 +13,6 @@ import java.awt.*;
* (c) Andrey Belomutskiy
*/
public class GaugesPanel {
private static final int ADC_MAX_VALUE = 255; // mazda ECU
// private static final int ADC_MAX_VALUE = 4095; // discovery board
private final JPanel content = new JPanel(new BorderLayout());
public static void main(String[] args) {
@ -31,7 +26,7 @@ public class GaugesPanel {
JPanel box2 = new JPanel(new GridLayout(3, 5));
box2.add(createControls());
box2.add(createRpmGauge());
box2.add(SensorGauge.createGauge(Sensor.RPM));
box2.add(SensorGauge.createGauge(Sensor.MAF));
box2.add(SensorGauge.createGauge(Sensor.CLT));
box2.add(SensorGauge.createGauge(Sensor.IAT));
@ -89,15 +84,4 @@ public class GaugesPanel {
controls.add(new RpmCommand());
return controls;
}
private Radial createRpmGauge() {
final Radial rpmGauge = SensorGauge.createRadial("RPM", "", 8000, 0);
RpmModel.getInstance().addListener(new RpmModel.RpmListener() {
public void onRpmChange(RpmModel rpm) {
rpmGauge.setValue(rpm.getValue());
}
});
rpmGauge.setMaxMeasuredValueVisible(true);
return rpmGauge;
}
}

View File

@ -25,7 +25,7 @@ import java.util.Hashtable;
public class SensorGauge {
public static Component createGauge(final Sensor sensor) {
return createGauge(sensor, null);
return createGauge(sensor, GaugeChangeListener.VOID);
}
private static Component createGauge(Sensor sensor, GaugeChangeListener listener) {
@ -37,7 +37,19 @@ public class SensorGauge {
}
interface GaugeChangeListener {
void onChange(Sensor sensor);
GaugeChangeListener VOID = new GaugeChangeListener() {
@Override
public void onSensorChange(Sensor sensor) {
}
};
/**
* This event happens when user decides to switch the kind of gauge
* displayed by this control
*
* @param sensor new type
*/
void onSensorChange(Sensor sensor);
}
private static void createGaugeBody(final Sensor sensor, final JPanel wrapper, final GaugeChangeListener listener) {
@ -87,8 +99,7 @@ public class SensorGauge {
@Override
public void actionPerformed(ActionEvent e) {
createGaugeBody(s, wrapper, listener);
if (listener != null)
listener.onChange(s);
listener.onSensorChange(s);
}
});
cmi.add(mi);
@ -102,7 +113,7 @@ public class SensorGauge {
GaugeChangeListener listener = new GaugeChangeListener() {
@Override
public void onChange(Sensor sensor) {
public void onSensorChange(Sensor sensor) {
ds.onChange(sensor);
}
};