mirror of https://github.com/rusefi/rusefi-1.git
refactoring
This commit is contained in:
parent
7cec254bb0
commit
b2aebdab38
|
@ -0,0 +1,9 @@
|
|||
package com.rusefi.ui.engine;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public enum ChannelNaming {
|
||||
INSTANCE;
|
||||
|
||||
public final HashMap<String, String> channelName2PhysicalPin = new HashMap<>();
|
||||
}
|
|
@ -16,7 +16,6 @@ import com.rusefi.ui.widgets.AnyCommand;
|
|||
import com.rusefi.waves.EngineChart;
|
||||
import com.rusefi.waves.EngineChartParser;
|
||||
import com.rusefi.waves.EngineReport;
|
||||
import com.rusefi.waves.RevolutionLog;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
@ -70,8 +69,6 @@ public class EngineSnifferPanel {
|
|||
private final EngineSnifferStatusPanel statusPanel = new EngineSnifferStatusPanel(zoomControl.getZoomProvider());
|
||||
private final UpDownImage crank = createImage(Fields.PROTOCOL_CRANK1);
|
||||
private final ChartScrollControl scrollControl;
|
||||
// todo: move it some sort of a singleton?
|
||||
public final HashMap<String, String> channelName2PhysicalPin = new HashMap<>();
|
||||
private AnyCommand command;
|
||||
|
||||
private boolean isPaused;
|
||||
|
@ -193,7 +190,7 @@ public class EngineSnifferPanel {
|
|||
String channel = pinInfo[0];
|
||||
String pin = pinInfo[1];
|
||||
UpDownImage image = images.get(channel);
|
||||
channelName2PhysicalPin.put(channel, pin);
|
||||
ChannelNaming.INSTANCE.channelName2PhysicalPin.put(channel, pin);
|
||||
if (image != null)
|
||||
image.setPhysicalPin(pin);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.rusefi.ui.engine;
|
||||
|
||||
import com.rusefi.Launcher;
|
||||
import com.rusefi.config.generated.Fields;
|
||||
import com.rusefi.core.Sensor;
|
||||
import com.rusefi.core.SensorCentral;
|
||||
|
@ -65,13 +64,9 @@ public class UpDownImage extends JPanel {
|
|||
public UpDownImage(final String name) {
|
||||
this(EngineReport.MOCK, name);
|
||||
setToolTip();
|
||||
// this code is horrible, I am in a rush :(
|
||||
EngineSnifferPanel p = Launcher.engineSnifferPanel;
|
||||
if (p != null) {
|
||||
String pin = p.channelName2PhysicalPin.get(name);
|
||||
if (pin != null)
|
||||
setPhysicalPin(pin);
|
||||
}
|
||||
String pin = ChannelNaming.INSTANCE.channelName2PhysicalPin.get(name);
|
||||
if (pin != null)
|
||||
setPhysicalPin(pin);
|
||||
}
|
||||
|
||||
public void setSignalBody(Color signalBody) {
|
||||
|
|
Loading…
Reference in New Issue