using System;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace Mirle.Component.API.ProgrammableLogicController.Models
{
///
/// 完成電梯命令回報類別
///
public class FP057FinishLifterCommandReportDto : CommonMessage
{
///
/// 當下任務編號
///
/// A[YYYYMMDDHH][Sequnce * 5]/S[YYYYMMDDHH][Sequnce * 5]
[Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)]
public string CurrentTaskID { get; set; }
///
/// 站點編號
///
[Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(102)]
public string StationID { get; set; }
///
/// 抵達樓層
///
[Required, JsonPropertyName("floor"), JsonPropertyOrder(102)]
public int Floor { get; set; }
///
/// 電梯狀態
///
///
/// 0 = Arrived
/// 1 = Alarm
///
[Required, JsonPropertyName("lifter_status"), JsonPropertyOrder(103)]
public LifterStatus LifterStatus { get; set; }
}
///
/// 完成電梯命令回應類別
///
public class TP058FinishLifterCommandAckDto : CommonMessage
{
///
/// 當下任務編號
///
/// A[YYYYMMDDHH][Sequnce * 5]/S[YYYYMMDDHH][Sequnce * 5]
[Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)]
public string CurrentTaskID { get; set; }
///
/// 抵達樓層
///
[Required, JsonPropertyName("floor"), JsonPropertyOrder(102)]
public int Floor { get; set; }
///
/// 結果代碼
///
///
/// 0 = OK
/// 1 = NG
///
[Required, JsonPropertyName("result_code"), JsonPropertyOrder(103)]
public ReplyCode ReplyCode { get; set; }
///
/// 取得完成電梯命令回應
///
/// 交易名稱
/// 軟體編號
/// 當下任務編號
/// 抵達樓層
/// 回應代碼
/// 完成電梯命令回應
public static TP058FinishLifterCommandAckDto Get(TransactionName transName, string softwareID,
string currentTaskID, int floor, ReplyCode replyCode)
{
return new TP058FinishLifterCommandAckDto()
{
Timetick = DateTime.Now,
TransactionName = transName.ToTransactionName(),
SoftwareID = softwareID,
CurrentTaskID = currentTaskID,
Floor = floor,
ReplyCode = replyCode
};
}
}
}