-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
28 lines (23 loc) · 931 Bytes
/
Program.cs
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
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace CompositeVideoOscilloscope {
class Program {
static void Main(string[] args) {
string settingsFile = args.Any() ? args[0] : "oscilloscope_controls.json";
using (var output = new Output(address: "tcp://*:10001")) {
var controller = new Controller(settingsFile);
var oscilloscope = new Oscilloscope(output, controller);
var canceller = new CancellationTokenSource();
Task.Run(() => oscilloscope.Run(canceller.Token));
var command = Console.ReadLine();
while (command != "") {
controller.Commands.Enqueue(command);
command = Console.ReadLine();
}
canceller.Cancel();
}
}
}
}