HandCart.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using WisdomClient.data;
  11. namespace IntelligentControlForsx.MyControls
  12. {
  13. public partial class HandCart : UserControl, IPointData
  14. {
  15. private string tagId;
  16. private TsData tagData;
  17. private bool PointValue = false;
  18. public HandCart()
  19. {
  20. InitializeComponent();
  21. }
  22. [Browsable(true), Category("Point")]
  23. public TsData TagData
  24. {
  25. get
  26. {
  27. return tagData;
  28. }
  29. set
  30. {
  31. tagData = value;
  32. if (tagData != null && tagData.booleanValue.HasValue)
  33. {
  34. if (PointValue != tagData.booleanValue)
  35. {
  36. Console.WriteLine("断路器测点发生变化" + tagData.booleanValue.Value);
  37. this.BackgroundImage = tagData.booleanValue.Value ? global::IntelligentControlForsx.Properties.Resources.handcart1 : global::IntelligentControlForsx.Properties.Resources.handcart0;
  38. PointValue = tagData.booleanValue.Value;
  39. }
  40. }
  41. }
  42. }
  43. [Browsable(true), Category("Point")]
  44. public string TagId
  45. {
  46. get
  47. {
  48. return tagId;
  49. }
  50. set
  51. {
  52. tagId = value;
  53. }
  54. }
  55. }
  56. }