Corrected saving the target module id to the Settings file and moved

module and fastpoll attributes to the transport element.
This commit is contained in:
Dale Schultz 2015-01-06 23:00:43 -05:00
parent b48b91f0b7
commit 685a6a7161
2 changed files with 4 additions and 4 deletions

View File

@ -291,14 +291,14 @@ public final class DOMSettingsBuilder {
IIOMetadataNode serial = new IIOMetadataNode("serial"); IIOMetadataNode serial = new IIOMetadataNode("serial");
serial.setAttribute("port", settings.getLoggerPortDefault()); serial.setAttribute("port", settings.getLoggerPortDefault());
serial.setAttribute("refresh", String.valueOf(settings.getRefreshMode())); serial.setAttribute("refresh", String.valueOf(settings.getRefreshMode()));
serial.setAttribute("module", settings.getTargetModule());
serial.setAttribute("fastpoll", String.valueOf(settings.isFastPoll()));
loggerSettings.appendChild(serial); loggerSettings.appendChild(serial);
// Protocol connection // Protocol connection
IIOMetadataNode protocol = new IIOMetadataNode("protocol"); IIOMetadataNode protocol = new IIOMetadataNode("protocol");
protocol.setAttribute("name", settings.getLoggerProtocol()); protocol.setAttribute("name", settings.getLoggerProtocol());
protocol.setAttribute("transport", settings.getTransportProtocol()); protocol.setAttribute("transport", settings.getTransportProtocol());
protocol.setAttribute("module", settings.getTargetModule());
protocol.setAttribute("fastpoll", String.valueOf(settings.isFastPoll()));
protocol.setAttribute("library", settings.getJ2534Device()); protocol.setAttribute("library", settings.getJ2534Device());
loggerSettings.appendChild(protocol); loggerSettings.appendChild(protocol);

View File

@ -253,12 +253,12 @@ public final class DOMSettingsUnmarshaller {
if (n.getNodeType() == ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("serial")) { if (n.getNodeType() == ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("serial")) {
settings.setLoggerPortDefault(unmarshallAttribute(n, "port", "")); settings.setLoggerPortDefault(unmarshallAttribute(n, "port", ""));
settings.setRefreshMode(unmarshallAttribute(n, "refresh", false)); settings.setRefreshMode(unmarshallAttribute(n, "refresh", false));
settings.setTargetModule(unmarshallAttribute(n, "module", "ecu"));
settings.setFastPoll(unmarshallAttribute(n, "fastpoll", true));
} else if (n.getNodeType() == ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("protocol")) { } else if (n.getNodeType() == ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("protocol")) {
settings.setLoggerProtocol(unmarshallAttribute(n, "name", "SSM")); settings.setLoggerProtocol(unmarshallAttribute(n, "name", "SSM"));
settings.setTransportProtocol(unmarshallAttribute(n, "transport", "ISO9141")); settings.setTransportProtocol(unmarshallAttribute(n, "transport", "ISO9141"));
settings.setTargetModule(unmarshallAttribute(n, "module", "ecu"));
settings.setFastPoll(unmarshallAttribute(n, "fastpoll", true));
settings.setJ2534Device(unmarshallAttribute(n, "library", null)); settings.setJ2534Device(unmarshallAttribute(n, "library", null));
} else if (n.getNodeType() == ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("maximized")) { } else if (n.getNodeType() == ELEMENT_NODE && n.getNodeName().equalsIgnoreCase("maximized")) {