You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
1.8 KiB
74 lines
1.8 KiB
1 month ago
|
namespace LTEMvcApp.Models
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 日志传输方向常量
|
||
|
/// </summary>
|
||
|
public static class LogDirection
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 无方向
|
||
|
/// </summary>
|
||
|
public const int None = 0;
|
||
|
|
||
|
/// <summary>
|
||
|
/// 上行传输
|
||
|
/// </summary>
|
||
|
public const int UL = 1;
|
||
|
|
||
|
/// <summary>
|
||
|
/// 下行传输
|
||
|
/// </summary>
|
||
|
public const int DL = 2;
|
||
|
|
||
|
/// <summary>
|
||
|
/// 从某处传输
|
||
|
/// </summary>
|
||
|
public const int From = 3;
|
||
|
|
||
|
/// <summary>
|
||
|
/// 传输到某处
|
||
|
/// </summary>
|
||
|
public const int To = 4;
|
||
|
|
||
|
/// <summary>
|
||
|
/// 获取方向名称
|
||
|
/// </summary>
|
||
|
/// <param name="direction">方向值</param>
|
||
|
/// <returns>方向名称</returns>
|
||
|
public static string GetDirectionName(int direction)
|
||
|
{
|
||
|
return direction switch
|
||
|
{
|
||
|
None => "-",
|
||
|
UL => "UL",
|
||
|
DL => "DL",
|
||
|
From => "FROM",
|
||
|
To => "TO",
|
||
|
_ => "UNKNOWN"
|
||
|
};
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 获取所有方向选项
|
||
|
/// </summary>
|
||
|
/// <returns>方向选项列表</returns>
|
||
|
public static List<DirectionOption> GetDirectionOptions()
|
||
|
{
|
||
|
return new List<DirectionOption>
|
||
|
{
|
||
|
new() { Value = None, Text = "-" },
|
||
|
new() { Value = DL, Text = "DL" },
|
||
|
new() { Value = UL, Text = "UL" }
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 方向选项
|
||
|
/// </summary>
|
||
|
public class DirectionOption
|
||
|
{
|
||
|
public int Value { get; set; }
|
||
|
public string Text { get; set; } = string.Empty;
|
||
|
}
|
||
|
}
|