using System; using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Mirle.Component.API.ProgrammableLogicController.Models { /// /// 量測物料重量請求類別 /// public class TP047MaterialWeightRequestDto : CommonMessage { /// /// 站點編號 /// [Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(101)] public string StationID { get; set; } /// /// 取得量測物料重量請求 /// /// 交易名稱 /// 軟體編號 /// 站點編號 /// 量測物料重量請求 public static TP047MaterialWeightRequestDto Get(TransactionName transName, string softwareID, string stationID) { return new TP047MaterialWeightRequestDto() { Timetick = DateTime.Now, TransactionName = transName.ToTransactionName(), SoftwareID = softwareID, StationID = stationID }; } } /// /// 量測物料重量回應類別 /// public class FP048MaterialWeightResponseDto : CommonMessage { /// /// 站點編號 /// [Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(101)] public string StationID { get; set; } /// /// 物料重量 /// [Required, JsonPropertyName("material_weight"), JsonPropertyOrder(102)] public int MaterialWeight { get; set; } /// /// 結果代碼 /// /// /// 0 = Success
/// 1 = Too Light
/// 2 = Too Heavy
/// 3 = No Weight
///
[Required, JsonPropertyName("result_code"), JsonPropertyOrder(103)] public MaterialInspectResultCode ResultCode { get; set; } } }