|
|
using System; using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization;
namespace Mirle.Component.API.ProgrammableLogicController.Models { /// <summary>
/// 電梯抵達回報類別
/// </summary>
public class FP023ArrivedLifterReportDto : CommonMessage { /// <summary>
/// 當下任務編號
/// </summary>
/// <remarks>AGVC/SHTC 任務編號</remarks>
[Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)] public string CurrentTaskID { get; set; } /// <summary>
/// 站點編號
/// </summary>
[Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(102)] public string StationID { get; set; } /// <summary>
/// 抵達樓層
/// </summary>
[Required, JsonPropertyName("floor"), JsonPropertyOrder(103)] public int Floor { get; set; } /// <summary>
/// 電梯狀態
/// </summary>
/// <value>
/// 0 = Arrived <br/>
/// 1 = Alarm <br/>
/// </value>
[Required, JsonPropertyName("lifter_status"), JsonPropertyOrder(104)] public LifterStatus LifterStatus { get; set; } } /// <summary>
/// 電梯抵達回應類別
/// </summary>
public class TP024ArrivedLifterAckDto : CommonMessage { /// <summary>
/// 當下任務編號
/// </summary>
/// <remarks>AGVC/SHTC 任務編號</remarks>
[Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)] public string CurrentTaskID { get; set; } /// <summary>
/// 站點編號
/// </summary>
[Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(102)] public string StationID { get; set; } /// <summary>
/// 抵達樓層
/// </summary>
[Required, JsonPropertyName("floor"), JsonPropertyOrder(103)] public int Floor { get; set; } /// <summary>
/// 電梯狀態
/// </summary>
/// <value>
/// 0 = Arrived <br/>
/// 1 = Alarm <br/>
/// </value>
[Required, JsonPropertyName("lifter_status"), JsonPropertyOrder(104)] public LifterStatus LifterStatus { get; set; } /// <summary>
/// 回應代碼
/// </summary>
/// <value>
/// 0 = OK <br/>
/// 1 = NG <br/>
/// </value>
[Required, JsonPropertyName("reply_code"), JsonPropertyOrder(105)] public ReplyCode ReplyCode { get; set; } /// <summary>
/// 取得電梯抵達回應
/// </summary>
/// <param name="transName">交易名稱</param>
/// <param name="softwareID">軟體編號</param>
/// <param name="currentTaskID">當下任務編號</param>
/// <param name="stationID">站點編號</param>
/// <param name="floor">抵達樓層</param>
/// <param name="lifterStatus">電梯狀態</param>
/// <param name="replyCode">回應代碼</param>
/// <returns>電梯抵達回應</returns>
public static TP024ArrivedLifterAckDto Get(TransactionName transName, string softwareID, string currentTaskID, string stationID, int floor, LifterStatus lifterStatus, ReplyCode replyCode) { return new TP024ArrivedLifterAckDto() { Timetick = DateTime.Now, TransactionName = transName.ToTransactionName(), SoftwareID = softwareID, CurrentTaskID = currentTaskID, StationID = stationID, Floor = floor, LifterStatus = lifterStatus, ReplyCode = replyCode }; } } }
|