using System;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace Mirle.Component.API.ProgrammableLogicController.Models
{
///
/// 鎖定庫區命令派送回報類別
///
public class FP045LockStorageDispatchReportDto : CommonMessage
{
///
/// 站點編號
///
[Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(101)]
public string StationID { get; set; }
///
/// 庫區事件
///
///
/// 0 = Lock
/// 1 = Unlock
///
[Required, JsonPropertyName("event_type"), JsonPropertyOrder(102)]
public DispatchEvent EventType { get; set; }
}
///
/// 鎖定庫區命令派送回應類別
///
public class TP046LockStorageDispatchAckDto : CommonMessage
{
///
/// 站點編號
///
[Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(101)]
public string StationID { get; set; }
///
/// 庫區事件
///
///
/// 0 = Lock
/// 1 = Unlock
///
[Required, JsonPropertyName("event_type"), JsonPropertyOrder(102)]
public DispatchEvent EventType { get; set; }
///
/// 回應代碼
///
///
/// 0 = OK
/// 1 = NG
///
[Required, JsonPropertyName("reply_code"), JsonPropertyOrder(103)]
public ReplyCode ReplyCode { get; set; }
///
/// 取得鎖定庫區命令派送回應
///
/// 交易名稱
/// 軟體編號
/// 站點編號
/// 事件類別
/// 回應代碼
/// 鎖定庫區命令派送回應
public static TP046LockStorageDispatchAckDto Get(TransactionName transName, string softwareID,
string stationID, DispatchEvent eventType, ReplyCode replyCode)
{
return new TP046LockStorageDispatchAckDto()
{
Timetick = DateTime.Now,
TransactionName = transName.ToTransactionName(),
SoftwareID = softwareID,
StationID = stationID,
EventType = eventType,
ReplyCode = replyCode
};
}
}
}