WcsDevice.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. namespace WCS.Entitys;
  2. using Microsoft.EntityFrameworkCore;
  3. using System;
  4. using System.ComponentModel.DataAnnotations;
  5. using System.ComponentModel.DataAnnotations.Schema;
  6. [Table("wcs_device")]
  7. public class WcsDevice
  8. {
  9. [Key]
  10. [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
  11. public int Id { get; set; }
  12. [Required]
  13. [StringLength(20)]
  14. public string Ip { get; set; }
  15. [Required]
  16. [StringLength(20)]
  17. [Column("protocol_type")]
  18. public string ProtocolType { get; set; }
  19. [Required]
  20. public bool State { get; set; } = true;
  21. [Required]
  22. [Column("use_state")]
  23. public bool UseState { get; set; } = false;
  24. [StringLength(100)]
  25. public string? Description { get; set; }
  26. [Column("disconnect_update_time")]
  27. public DateTime? DisconnectUpdateTime { get; set; }
  28. [Column("offline_update_time")]
  29. public DateTime? OfflineUpdateTime { get; set; }
  30. [Column("timeout_remind_duration", TypeName = "decimal(5,2)")]
  31. public decimal? TimeoutRemindDuration { get; set; }
  32. }
  33. /// <summary>
  34. /// 协议类型
  35. /// </summary>
  36. public enum ProtocalTypeEnum
  37. {
  38. OPCUA,
  39. S7_1500,
  40. S7_1200,
  41. S7_400,
  42. S7_300,
  43. FTP,
  44. FANUC,
  45. HEIDEHAIN
  46. }