generated from wenjy/Sln.Iot
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.8 KiB
C#
60 lines
1.8 KiB
C#
using System.Reflection;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Sln.Iot.Business;
|
|
using Sln.Iot.CFX;
|
|
using Sln.Iot.Config;
|
|
using Sln.Iot.PLC;
|
|
using Sln.Iot.Repository;
|
|
using Sln.Iot.Serilog;
|
|
using TouchSocket.Sockets;
|
|
|
|
namespace Sln.Iot
|
|
{
|
|
/// <summary>
|
|
/// 程序主入口
|
|
/// </summary>
|
|
public class Program
|
|
{
|
|
static async Task Main(string[] args)
|
|
{
|
|
//Serilog中间件
|
|
SerilogExtensions.UseSerilogExtensions();
|
|
//日志实例
|
|
var log = SerilogHelper.Instance;
|
|
//配置文件加载
|
|
var appConfig = AppConfigSetting.Load();
|
|
//PLC连接初始化
|
|
//PLCConnect.Instance.InitConnect();
|
|
//业务类启动
|
|
//BusinessStart business = new BusinessStart();
|
|
//CFX接口启动
|
|
CFXHelper.Instance.Endpoint1 = CFXHelper.Instance.Init("CFX.A00.SDSH000001",
|
|
new Uri("amqp://127.0.0.1:1235"),
|
|
new Uri("amqp://127.0.0.1:8888"),
|
|
"event");
|
|
CFXHelper.Instance.Endpoint1 = CFXHelper.Instance.Init("CFX.A00.SDSH000002",
|
|
new Uri("amqp://127.0.0.1:1235"),
|
|
new Uri("amqp://127.0.0.1:8888"),
|
|
"event");
|
|
CFXHelper.Instance.Endpoint1 = CFXHelper.Instance.Init("CFX.A00.SDSH000003",
|
|
new Uri("amqp://127.0.0.1:1235"),
|
|
new Uri("amqp://127.0.0.1:8888"),
|
|
"event");
|
|
log.Info($"系统启动成功,日志存放位置:{appConfig.logPath}");
|
|
|
|
CFXTest cFXTest = new CFXTest();
|
|
cFXTest.Test1();
|
|
|
|
//test();
|
|
|
|
await Task.Delay(-1);
|
|
}
|
|
|
|
private static void test()
|
|
{
|
|
TestBusiness test = new TestBusiness();
|
|
|
|
}
|
|
}
|
|
} |