InfoBase.cs 680 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace ProjectManagementSystem.Device.CasunBox
  7. {
  8. public abstract class InfoBase
  9. {
  10. public string Name { get; set; }
  11. public EnumBoxDevice EBoxDevice { get; set; }
  12. public DateTime LastUpdateTime { get; set; }
  13. public bool DataValid
  14. {
  15. get { return (DateTime.Now - LastUpdateTime).TotalSeconds < 5; }
  16. }
  17. public bool CheckXOR { get; set; }
  18. public abstract InfoBase Deserialize(byte[] data);
  19. }
  20. public enum EnumBoxDevice
  21. {
  22. CallBox,
  23. WarningLight
  24. }
  25. }