package com.irnems; import com.irnems.core.EngineState; import com.irnems.core.MessagesCentral; import com.rusefi.*; import com.rusefi.io.LinkManager; import com.rusefi.ui.*; import jssc.SerialPortList; import javax.swing.*; /** * this is the main entry point of rusEfi ECU console *
* * Date: 12/25/12 * (c) Andrey Belomutskiy * * @see WavePanel */ public class Launcher extends FrameHelper { public static final int CONSOLE_VERSION = 20140905; public static final boolean SHOW_STIMULATOR = true; public Launcher(String port) { FileLog.MAIN.start(); LinkManager.start(port); FileLog.MAIN.logLine("Console " + CONSOLE_VERSION); JTabbedPane tabbedPane = new JTabbedPane(); RpmPanel rpmPanel = new RpmPanel(); tabbedPane.addTab("Main", rpmPanel.createRpmPanel()); tabbedPane.addTab("Gauges", new GaugesPanel().getContent()); tabbedPane.addTab("Digital Sniffer", WavePanel.getInstance().getPanel()); tabbedPane.addTab("Analog Sniffer", new AnalogChartPanel()); // tabbedPane.addTab("ADC", new AdcPanel(new BooleanInputsModel()).createAdcPanel()); if (SHOW_STIMULATOR) { EcuStimulator stimulator = EcuStimulator.getInstance(); tabbedPane.add("ECU stimulation", stimulator.getPanel()); } // tabbedPane.addTab("live map adjustment", new Live3DReport().getControl()); tabbedPane.add("Messages", new MsgPanel(true).getContent()); tabbedPane.add("Log Viewer", new LogViewer()); tabbedPane.setSelectedIndex(2); // tabbedPane.setSelectedIndex(5); for (String p : SerialPortList.getPortNames()) MessagesCentral.getInstance().postMessage(Launcher.class, "Available port: " + p); showFrame(tabbedPane); } @Override protected void onWindowOpened() { super.onWindowOpened(); setTitle("N/A"); LinkManager.open(); LinkManager.engineState.registerStringValueAction("rusEfiVersion", new EngineState.ValueCallback