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.

62 lines
2.1 KiB

8 months ago
  1. using System;
  2. using System.ComponentModel.DataAnnotations;
  3. using System.Text.Json.Serialization;
  4. namespace Mirle.Component.API.ProgrammableLogicController.Models
  5. {
  6. /// <summary>
  7. /// 量測物料重量請求類別
  8. /// </summary>
  9. public class TP047MaterialWeightRequestDto : CommonMessage
  10. {
  11. /// <summary>
  12. /// 站點編號
  13. /// </summary>
  14. [Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(101)]
  15. public string StationID { get; set; }
  16. /// <summary>
  17. /// 取得量測物料重量請求
  18. /// </summary>
  19. /// <param name="transName">交易名稱</param>
  20. /// <param name="softwareID">軟體編號</param>
  21. /// <param name="stationID">站點編號</param>
  22. /// <returns>量測物料重量請求</returns>
  23. public static TP047MaterialWeightRequestDto Get(TransactionName transName, string softwareID, string stationID)
  24. {
  25. return new TP047MaterialWeightRequestDto()
  26. {
  27. Timetick = DateTime.Now,
  28. TransactionName = transName.ToTransactionName(),
  29. SoftwareID = softwareID,
  30. StationID = stationID
  31. };
  32. }
  33. }
  34. /// <summary>
  35. /// 量測物料重量回應類別
  36. /// </summary>
  37. public class FP048MaterialWeightResponseDto : CommonMessage
  38. {
  39. /// <summary>
  40. /// 站點編號
  41. /// </summary>
  42. [Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(101)]
  43. public string StationID { get; set; }
  44. /// <summary>
  45. /// 物料重量
  46. /// </summary>
  47. [Required, JsonPropertyName("material_weight"), JsonPropertyOrder(102)]
  48. public int MaterialWeight { get; set; }
  49. /// <summary>
  50. /// 結果代碼
  51. /// </summary>
  52. /// <value>
  53. /// 0 = Success <br/>
  54. /// 1 = Too Light <br/>
  55. /// 2 = Too Heavy <br/>
  56. /// 3 = No Weight <br/>
  57. /// </value>
  58. [Required, JsonPropertyName("result_code"), JsonPropertyOrder(103)]
  59. public MaterialInspectResultCode ResultCode { get; set; }
  60. }
  61. }