|
|
|
|
using HighWayIot.Common;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace HighWayIot.Config
|
|
|
|
|
{
|
|
|
|
|
public sealed class PlcSpaceConfig
|
|
|
|
|
{
|
|
|
|
|
//private static IniHelper iniHelper = new IniHelper(System.Environment.CurrentDirectory + "/config/PlcSpace.Ini");
|
|
|
|
|
private static IniHelper iniHelper = new IniHelper("E:\\桌面\\澳柯玛MES项目\\程序设计\\Aucma.Scada\\Aucma.Scada.UI\\bin\\Debug\\config\\PlcSpace.Ini");
|
|
|
|
|
|
|
|
|
|
private static readonly Lazy<PlcSpaceConfig> lazy = new Lazy<PlcSpaceConfig>(() => new PlcSpaceConfig());
|
|
|
|
|
public static PlcSpaceConfig Instance
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return lazy.Value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private PlcSpaceConfig()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public SpaceAddress GetSpaceAddress(string storeCode,string spaceCode)
|
|
|
|
|
{
|
|
|
|
|
SpaceAddress spaceAddress = new SpaceAddress();
|
|
|
|
|
spaceAddress.onStore = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "在库数量");
|
|
|
|
|
spaceAddress.onRoute = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "在途数量");
|
|
|
|
|
spaceAddress.isFull = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "是否已满");
|
|
|
|
|
spaceAddress.spaceStatus = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "货道状态");
|
|
|
|
|
spaceAddress.storeStatus = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "仓库状态");
|
|
|
|
|
spaceAddress.alarmInfo = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "报警信息");
|
|
|
|
|
spaceAddress.outStoreFinish = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "出库完成");
|
|
|
|
|
return spaceAddress;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class SpaceAddress
|
|
|
|
|
{
|
|
|
|
|
public string onStore { get; set; }
|
|
|
|
|
|
|
|
|
|
public string onRoute { get; set; }
|
|
|
|
|
|
|
|
|
|
public string isFull { get; set; }
|
|
|
|
|
|
|
|
|
|
public string spaceStatus { get; set; }
|
|
|
|
|
|
|
|
|
|
public string storeStatus { get; set; }
|
|
|
|
|
|
|
|
|
|
public string alarmInfo { get; set; }
|
|
|
|
|
|
|
|
|
|
public string outStoreFinish { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|