@things-factory/qc 8.0.0 → 9.0.0-beta.3
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/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/qc",
|
3
|
-
"version": "
|
3
|
+
"version": "9.0.0-beta.3",
|
4
4
|
"main": "dist-server/index.js",
|
5
5
|
"browser": "client/index.js",
|
6
6
|
"things-factory": true,
|
@@ -24,9 +24,9 @@
|
|
24
24
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create ./server/migrations/migration"
|
25
25
|
},
|
26
26
|
"dependencies": {
|
27
|
-
"@operato/dataset": "^
|
28
|
-
"@things-factory/dataset": "^
|
29
|
-
"@things-factory/shell": "^
|
27
|
+
"@operato/dataset": "^9.0.0-beta",
|
28
|
+
"@things-factory/dataset": "^9.0.0-beta.3",
|
29
|
+
"@things-factory/shell": "^9.0.0-beta.0"
|
30
30
|
},
|
31
|
-
"gitHead": "
|
31
|
+
"gitHead": "1d7e0dd4c88f3c3f3bd311c00e4b1d1542d53634"
|
32
32
|
}
|
@@ -1,44 +0,0 @@
|
|
1
|
-
import { DataItemSpecSet, DataUseCase, EvaluationResult } from '@things-factory/dataset'
|
2
|
-
|
3
|
-
export class DataUseCaseQC implements DataUseCase {
|
4
|
-
getSpecification(): DataItemSpecSet {
|
5
|
-
return {
|
6
|
-
name: 'QC',
|
7
|
-
description: 'Quality Control Data Spec',
|
8
|
-
help: '',
|
9
|
-
specs: [
|
10
|
-
{
|
11
|
-
type: 'qc-limits' /* 'A value which seperates acceptability from unacceptability' */,
|
12
|
-
label: 'pass limits',
|
13
|
-
name: 'passLimits'
|
14
|
-
}
|
15
|
-
]
|
16
|
-
}
|
17
|
-
}
|
18
|
-
|
19
|
-
evaluate(spec: any, values: any | any[]): EvaluationResult {
|
20
|
-
const { minimum, maximum, acceptables } = spec['passLimits']
|
21
|
-
|
22
|
-
if (!(values instanceof Array)) {
|
23
|
-
values = [values]
|
24
|
-
}
|
25
|
-
|
26
|
-
for (let i = 0; i < values.length; i++) {
|
27
|
-
const value = values[i]
|
28
|
-
|
29
|
-
if (minimum != null && value < minimum) {
|
30
|
-
return { oos: true, ooc: true }
|
31
|
-
}
|
32
|
-
|
33
|
-
if (maximum != null && value > maximum) {
|
34
|
-
return { oos: true, ooc: true }
|
35
|
-
}
|
36
|
-
|
37
|
-
if (acceptables != null && !acceptables.includes(value)) {
|
38
|
-
return { oos: true, ooc: true }
|
39
|
-
}
|
40
|
-
}
|
41
|
-
|
42
|
-
return { oos: false, ooc: false }
|
43
|
-
}
|
44
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './data-use-case-qc'
|
package/server/index.ts
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
import { DataUseCase } from '@things-factory/dataset'
|
2
|
-
import { DataUseCaseQC } from './controllers'
|
3
|
-
|
4
|
-
process.on('bootstrap-module-start' as any, async ({ app, config, schema }: any) => {
|
5
|
-
DataUseCase.registerUseCase('QC', new DataUseCaseQC())
|
6
|
-
|
7
|
-
console.log('[qc:bootstrap] QC has just registered as a DataUseCase.')
|
8
|
-
})
|