Breaker.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 Breaker : UserControl, IPointData
  14. {
  15. private string tagId;
  16. private TsData tagData;
  17. private bool? PointValue = null;
  18. public Breaker()
  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.HasValue)
  35. {
  36. if (PointValue != tagData.booleanValue.Value)
  37. {
  38. this.BackColor = tagData.booleanValue.Value ? Color.Red : Color.Green;
  39. PointValue = tagData.booleanValue.Value;
  40. }
  41. }
  42. else
  43. {
  44. this.BackColor = tagData.booleanValue.Value ? Color.Red : Color.Green;
  45. PointValue = tagData.booleanValue.Value;
  46. }
  47. }
  48. }
  49. }
  50. [Browsable(true), Category("Point")]
  51. public string TagId
  52. {
  53. get
  54. {
  55. return tagId;
  56. }
  57. set
  58. {
  59. tagId = value;
  60. }
  61. }
  62. private void Breaker_Load(object sender, EventArgs e)
  63. {
  64. }
  65. }
  66. }