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.Init();
            log.Info($"系统启动成功,日志存放位置:{appConfig.logPath}");

            await Task.Delay(-1);
        }
    }
}