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