You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

67 lines
2.2 KiB

using System;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace Mirle.Component.API.ProgrammableLogicController.Models
{
/// <summary>
/// 操作模式請求類別
/// </summary>
public class FP043OperationModeReportDto : CommonMessage
{
/// <summary>
/// 操作模式
/// </summary>
/// <value>
/// 0 = Online Reomte <br/>
/// 1 = Online Local <br/>
/// 2 = Offline <br/>
/// </value>
[Required, JsonPropertyName("operation_mode"), JsonPropertyOrder(101)]
public OperationMode OperationMode { get; set; }
}
/// <summary>
/// 操作模式回應類別
/// </summary>
public class TP044OperationModeAckDto : CommonMessage
{
/// <summary>
/// 操作模式
/// </summary>
/// <value>
/// 0 = Online Reomte <br/>
/// 1 = Online Local <br/>
/// 2 = Offline <br/>
/// </value>
[Required, JsonPropertyName("operation_mode"), JsonPropertyOrder(101)]
public OperationMode OperationMode { get; set; }
/// <summary>
/// 結果代碼
/// </summary>
/// <value>
/// 0 = OK <br/>
/// 1 = NG <br/>
/// </value>
[Required, JsonPropertyName("reply_code"), JsonPropertyOrder(102)]
public ReplyCode ReplyCode { get; set; }
/// <summary>
/// 取得操作模式回應
/// </summary>
/// <param name="transName">交易名稱</param>
/// <param name="softwareID">軟體編號</param>
/// <param name="operationMode">操作模式</param>
/// <param name="replyCode">回應代碼</param>
/// <returns>操作模式回應</returns>
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
};
}
}
}