auto-sync

This commit is contained in:
rusEfi 2016-01-24 03:01:36 -05:00
parent f49f8a9bc4
commit afdbbb03f3
2 changed files with 11 additions and 3 deletions

View File

@ -32,7 +32,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
* @see EngineSnifferPanel
*/
public class Launcher {
public static final int CONSOLE_VERSION = 20160122;
public static final int CONSOLE_VERSION = 20160123;
public static final boolean SHOW_STIMULATOR = false;
private static final String TAB_INDEX = "main_tab";
protected static final String PORT_KEY = "port";

View File

@ -12,9 +12,12 @@ import javax.swing.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.nio.ByteBuffer;
import java.text.DecimalFormat;
import java.text.ParseException;
public class ConfigField extends BaseConfigField {
private final JTextField view = new JTextFieldWithWidth(200);
private final static DecimalFormat df = new DecimalFormat("0.0000");
public ConfigField(final Field field, String topLabel) {
super(field);
@ -69,9 +72,14 @@ public class ConfigField extends BaseConfigField {
}
public static double getFloatValue(ConfigurationImage ci, Field field) {
// this hack is trying to restore lost precision. It's a lame hack
float value = getValue(ci, field).floatValue();
return Double.parseDouble(String.format("%.4f", value));
// this hack is trying to restore lost precision. It's a lame hack
String str = df.format(value);
try {
return df.parse(str).doubleValue();
} catch (ParseException e) {
throw new IllegalStateException("While parsing [" + str + "]");
}
}
public static int getIntValue(ConfigurationImage ci, Field field) {