using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GatewayTool.Models;

namespace GatewayTool.Businesses
{
    public class SoftwareConfigs
    {
        /// <summary>
        /// 当前时间
        /// </summary>
        public static string Now
        {
            get => $"[{DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")}]";
        }

        /// <summary>
        /// 服务端口号
        /// </summary>
        public int ServicePortNum { get; set; } = 3333;

        private string _LogFolderPath = $"{Environment.CurrentDirectory}\\Log";
        /// <summary>
        /// 日志文件夹路径
        /// </summary>
        public string LogFolderPath
        {
            get => _LogFolderPath;
            set
            {
                _LogFolderPath = value;
            }
        }

        /// <summary>
        /// 日志文件路径
        /// </summary>
        public string LogFilePath
        {
            get => $"{_LogFolderPath}\\{DateTime.Now.ToString("yyyy-MM-dd")}.log";
        }

        /// <summary>
        /// 实时日志最大显示行数
        /// </summary>
        public int ShowLogMaxLine { get; set; } = 20;

        /// <summary>
        /// 帮助文档路径
        /// </summary>
        public string HelpFilePath { get; set; } = $"{Environment.CurrentDirectory}\\Help.pdf";

        /// <summary>
        /// 配置文件路径
        /// </summary>
        public string ConfigFilePath { get; set; } = $"{Environment.CurrentDirectory}\\Config.ini";

        /// <summary>
        /// 嗅探远程端口号
        /// </summary>
        public int SniffRemotePortNum { get; set; } = 2009;

        /// <summary>
        /// 嗅探波特率
        /// </summary>
        public EnumBaudrate SniffBaudRate { get; set; } = EnumBaudrate.rate_9600;

        /// <summary>
        /// 嗅探数据位
        /// </summary>
        public EnumDataBits SniffDataBits { get; set; } = EnumDataBits.Bit_8;

        /// <summary>
        /// 嗅探停止位
        /// </summary>
        public EnumStopBits SniffStopBits { get; set; } = EnumStopBits.Bit_1;

        /// <summary>
        /// 嗅探校验位
        /// </summary>
        public EnumCheckBit SniffParity { get; set; } = EnumCheckBit.none;
    }
}