From d4a1811f7f5a4a29d6788c659cdbf382fa1a37b7 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Tue, 26 Apr 2022 19:38:49 -0400 Subject: [PATCH] new autoscale constraint #4111 --- .../src/main/java/com/rusefi/ConfigField.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/ConfigField.java b/java_tools/configuration_definition/src/main/java/com/rusefi/ConfigField.java index ec305cf5f6..eb17534641 100644 --- a/java_tools/configuration_definition/src/main/java/com/rusefi/ConfigField.java +++ b/java_tools/configuration_definition/src/main/java/com/rusefi/ConfigField.java @@ -88,6 +88,16 @@ public class ConfigField { this.arraySizes = arraySizes; this.tsInfo = tsInfo == null ? null : state.variableRegistry.applyVariables(tsInfo); this.isIterate = isIterate; + if (tsInfo != null) { + String[] tokens = getTokens(); + if (tokens.length > 1) { + String scale = tokens[1].trim(); + if (!hasAutoscale && !scale.trim().equals("1")) { + System.out.println("GRRRRRRRRRRRRRRRR " + "Unexpected scale of " + scale + " without autoscale on " + this); +// throw new IllegalStateException("Unexpected scale of " + scale + " without autoscale on " + this); + } + } + } } private static int getSize(VariableRegistry variableRegistry, String s) { @@ -289,7 +299,7 @@ public class ConfigField { } if (tsInfo == null) throw new IllegalArgumentException("tsInfo expected with autoscale"); - String[] tokens = tsInfo.split(","); + String[] tokens = getTokens(); if (tokens.length < 2) throw new IllegalArgumentException("Second comma-separated token expected in [" + tsInfo + "] for " + name);