-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathProgram.cs
33 lines (27 loc) · 1.02 KB
/
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
29
30
31
32
33
using CommandLine;
using Serilog;
using System.IO;
namespace net.sictransit.wefax
{
public static class Program
{
public static void Main(string[] args)
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.Console()
.CreateLogger();
Parser.Default.ParseArguments<Options>(args)
.WithParsed(o =>
{
if (!File.Exists(o.SourceImage))
{
throw new FileNotFoundException(o.SourceImage);
}
var wavFilename = Path.Combine(Path.GetDirectoryName(o.SourceImage), $"{Path.GetFileNameWithoutExtension(o.SourceImage)}.wav");
var faxMachine = new FaxMachine(16000);
faxMachine.Fax(o.SourceImage, wavFilename, new BinaryCodedHeader(o.SatelliteName, o.SectorName, o.Date, o.Time, o.SectorName, o.Open));
});
}
}
}