forked from microsoft/Quantum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrenderer.js
44 lines (37 loc) · 1.15 KB
/
renderer.js
1
2
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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
"use strict";
exports.id = 'renderer';
const ipc = require('node-ipc')
exports.connectToSimulationServer = function(callback) {
ipc.config.id = "h2SimulationClient";
ipc.config.networkPort = 8010;
ipc.connectToNet(
"h2SimulationServer",
() => {
ipc.of.h2SimulationServer.on(
'connect',
() => {
ipc.log('## Connected to simulation server. ##', ipc.config.delay);
ipc.of.h2SimulationServer.emit(
'event',
'readyToPlot'
)
}
);
ipc.of.h2SimulationServer.on(
'disconnect',
() => {
ipc.log('## Disconnected from simulation server. ##')
}
)
ipc.of.h2SimulationServer.on(
'plotPoint',
(data) => {
ipc.log('## Got data: ', data, ' ##')
callback(data);
}
)
}
)
}