@oimlsmart/primmel-packages 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/oiml-r129/specification/calculations.prl +28 -0
- package/oiml-r144/model/attributes.prl +20 -0
- package/oiml-r144/specification/calculations.prl +28 -0
- package/oiml-r60/specification/calculations.prl +42 -0
- package/package.json +1 -1
- package/oiml-r129/payload/formulas-variants.yaml +0 -33
- package/oiml-r144/payload/attributes-pair-list.yaml +0 -18
- package/oiml-r144/payload/formulas-variants.yaml +0 -32
- package/oiml-r60/payload/formulas-variants.yaml +0 -55
|
@@ -22,6 +22,13 @@ calculation lookupMPE {
|
|
|
22
22
|
}
|
|
23
23
|
output : number { unit "cm" name "mpe" description "Maximum permissible error" }
|
|
24
24
|
expression "ocl{1.0 * d}"
|
|
25
|
+
variant engine {
|
|
26
|
+
type expression
|
|
27
|
+
label "Maximum Permissible Error"
|
|
28
|
+
description "MPE = ±1.0 d per R 129-1, 4.1.2"
|
|
29
|
+
params { d }
|
|
30
|
+
expression "1.0 * p.d"
|
|
31
|
+
}
|
|
25
32
|
ref derives-from "urn:oiml:pub:r:129-1:2020#clause-4.1.2"
|
|
26
33
|
}
|
|
27
34
|
|
|
@@ -35,6 +42,13 @@ calculation lookupMinDimension {
|
|
|
35
42
|
}
|
|
36
43
|
output : number { unit "cm" name "min_dimension" description "Minimum dimension lower limit" }
|
|
37
44
|
expression "ocl{if d <= 2 then 10 * d else (if d <= 10 then 20 * d else 50 * d endif) endif}"
|
|
45
|
+
variant engine {
|
|
46
|
+
type expression
|
|
47
|
+
label "Minimum Dimension"
|
|
48
|
+
description "Min dimension lower limit per R 129-1, Table 2"
|
|
49
|
+
params { d }
|
|
50
|
+
expression "p.d <= 0.02 ? 10 * p.d : (p.d <= 0.1 ? 20 * p.d : 50 * p.d)"
|
|
51
|
+
}
|
|
38
52
|
ref derives-from "urn:oiml:pub:r:129-1:2020#clause-4.1.1"
|
|
39
53
|
}
|
|
40
54
|
|
|
@@ -50,6 +64,13 @@ calculation dimensionalVolume {
|
|
|
50
64
|
}
|
|
51
65
|
output : number { unit "cm3" name "dimensional_volume" description "Dimensional volume" }
|
|
52
66
|
expression "ocl{indication_l * indication_w * indication_h}"
|
|
67
|
+
variant engine {
|
|
68
|
+
type expression
|
|
69
|
+
label "Dimensional Volume"
|
|
70
|
+
description "DV = L × W × H"
|
|
71
|
+
params { L W H }
|
|
72
|
+
expression "p.L * p.W * p.H"
|
|
73
|
+
}
|
|
53
74
|
ref derives-from "urn:oiml:pub:r:129-1:2020#clause-2.2.4"
|
|
54
75
|
}
|
|
55
76
|
|
|
@@ -78,6 +99,13 @@ calculation determinePassFail {
|
|
|
78
99
|
}
|
|
79
100
|
output : boolean { unit "1" name "pass" description "True when the absolute error does not exceed the MPE" }
|
|
80
101
|
expression "ocl{abs(error) <= abs(mpe)}"
|
|
102
|
+
variant engine {
|
|
103
|
+
type pass_fail
|
|
104
|
+
label "Pass/Fail Determination"
|
|
105
|
+
description "|error| <= |mpe| -> pass, else fail"
|
|
106
|
+
params { error mpe }
|
|
107
|
+
expression "Math.abs(p.error) <= Math.abs(p.mpe)"
|
|
108
|
+
}
|
|
81
109
|
ref derives-from "urn:oiml:pub:r:129-1:2020#clause-4.1.2"
|
|
82
110
|
}
|
|
83
111
|
|
|
@@ -512,6 +512,26 @@ attribute_definition interfering_components {
|
|
|
512
512
|
definition "List of gas components other than the measurand and their maximum permissible concentrations, provided by the manufacturer in the operating instructions."
|
|
513
513
|
ref derives-from "urn:oiml:pub:r:144-1:2013#clause-4.5.2"
|
|
514
514
|
value_type pair-list
|
|
515
|
+
pair_list {
|
|
516
|
+
key component
|
|
517
|
+
value max_concentration
|
|
518
|
+
key_dimension measurand_components
|
|
519
|
+
component co2 {
|
|
520
|
+
name "Carbon dioxide"
|
|
521
|
+
}
|
|
522
|
+
component h2o {
|
|
523
|
+
name "Water vapour"
|
|
524
|
+
}
|
|
525
|
+
component so2 {
|
|
526
|
+
name "Sulfur dioxide"
|
|
527
|
+
}
|
|
528
|
+
component ch4 {
|
|
529
|
+
name "Methane"
|
|
530
|
+
}
|
|
531
|
+
component h2 {
|
|
532
|
+
name "Hydrogen"
|
|
533
|
+
}
|
|
534
|
+
}
|
|
515
535
|
origin declared
|
|
516
536
|
scope model
|
|
517
537
|
category administrative
|
|
@@ -9,6 +9,13 @@ calculation measurementError {
|
|
|
9
9
|
}
|
|
10
10
|
output : number { unit "ppm" quantity_kind volume-fraction name "e_x" description "Error of the gas analytical system" }
|
|
11
11
|
expression "ocl{x_ind - x_ref}"
|
|
12
|
+
variant engine {
|
|
13
|
+
type expression
|
|
14
|
+
label "Measurement Error E"
|
|
15
|
+
description "E = x_ind − x_ref"
|
|
16
|
+
params { x_ind x_ref }
|
|
17
|
+
expression "p.x_ind - p.x_ref"
|
|
18
|
+
}
|
|
12
19
|
ref derives-from "urn:oiml:pub:r:144-1:2013#clause-2.13"
|
|
13
20
|
}
|
|
14
21
|
|
|
@@ -36,6 +43,13 @@ calculation mpeIntrinsic {
|
|
|
36
43
|
}
|
|
37
44
|
output : number { unit "ppm" quantity_kind volume-fraction name "mpe" description "Maximum permissible intrinsic error at this point" range { min 0 } }
|
|
38
45
|
expression "ocl{max(2, 0.05 * abs(measured_value))}"
|
|
46
|
+
variant engine {
|
|
47
|
+
type expression
|
|
48
|
+
label "Maximum Permissible Intrinsic Error"
|
|
49
|
+
description "MPE = max(2 ppm, 5 % of measured value) per R 144-1, 4.3.1"
|
|
50
|
+
params { measured_value }
|
|
51
|
+
expression "Math.max(2, 0.05 * Math.abs(p.measured_value))"
|
|
52
|
+
}
|
|
39
53
|
ref derives-from "urn:oiml:pub:r:144-1:2013#clause-4.3.1"
|
|
40
54
|
}
|
|
41
55
|
|
|
@@ -49,6 +63,13 @@ calculation mpeVerification {
|
|
|
49
63
|
}
|
|
50
64
|
output : number { unit "ppm" quantity_kind volume-fraction name "mpe_v" description "Maximum permissible error under rated operating conditions at this point" range { min 0 } }
|
|
51
65
|
expression "ocl{max(5, 0.10 * abs(measured_value))}"
|
|
66
|
+
variant engine {
|
|
67
|
+
type expression
|
|
68
|
+
label "MPE on Verification (rated operating conditions)"
|
|
69
|
+
description "MPE = max(5 ppm, 10 % of measured value) per R 144-1, 4.3.2"
|
|
70
|
+
params { measured_value }
|
|
71
|
+
expression "Math.max(5, 0.10 * Math.abs(p.measured_value))"
|
|
72
|
+
}
|
|
52
73
|
ref derives-from "urn:oiml:pub:r:144-1:2013#clause-4.3.2"
|
|
53
74
|
}
|
|
54
75
|
|
|
@@ -103,6 +124,13 @@ calculation driftChange {
|
|
|
103
124
|
}
|
|
104
125
|
output : number { unit "ppm" quantity_kind volume-fraction name "drift_x" description "Change in indication over the stated period" }
|
|
105
126
|
expression "ocl{indication_at_time - initial_indication}"
|
|
127
|
+
variant engine {
|
|
128
|
+
type expression
|
|
129
|
+
label "Drift Change"
|
|
130
|
+
description "Change in indication over the stated drift period"
|
|
131
|
+
params { indication_at_time initial_indication }
|
|
132
|
+
expression "p.indication_at_time - p.initial_indication"
|
|
133
|
+
}
|
|
106
134
|
ref derives-from "urn:oiml:pub:r:144-1:2013#clause-2.23"
|
|
107
135
|
}
|
|
108
136
|
|
|
@@ -57,6 +57,13 @@ calculation loadCellError {
|
|
|
57
57
|
}
|
|
58
58
|
output : number { unit "v" name "e_l" description "Load cell error in verification units" }
|
|
59
59
|
expression "ocl{(avgIndication - referenceIndication) / conversion_factor_f}"
|
|
60
|
+
variant engine {
|
|
61
|
+
type expression
|
|
62
|
+
label "Load Cell Error E_L"
|
|
63
|
+
description "E_L = (I - I_ref) / f"
|
|
64
|
+
params { avgIndication referenceIndication conversion_factor_f }
|
|
65
|
+
expression "(p.avgIndication - p.referenceIndication) / p.conversion_factor_f"
|
|
66
|
+
}
|
|
60
67
|
ref derives-from "urn:oiml:pub:r:60-3:2021#clause-2.1.2"
|
|
61
68
|
ref derives-from "urn:oiml:pub:r:60-3:2021#clause-2.1.2"
|
|
62
69
|
ref derives-from "urn:oiml:pub:r:60-3:2021#clause-2.1.2.1"
|
|
@@ -80,6 +87,13 @@ calculation repeatabilityError {
|
|
|
80
87
|
}
|
|
81
88
|
output : number { unit "v" name "e_r" description "Repeatability error in verification units" }
|
|
82
89
|
expression "ocl{(indications->max() - indications->min()) / conversion_factor_f}"
|
|
90
|
+
variant engine {
|
|
91
|
+
type expression
|
|
92
|
+
label "Repeatability Error E_R"
|
|
93
|
+
description "E_R = (max - min) / f across runs"
|
|
94
|
+
params { indications conversion_factor_f }
|
|
95
|
+
expression "(Math.max(...Object.values(p.indications)) - Math.min(...Object.values(p.indications))) / p.conversion_factor_f"
|
|
96
|
+
}
|
|
83
97
|
ref derives-from "urn:oiml:pub:r:60-3:2021#clause-2.1.3"
|
|
84
98
|
ref derives-from "urn:oiml:pub:r:60-3:2021#clause-2.1.3"
|
|
85
99
|
ref derives-from "urn:oiml:pub:r:60-3:2021#clause-2.1.3.1"
|
|
@@ -99,6 +113,13 @@ calculation creep {
|
|
|
99
113
|
}
|
|
100
114
|
output : number { unit "v" name "c_c" description "Creep change in verification units" }
|
|
101
115
|
expression "ocl{(indicationAtTime - initialIndication) / conversion_factor_f}"
|
|
116
|
+
variant engine {
|
|
117
|
+
type expression
|
|
118
|
+
label "Creep C_C"
|
|
119
|
+
description "C_C = (I_t - I_0) / f"
|
|
120
|
+
params { indicationAtTime initialIndication conversion_factor_f }
|
|
121
|
+
expression "(p.indicationAtTime - p.initialIndication) / p.conversion_factor_f"
|
|
122
|
+
}
|
|
102
123
|
ref derives-from "urn:oiml:pub:r:60-3:2021#clause-2.1.5"
|
|
103
124
|
ref derives-from "urn:oiml:pub:r:60-3:2021#clause-2.1.5"
|
|
104
125
|
ref derives-from "urn:oiml:pub:r:60-3:2021#clause-2.1.5.1"
|
|
@@ -124,6 +145,13 @@ calculation deadLoadOutputReturn {
|
|
|
124
145
|
}
|
|
125
146
|
output : number { unit "v" name "c_dr" description "Dead load output return in verification units" }
|
|
126
147
|
expression "ocl{(minLoadIndication2 - minLoadIndication1) / conversion_factor_f}"
|
|
148
|
+
variant engine {
|
|
149
|
+
type expression
|
|
150
|
+
label "Dead Load Output Return DR"
|
|
151
|
+
description "DR = (I_min2 - I_min1) / f"
|
|
152
|
+
params { minLoadIndication2 minLoadIndication1 conversion_factor_f }
|
|
153
|
+
expression "(p.minLoadIndication2 - p.minLoadIndication1) / p.conversion_factor_f"
|
|
154
|
+
}
|
|
127
155
|
ref derives-from "urn:oiml:pub:r:60-3:2021#clause-2.1.5.4"
|
|
128
156
|
ref derives-from "urn:oiml:pub:r:60-3:2021#clause-2.1.5.4"
|
|
129
157
|
}
|
|
@@ -140,6 +168,13 @@ calculation barometricPressureEffect {
|
|
|
140
168
|
}
|
|
141
169
|
output : number { unit "v" name "change_v" description "Pressure-induced change in verification units" }
|
|
142
170
|
expression "ocl{(indication2 - indication1) / conversion_factor_f}"
|
|
171
|
+
variant engine {
|
|
172
|
+
type expression
|
|
173
|
+
label "Barometric Pressure Effect C_P"
|
|
174
|
+
description "C_P = |I_2 - I_1| / f"
|
|
175
|
+
params { indication1 indication2 conversion_factor_f }
|
|
176
|
+
expression "Math.abs(p.indication2 - p.indication1) / p.conversion_factor_f"
|
|
177
|
+
}
|
|
143
178
|
ref derives-from "urn:oiml:pub:r:60-3:2021#clause-2.1.6"
|
|
144
179
|
ref derives-from "urn:oiml:pub:r:60-3:2021#clause-2.1.6"
|
|
145
180
|
ref derives-from "urn:oiml:pub:r:60-3:2021#clause-2.1.6.1"
|
|
@@ -235,6 +270,13 @@ calculation maxAllowableSpanVariation {
|
|
|
235
270
|
}
|
|
236
271
|
output : number { unit "v" name "maxVariation" description "Maximum allowable variation" }
|
|
237
272
|
expression "ocl{max(0.5, 0.5 * abs(lookupMPE(d_max, accuracy_class, 1.0)))}"
|
|
273
|
+
variant engine {
|
|
274
|
+
type expression
|
|
275
|
+
label "Max Allowable Span Variation"
|
|
276
|
+
description "max(0.5, 0.5*|MPE|)"
|
|
277
|
+
params { d_max accuracy_class p_lc }
|
|
278
|
+
expression "Math.max(0.5, 0.5 * Math.abs(compute('lookupMPE', [p.d_max, p.accuracy_class, p.p_lc])))"
|
|
279
|
+
}
|
|
238
280
|
ref derives-from "urn:oiml:pub:r:60-1:2021#clause-5.7.2.6"
|
|
239
281
|
}
|
|
240
282
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oimlsmart/primmel-packages",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "The OIML SMART platform's authoritative model content: every Recommendation, the OIML-CS scheme, the CASCO foundations, the shared modules, and the product/program reference packages as Primmel (.prl) packages — the single source of truth the platform's data trees regenerate from. Consumed by the smart monorepo (oimlsmart/smart) at a pinned version (TODO.repos/02).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# GENERATED package payload (task 31b) — content with no PRL construct; composed back by regenerate-data + build-primmel-cache. Do not edit by hand.
|
|
2
|
-
formulas:
|
|
3
|
-
- name: lookupMPE
|
|
4
|
-
type: expression
|
|
5
|
-
label: Maximum Permissible Error
|
|
6
|
-
params:
|
|
7
|
-
- d
|
|
8
|
-
description: MPE = ±1.0 d per R 129-1, 4.1.2
|
|
9
|
-
expression: 1.0 * p.d
|
|
10
|
-
- name: lookupMinDimension
|
|
11
|
-
type: expression
|
|
12
|
-
label: Minimum Dimension
|
|
13
|
-
params:
|
|
14
|
-
- d
|
|
15
|
-
description: Min dimension lower limit per R 129-1, Table 2
|
|
16
|
-
expression: 'p.d <= 0.02 ? 10 * p.d : (p.d <= 0.1 ? 20 * p.d : 50 * p.d)'
|
|
17
|
-
- name: dimensionalVolume
|
|
18
|
-
type: expression
|
|
19
|
-
label: Dimensional Volume
|
|
20
|
-
params:
|
|
21
|
-
- L
|
|
22
|
-
- W
|
|
23
|
-
- H
|
|
24
|
-
description: DV = L × W × H
|
|
25
|
-
expression: p.L * p.W * p.H
|
|
26
|
-
- name: determinePassFail
|
|
27
|
-
type: pass_fail
|
|
28
|
-
label: Pass/Fail Determination
|
|
29
|
-
params:
|
|
30
|
-
- error
|
|
31
|
-
- mpe
|
|
32
|
-
description: '|error| <= |mpe| -> pass, else fail'
|
|
33
|
-
expression: Math.abs(p.error) <= Math.abs(p.mpe)
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# GENERATED package payload (task 31b) — content with no PRL construct; composed back by regenerate-data + build-primmel-cache. Do not edit by hand.
|
|
2
|
-
attribute_definitions:
|
|
3
|
-
- id: interfering_components
|
|
4
|
-
pair_list:
|
|
5
|
-
key: component
|
|
6
|
-
value: max_concentration
|
|
7
|
-
key_dimension: measurand_components
|
|
8
|
-
components:
|
|
9
|
-
- id: co2
|
|
10
|
-
name: Carbon dioxide
|
|
11
|
-
- id: h2o
|
|
12
|
-
name: Water vapour
|
|
13
|
-
- id: so2
|
|
14
|
-
name: Sulfur dioxide
|
|
15
|
-
- id: ch4
|
|
16
|
-
name: Methane
|
|
17
|
-
- id: h2
|
|
18
|
-
name: Hydrogen
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# GENERATED package payload (task 31b) — content with no PRL construct; composed back by regenerate-data + build-primmel-cache. Do not edit by hand.
|
|
2
|
-
formulas:
|
|
3
|
-
- name: mpeIntrinsic
|
|
4
|
-
type: expression
|
|
5
|
-
label: Maximum Permissible Intrinsic Error
|
|
6
|
-
params:
|
|
7
|
-
- measured_value
|
|
8
|
-
description: MPE = max(2 ppm, 5 % of measured value) per R 144-1, 4.3.1
|
|
9
|
-
expression: Math.max(2, 0.05 * Math.abs(p.measured_value))
|
|
10
|
-
- name: mpeVerification
|
|
11
|
-
type: expression
|
|
12
|
-
label: MPE on Verification (rated operating conditions)
|
|
13
|
-
params:
|
|
14
|
-
- measured_value
|
|
15
|
-
description: MPE = max(5 ppm, 10 % of measured value) per R 144-1, 4.3.2
|
|
16
|
-
expression: Math.max(5, 0.10 * Math.abs(p.measured_value))
|
|
17
|
-
- name: measurementError
|
|
18
|
-
type: expression
|
|
19
|
-
label: Measurement Error E
|
|
20
|
-
params:
|
|
21
|
-
- x_ind
|
|
22
|
-
- x_ref
|
|
23
|
-
description: E = x_ind − x_ref
|
|
24
|
-
expression: p.x_ind - p.x_ref
|
|
25
|
-
- name: driftChange
|
|
26
|
-
type: expression
|
|
27
|
-
label: Drift Change
|
|
28
|
-
params:
|
|
29
|
-
- indication_at_time
|
|
30
|
-
- initial_indication
|
|
31
|
-
description: Change in indication over the stated drift period
|
|
32
|
-
expression: p.indication_at_time - p.initial_indication
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# GENERATED package payload (task 31b) — content with no PRL construct; composed back by regenerate-data + build-primmel-cache. Do not edit by hand.
|
|
2
|
-
formulas:
|
|
3
|
-
- name: loadCellError
|
|
4
|
-
type: expression
|
|
5
|
-
label: Load Cell Error E_L
|
|
6
|
-
params:
|
|
7
|
-
- avgIndication
|
|
8
|
-
- referenceIndication
|
|
9
|
-
- conversion_factor_f
|
|
10
|
-
description: E_L = (I - I_ref) / f
|
|
11
|
-
expression: (p.avgIndication - p.referenceIndication) / p.conversion_factor_f
|
|
12
|
-
- name: repeatabilityError
|
|
13
|
-
type: expression
|
|
14
|
-
label: Repeatability Error E_R
|
|
15
|
-
params:
|
|
16
|
-
- indications
|
|
17
|
-
- conversion_factor_f
|
|
18
|
-
description: E_R = (max - min) / f across runs
|
|
19
|
-
expression: (Math.max(...Object.values(p.indications)) - Math.min(...Object.values(p.indications))) / p.conversion_factor_f
|
|
20
|
-
- name: creep
|
|
21
|
-
type: expression
|
|
22
|
-
label: Creep C_C
|
|
23
|
-
params:
|
|
24
|
-
- indicationAtTime
|
|
25
|
-
- initialIndication
|
|
26
|
-
- conversion_factor_f
|
|
27
|
-
description: C_C = (I_t - I_0) / f
|
|
28
|
-
expression: (p.indicationAtTime - p.initialIndication) / p.conversion_factor_f
|
|
29
|
-
- name: deadLoadOutputReturn
|
|
30
|
-
type: expression
|
|
31
|
-
label: Dead Load Output Return DR
|
|
32
|
-
params:
|
|
33
|
-
- minLoadIndication2
|
|
34
|
-
- minLoadIndication1
|
|
35
|
-
- conversion_factor_f
|
|
36
|
-
description: DR = (I_min2 - I_min1) / f
|
|
37
|
-
expression: (p.minLoadIndication2 - p.minLoadIndication1) / p.conversion_factor_f
|
|
38
|
-
- name: barometricPressureEffect
|
|
39
|
-
type: expression
|
|
40
|
-
label: Barometric Pressure Effect C_P
|
|
41
|
-
params:
|
|
42
|
-
- indication1
|
|
43
|
-
- indication2
|
|
44
|
-
- conversion_factor_f
|
|
45
|
-
description: C_P = |I_2 - I_1| / f
|
|
46
|
-
expression: Math.abs(p.indication2 - p.indication1) / p.conversion_factor_f
|
|
47
|
-
- name: maxAllowableSpanVariation
|
|
48
|
-
type: expression
|
|
49
|
-
label: Max Allowable Span Variation
|
|
50
|
-
params:
|
|
51
|
-
- d_max
|
|
52
|
-
- accuracy_class
|
|
53
|
-
- p_lc
|
|
54
|
-
description: max(0.5, 0.5*|MPE|)
|
|
55
|
-
expression: Math.max(0.5, 0.5 * Math.abs(compute('lookupMPE', [p.d_max, p.accuracy_class, p.p_lc])))
|