using System;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace Mirle.Component.API.ProgrammableLogicController.Models
{
///
/// 電梯抵達回報類別
///
public class FP023ArrivedLifterReportDto : CommonMessage
{
///
/// 當下任務編號
///
/// AGVC/SHTC 任務編號
[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(103)]
public int Floor { get; set; }
///
/// 電梯狀態
///
///
/// 0 = Arrived
/// 1 = Alarm
///
[Required, JsonPropertyName("lifter_status"), JsonPropertyOrder(104)]
public LifterStatus LifterStatus { get; set; }
}
///
/// 電梯抵達回應類別
///
public class TP024ArrivedLifterAckDto : CommonMessage
{
///
/// 當下任務編號
///
/// AGVC/SHTC 任務編號
[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(103)]
public int Floor { get; set; }
///
/// 電梯狀態
///
///
/// 0 = Arrived
/// 1 = Alarm
///
[Required, JsonPropertyName("lifter_status"), JsonPropertyOrder(104)]
public LifterStatus LifterStatus { get; set; }
///
/// 回應代碼
///
///
/// 0 = OK
/// 1 = NG
///
[Required, JsonPropertyName("reply_code"), JsonPropertyOrder(105)]
public ReplyCode ReplyCode { get; set; }
///
/// 取得電梯抵達回應
///
/// 交易名稱
/// 軟體編號
/// 當下任務編號
/// 站點編號
/// 抵達樓層
/// 電梯狀態
/// 回應代碼
/// 電梯抵達回應
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
};
}
}
}