|
1 include yslt.yml2 |
|
2 estylesheet xmlns:ns="entries_list_ns" |
|
3 extension-element-prefixes="ns" |
|
4 exclude-result-prefixes="ns" { |
|
5 |
|
6 param "min_index"; |
|
7 param "max_index"; |
|
8 |
|
9 template "text()"; |
|
10 |
|
11 template "Device" { |
|
12 apply "Profile/Dictionary/Objects/Object"; |
|
13 foreach "RxPdo" { |
|
14 call "pdo_entries" with "direction", "'Receive'"; |
|
15 } |
|
16 foreach "TxPdo" { |
|
17 call "pdo_entries" with "direction", "'Transmit'"; |
|
18 } |
|
19 } |
|
20 |
|
21 template "Object" { |
|
22 variable "index" > «ns:HexDecValue(Index/text())» |
|
23 variable "entry_name" > «ns:EntryName(Name)» |
|
24 choose { |
|
25 when "$index >= $min_index and $index <= $max_index" { |
|
26 variable "datatype_name" > «Type/text()» |
|
27 choose { |
|
28 when "ancestor::Dictionary/child::DataTypes/DataType[Name/text()=$datatype_name][SubItem]" { |
|
29 apply "ancestor::Dictionary/child::DataTypes/DataType[Name/text()=$datatype_name][SubItem]" { |
|
30 with "index" > «$index» |
|
31 with "entry_name" > «$entry_name» |
|
32 } |
|
33 } |
|
34 otherwise { |
|
35 variable "subindex" > 0 |
|
36 variable "entry" { |
|
37 > «ns:AddEntry($index, $subindex, $entry_name, $datatype_name, BitSize/text(), Flags/Access/text(), Flags/PdoMapping/text())» |
|
38 } |
|
39 } |
|
40 } |
|
41 } |
|
42 } |
|
43 } |
|
44 |
|
45 template "DataType" { |
|
46 param "index"; |
|
47 param "entry_name"; |
|
48 foreach "SubItem" { |
|
49 variable "subindex" > «ns:HexDecValue(SubIdx/text())» |
|
50 variable "subentry_name" > «$entry_name» - «ns:EntryName(DisplayName, Name/text())» |
|
51 variable "entry" { |
|
52 > «ns:AddEntry($index, $subindex, $subentry_name, Type/text(), BitSize/text(), Flags/Access/text(), Flags/PdoMapping/text())» |
|
53 } |
|
54 } |
|
55 } |
|
56 |
|
57 function "pdo_entries" { |
|
58 param "direction"; |
|
59 variable "pdo_index" > «ns:HexDecValue(Index/text())» |
|
60 variable "pdo_name" > «ns:EntryName(Name)» |
|
61 foreach "Entry" { |
|
62 variable "index" > «ns:HexDecValue(Index/text())» |
|
63 choose { |
|
64 when "$index >= $min_index and $index <= $max_index" { |
|
65 variable "subindex" > «ns:HexDecValue(SubIndex/text())» |
|
66 variable "subentry_name" > «ns:EntryName(Name)» |
|
67 variable "access" { |
|
68 choose { |
|
69 when "$direction='Transmit'" > ro |
|
70 otherwise > wo |
|
71 } |
|
72 } |
|
73 variable "pdo_mapping" { |
|
74 choose { |
|
75 when "$direction='Transmit'" > T |
|
76 otherwise > R |
|
77 } |
|
78 } |
|
79 variable "entry" { |
|
80 > «ns:AddEntry($index, $subindex, $subentry_name, DataType/text(), BitLen/text(), $access, $pdo_mapping, $pdo_index, $pdo_name, $direction)» |
|
81 } |
|
82 } |
|
83 } |
|
84 } |
|
85 } |
|
86 } |