|
8 | 8 | "github.com/rs/zerolog/log" |
9 | 9 | ) |
10 | 10 |
|
11 | | -type module struct { |
| 11 | +type Module struct { |
12 | 12 | Name string |
13 | 13 | nameSet bool |
14 | 14 | longIdentifier string |
@@ -42,9 +42,9 @@ type module struct { |
42 | 42 | variantCoding variantCoding |
43 | 43 | } |
44 | 44 |
|
45 | | -func parseModule(tok *tokenGenerator) (module, error) { |
| 45 | +func parseModule(tok *tokenGenerator) (Module, error) { |
46 | 46 | //Bulk init of an average number of objects contained in a modern a2l-file. |
47 | | - myModule := module{} |
| 47 | + myModule := Module{} |
48 | 48 | myModule.AxisPts = make(map[string]axisPts, 1000) |
49 | 49 | myModule.blobs = make(map[string]blob, 5) |
50 | 50 | myModule.Characteristics = make(map[string]Characteristic, 10000) |
@@ -222,7 +222,7 @@ forLoop: |
222 | 222 | log.Err(err).Msg("module recordLayout could not be parsed") |
223 | 223 | break forLoop |
224 | 224 | } |
225 | | - myModule.RecordLayouts[bufRecordLayout.name] = bufRecordLayout |
| 225 | + myModule.RecordLayouts[bufRecordLayout.Name] = bufRecordLayout |
226 | 226 | log.Info().Msg("module recordLayout successfully parsed") |
227 | 227 | case beginTransformerToken: |
228 | 228 | bufTransformer, err = parseTransformer(tok) |
@@ -324,10 +324,10 @@ forLoop: |
324 | 324 | // it computes the start and the end of the module struct |
325 | 325 | // and splits it up among numProc number of goroutines |
326 | 326 | // which each execute a separate moduleMainLoop |
327 | | -func parseModuleMultithreaded(tok *tokenGenerator) (module, error) { |
| 327 | +func parseModuleMultithreaded(tok *tokenGenerator) (Module, error) { |
328 | 328 | //Bulk init of an average number of objects contained in a modern a2l-file. |
329 | 329 | log.Info().Msg("creating maps for module subtypes") |
330 | | - myModule := module{} |
| 330 | + myModule := Module{} |
331 | 331 | myModule.AxisPts = make(map[string]axisPts, 1000) |
332 | 332 | myModule.blobs = make(map[string]blob, 5) |
333 | 333 | myModule.Characteristics = make(map[string]Characteristic, 10000) |
@@ -452,7 +452,7 @@ forLoop: |
452 | 452 | // collectChannelsMultithreaded uses anonymous function to collect the data sent by the goroutines running the moduleMainLoop. |
453 | 453 | // usually the Select Collector is to be prefered as it is mostly faster and always easier on memory |
454 | 454 | // as the additional goroutines spun up in collectChannelsMultithreaded seem to block the GC a lot |
455 | | -func collectChannelsMultithreaded(myModule *module, cA2ml chan a2ml, cAxisPts chan axisPts, cBlob chan blob, cCharacteristic chan Characteristic, |
| 455 | +func collectChannelsMultithreaded(myModule *Module, cA2ml chan a2ml, cAxisPts chan axisPts, cBlob chan blob, cCharacteristic chan Characteristic, |
456 | 456 | cCompuMethod chan compuMethod, cCompuTab chan compuTab, cCompuVtab chan compuVTab, |
457 | 457 | cCompuVtabRange chan compuVTabRange, cFrame chan frame, cFunction chan function, |
458 | 458 | cGroup chan group, cIfData chan IfData, cMeasurement chan measurement, |
@@ -580,7 +580,7 @@ func collectChannelsMultithreaded(myModule *module, cA2ml chan a2ml, cAxisPts ch |
580 | 580 | go func(wg *sync.WaitGroup) { |
581 | 581 | defer wg.Done() |
582 | 582 | for elem := range cRecordLayout { |
583 | | - myModule.RecordLayouts[elem.name] = elem |
| 583 | + myModule.RecordLayouts[elem.Name] = elem |
584 | 584 | } |
585 | 585 | log.Info().Msg("collected recordLayouts") |
586 | 586 | }(wgCollectors) |
|
0 commit comments