[UI.Core]

将AlarmItem对象从MonitorViewModel.cs文件中分离独立。
AlarmItem增加注释。
This commit is contained in:
DESKTOP-1N1NK8A\auvkk 2023-05-09 14:30:12 +08:00
parent a7786e6563
commit 623c7a1b56
3 changed files with 82 additions and 23 deletions

View File

@ -445,6 +445,7 @@
<Compile Include="ValidationRules\ValidateEmailAddress.cs" />
<Compile Include="ValidationRules\ValidatePhoneNumber.cs" />
<Compile Include="ValidationRules\ValidateUserName.cs" />
<Compile Include="View\Common\AlarmItem.cs" />
<Compile Include="View\Common\FolderTreeViewItem.cs" />
<Compile Include="View\Common\MonitorView.xaml.cs">
<DependentUpon>MonitorView.xaml</DependentUpon>

View File

@ -0,0 +1,80 @@
using System.Windows.Media;
using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot;
namespace Aitex.Core.UI.View.Common
{
/// <summary>
/// 应用于UI端显示的报警信息对象。
/// </summary>
public class AlarmItem
{
#region Properties
/// <summary>
/// 设置或返回报警发生的时间。
/// </summary>
public string OccuringTime { get; set; }
/// <summary>
/// 设置或返回报警描述。
/// </summary>
public string Description { get; set; }
/// <summary>
/// 设置或返回报警信息文本显示的颜色。
/// </summary>
public Brush TextColor { get; set; }
/// <summary>
/// 设置或返回报警类型。
/// <remarks>
/// 可用的报警类型请参考<see cref="EventType"/>枚举。
/// </remarks>
/// </summary>
public string Type { get; set; }
/// <summary>
/// 设置或返回报警编号。
/// </summary>
public int EventId { get; set; }
/// <summary>
/// 设置或返回报警名称。
/// </summary>
public string EventEnum { get; set; }
/// <summary>
/// 设置或返回报警的详细解释。
/// </summary>
public string Explaination { get; set; }
/// <summary>
/// 设置或返回报警的处理方法描述。
/// </summary>
public string Solution { get; set; }
/// <summary>
/// 设置或返回报警来源。
/// </summary>
public string Source { get; set; }
#endregion
#region Methods
/// <summary>
/// 判断当前报警信息是否和指定的报警信息相同。
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
public bool IsEqualTo(AlarmItem item)
{
return item.OccuringTime == OccuringTime &&
item.Description == Description &&
item.Type == Type;
}
#endregion
}
}

View File

@ -1,32 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.Windows.Media;
using Aitex.Core.RT.Event;
using Aitex.Core.UI.MVVM;
namespace Aitex.Core.UI.View.Common
{
public class AlarmItem
{
public string OccuringTime { get; set; }
public string Description { get; set; }
public Brush TextColor { get; set; }
public string Type { get; set; }
public bool IsEqualTo(AlarmItem item)
{
return item.OccuringTime == OccuringTime &&
item.Description == Description &&
item.Type == Type;
}
public int EventId { get; set; }
public string EventEnum { get; set; }
public string Explaination { get; set; }
public string Solution { get; set; }
public string Source { get; set; }
}
public class MonitorViewModel : ViewModelBase
{
public List<AlarmItem> AlarmEvents { get; set; }