allowDuplicateNames
This commit is contained in:
parent
22e66be7cd
commit
d14ca16039
|
@ -12,6 +12,8 @@ public class Launcher {
|
||||||
public static String fileNameFilter;
|
public static String fileNameFilter;
|
||||||
public static final String DBC_FILENAME_PROPERTY = "-dbc";
|
public static final String DBC_FILENAME_PROPERTY = "-dbc";
|
||||||
public static String dbcFileName;
|
public static String dbcFileName;
|
||||||
|
public static final String DBC_DUP_FIELD_NAMES = "-allow-dup-names";
|
||||||
|
public static boolean allowDuplicateNames = false;
|
||||||
|
|
||||||
public static void main(String[] args) throws IOException {
|
public static void main(String[] args) throws IOException {
|
||||||
if (args.length < 1) {
|
if (args.length < 1) {
|
||||||
|
@ -26,6 +28,9 @@ public class Launcher {
|
||||||
String inputFolderName = args[0];
|
String inputFolderName = args[0];
|
||||||
for (int i = 1; i < args.length; i++) {
|
for (int i = 1; i < args.length; i++) {
|
||||||
switch (args[i]) {
|
switch (args[i]) {
|
||||||
|
case DBC_DUP_FIELD_NAMES:
|
||||||
|
allowDuplicateNames = true;
|
||||||
|
break;
|
||||||
case FILENAME_SUFFIX_PROPERTY:
|
case FILENAME_SUFFIX_PROPERTY:
|
||||||
i += 1;
|
i += 1;
|
||||||
fileNameSuffixValue = args[i];
|
fileNameSuffixValue = args[i];
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.rusefi.can.reader.dbc;
|
package com.rusefi.can.reader.dbc;
|
||||||
|
|
||||||
|
import com.rusefi.can.Launcher;
|
||||||
import com.rusefi.mlv.LoggingStrategy;
|
import com.rusefi.mlv.LoggingStrategy;
|
||||||
import com.rusefi.sensor_logs.BinaryLogEntry;
|
import com.rusefi.sensor_logs.BinaryLogEntry;
|
||||||
|
|
||||||
|
@ -82,7 +83,7 @@ public class DbcFile {
|
||||||
if (debugEnabled)
|
if (debugEnabled)
|
||||||
System.out.println("Found " + field);
|
System.out.println("Found " + field);
|
||||||
if (field != null) {
|
if (field != null) {
|
||||||
if (!fieldNames.add(field.getName()))
|
if (!fieldNames.add(field.getName()) && !Launcher.allowDuplicateNames)
|
||||||
throw new IllegalArgumentException("Let's use unique field names: " + field.getName());
|
throw new IllegalArgumentException("Let's use unique field names: " + field.getName());
|
||||||
currentPacket.add(field);
|
currentPacket.add(field);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue