mirror of https://github.com/rusefi/RomRaider.git
Editor Bug Fixes:
- Scaling fix for switching from Default to raw and then raw back to default. - Overlay tables are not registered when the table is closed and displayed again.
This commit is contained in:
parent
8a08c39aa8
commit
17a96e6cb8
|
@ -25,6 +25,7 @@ import static java.util.Collections.synchronizedMap;
|
|||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
import java.util.Map;
|
||||
|
||||
import com.romraider.logger.ecu.comms.query.Response;
|
||||
|
@ -39,6 +40,7 @@ public final class TableUpdateHandler implements DataUpdateHandler {
|
|||
private final Map<String, List<Table>> tableMap = synchronizedMap(new HashMap<String, List<Table>>());
|
||||
|
||||
private TableUpdateHandler() {
|
||||
tableMap.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -51,8 +53,9 @@ public final class TableUpdateHandler implements DataUpdateHandler {
|
|||
List<Table> tables = tableMap.get(loggerData.getId());
|
||||
if (tables != null && !tables.isEmpty()) {
|
||||
String formattedValue = loggerData.getSelectedConvertor().format(response.getDataValue(loggerData));
|
||||
for (Table table : tables) {
|
||||
table.highlightLiveData(formattedValue);
|
||||
ListIterator<Table> item = tables.listIterator();
|
||||
if(item.hasNext()) {
|
||||
item.next().highlightLiveData(formattedValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -361,6 +361,10 @@ public class Table2D extends Table {
|
|||
try {
|
||||
this.axis.setScaleByName(curScale.getName());
|
||||
} catch (NameNotFoundException e) {
|
||||
try {
|
||||
this.axis.setScaleByName(SettingsManager.getSettings().getDefaultScale());
|
||||
} catch (NameNotFoundException e1) {
|
||||
}
|
||||
}
|
||||
}
|
||||
this.curScale = curScale;
|
||||
|
|
|
@ -845,10 +845,18 @@ public class Table3D extends Table {
|
|||
try {
|
||||
this.xAxis.setScaleByName(curScale.getName());
|
||||
} catch (NameNotFoundException e) {
|
||||
try {
|
||||
this.xAxis.setScaleByName(SettingsManager.getSettings().getDefaultScale());
|
||||
} catch (NameNotFoundException e1) {
|
||||
}
|
||||
}
|
||||
try {
|
||||
this.yAxis.setScaleByName(curScale.getName());
|
||||
} catch (NameNotFoundException e) {
|
||||
try {
|
||||
this.yAxis.setScaleByName(SettingsManager.getSettings().getDefaultScale());
|
||||
} catch (NameNotFoundException e1) {
|
||||
}
|
||||
}
|
||||
}
|
||||
this.curScale = curScale;
|
||||
|
|
|
@ -107,6 +107,7 @@ public class MDIDesktopPane extends JDesktopPane {
|
|||
|
||||
if(frame instanceof TableFrame) {
|
||||
getEditor().getTableToolBar().updateTableToolBar();
|
||||
((TableFrame) frame).RegisterTable();
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
|
@ -67,10 +67,9 @@ public class TableFrame extends JInternalFrame implements InternalFrameListener,
|
|||
parent.getEditorMenuBar().updateMenu();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void internalFrameOpened(InternalFrameEvent e) {
|
||||
TableUpdateHandler.getInstance().registerTable(this.getTable());
|
||||
RegisterTable();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -98,6 +97,10 @@ public class TableFrame extends JInternalFrame implements InternalFrameListener,
|
|||
getEditor().getTableToolBar().updateTableToolBar();
|
||||
}
|
||||
|
||||
public void RegisterTable() {
|
||||
TableUpdateHandler.getInstance().registerTable(this.getTable());
|
||||
}
|
||||
|
||||
public Table getTable() {
|
||||
return table;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue