You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I use Asap2 to parse a v1.7 a2l file, it report error when meet MATRIX_DIM like this:
MATRIX_DIM 1 200
I have check the specification, the MATRIX_DIM have fix 3 member x,y,z in v1.6, but v1.7 define like this:
MATRIX_DIM (uint Dim)+
The count of Dim can be 1,2,3,......
So I change my local project, in file Asap2.Language.grammar.y line 1194-1197 change to
matrix_dim : MATRIX_DIM NUMBER {
$$ = new MATRIX_DIM(@$, (uint)$2);
}
;
matrix_dim : MATRIX_DIM NUMBER NUMBER {
$$ = new MATRIX_DIM(@$, (uint)$2, (uint)$3);
}
;
matrix_dim : MATRIX_DIM NUMBER NUMBER NUMBER {
$$ = new MATRIX_DIM(@$, (uint)$2, (uint)$3, (uint)$4);
}
;
And class MATRIX_DIM in file Asap2File.cs change to
[Base(IsSimple = true)]
public class MATRIX_DIM : Asap2Base
{
public MATRIX_DIM(Location location, uint xDim, uint yDim, uint zDim) : base(location)
{
_Dims.Add(xDim);
_Dims.Add(yDim);
_Dims.Add(zDim);
Dims_str = xDim.ToString() + " " + yDim.ToString() + " " + zDim.ToString();
}
public MATRIX_DIM(Location location, uint xDim, uint yDim) : base(location)
{
_Dims.Add(xDim);
_Dims.Add(yDim);
Dims_str = xDim.ToString() + " " + yDim.ToString();
}
public MATRIX_DIM(Location location, uint xDim) : base(location)
{
_Dims.Add(xDim);
Dims_str = xDim.ToString();
}
[Element(0, IsArgument = true)]
public string Dims_str = "";
public List _Dims = new List();
}
Now it work for my a2l file, but the count of MATRIX_DIM is limit to 3, is there a better solution?
The text was updated successfully, but these errors were encountered:
ASAM MCD-2 MC V1.7 defines the dimensions as optional numbers. This allows to add only
the dimensions used.
In earlier versions (<= V1.6.1) always 3 dimensions are given. To describe objects with less
than 3 dimensions ASAM MCD-2 MC V1.6.1 defined a rule that not used dimensions are
stated as ‘1’.
This leads to inconsistency in case of usage of MATRIX_DIM for 1 or two dimensions. E.g.
MATRIX_DIM 4 2 1 describes in V1.7 a 3-dimensional object (z-dimension = 1) and in V1.6.1
a 2-dimensional object.
To avoid conflicts MATRIX_DIM must be handled version dependent.
So, there is a little bit more to handle to support V1.7 ;)
Hello, I use Asap2 to parse a v1.7 a2l file, it report error when meet MATRIX_DIM like this:
MATRIX_DIM 1 200
I have check the specification, the MATRIX_DIM have fix 3 member x,y,z in v1.6, but v1.7 define like this:
MATRIX_DIM (uint Dim)+
The count of Dim can be 1,2,3,......
So I change my local project, in file Asap2.Language.grammar.y line 1194-1197 change to
matrix_dim : MATRIX_DIM NUMBER {
$$ = new MATRIX_DIM(@$, (uint)$2);
}
;
matrix_dim : MATRIX_DIM NUMBER NUMBER {
$$ = new MATRIX_DIM(@$, (uint)$2, (uint)$3);
}
;
matrix_dim : MATRIX_DIM NUMBER NUMBER NUMBER {
$$ = new MATRIX_DIM(@$, (uint)$2, (uint)$3, (uint)$4);
}
;
And class MATRIX_DIM in file Asap2File.cs change to
[Base(IsSimple = true)]
public class MATRIX_DIM : Asap2Base
{
public MATRIX_DIM(Location location, uint xDim, uint yDim, uint zDim) : base(location)
{
_Dims.Add(xDim);
_Dims.Add(yDim);
_Dims.Add(zDim);
Dims_str = xDim.ToString() + " " + yDim.ToString() + " " + zDim.ToString();
}
public MATRIX_DIM(Location location, uint xDim, uint yDim) : base(location)
{
_Dims.Add(xDim);
_Dims.Add(yDim);
Dims_str = xDim.ToString() + " " + yDim.ToString();
}
public MATRIX_DIM(Location location, uint xDim) : base(location)
{
_Dims.Add(xDim);
Dims_str = xDim.ToString();
}
[Element(0, IsArgument = true)]
public string Dims_str = "";
public List _Dims = new List();
}
Now it work for my a2l file, but the count of MATRIX_DIM is limit to 3, is there a better solution?
The text was updated successfully, but these errors were encountered: