35 lines
785 B
C#
35 lines
785 B
C#
using RobotNet.VDA5050.State;
|
|
using RobotNet10.RobotApp.Interfaces;
|
|
|
|
namespace RobotNet10.RobotApp.Services.Robot;
|
|
|
|
public class RobotInfomations() : IInfomation
|
|
{
|
|
public Information[] InformationState => [.. Infors];
|
|
private readonly List<Information> Infors = [];
|
|
public void AddInfo(Information infor)
|
|
{
|
|
if (Infors.Any(e => e.InfoType == infor.InfoType)) return;
|
|
lock (Infors)
|
|
{
|
|
Infors.Add(infor);
|
|
}
|
|
}
|
|
|
|
public void DeleteInfoType(string infoType)
|
|
{
|
|
lock (Infors)
|
|
{
|
|
Infors.RemoveAll(e => e.InfoType == infoType);
|
|
}
|
|
}
|
|
|
|
public void ClearAllInfos()
|
|
{
|
|
lock (Infors)
|
|
{
|
|
Infors.Clear();
|
|
}
|
|
}
|
|
}
|