using System;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace Mirle.Component.API.ProgrammableLogicController.Models
{
///
/// 操作模式請求類別
///
public class FP043OperationModeReportDto : CommonMessage
{
///
/// 操作模式
///
///
/// 0 = Online Reomte
/// 1 = Online Local
/// 2 = Offline
///
[Required, JsonPropertyName("operation_mode"), JsonPropertyOrder(101)]
public OperationMode OperationMode { get; set; }
}
///
/// 操作模式回應類別
///
public class TP044OperationModeAckDto : CommonMessage
{
///
/// 操作模式
///
///
/// 0 = Online Reomte
/// 1 = Online Local
/// 2 = Offline
///
[Required, JsonPropertyName("operation_mode"), JsonPropertyOrder(101)]
public OperationMode OperationMode { get; set; }
///
/// 結果代碼
///
///
/// 0 = OK
/// 1 = NG
///
[Required, JsonPropertyName("reply_code"), JsonPropertyOrder(102)]
public ReplyCode ReplyCode { get; set; }
///
/// 取得操作模式回應
///
/// 交易名稱
/// 軟體編號
/// 操作模式
/// 回應代碼
/// 操作模式回應
public static TP044OperationModeAckDto Get(TransactionName transName, string softwareID, OperationMode operationMode, ReplyCode replyCode)
{
return new TP044OperationModeAckDto()
{
Timetick = DateTime.Now,
TransactionName = transName.ToTransactionName(),
SoftwareID = softwareID,
OperationMode = operationMode,
ReplyCode = replyCode
};
}
}
}