You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
3.7 KiB

using System;
using System.IO;
namespace EC.AutoWeightServer.Model.Config
{
public class ServerConfig : BaseConfig
{
/// <summary>
/// 站点编号
/// </summary>
public static string SiteName { get; } = GetAppConfig("SITE_Name");
/// <summary>
/// 相机
/// </summary>
public static string CameraAddress1 { get; } = GetAppConfig("CAMERA_ADDRESS1");
public static string CameraAddress2 { get; } = GetAppConfig("CAMERA_ADDRESS2");
public static string CameraAddress3 { get; } = GetAppConfig("CAMERA_ADDRESS3");
public static string CameraAddress4 { get; } = GetAppConfig("CAMERA_ADDRESS4");
public static ushort CameraSocketPort { get; } = (ushort)FormatCom.ToShort(GetAppConfig("CAMERA_SOCKET_PORT"));
public static string CameraUsername { get; } = GetAppConfig("CAMERA_USERNAME");
public static string CameraPassword { get; } = GetAppConfig("CAMERA_PASSWORD");
public static int AutoDetectInterval { get; } = FormatCom.ToInt(GetAppConfig("AutoDetectInterval"));
/// <summary>
/// 称重串口
/// </summary>
public static string WtCom { get; } = GetAppConfig("WT_COM");
public static int WtBaudRate { get; } = FormatCom.ToInt(GetAppConfig("WT_BaudRate"));
public static int WtDiff { get; } = FormatCom.ToInt(GetAppConfig("WT_Diff"));
public static int WtInterval { get; } = FormatCom.ToInt(GetAppConfig("WT_Interval"));
public static int WtLenLimit { get; } = FormatCom.ToInt(GetAppConfig("WT_LenLimit"));
public static int WtReceivedBytesThreshold { get; } = FormatCom.ToInt(GetAppConfig("WT_ReceivedBytesThreshold"));
public static int WTDiscardInBufferFlag { get; } = FormatCom.ToInt(GetAppConfig("WT_DiscardInBuffer_Flag"));
public static int WtTransmitFlag { get; } = FormatCom.ToInt(GetAppConfig("WT_Transmit_Flag"));
public static string WtTransmitCom { get; } = GetAppConfig("WT_Transmit_Com");
/// <summary>
/// 指示灯继电器串口
/// </summary>
public static string LightRelayCom { get; } = GetAppConfig("Light_Relay_COM");
public static int LightRelayBaudRate { get; } = FormatCom.ToInt(GetAppConfig("Light_Relay_BaudRate"));
public static string LightCodeName { get; } = Path.Combine(Environment.CurrentDirectory, "conf", GetAppConfig("Light_Code_Name"));
public static int LightInterval { get; } = FormatCom.ToInt(GetAppConfig("Light_Interval"));
public static int LightBlink { get; } = FormatCom.ToInt(GetAppConfig("Light_Blink"));
/// <summary>
/// Led控制
/// </summary>
public static string LedIp { get; } = GetAppConfig("Led_Ip");
public static short LedPort { get; } = FormatCom.ToShort(GetAppConfig("Led_Port"));
public static int BoardThreadInterval { get; } = FormatCom.ToInt(GetAppConfig("BoardThread_Interval"));
public static int BoardType { get; } = FormatCom.ToInt(GetAppConfig("Board_Type"));
/// <summary>
/// 跑马灯
/// </summary>
public static int ScrollTextInterval { get; } = FormatCom.ToInt(GetAppConfig("ScrollText_Interval"));
public static int ScrollTextGap { get; } = FormatCom.ToInt(GetAppConfig("ScrollText_Gap"));
/// <summary>
/// 超时检测
/// </summary>
public static int InTimeOut { get; } = FormatCom.ToInt(GetAppConfig("InTimeOut"));
public static int OutTimeOut { get; } = FormatCom.ToInt(GetAppConfig("OutTimeOut"));
public static int BillInterval { get; } = FormatCom.ToInt(GetAppConfig("Bill_Interval"));
public static int SavePhotoDay { get; } = FormatCom.ToInt(GetAppConfig("SavePhoto_Day"));
public static int IsPretreatPlate { get; } = FormatCom.ToInt(GetAppConfig("IsPretreatPlate"));
public static int ShowDebug { get; } = FormatCom.ToInt(GetAppConfig("ShowDebug"));
public static int ShowTrailer { get; } = FormatCom.ToInt(GetAppConfig("ShowTrailer"));
}
}