diff --git a/src/main/resources/alfa.json b/src/main/resources/alfa.json index 4f74ae97..c8f3615f 100644 --- a/src/main/resources/alfa.json +++ b/src/main/resources/alfa.json @@ -543,7 +543,32 @@ "units": "%", "formula": "parseFloat(((((A*256)+B)*(1000/65535))/10).toFixed(2))", "stable": false + }, + { + "priority": 0, + "id": "6034", + "mode": "22", + "pid": "196C", + "length": 2, + "description": "Camshaft desired angle", + "min": "0", + "max": "360", + "units": "degrees", + "formula": "parseFloat(((A*256+B)/128).toFixed(1))", + "stable": false + }, + { + "priority": 0, + "id": "6035", + "mode": "22", + "pid": "196D", + "length": 2, + "description": "Camshaft actual angle", + "min": "0", + "max": "360", + "units": "degrees", + "formula": "parseFloat(((A*256+B)/128).toFixed(1))", + "stable": false } - ] } diff --git a/src/test/java/org/obd/metrics/codec/giulietta_qv_med17_3_1/CamshaftActualAngleTest.java b/src/test/java/org/obd/metrics/codec/giulietta_qv_med17_3_1/CamshaftActualAngleTest.java new file mode 100644 index 00000000..6bf0ab7e --- /dev/null +++ b/src/test/java/org/obd/metrics/codec/giulietta_qv_med17_3_1/CamshaftActualAngleTest.java @@ -0,0 +1,17 @@ +package org.obd.metrics.codec.giulietta_qv_med17_3_1; + +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; + +public class CamshaftActualAngleTest implements Giulietta_QV_Med_17_3_1_Test { + + @ParameterizedTest + @CsvSource(value = { + "62196D0000=00", + "62196D0A00=20", + "62196D09D0=19.60" + }, delimiter = '=') + public void parameterizedTest(String input, String expected) { + assertEquals(input, Double.parseDouble(expected)); + } +} diff --git a/src/test/java/org/obd/metrics/codec/giulietta_qv_med17_3_1/CamshaftDesiredAngleTest.java b/src/test/java/org/obd/metrics/codec/giulietta_qv_med17_3_1/CamshaftDesiredAngleTest.java new file mode 100644 index 00000000..65f4323f --- /dev/null +++ b/src/test/java/org/obd/metrics/codec/giulietta_qv_med17_3_1/CamshaftDesiredAngleTest.java @@ -0,0 +1,17 @@ +package org.obd.metrics.codec.giulietta_qv_med17_3_1; + +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; + +public class CamshaftDesiredAngleTest implements Giulietta_QV_Med_17_3_1_Test { + + @ParameterizedTest + @CsvSource(value = { + "62196C0000=00", + "62196C0A00=20", + "62196C09D0=19.60" + }, delimiter = '=') + public void parameterizedTest(String input, String expected) { + assertEquals(input, Double.parseDouble(expected)); + } +}