using System; using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Mirle.Component.API.ProgrammableLogicController.Models { /// /// 鐵捲門狀態回報類別 /// public class FP039RollingDoorStatusReportDto : CommonMessage { /// /// 當下任務編號 /// /// S[YYYYMMDDHH][SEQ * 5] [Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)] public string CurrentTaskID { get; set; } /// /// 鐵捲門編號 /// [Required, StringLength(9), JsonPropertyName("rolling_door_id"), JsonPropertyOrder(102)] public string RollingDoorID { get; set; } /// /// 鐵捲門狀態 /// /// /// 0 = Opne
/// 1 = Close
///
[Required, JsonPropertyName("rolling_door_status"), JsonPropertyOrder(103)] public RollingDoorStatus RollingDoorStatus { get; set; } } /// /// 鐵捲門狀態回應類別 /// public class TP040RollingDoorStatusAckDto : CommonMessage { /// /// 當下任務編號 /// /// S[YYYYMMDDHH][SEQ * 5] [Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)] public string CurrentTaskID { get; set; } /// /// 鐵捲門編號 /// [Required, StringLength(9), JsonPropertyName("rolling_door_id"), JsonPropertyOrder(102)] public string RollingDoorID { get; set; } /// /// 鐵捲門狀態 /// /// /// 0 = Open
/// 1 = Close
///
[Required, JsonPropertyName("rolling_door_status"), JsonPropertyOrder(103)] public RollingDoorStatus RollingDoorStatus { get; set; } /// /// 回應代碼 /// /// /// 0 = OK
/// 1 = NG
///
[Required, JsonPropertyName("reply_code"), JsonPropertyOrder(104)] public ReplyCode ReplyCode { get; set; } /// /// 取得鐵捲門狀態回應 /// /// 交易名稱 /// 軟體編號 /// 當前任務編號 /// 鐵捲門編號 /// 鐵捲門狀態 /// 回應代碼 /// 鐵捲門狀態回應 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 }; } } }