@operato/scene-mpi 8.0.0-beta.1 → 8.0.0-beta.2

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.
@@ -1,162 +0,0 @@
1
- const NATURE: ComponentNature = {
2
- mutable: false,
3
- resizable: true,
4
- rotatable: true,
5
- properties: [
6
- {
7
- type: 'string',
8
- label: 'value',
9
- name: 'value',
10
- placeholder: '12:34:56'
11
- },
12
- {
13
- type: 'string',
14
- label: 'pattern',
15
- name: 'pattern',
16
- placeholder: '##:##:##'
17
- },
18
- {
19
- type: 'number',
20
- label: 'digit height',
21
- name: 'digitHeight',
22
- placeholder: '20'
23
- },
24
- {
25
- type: 'number',
26
- label: 'digit width',
27
- name: 'digitWidth',
28
- placeholder: '10'
29
- },
30
- {
31
- type: 'number',
32
- label: 'digit distance',
33
- name: 'digitDistance',
34
- placeholder: '2.5'
35
- },
36
- {
37
- type: 'number',
38
- label: 'display angle',
39
- name: 'displayAngle',
40
- placeholder: '12'
41
- },
42
- {
43
- type: 'number',
44
- label: 'segment width',
45
- name: 'segmentWidth',
46
- placeholder: '2.5'
47
- },
48
- {
49
- type: 'number',
50
- label: 'segment distance',
51
- name: 'segmentDistance',
52
- placeholder: '0.2'
53
- },
54
- {
55
- type: 'select',
56
- label: 'segment count',
57
- name: 'segmentCount',
58
- property: {
59
- options: [
60
- {
61
- display: 7,
62
- value: 7
63
- },
64
- {
65
- display: 14,
66
- value: 14
67
- },
68
- {
69
- display: 16,
70
- value: 16
71
- }
72
- ]
73
- }
74
- },
75
- {
76
- type: 'select',
77
- label: 'corner type',
78
- name: 'cornerType',
79
- property: {
80
- options: [
81
- {
82
- display: 'SymmetricCorner',
83
- value: 0
84
- },
85
- {
86
- display: 'SquaredCorner',
87
- value: 1
88
- },
89
- {
90
- display: 'RoundedCorner',
91
- value: 2
92
- }
93
- ]
94
- }
95
- },
96
- {
97
- type: 'color',
98
- label: 'color-on',
99
- name: 'colorOn'
100
- },
101
- {
102
- type: 'color',
103
- label: 'color-off',
104
- name: 'colorOff'
105
- }
106
- ],
107
- 'value-property': 'value',
108
- help: 'scene/component/seven-segment'
109
- }
110
-
111
- import { Component, ComponentNature, RectPath, Shape } from '@hatiolab/things-scene'
112
- import SegmentDisplay from './segment-display'
113
-
114
- export default class SevenSegment extends RectPath(Shape) {
115
- render(context: CanvasRenderingContext2D) {
116
- var {
117
- top,
118
- left,
119
- height,
120
- width,
121
- pattern = '##:##:##',
122
- value = '12:34:56',
123
- digitHeight = 20,
124
- digitWidth = 10,
125
- digitDistance = 2.5,
126
- displayAngle = 12,
127
- segmentWidth = 2.5,
128
- segmentDistance = 0.2,
129
- segmentCount = SegmentDisplay.SevenSegment,
130
- cornerType = SegmentDisplay.RoundedCorner,
131
- colorOn = 'rgb(233, 93, 15)',
132
- colorOff = 'rgb(75, 30, 5)'
133
- } = this.state
134
-
135
- var display = new SegmentDisplay(width, height)
136
- display.pattern = pattern
137
- display.displayAngle = displayAngle
138
- display.digitHeight = digitHeight
139
- display.digitWidth = digitWidth
140
- display.digitDistance = digitDistance
141
- display.segmentWidth = segmentWidth
142
- display.segmentDistance = segmentDistance
143
- display.segmentCount = segmentCount
144
- display.cornerType = cornerType
145
- display.colorOn = colorOn
146
- display.colorOff = colorOff
147
-
148
- display.setValue(String(value))
149
-
150
- context.translate(left, top)
151
-
152
- display.draw(context)
153
-
154
- context.beginPath()
155
- }
156
-
157
- get nature() {
158
- return NATURE
159
- }
160
- }
161
-
162
- Component.register('seven-segment', SevenSegment)
@@ -1,19 +0,0 @@
1
- const icon = new URL('../../icons/no-image.png', import.meta.url).href
2
-
3
- export default {
4
- type: 'auto-clicker',
5
- description: 'auto clicking target',
6
- group: 'IoT',
7
- /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */
8
- icon,
9
- model: {
10
- type: 'auto-clicker',
11
- left: 100,
12
- top: 100,
13
- width: 100,
14
- height: 100,
15
- fillStyle: 'white',
16
- strokeStyle: 'black',
17
- switch: 'false'
18
- }
19
- }
@@ -1,18 +0,0 @@
1
- const icon = new URL('../../icons/icon-boot-button.png', import.meta.url).href
2
-
3
- export default {
4
- type: 'boot-button',
5
- description: 'all gateway boot',
6
- group: 'IoT',
7
- /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */
8
- icon,
9
- model: {
10
- type: 'boot-button',
11
- left: 100,
12
- top: 100,
13
- width: 500,
14
- height: 500,
15
- fillStyle: 'transparent',
16
- strokeStyle: 'transparent'
17
- }
18
- }
@@ -1,18 +0,0 @@
1
- const icon = new URL('../../icons/icon-gateway.png', import.meta.url).href
2
-
3
- export default {
4
- type: 'gateway',
5
- description: 'multi-purpose indicator gateway',
6
- group: 'IoT',
7
- /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */
8
- icon,
9
- model: {
10
- type: 'gateway',
11
- left: 10,
12
- top: 10,
13
- width: 800,
14
- height: 600,
15
- fillStyle: 'cyan',
16
- strokeStyle: 'darkgray'
17
- }
18
- }
@@ -1,15 +0,0 @@
1
- import indicator from './indicator'
2
- import gateway from './gateway'
3
- import sevenSegment from './seven-segment'
4
- import bootButton from './boot-button'
5
- import replyButton from './reply-button'
6
- // import autoClicker from './auto-clicker'
7
-
8
- export default [
9
- indicator,
10
- gateway,
11
- sevenSegment,
12
- bootButton,
13
- replyButton
14
- // autoClicker
15
- ]
@@ -1,18 +0,0 @@
1
- const icon = new URL('../../icons/icon-indicator.png', import.meta.url).href
2
-
3
- export default {
4
- type: 'indicator',
5
- description: 'multi-purpose indicator',
6
- group: 'IoT',
7
- /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */
8
- icon,
9
- model: {
10
- type: 'indicator',
11
- left: 10,
12
- top: 10,
13
- width: 449,
14
- height: 53,
15
- fillStyle: 'black',
16
- strokeStyle: 'darkgray'
17
- }
18
- }
@@ -1,18 +0,0 @@
1
- const icon = new URL('../../icons/icon-reply-button.png', import.meta.url).href
2
-
3
- export default {
4
- type: 'reply-button',
5
- description: 'all mpi response',
6
- group: 'IoT',
7
- /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */
8
- icon,
9
- model: {
10
- type: 'reply-button',
11
- left: 100,
12
- top: 100,
13
- width: 500,
14
- height: 500,
15
- fillStyle: 'transparent',
16
- strokeStyle: 'transparent'
17
- }
18
- }
@@ -1,30 +0,0 @@
1
- const icon = new URL('../../icons/icon-seven-segment.png', import.meta.url).href
2
-
3
- export default {
4
- type: 'seven-segment',
5
- description: 'electric seven segment emulator',
6
- group: 'IoT',
7
- /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */
8
- icon,
9
- model: {
10
- type: 'seven-segment',
11
- left: 10,
12
- top: 10,
13
- width: 200,
14
- height: 300,
15
- fillStyle: 'black',
16
- strokeStyle: 'darkgray',
17
- pattern: '##:##:##',
18
- value: '12:34:56',
19
- digitHeight: 20,
20
- digitWidth: 10,
21
- digitDistance: 2.5,
22
- displayAngle: 12,
23
- segmentWidth: 2.5,
24
- segmentDistance: 0.2,
25
- segmentCount: 7,
26
- cornerType: 0,
27
- colorOn: 'rgb(233, 93, 15)',
28
- colorOff: 'rgb(75, 30, 5)'
29
- }
30
- }
package/src/uuid.ts DELETED
@@ -1,20 +0,0 @@
1
- export function uuid() {
2
- const chars = '0123456789abcdef'
3
- const uuid = []
4
- let random
5
-
6
- for (let i = 0; i < 36; i++) {
7
- if (i === 8 || i === 13 || i === 18 || i === 23) {
8
- uuid[i] = '-'
9
- } else if (i === 14) {
10
- uuid[i] = '4'
11
- } else {
12
- if (random === undefined || i % 6 === 0) {
13
- random = (Math.random() * 16) | 0
14
- }
15
- uuid[i] = chars[i === 19 ? (random & 0x3) | 0x8 : random]
16
- }
17
- }
18
-
19
- return uuid.join('')
20
- }
package/tsconfig.json DELETED
@@ -1,23 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2018",
4
- "module": "esnext",
5
- "moduleResolution": "node",
6
- "noEmitOnError": true,
7
- "lib": ["es2019", "dom"],
8
- "strict": true,
9
- "esModuleInterop": false,
10
- "allowJs": true,
11
- "allowSyntheticDefaultImports": true,
12
- "experimentalDecorators": true,
13
- "importHelpers": true,
14
- "outDir": "dist",
15
- "sourceMap": true,
16
- "inlineSources": true,
17
- "rootDir": "src",
18
- "declaration": true,
19
- "incremental": true,
20
- "skipLibCheck": true
21
- },
22
- "include": ["**/*.ts", "*.d.ts"]
23
- }