TsData.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace WisdomClient.data
  6. {
  7. public class TsData
  8. {
  9. public long ts { get; set; }
  10. public short status { get; set; }
  11. public double? doubleValue { get; set; }
  12. public bool? booleanValue { get; set; }
  13. public long? longValue { get; set; }
  14. public String stringValue { get; set; }
  15. public String blobValue { get; set; }
  16. public Coordinate coordinateValue { get; set; }
  17. public String getValue()
  18. {
  19. if (doubleValue.HasValue)
  20. return doubleValue.ToString();
  21. else if (booleanValue.HasValue)
  22. return booleanValue.ToString();
  23. else if (longValue.HasValue)
  24. return longValue.ToString();
  25. else if (stringValue != null)
  26. return stringValue;
  27. else if (blobValue != null)
  28. return blobValue;
  29. else if (coordinateValue != null)
  30. return coordinateValue.ToString();
  31. return "invalid value";
  32. }
  33. public override string ToString()
  34. {
  35. return String.Format("ts={0}, value={1}", ts, this.getValue());
  36. }
  37. }
  38. }