Skip to content

Commit 083f51d

Browse files
authored
Merge pull request #11 from iromzy/develop
Add COEFFS_LINEAR for COMPU_METHOD
2 parents 5dfe395 + 99fd8d9 commit 083f51d

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

pkg/a2l/a2lextension.go

+12
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,16 @@ func (t *CoeffsType) MarshalA2L(indentLevel int, indentString string, _ bool) (r
777777
t.F.A2LString()), indentLevel, indentString)
778778
}
779779

780+
func (t *CoeffsLinearType) MapChildNodes(_ any) {
781+
panic("leaf node")
782+
}
783+
784+
func (t *CoeffsLinearType) MarshalA2L(indentLevel int, indentString string, _ bool) (result string) {
785+
return indentContent(fmt.Sprintf("COEFFS_LINEAR %s %s",
786+
t.A.A2LString(),
787+
t.B.A2LString()), indentLevel, indentString)
788+
}
789+
780790
func (t *ComparisonQuantityType) MapChildNodes(_ any) {
781791
panic("leaf node")
782792
}
@@ -795,6 +805,8 @@ func (t *CompuMethodType) MapChildNodes(node any) {
795805
t.FORMULA = node.(*FormulaType)
796806
case *CoeffsType:
797807
t.COEFFS = node.(*CoeffsType)
808+
case *CoeffsLinearType:
809+
t.COEFFS_LINEAR = node.(*CoeffsLinearType)
798810
case *CompuTabRefType:
799811
t.COMPU_TAB_REF = node.(*CompuTabRefType)
800812
case *RefUnitType:

protobuf/A2L.proto

+8-2
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,11 @@ message CoeffsType {
254254
FloatType F = 6 [json_name = "F"];
255255
}
256256

257+
message CoeffsLinearType {
258+
FloatType A = 1 [json_name = "A"];
259+
FloatType B = 2 [json_name = "B"];
260+
}
261+
257262
message ComparisonQuantityType {
258263
IdentType Name = 1 [json_name = "Name"];
259264
}
@@ -266,8 +271,9 @@ message CompuMethodType {
266271
StringType Unit = 5 [json_name = "Unit"];
267272
optional FormulaType FORMULA = 6 [json_name = "FORMULA"];
268273
optional CoeffsType COEFFS = 7 [json_name = "COEFFS"];
269-
optional CompuTabRefType COMPU_TAB_REF = 8 [json_name = "COMPU_TAB_REF"];
270-
optional RefUnitType REF_UNIT = 9 [json_name = "REF_UNIT"];
274+
optional CoeffsLinearType COEFFS_LINEAR = 8 [json_name = "COEFFS_LINEAR"];
275+
optional CompuTabRefType COMPU_TAB_REF = 9 [json_name = "COMPU_TAB_REF"];
276+
optional RefUnitType REF_UNIT = 10 [json_name = "REF_UNIT"];
271277
}
272278

273279
message CompuTabRefType {

0 commit comments

Comments
 (0)