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

136 lines
4.3 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>
/// 泡后PLC IP
/// </summary>
public string foam_Plc_Ip
{
get { return iniHelper.IniReadValue("plcSystem", "泡后PLCIP"); }
set { iniHelper.IniWriteValue("plcSystem", "泡后PLCIP", value); }
}
/// <summary>
/// 泡后PLC端口
/// </summary>
public int foam_Plc_Port
{
get { return stringChange.ParseToInt(iniHelper.IniReadValue("plcSystem", "泡后PLC端口")); }
set { iniHelper.IniWriteValue("plcSystem", "泡后PLC端口", value.ToString()); }
}
#endregion
#region 泡后入库地址
/// <summary>
/// 泡后——入库货道号
/// </summary>
public string in_foam_spaceCode
{
get { return iniHelper.IniReadValue("foam_inStore_address", "入库货道号"); }
set { iniHelper.IniWriteValue("foam_inStore_address", "入库货道号", value); }
}
/// <summary>
/// 泡后——入库应答字
/// </summary>
public string in_foam_answer
{
get { return iniHelper.IniReadValue("foam_inStore_address", "入库应答字"); }
set { iniHelper.IniWriteValue("foam_inStore_address", "入库应答字", value); }
}
/// <summary>
/// 泡后——入库任务号
/// </summary>
//public string in_foam_task
//{
// get { return iniHelper.IniReadValue("foam_inStore_address", "入库任务号"); }
// set { iniHelper.IniWriteValue("foam_inStore_address", "入库任务号", value); }
//}
/// <summary>
/// 泡后——入库完成
/// </summary>
//public string in_foam_finish
//{
// get { return iniHelper.IniReadValue("foam_inStore_address", "入库完成"); }
// set { iniHelper.IniWriteValue("foam_inStore_address", "入库完成", value); }
//}
#endregion
#region 泡后出库地址
/// <summary>
/// 泡后——出库货道号
/// </summary>
public string out_foam_spaceCode
{
get { return iniHelper.IniReadValue("foam_outStore_address", "出库货道号"); }
set { iniHelper.IniWriteValue("foam_outStore_address", "出库货道号", value); }
}
/// <summary>
/// 泡后——出库数量
/// </summary>
public string out_foam_amount
{
get { return iniHelper.IniReadValue("foam_outStore_address", "出库数量"); }
set { iniHelper.IniWriteValue("foam_outStore_address", "出库数量", value); }
}
/// <summary>
/// 泡后——出库应答字
/// </summary>
public string out_foam_answer
{
get { return iniHelper.IniReadValue("foam_outStore_address", "出库应答字"); }
set { iniHelper.IniWriteValue("foam_outStore_address", "出库应答字", value); }
}
/// <summary>
/// 泡后——出库任务号
/// </summary>
public string out_foam_task
{
get { return iniHelper.IniReadValue("foam_outStore_address", "出库任务号"); }
set { iniHelper.IniWriteValue("foam_outStore_address", "出库任务号", value); }
}
/// <summary>
/// 泡后——出库完成
/// </summary>
public string out_foam_finish
{
get { return iniHelper.IniReadValue("foam_outStore_address", "出库完成"); }
set { iniHelper.IniWriteValue("foam_outStore_address", "出库完成", value); }
}
#endregion
}
}