loupedeck-commander 1.4.1 → 1.4.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.
- package/LICENSE +201 -201
- package/README.md +131 -131
- package/common/ApplicationConfig.mjs +300 -300
- package/common/BaseLoupeDeckHandler.mjs +393 -381
- package/common/ButtonField.mjs +168 -166
- package/common/button.mjs +533 -520
- package/common/cmd-executer.mjs +16 -16
- package/common/index.mjs +5 -5
- package/common/utils.mjs +106 -106
- package/config.yaml +8 -8
- package/index.mjs +3 -3
- package/interfaces/baseif.mjs +71 -71
- package/interfaces/httpif.mjs +90 -90
- package/interfaces/interfaces.mjs +34 -34
- package/interfaces/opcuaif.mjs +484 -481
- package/interfaces/shellif.mjs +58 -58
- package/package.json +32 -32
- package/profile-1.yaml +186 -188
- package/profile-2.yaml +213 -215
- package/test.mjs +40 -40
package/profile-2.yaml
CHANGED
|
@@ -1,215 +1,213 @@
|
|
|
1
|
-
name: profile-1
|
|
2
|
-
profile: example
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
nodeid: ns=0;s=nodeID
|
|
215
|
-
verbose: true
|
|
1
|
+
name: profile-1
|
|
2
|
+
profile: example
|
|
3
|
+
description: ""
|
|
4
|
+
touch:
|
|
5
|
+
center:
|
|
6
|
+
"0":
|
|
7
|
+
default: one
|
|
8
|
+
states:
|
|
9
|
+
off:
|
|
10
|
+
color: "#000099"
|
|
11
|
+
cmd: echo "{id} {state}"
|
|
12
|
+
one:
|
|
13
|
+
color: "#00ff00"
|
|
14
|
+
image: numbers/one_9278045.png
|
|
15
|
+
cmd: echo "{id} {state}"
|
|
16
|
+
two:
|
|
17
|
+
color: "#00ff00"
|
|
18
|
+
image: numbers/two_9278103.png
|
|
19
|
+
cmd: echo "{id} {state}"
|
|
20
|
+
three:
|
|
21
|
+
color: "#00ff00"
|
|
22
|
+
image: numbers/three_9278150.png
|
|
23
|
+
cmd: echo "{id} {state}"
|
|
24
|
+
four:
|
|
25
|
+
color: "#00ff00"
|
|
26
|
+
image: numbers/four_9278183.png
|
|
27
|
+
cmd: echo "{id} {state}"
|
|
28
|
+
five:
|
|
29
|
+
color: "#00ff00"
|
|
30
|
+
image: numbers/five_9278222.png
|
|
31
|
+
cmd: echo "{id} {state}"
|
|
32
|
+
"1":
|
|
33
|
+
default: two
|
|
34
|
+
params:
|
|
35
|
+
nodeid: ns=2;s=DRV.AAFHR.compOut.FeldTempGetriebeoel
|
|
36
|
+
states:
|
|
37
|
+
off:
|
|
38
|
+
color: "#000099"
|
|
39
|
+
cmd: echo "{id} {state}"
|
|
40
|
+
one:
|
|
41
|
+
color: "#00ff00"
|
|
42
|
+
image: numbers/one_9278045.png
|
|
43
|
+
cmd: echo "{id} {state}"
|
|
44
|
+
two:
|
|
45
|
+
color: "#00ff00"
|
|
46
|
+
image: numbers/two_9278103.png
|
|
47
|
+
cmd: echo "{id} {state}"
|
|
48
|
+
three:
|
|
49
|
+
color: "#00ff00"
|
|
50
|
+
image: numbers/three_9278150.png
|
|
51
|
+
cmd: echo "{id} {state}"
|
|
52
|
+
four:
|
|
53
|
+
color: "#00ff00"
|
|
54
|
+
image: numbers/four_9278183.png
|
|
55
|
+
cmd: echo "{id} {state}"
|
|
56
|
+
five:
|
|
57
|
+
color: "#00ff00"
|
|
58
|
+
image: numbers/five_9278222.png
|
|
59
|
+
cmd: echo "{id} {state}"
|
|
60
|
+
"2":
|
|
61
|
+
default: three
|
|
62
|
+
states:
|
|
63
|
+
off:
|
|
64
|
+
color: "#000099"
|
|
65
|
+
cmd: echo "{id} {state}"
|
|
66
|
+
one:
|
|
67
|
+
color: "#00ff00"
|
|
68
|
+
image: numbers/one_9278045.png
|
|
69
|
+
cmd: echo "{id} {state}"
|
|
70
|
+
two:
|
|
71
|
+
color: "#00ff00"
|
|
72
|
+
image: numbers/two_9278103.png
|
|
73
|
+
cmd: echo "{id} {state}"
|
|
74
|
+
three:
|
|
75
|
+
color: "#00ff00"
|
|
76
|
+
image: numbers/three_9278150.png
|
|
77
|
+
cmd: echo "{id} {state}"
|
|
78
|
+
four:
|
|
79
|
+
color: "#00ff00"
|
|
80
|
+
image: numbers/four_9278183.png
|
|
81
|
+
cmd: echo "{id} {state}"
|
|
82
|
+
five:
|
|
83
|
+
color: "#00ff00"
|
|
84
|
+
image: numbers/five_9278222.png
|
|
85
|
+
cmd: echo "{id} {state}"
|
|
86
|
+
"3":
|
|
87
|
+
default: four
|
|
88
|
+
states:
|
|
89
|
+
off:
|
|
90
|
+
color: "#000099"
|
|
91
|
+
cmd: echo "{id} {state}"
|
|
92
|
+
one:
|
|
93
|
+
color: "#00ff00"
|
|
94
|
+
image: numbers/one_9278045.png
|
|
95
|
+
cmd: echo "{id} {state}"
|
|
96
|
+
two:
|
|
97
|
+
color: "#00ff00"
|
|
98
|
+
image: numbers/two_9278103.png
|
|
99
|
+
cmd: echo "{id} {state}"
|
|
100
|
+
three:
|
|
101
|
+
color: "#00ff00"
|
|
102
|
+
image: numbers/three_9278150.png
|
|
103
|
+
cmd: echo "{id} {state}"
|
|
104
|
+
four:
|
|
105
|
+
color: "#00ff00"
|
|
106
|
+
image: numbers/four_9278183.png
|
|
107
|
+
cmd: echo "{id} {state}"
|
|
108
|
+
five:
|
|
109
|
+
color: "#00ff00"
|
|
110
|
+
image: numbers/five_9278222.png
|
|
111
|
+
cmd: echo "{id} {state}"
|
|
112
|
+
"4":
|
|
113
|
+
default: five
|
|
114
|
+
states:
|
|
115
|
+
off:
|
|
116
|
+
color: "#000099"
|
|
117
|
+
cmd: echo "{id} {state}"
|
|
118
|
+
one:
|
|
119
|
+
color: "#00ff00"
|
|
120
|
+
image: numbers/one_9278045.png
|
|
121
|
+
cmd: echo "{id} {state}"
|
|
122
|
+
two:
|
|
123
|
+
color: "#00ff00"
|
|
124
|
+
image: numbers/two_9278103.png
|
|
125
|
+
cmd: echo "{id} {state}"
|
|
126
|
+
three:
|
|
127
|
+
color: "#00ff00"
|
|
128
|
+
image: numbers/three_9278150.png
|
|
129
|
+
cmd: echo "{id} {state}"
|
|
130
|
+
four:
|
|
131
|
+
color: "#00ff00"
|
|
132
|
+
image: numbers/four_9278183.png
|
|
133
|
+
cmd: echo "{id} {state}"
|
|
134
|
+
five:
|
|
135
|
+
color: "#00ff00"
|
|
136
|
+
image: numbers/five_9278222.png
|
|
137
|
+
cmd: echo "{id} {state}"
|
|
138
|
+
"5":
|
|
139
|
+
states:
|
|
140
|
+
off:
|
|
141
|
+
color: "#000099"
|
|
142
|
+
cmd: echo "{id} {state}"
|
|
143
|
+
one:
|
|
144
|
+
color: "#00ff00"
|
|
145
|
+
image: numbers/one_9278045.png
|
|
146
|
+
cmd: echo "{id} {state}"
|
|
147
|
+
two:
|
|
148
|
+
color: "#00ff00"
|
|
149
|
+
image: numbers/two_9278103.png
|
|
150
|
+
cmd: echo "{id} {state}"
|
|
151
|
+
three:
|
|
152
|
+
color: "#00ff00"
|
|
153
|
+
image: numbers/three_9278150.png
|
|
154
|
+
cmd: echo "{id} {state}"
|
|
155
|
+
four:
|
|
156
|
+
color: "#00ff00"
|
|
157
|
+
image: numbers/four_9278183.png
|
|
158
|
+
cmd: echo "{id} {state}"
|
|
159
|
+
five:
|
|
160
|
+
color: "#00ff00"
|
|
161
|
+
image: numbers/five_9278222.png
|
|
162
|
+
cmd: echo "{id} {state}"
|
|
163
|
+
left:
|
|
164
|
+
"0":
|
|
165
|
+
states:
|
|
166
|
+
on:
|
|
167
|
+
color: "#000000"
|
|
168
|
+
cmd: echo "{id} {state}"
|
|
169
|
+
right:
|
|
170
|
+
"0":
|
|
171
|
+
states:
|
|
172
|
+
on:
|
|
173
|
+
color: "#000000"
|
|
174
|
+
cmd: echo "{id} {state}"
|
|
175
|
+
knobs:
|
|
176
|
+
knobTL:
|
|
177
|
+
states:
|
|
178
|
+
on:
|
|
179
|
+
cmd: echo "{id} {state}"
|
|
180
|
+
group: ""
|
|
181
|
+
knobCL:
|
|
182
|
+
states:
|
|
183
|
+
on:
|
|
184
|
+
cmd: echo "{id} {state}"
|
|
185
|
+
group: ""
|
|
186
|
+
knobBL:
|
|
187
|
+
states:
|
|
188
|
+
on:
|
|
189
|
+
cmd: echo "{id} {state}"
|
|
190
|
+
opcua: ns=2;s=DRV.AAFHR.compOut.FeldTempGetriebeoel
|
|
191
|
+
blink: ns=2;s=DRV.AAFHR.compOut.Feststellbremse
|
|
192
|
+
group: ""
|
|
193
|
+
knobTR:
|
|
194
|
+
states:
|
|
195
|
+
on:
|
|
196
|
+
cmd: echo "{id} {state}"
|
|
197
|
+
group: ""
|
|
198
|
+
knobCR:
|
|
199
|
+
states:
|
|
200
|
+
on:
|
|
201
|
+
cmd: echo "{id} {state}"
|
|
202
|
+
group: ""
|
|
203
|
+
knobBR:
|
|
204
|
+
states:
|
|
205
|
+
on:
|
|
206
|
+
cmd: echo "{id} {state}"
|
|
207
|
+
group: ""
|
|
208
|
+
parameters:
|
|
209
|
+
hostname: 127.0.0.1
|
|
210
|
+
simnbr: "1"
|
|
211
|
+
endpointurl: opc.tcp://{hostname}:4840
|
|
212
|
+
nodeid: ns=0;s=nodeID
|
|
213
|
+
verbose: true
|
package/test.mjs
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { BaseLoupeDeckHandler } from './common/BaseLoupeDeckHandler.mjs'
|
|
2
|
-
|
|
3
|
-
var config='config.yaml'
|
|
4
|
-
|
|
5
|
-
// Check if a config file exists
|
|
6
|
-
import { existsSync } from 'fs'
|
|
7
|
-
if (existsSync(config)) {
|
|
8
|
-
console.log(`Using config file: ${config}`)
|
|
9
|
-
} else if (existsSync(config.replace('.yaml', '.json'))) {
|
|
10
|
-
// If a JSON config file exists, use it instead
|
|
11
|
-
config = config.replace('.yaml', '.json')
|
|
12
|
-
console.log(`Using config file: ${config}`)
|
|
13
|
-
} else {
|
|
14
|
-
// If no config file exists, exit with an error message
|
|
15
|
-
console.error(`Config file ${config} does not exist. Please create it.`)
|
|
16
|
-
process.exit(1)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Initialize the Handler using a default config-File
|
|
21
|
-
*/
|
|
22
|
-
const handler = new BaseLoupeDeckHandler(config)
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Stop the handlers when a signal like SIGINT or SIGTERM arrive
|
|
26
|
-
* @param {*} signal
|
|
27
|
-
*/
|
|
28
|
-
const stopHandler = async(signal) => {
|
|
29
|
-
console.log(`Receiving ${signal} => Stopping processes.`)
|
|
30
|
-
await handler.stop()
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// Initiating the signal handlers:
|
|
34
|
-
// see https://www.tutorialspoint.com/unix/unix-signals-traps.htm
|
|
35
|
-
process.on('SIGINT', async (signal) => { stopHandler(signal) })
|
|
36
|
-
process.on('SIGTERM', async (signal) => { stopHandler(signal) })
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
await handler.start()
|
|
40
|
-
|
|
1
|
+
import { BaseLoupeDeckHandler } from './common/BaseLoupeDeckHandler.mjs'
|
|
2
|
+
|
|
3
|
+
var config='config.yaml'
|
|
4
|
+
|
|
5
|
+
// Check if a config file exists
|
|
6
|
+
import { existsSync } from 'fs'
|
|
7
|
+
if (existsSync(config)) {
|
|
8
|
+
console.log(`Using config file: ${config}`)
|
|
9
|
+
} else if (existsSync(config.replace('.yaml', '.json'))) {
|
|
10
|
+
// If a JSON config file exists, use it instead
|
|
11
|
+
config = config.replace('.yaml', '.json')
|
|
12
|
+
console.log(`Using config file: ${config}`)
|
|
13
|
+
} else {
|
|
14
|
+
// If no config file exists, exit with an error message
|
|
15
|
+
console.error(`Config file ${config} does not exist. Please create it.`)
|
|
16
|
+
process.exit(1)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Initialize the Handler using a default config-File
|
|
21
|
+
*/
|
|
22
|
+
const handler = new BaseLoupeDeckHandler(config)
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Stop the handlers when a signal like SIGINT or SIGTERM arrive
|
|
26
|
+
* @param {*} signal
|
|
27
|
+
*/
|
|
28
|
+
const stopHandler = async(signal) => {
|
|
29
|
+
console.log(`Receiving ${signal} => Stopping processes.`)
|
|
30
|
+
await handler.stop()
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Initiating the signal handlers:
|
|
34
|
+
// see https://www.tutorialspoint.com/unix/unix-signals-traps.htm
|
|
35
|
+
process.on('SIGINT', async (signal) => { stopHandler(signal) })
|
|
36
|
+
process.on('SIGTERM', async (signal) => { stopHandler(signal) })
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
await handler.start()
|
|
40
|
+
|
|
41
41
|
await new Promise((resolve) => process.once("SIGINT", resolve));
|