|
|
|
|
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 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.inStoreFinish = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "入库完成");
|
|
|
|
|
spaceAddress.outStoreFinish = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "出库完成");
|
|
|
|
|
return spaceAddress;
|
|
|
|
|
// spaceAddress.isFull = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "是否已满");
|
|
|
|
|
// spaceAddress.spaceStatus = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "货道状态");
|
|
|
|
|
// spaceAddress.storeStatus = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "仓库状态");
|
|
|
|
|
// spaceAddress.alarmInfo = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "报警信息");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class SpaceAddress
|
|
|
|
|
{
|
|
|
|
|
public string onStore { get; set; }
|
|
|
|
|
|
|
|
|
|
public string onRoute { get; set; }
|
|
|
|
|
|
|
|
|
|
public string inStoreFinish { get; set; }
|
|
|
|
|
|
|
|
|
|
public string outStoreFinish { get; set; }
|
|
|
|
|
|
|
|
|
|
// public string isFull { get; set; }
|
|
|
|
|
|
|
|
|
|
// public string spaceStatus { get; set; }
|
|
|
|
|
|
|
|
|
|
// public string storeStatus { get; set; }
|
|
|
|
|
|
|
|
|
|
// public string alarmInfo { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|