using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common
{
    public class AppConfigCache
    {
        #region 服务连接
        /// <summary>
        /// 服务器连接地址
        /// </summary>
        public static readonly string serviceUrl = ConfigurationManager.AppSettings["ServiceUrl"].ToString().Trim();

        /// <summary>
        /// 最新实时数据库连接地址
        /// </summary>
        public static readonly string icoredbTcp= ConfigurationManager.AppSettings["icoredbTcp"].ToString().Trim();
        #endregion

        #region ftp信息
        /// <summary>
        /// ftp IP地址
        /// </summary>
        public static readonly string ftpIp = ConfigurationManager.AppSettings["fip"].ToString().Trim();

        /// <summary>
        /// ftp IP地址
        /// </summary>
        public static readonly int ftpPort = Convert.ToInt32(ConfigurationManager.AppSettings["fport"].ToString().Trim());

        /// <summary>
        /// ftp 登录用户名
        /// </summary>
        public static readonly string ftpUid = ConfigurationManager.AppSettings["fuid"].ToString().Trim();

        /// <summary>
        /// ftp 登录密码
        /// </summary>
        public static readonly string ftpPwd = ConfigurationManager.AppSettings["fpwd"].ToString().Trim();
        
        /// <summary>
        /// ftp 文件存储地址
        /// </summary>
        public static readonly string ftpPath= ConfigurationManager.AppSettings["fpath"].ToString().Trim();

        public static readonly int imgWidth= Convert.ToInt32(ConfigurationManager.AppSettings["imgWidth"].ToString().Trim());

        public static readonly int imgHeight = Convert.ToInt32(ConfigurationManager.AppSettings["imgHeight"].ToString().Trim());

        public static readonly string ftpType= ConfigurationManager.AppSettings["ftpType"].ToString().Trim();
        #endregion


        #region 毛皮判断值配置
        /// <summary>
        /// 重量差值，在重量相差小于1t的时候，我们认为这个重量可能是同一个车，
        /// </summary>
        public static double differenceWgt = Convert.ToDouble(ConfigurationManager.AppSettings["differenceWgt"].ToString().Trim());

        /// <summary>
        /// 当前重量-历史皮>2则是毛
        /// </summary>
        //public static readonly double grossMoreWgt = Convert.ToDouble(ConfigurationManager.AppSettings["grossMoreWgt"].ToString().Trim());
        #endregion

        /// <summary>
        /// 0测试，1正式
        /// </summary>
        public static readonly string productType = ConfigurationManager.AppSettings["productType"].ToString().Trim();

    }
}
