nodeskini 1.0.2 → 1.0.5

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,64 +1,64 @@
1
- /**
2
- * @fileOverview Utilitaires en hiphop.js pour Skini
3
- *
4
- * node ../node_modules/@hop/hiphop/bin/hhc.mjs utilsHHSkini.hh.js -o utilsHHSkini.mjs
5
- *
6
- * @copyright (C) 2019-2025 Bertrand Petit-Hédelin
7
- * @author Bertrand Petit-Hédelin <bertrand@hedelin.fr>
8
- * @version 1.0
9
- */
10
- import { ReactiveMachine } from "@hop/hiphop";
11
-
12
- // Création réservoir ***********************************************************
13
- function makeAwait(instruments, groupeClient) {
14
- return hiphop fork ${
15
- instruments.map(val => hiphop {
16
- await(this[`${val}IN`].now);
17
- emit ${`${val}OUT`}([false, groupeClient]);
18
- //host{ console.log("---------------------------- makeAwait", instruments, groupeClient)}
19
- })}
20
- }
21
-
22
- function makeReservoir(groupeClient, instrument) {
23
- return hiphop ${hiphop {
24
- laTrappe: {
25
- abort immediate(stopReservoir.now) { // To kill the tank
26
- host {
27
- console.log("--- MAKE RESERVOIR:", instrument[0], ", groupeClient: ", groupeClient);
28
- var msg = {
29
- type: 'startTank',
30
- value: instrument[0]
31
- }
32
- serveur.broadcast(JSON.stringify(msg)); // Pour les gestions des tanks dans l'affichage de la partition "score"
33
- }
34
- ${
35
- instrument.map(val => hiphop {
36
- emit ${`${val}OUT`} ([true, groupeClient])
37
- })
38
- }
39
- host { gcs.informSelecteurOnMenuChange(groupeClient, instrument[0], true); }
40
- ${ makeAwait(instrument, groupeClient) }
41
- host { console.log("--- FIN NATURELLE RESERVOIR:", instrument[0]); }
42
- break laTrappe;
43
- }
44
-
45
- host { console.log("--- FIN FORCEE DU RESERVOIR:", instrument[0]); }
46
- ${
47
- instrument.map(val => hiphop {
48
- emit ${`${val}OUT`} ([false, groupeClient])})
49
- }
50
-
51
- host { gcs.informSelecteurOnMenuChange(groupeClient, instrument[0], false); }
52
- host {
53
- console.log("--- ABORT RESERVOIR:", instrument[0]);
54
- var msg = {
55
- type: 'killTank',
56
- value: instrument[0]
57
- }
58
- serveur.broadcast(JSON.stringify(msg)); // Pour les gestions des tanks dans l'affichage de la partition "score"
59
- }
60
- }
61
- }
62
- }
63
- }
64
-
1
+ /**
2
+ * @fileOverview Utilitaires en hiphop.js pour Skini
3
+ *
4
+ * node ../node_modules/@hop/hiphop/bin/hhc.mjs utilsHHSkini.hh.js -o utilsHHSkini.mjs
5
+ *
6
+ * @copyright (C) 2019-2025 Bertrand Petit-Hédelin
7
+ * @author Bertrand Petit-Hédelin <bertrand@hedelin.fr>
8
+ * @version 1.0
9
+ */
10
+ import { ReactiveMachine } from "@hop/hiphop";
11
+
12
+ // Création réservoir ***********************************************************
13
+ function makeAwait(instruments, groupeClient) {
14
+ return hiphop fork ${
15
+ instruments.map(val => hiphop {
16
+ await(this[`${val}IN`].now);
17
+ emit ${`${val}OUT`}([false, groupeClient]);
18
+ //host{ console.log("---------------------------- makeAwait", instruments, groupeClient)}
19
+ })}
20
+ }
21
+
22
+ function makeReservoir(groupeClient, instrument) {
23
+ return hiphop ${hiphop {
24
+ laTrappe: {
25
+ abort immediate(stopReservoir.now) { // To kill the tank
26
+ host {
27
+ console.log("--- MAKE RESERVOIR:", instrument[0], ", groupeClient: ", groupeClient);
28
+ var msg = {
29
+ type: 'startTank',
30
+ value: instrument[0]
31
+ }
32
+ serveur.broadcast(JSON.stringify(msg)); // Pour les gestions des tanks dans l'affichage de la partition "score"
33
+ }
34
+ ${
35
+ instrument.map(val => hiphop {
36
+ emit ${`${val}OUT`} ([true, groupeClient])
37
+ })
38
+ }
39
+ host { gcs.informSelecteurOnMenuChange(groupeClient, instrument[0], true); }
40
+ ${ makeAwait(instrument, groupeClient) }
41
+ host { console.log("--- FIN NATURELLE RESERVOIR:", instrument[0]); }
42
+ break laTrappe;
43
+ }
44
+
45
+ host { console.log("--- FIN FORCEE DU RESERVOIR:", instrument[0]); }
46
+ ${
47
+ instrument.map(val => hiphop {
48
+ emit ${`${val}OUT`} ([false, groupeClient])})
49
+ }
50
+
51
+ host { gcs.informSelecteurOnMenuChange(groupeClient, instrument[0], false); }
52
+ host {
53
+ console.log("--- ABORT RESERVOIR:", instrument[0]);
54
+ var msg = {
55
+ type: 'killTank',
56
+ value: instrument[0]
57
+ }
58
+ serveur.broadcast(JSON.stringify(msg)); // Pour les gestions des tanks dans l'affichage de la partition "score"
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
64
+