mirror of https://github.com/rusefi/RomRaider.git
Added external plugin message. Set external plugin mode if no definition is setup
This commit is contained in:
parent
a1adb99be9
commit
128b96623a
|
@ -1,5 +1,6 @@
|
|||
# Each of these lines has a trailing space, do not remove it
|
||||
CONNECTING = Connecting
|
||||
READING = Reading data
|
||||
READING = Reading data
|
||||
READING_EXTERNAL = Reading plugins only
|
||||
LOGGING = Logging to file
|
||||
STOPPED = Stopped
|
||||
|
|
|
@ -543,7 +543,11 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
|
||||
private void loadLoggerConfig() {
|
||||
String loggerConfigFilePath = getSettings().getLoggerDefinitionFilePath();
|
||||
if (isNullOrEmpty(loggerConfigFilePath)) showMissingConfigDialog();
|
||||
if (isNullOrEmpty(loggerConfigFilePath))
|
||||
{
|
||||
showMissingConfigDialog();
|
||||
getSettings().setLogExternalsOnly(true);
|
||||
}
|
||||
else {
|
||||
try {
|
||||
EcuDataLoader dataLoader = new EcuDataLoaderImpl();
|
||||
|
@ -1527,40 +1531,45 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
private void buildModuleSelectPanel() {
|
||||
moduleSelectPanel.removeAll();
|
||||
final CustomButtonGroup moduleGroup = new CustomButtonGroup();
|
||||
|
||||
for (Module module : getModuleList()) {
|
||||
final JCheckBox cb = new JCheckBox(module.getName().toUpperCase());
|
||||
if (touchEnabled == true)
|
||||
{
|
||||
cb.setPreferredSize(new Dimension(75, 50));
|
||||
}
|
||||
cb.setToolTipText(MessageFormat.format(
|
||||
rb.getString("TTTEXTEXTERNALS"),
|
||||
module.getDescription()));
|
||||
if (getSettings().getTargetModule().equalsIgnoreCase(module.getName())) {
|
||||
cb.setSelected(true);
|
||||
setTarget(module.getName());
|
||||
}
|
||||
|
||||
cb.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent actionEvent) {
|
||||
stopLogging();
|
||||
final JCheckBox source = (JCheckBox) actionEvent.getSource();
|
||||
if (source.isSelected()) {
|
||||
getSettings().setLogExternalsOnly(false);
|
||||
setTarget(source.getText());
|
||||
}
|
||||
else {
|
||||
getSettings().setLogExternalsOnly(true);
|
||||
}
|
||||
startLogging();
|
||||
}
|
||||
});
|
||||
|
||||
moduleGroup.add(cb);
|
||||
moduleSelectPanel.add(cb);
|
||||
moduleSelectPanel.validate();
|
||||
Collection<Module> moduleList = getModuleList();
|
||||
if(moduleList.size() == 0) {
|
||||
getSettings().setLogExternalsOnly(true);
|
||||
}
|
||||
else {
|
||||
for (Module module : moduleList) {
|
||||
final JCheckBox cb = new JCheckBox(module.getName().toUpperCase());
|
||||
if (touchEnabled == true)
|
||||
{
|
||||
cb.setPreferredSize(new Dimension(75, 50));
|
||||
}
|
||||
cb.setToolTipText(MessageFormat.format(
|
||||
rb.getString("TTTEXTEXTERNALS"),
|
||||
module.getDescription()));
|
||||
if (getSettings().getTargetModule().equalsIgnoreCase(module.getName())) {
|
||||
cb.setSelected(true);
|
||||
setTarget(module.getName());
|
||||
}
|
||||
|
||||
cb.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent actionEvent) {
|
||||
stopLogging();
|
||||
final JCheckBox source = (JCheckBox) actionEvent.getSource();
|
||||
if (source.isSelected()) {
|
||||
getSettings().setLogExternalsOnly(false);
|
||||
setTarget(source.getText());
|
||||
}
|
||||
else {
|
||||
getSettings().setLogExternalsOnly(true);
|
||||
}
|
||||
startLogging();
|
||||
}
|
||||
});
|
||||
|
||||
moduleGroup.add(cb);
|
||||
moduleSelectPanel.add(cb);
|
||||
moduleSelectPanel.validate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -468,7 +468,10 @@ public final class QueryManagerImpl implements QueryManager {
|
|||
@Override
|
||||
public void run() {
|
||||
for (StatusChangeListener listener : listeners) {
|
||||
listener.readingData();
|
||||
if(settings.isLogExternalsOnly()) listener.readingDataExternal();
|
||||
else {
|
||||
listener.readingData();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -75,7 +75,11 @@ public final class DataRegistrationBrokerImpl implements DataRegistrationBroker
|
|||
|
||||
public synchronized void readingData() {
|
||||
}
|
||||
|
||||
|
||||
public void readingDataExternal() {
|
||||
|
||||
}
|
||||
|
||||
public synchronized void loggingData() {
|
||||
}
|
||||
|
||||
|
@ -90,4 +94,6 @@ public final class DataRegistrationBrokerImpl implements DataRegistrationBroker
|
|||
handlerManager.deregisterData(loggerData);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -24,6 +24,8 @@ public interface StatusChangeListener {
|
|||
void connecting();
|
||||
|
||||
void readingData();
|
||||
|
||||
void readingDataExternal();
|
||||
|
||||
void loggingData();
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ public final class StatusIndicator extends JPanel implements StatusChangeListene
|
|||
private final JLabel statusLabel = new JLabel();
|
||||
private static final String TEXT_CONNECTING = rb.getString("CONNECTING");
|
||||
private static final String TEXT_READING = rb.getString("READING");
|
||||
private static final String TEXT_READING_EXTERNAL = rb.getString("READING_EXTERNAL");
|
||||
private static final String TEXT_LOGGING = rb.getString("LOGGING");
|
||||
private static final String TEXT_STOPPED = rb.getString("STOPPED");
|
||||
private static final ImageIcon ICON_CONNECTING = new ImageIcon(StatusIndicator.class.getClass().getResource("/graphics/logger_blue.png"));
|
||||
|
@ -59,7 +60,11 @@ public final class StatusIndicator extends JPanel implements StatusChangeListene
|
|||
public void readingData() {
|
||||
updateStatusLabel(TEXT_READING, ICON_READING);
|
||||
}
|
||||
|
||||
|
||||
public void readingDataExternal() {
|
||||
updateStatusLabel(TEXT_READING_EXTERNAL, ICON_READING);
|
||||
}
|
||||
|
||||
public void loggingData() {
|
||||
updateStatusLabel(TEXT_LOGGING, ICON_LOGGING);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue