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.
Aucma.Scada/HighWayIot.Config/PlcConfig.cs

237 lines
7.9 KiB
C#

using HighWayIot.Common;
using System;
namespace HighWayIot.Config
{
public sealed class PlcConfig
{
private static IniHelper iniHelper = new IniHelper(System.Environment.CurrentDirectory + "/config/Plc.Ini");
private static readonly Lazy<PlcConfig> lazy = new Lazy<PlcConfig>(() => new PlcConfig());
public static PlcConfig Instance
{
get
{
return lazy.Value;
}
}
private StringChange stringChange = StringChange.Instance;
private PlcConfig()
{
}
#region PLC基础参数
/// <summary>
/// 箱壳PLCIP
/// </summary>
public string shell_Plc_Ip
{
get { return iniHelper.IniReadValue("plcSystem", "箱壳PLCIP"); }
set { iniHelper.IniWriteValue("plcSystem", "箱壳PLCIP", value); }
}
/// <summary>
/// 箱壳PLC端口
/// </summary>
public int shell_Plc_Port
{
get { return stringChange.ParseToInt(iniHelper.IniReadValue("plcSystem", "箱壳PLC端口")); }
set { iniHelper.IniWriteValue("plcSystem", "箱壳PLC端口", value.ToString()); }
}
/// <summary>
/// 内胆PLCIP
/// </summary>
public string liner_Plc_Ip
{
get { return iniHelper.IniReadValue("plcSystem", "内胆PLCIP"); }
set { iniHelper.IniWriteValue("plcSystem", "内胆PLCIP", value); }
}
/// <summary>
/// 内胆PLC端口
/// </summary>
public int liner_Plc_Port
{
get { return stringChange.ParseToInt(iniHelper.IniReadValue("plcSystem", "内胆PLC端口")); }
set { iniHelper.IniWriteValue("plcSystem", "内胆PLC端口", value.ToString()); }
}
#endregion
#region 箱壳入库地址
/// <summary>
/// 箱壳——入库货道号
/// </summary>
public string in_shell_spaceCode
{
get { return iniHelper.IniReadValue("shell_inStore_address", "入库货道号"); }
set { iniHelper.IniWriteValue("shell_inStore_address", "入库货道号", value); }
}
/// <summary>
/// 箱壳——入库应答字
/// </summary>
public string in_shell_answer
{
get { return iniHelper.IniReadValue("shell_inStore_address", "入库应答字"); }
set { iniHelper.IniWriteValue("shell_inStore_address", "入库应答字", value); }
}
/// <summary>
/// 箱壳——入库任务号
/// </summary>
public string in_shell_task
{
get { return iniHelper.IniReadValue("shell_inStore_address", "入库任务号"); }
set { iniHelper.IniWriteValue("shell_inStore_address", "入库任务号", value); }
}
/// <summary>
/// 箱壳——入库完成
/// </summary>
public string in_shell_finish
{
get { return iniHelper.IniReadValue("shell_inStore_address", "入库完成"); }
set { iniHelper.IniWriteValue("shell_inStore_address", "入库完成", value); }
}
#endregion
#region 内胆入库地址
/// <summary>
/// 内胆——入库货道号
/// </summary>
public string in_liner_spaceCode
{
get { return iniHelper.IniReadValue("liner_inStore_address", "入库货道号"); }
set { iniHelper.IniWriteValue("liner_inStore_address", "入库货道号", value); }
}
/// <summary>
/// 内胆——入库应答字
/// </summary>
public string in_liner_answer
{
get { return iniHelper.IniReadValue("liner_inStore_address", "入库应答字"); }
set { iniHelper.IniWriteValue("liner_inStore_address", "入库应答字", value); }
}
/// <summary>
/// 内胆——入库任务号
/// </summary>
public string in_liner_task
{
get { return iniHelper.IniReadValue("liner_inStore_address", "入库任务号"); }
set { iniHelper.IniWriteValue("liner_inStore_address", "入库任务号", value); }
}
/// <summary>
/// 内胆——入库完成
/// </summary>
public string in_liner_finish
{
get { return iniHelper.IniReadValue("liner_inStore_address", "入库完成"); }
set { iniHelper.IniWriteValue("liner_inStore_address", "入库完成", value); }
}
#endregion
#region 箱壳出库地址
/// <summary>
/// 箱壳——出库货道号
/// </summary>
public string out_shell_spaceCode
{
get { return iniHelper.IniReadValue("shell_outStore_address", "出库货道号"); }
set { iniHelper.IniWriteValue("shell_outStore_address", "出库货道号", value); }
}
/// <summary>
/// 箱壳——出库数量
/// </summary>
public string out_shell_amount
{
get { return iniHelper.IniReadValue("shell_outStore_address", "出库数量"); }
set { iniHelper.IniWriteValue("shell_outStore_address", "出库数量", value); }
}
/// <summary>
/// 箱壳——出库应答字
/// </summary>
public string out_shell_answer
{
get { return iniHelper.IniReadValue("shell_outStore_address", "出库应答字"); }
set { iniHelper.IniWriteValue("shell_outStore_address", "出库应答字", value); }
}
/// <summary>
/// 箱壳——出库任务号
/// </summary>
public string out_shell_task
{
get { return iniHelper.IniReadValue("shell_outStore_address", "出库任务号"); }
set { iniHelper.IniWriteValue("shell_outStore_address", "出库任务号", value); }
}
/// <summary>
/// 箱壳——出库完成
/// </summary>
public string out_shell_finish
{
get { return iniHelper.IniReadValue("shell_outStore_address", "出库完成"); }
set { iniHelper.IniWriteValue("shell_outStore_address", "出库完成", value); }
}
#endregion
#region 内胆出库地址
/// <summary>
/// 内胆——出库货道号
/// </summary>
public string out_liner_spaceCode
{
get { return iniHelper.IniReadValue("liner_outStore_address", "出库货道号"); }
set { iniHelper.IniWriteValue("liner_outStore_address", "出库货道号", value); }
}
/// <summary>
/// 内胆——出库数量
/// </summary>
public string out_liner_amount
{
get { return iniHelper.IniReadValue("liner_outStore_address", "出库数量"); }
set { iniHelper.IniWriteValue("liner_outStore_address", "出库数量", value); }
}
/// <summary>
/// 内胆——出库应答字
/// </summary>
public string out_liner_answer
{
get { return iniHelper.IniReadValue("liner_outStore_address", "出库应答字"); }
set { iniHelper.IniWriteValue("liner_outStore_address", "出库应答字", value); }
}
/// <summary>
/// 内胆——出库任务号
/// </summary>
public string out_liner_task
{
get { return iniHelper.IniReadValue("liner_outStore_address", "出库任务号"); }
set { iniHelper.IniWriteValue("liner_outStore_address", "出库任务号", value); }
}
/// <summary>
/// 内胆——出库完成
/// </summary>
public string out_liner_finish
{
get { return iniHelper.IniReadValue("liner_outStore_address", "出库完成"); }
set { iniHelper.IniWriteValue("liner_outStore_address", "出库完成", value); }
}
#endregion
}
}