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.

76 lines
2.8 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using Microsoft.AspNetCore.Http.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Admin.Core.Common.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()
{
}
/// <summary>
/// 获取6条货道的信息在库数量,货道物料号,入库完成,仓库状态,出库完成
/// </summary>
/// <param name="storeCode"></param>
/// <param name="spaceCode"></param>
/// <returns></returns>
public SpaceAddress GetSpaceAddress(string storeCode, string spaceCode)
{
SpaceAddress spaceAddress = new SpaceAddress();
spaceAddress.spaceCode = spaceCode;
spaceAddress.onStore = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "在库数量");
spaceAddress.materialType = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "货道物料号");
spaceAddress.inStoreFinish = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "入库完成");
spaceAddress.storeStatus = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "仓库状态");
spaceAddress.outStoreFinish = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "出库完成");
// spaceAddress.onRoute = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "在途数量");
// spaceAddress.isFull = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "是否已满");
// spaceAddress.spaceStatus = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "货道状态");
// spaceAddress.alarmInfo = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "报警信息");
return spaceAddress;
}
}
public class SpaceAddress
{
// 存储货道号
public string spaceCode;
public string onStore { get; set; }
public string materialType { 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 inStoreFinish { get; set; }
public string outStoreFinish { get; set; }
}
}