Skip to content

Commit 7b0aeb4

Browse files
committed
exported fields FNC_VALUES and RECORD_LAYOUT
also added a description to staticRecordLayout
1 parent f91a9b3 commit 7b0aeb4

File tree

4 files changed

+33
-19
lines changed

4 files changed

+33
-19
lines changed

a2l/fnc_values.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,20 @@ import (
77
"github.com/rs/zerolog/log"
88
)
99

10-
type fncValues struct {
10+
// FncValues defines the way the data of a specific record layout is stored within the hex file.
11+
type FncValues struct {
1112
//Position of table values (function values) in the deposit structure (description of sequence of elements in the data record).
1213
Position uint16
1314
PositionSet bool
14-
//data type of the table values
15+
//Datatype of the table values
1516
Datatype dataTypeEnum
1617
DatatypeSet bool
17-
//for characteristic maps, curves and value blocks, this field is used to describe how the 2-dimensional table values are mapped onto the 1-dimensional address space
18+
/*IndexMode for characteristic maps, curves and value blocks,
19+
this field is used to describe how the 2-dimensional table values
20+
are mapped onto the 1-dimensional address space*/
1821
IndexMode indexModeEnum
1922
IndexModeSet bool
20-
/*addressing of the table values:
23+
/*Addresstype defines the addressing of the table values:
2124
Enumeration for description of the addressing of table
2225
values or axis point values:
2326
PBYTE: The relevant memory location has a 1 byte pointer
@@ -32,8 +35,8 @@ type fncValues struct {
3235
AddresstypeSet bool
3336
}
3437

35-
func parseFncValues(tok *tokenGenerator) (fncValues, error) {
36-
fv := fncValues{}
38+
func parseFncValues(tok *tokenGenerator) (FncValues, error) {
39+
fv := FncValues{}
3740
var err error
3841
forLoop:
3942
for {

a2l/module.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type module struct {
3030
Measurements map[string]measurement
3131
ModCommon modCommon
3232
ModPar modPar
33-
RecordLayouts map[string]recordLayout
33+
RecordLayouts map[string]RecordLayout
3434
transformers map[string]transformer
3535
typeDefAxis map[string]typeDefAxis
3636
typeDefBlobs map[string]typeDefBlob
@@ -57,7 +57,7 @@ func parseModule(tok *tokenGenerator) (module, error) {
5757
myModule.ifData = make(map[string]IfData, 1000)
5858
myModule.instances = make(map[string]instance, 10)
5959
myModule.Measurements = make(map[string]measurement, 10000)
60-
myModule.RecordLayouts = make(map[string]recordLayout, 1000)
60+
myModule.RecordLayouts = make(map[string]RecordLayout, 1000)
6161
myModule.transformers = make(map[string]transformer, 10)
6262
myModule.typeDefAxis = make(map[string]typeDefAxis, 10)
6363
myModule.typeDefBlobs = make(map[string]typeDefBlob, 10)
@@ -79,7 +79,7 @@ func parseModule(tok *tokenGenerator) (module, error) {
7979
var bufIfData IfData
8080
var bufInstance instance
8181
var bufMeasurement measurement
82-
var bufRecordLayout recordLayout
82+
var bufRecordLayout RecordLayout
8383
var bufTransformer transformer
8484
var bufTypeDefAxis typeDefAxis
8585
var bufTypeDefBlob typeDefBlob
@@ -340,7 +340,7 @@ func parseModuleMultithreaded(tok *tokenGenerator) (module, error) {
340340
myModule.ifData = make(map[string]IfData, 1000)
341341
myModule.instances = make(map[string]instance, 10)
342342
myModule.Measurements = make(map[string]measurement, 10000)
343-
myModule.RecordLayouts = make(map[string]recordLayout, 1000)
343+
myModule.RecordLayouts = make(map[string]RecordLayout, 1000)
344344
myModule.transformers = make(map[string]transformer, 10)
345345
myModule.typeDefAxis = make(map[string]typeDefAxis, 10)
346346
myModule.typeDefBlobs = make(map[string]typeDefBlob, 10)
@@ -387,7 +387,7 @@ forLoop:
387387
cMeasurement := make(chan measurement, 1000)
388388
cModCommon := make(chan modCommon, 1)
389389
cModPar := make(chan modPar, 1)
390-
cRecordLayout := make(chan recordLayout, 100)
390+
cRecordLayout := make(chan RecordLayout, 100)
391391
cTransformer := make(chan transformer, 10)
392392
cTypeDefAxis := make(chan typeDefAxis, 10)
393393
cTypeDefBlob := make(chan typeDefBlob, 10)
@@ -456,7 +456,7 @@ func collectChannelsMultithreaded(myModule *module, cA2ml chan a2ml, cAxisPts ch
456456
cCompuMethod chan compuMethod, cCompuTab chan compuTab, cCompuVtab chan compuVTab,
457457
cCompuVtabRange chan compuVTabRange, cFrame chan frame, cFunction chan function,
458458
cGroup chan group, cIfData chan IfData, cMeasurement chan measurement,
459-
cModCommon chan modCommon, cModPar chan modPar, cRecordLayout chan recordLayout,
459+
cModCommon chan modCommon, cModPar chan modPar, cRecordLayout chan RecordLayout,
460460
cInstance chan instance, cTransformer chan transformer, cTypeDefAxis chan typeDefAxis,
461461
cTypeDefBlob chan typeDefBlob, cTypeDefCharacteristic chan typeDefCharacteristic,
462462
cTypeDefMeasurement chan typeDefMeasurement, cTypeDefStructure chan typeDefStructure,
@@ -667,7 +667,7 @@ func closeChannelsAfterParsing(wg *sync.WaitGroup, cA2ml chan a2ml, cAxisPts cha
667667
cCompuMethod chan compuMethod, cCompuTab chan compuTab, cCompuVtab chan compuVTab,
668668
cCompuVtabRange chan compuVTabRange, cFrame chan frame, cFunction chan function,
669669
cGroup chan group, cIfData chan IfData, cMeasurement chan measurement,
670-
cModCommon chan modCommon, cModPar chan modPar, cRecordLayout chan recordLayout,
670+
cModCommon chan modCommon, cModPar chan modPar, cRecordLayout chan RecordLayout,
671671
cInstance chan instance, cTransformer chan transformer, cTypeDefAxis chan typeDefAxis,
672672
cTypeDefBlob chan typeDefBlob, cTypeDefCharacteristic chan typeDefCharacteristic,
673673
cTypeDefMeasurement chan typeDefMeasurement, cTypeDefStructure chan typeDefStructure,
@@ -710,7 +710,7 @@ func parseModuleMainLoop(wg *sync.WaitGroup, minIndex int, maxIndex int,
710710
cCompuMethod chan compuMethod, cCompuTab chan compuTab, cCompuVtab chan compuVTab,
711711
cCompuVtabRange chan compuVTabRange, cFrame chan frame, cFunction chan function,
712712
cGroup chan group, cIfData chan IfData, cMeasurement chan measurement,
713-
cModCommon chan modCommon, cModPar chan modPar, cRecordLayout chan recordLayout,
713+
cModCommon chan modCommon, cModPar chan modPar, cRecordLayout chan RecordLayout,
714714
cInstance chan instance, cTransformer chan transformer, cTypeDefAxis chan typeDefAxis,
715715
cTypeDefBlob chan typeDefBlob, cTypeDefCharacteristic chan typeDefCharacteristic,
716716
cTypeDefMeasurement chan typeDefMeasurement, cTypeDefStructure chan typeDefStructure,
@@ -733,7 +733,7 @@ func parseModuleMainLoop(wg *sync.WaitGroup, minIndex int, maxIndex int,
733733
var bufIfData IfData
734734
var bufInstance instance
735735
var bufMeasurement measurement
736-
var bufRecordLayout recordLayout
736+
var bufRecordLayout RecordLayout
737737
var bufTransformer transformer
738738
var bufTypeDefAxis typeDefAxis
739739
var bufTypeDefBlob typeDefBlob

a2l/record_layout.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"github.com/rs/zerolog/log"
77
)
88

9-
type recordLayout struct {
9+
type RecordLayout struct {
1010
name string
1111
nameSet bool
1212
alignmentByte alignmentByte
@@ -32,7 +32,7 @@ type recordLayout struct {
3232
fixNoAxisPtsZ fixNoAxisPtsZ
3333
fixNoAxisPts4 fixNoAxisPts4
3434
fixNoAxisPts5 fixNoAxisPts5
35-
FncValues fncValues
35+
FncValues FncValues
3636
identification identification
3737
noAxisPtsX noAxisPtsX
3838
noAxisPtsY noAxisPtsY
@@ -66,8 +66,8 @@ type recordLayout struct {
6666
staticAddressOffsets staticAddressOffsetsKeyword
6767
}
6868

69-
func parseRecordLayout(tok *tokenGenerator) (recordLayout, error) {
70-
rl := recordLayout{}
69+
func parseRecordLayout(tok *tokenGenerator) (RecordLayout, error) {
70+
rl := RecordLayout{}
7171
var err error
7272
forLoop:
7373
for {

a2l/static_record_layout.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@ package a2l
22

33
import "github.com/rs/zerolog/log"
44

5+
/*staticRecordLayoutKeyword states that
6+
for calibration objects with a dynamic number of axis points
7+
the calibration object does not compact or expand data
8+
when removing or inserting axis points.
9+
All record layout elements are stored at the same address
10+
as for the max. number of axis points specified at the calibration object -
11+
independent of the actual number of axis points.
12+
If the parameter STATIC_RECORD_LAYOUT is missing,
13+
the calibration objects referencing this record layout do compact / extend data when
14+
removing resp. inserting axis points and the addresses of the record layout elements
15+
depend on the actual number of axis points.*/
516
type staticRecordLayoutKeyword struct {
617
value bool
718
valueSet bool

0 commit comments

Comments
 (0)