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.
92 lines
3.4 KiB
92 lines
3.4 KiB
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace Mirle.Component.API.ProgrammableLogicController.Models
|
|
{
|
|
/// <summary>
|
|
/// 鐵捲門狀態回報類別
|
|
/// </summary>
|
|
public class FP039RollingDoorStatusReportDto : CommonMessage
|
|
{
|
|
/// <summary>
|
|
/// 當下任務編號
|
|
/// </summary>
|
|
/// <remarks>S[YYYYMMDDHH][SEQ * 5]</remarks>
|
|
[Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)]
|
|
public string CurrentTaskID { get; set; }
|
|
/// <summary>
|
|
/// 鐵捲門編號
|
|
/// </summary>
|
|
[Required, StringLength(9), JsonPropertyName("rolling_door_id"), JsonPropertyOrder(102)]
|
|
public string RollingDoorID { get; set; }
|
|
/// <summary>
|
|
/// 鐵捲門狀態
|
|
/// </summary>
|
|
/// <value>
|
|
/// 0 = Opne <br/>
|
|
/// 1 = Close <br/>
|
|
/// </value>
|
|
[Required, JsonPropertyName("rolling_door_status"), JsonPropertyOrder(103)]
|
|
public RollingDoorStatus RollingDoorStatus { get; set; }
|
|
}
|
|
/// <summary>
|
|
/// 鐵捲門狀態回應類別
|
|
/// </summary>
|
|
public class TP040RollingDoorStatusAckDto : CommonMessage
|
|
{
|
|
/// <summary>
|
|
/// 當下任務編號
|
|
/// </summary>
|
|
/// <remarks>S[YYYYMMDDHH][SEQ * 5]</remarks>
|
|
[Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)]
|
|
public string CurrentTaskID { get; set; }
|
|
/// <summary>
|
|
/// 鐵捲門編號
|
|
/// </summary>
|
|
[Required, StringLength(9), JsonPropertyName("rolling_door_id"), JsonPropertyOrder(102)]
|
|
public string RollingDoorID { get; set; }
|
|
/// <summary>
|
|
/// 鐵捲門狀態
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// 0 = Open <br/>
|
|
/// 1 = Close <br/>
|
|
/// </remarks>
|
|
[Required, JsonPropertyName("rolling_door_status"), JsonPropertyOrder(103)]
|
|
public RollingDoorStatus RollingDoorStatus { get; set; }
|
|
/// <summary>
|
|
/// 回應代碼
|
|
/// </summary>
|
|
/// <value>
|
|
/// 0 = OK <br/>
|
|
/// 1 = NG <br/>
|
|
/// </value>
|
|
[Required, JsonPropertyName("reply_code"), JsonPropertyOrder(104)]
|
|
public ReplyCode ReplyCode { get; set; }
|
|
/// <summary>
|
|
/// 取得鐵捲門狀態回應
|
|
/// </summary>
|
|
/// <param name="transName">交易名稱</param>
|
|
/// <param name="softwareID">軟體編號</param>
|
|
/// <param name="currentTaskID">當前任務編號</param>
|
|
/// <param name="rollingDoorID">鐵捲門編號</param>
|
|
/// <param name="status">鐵捲門狀態</param>
|
|
/// <param name="replyCode">回應代碼</param>
|
|
/// <returns>鐵捲門狀態回應</returns>
|
|
public static TP040RollingDoorStatusAckDto Get(TransactionName transName, string softwareID,
|
|
string currentTaskID, string rollingDoorID, RollingDoorStatus status, ReplyCode replyCode)
|
|
{
|
|
return new TP040RollingDoorStatusAckDto()
|
|
{
|
|
Timetick = DateTime.Now,
|
|
TransactionName = transName.ToTransactionName(),
|
|
SoftwareID = softwareID,
|
|
CurrentTaskID = currentTaskID,
|
|
RollingDoorID = rollingDoorID,
|
|
RollingDoorStatus = status,
|
|
ReplyCode = replyCode
|
|
};
|
|
}
|
|
}
|
|
}
|