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.

93 lines
2.3 KiB
C#

using System.Collections.Generic;
namespace Highway.Assemble.common
{
public interface ISoftInfo
{
Mode mode { get; set; }
/// <summary>
/// 汇集软件配置信息
/// </summary>
Collect CollectInfo { get; set; }
/// <summary>
/// 设备信息列表
/// </summary>
List<Equip> EquipList { get; set; }
/// <summary>
/// MES信息列表
/// </summary>
List<mesSoft> mesSoftList { get; set; }
/// <summary>
///传感器信息列表
/// </summary>
List<Sensor> SensorList { get; set; }
}
public class SoftInfo : ISoftInfo
{
private List<mesSoft> m_mesSoftList = new List<mesSoft>(20);
public List<Equip> m_EquipList = new List<Equip>(80);
public Mode mode { get; set; } = Mode.Triangle; //这里修改默认值
public Collect CollectInfo { get; set; }
object Equiplock = new object();
/// <summary>
/// 设备信息列表
/// </summary>
public List<Equip> EquipList
{
get
{
lock (Equiplock)
{
return m_EquipList;
}
}
set
{
lock (Equiplock)
{
m_EquipList = value;
}
}
}
object mesSoftlock = new object();
/// <summary>
///MES信息列表
/// </summary>
public List<mesSoft> mesSoftList
{
get
{
lock (mesSoftlock)
{
return m_mesSoftList;
}
}
set
{
lock (mesSoftlock)
{
m_mesSoftList = value;
}
}
}
/// <summary>
///传感器信息列表
/// </summary>
public List<Sensor> SensorList { get; set; }
}
public enum Mode
{/// <summary>
/// 三角轮胎厂
/// </summary>
Triangle = 0,//威海三角轮胎所用的模式未读取到数据返回NoData
/// <summary>
/// 新疆昆仑
/// </summary>
kltyre = 1, //新疆昆仑轮胎厂使用读取不到数据返回空数据 数据位为空
}
}