handcart_breaker.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 HandCartBreaker : UserControl, IPointData
  14. {
  15. private string tagId;
  16. private TsData tagData;
  17. private string breakerTagId;
  18. private TsData breakerTagData;
  19. public HandCartBreaker()
  20. {
  21. InitializeComponent();
  22. }
  23. [Browsable(true), Category("Point")]
  24. public TsData TagData
  25. {
  26. get
  27. {
  28. return tagData;
  29. }
  30. set
  31. {
  32. tagData = value;
  33. if (tagData != null && tagData.booleanValue.HasValue)
  34. {
  35. this.BackgroundImage = tagData.booleanValue.Value ? global::IntelligentControlForsx.Properties.Resources.handcart1 : global::IntelligentControlForsx.Properties.Resources.handcart0;
  36. }
  37. }
  38. }
  39. [Browsable(true), Category("Point")]
  40. public string TagId
  41. {
  42. get
  43. {
  44. return tagId;
  45. }
  46. set
  47. {
  48. tagId = value;
  49. }
  50. }
  51. [Browsable(true), Category("Point")]
  52. public TsData BreakerTagData
  53. {
  54. get
  55. {
  56. return breakerTagData;
  57. }
  58. set
  59. {
  60. breakerTagData = value;
  61. if (breakerTagData != null && breakerTagData.booleanValue.HasValue)
  62. {
  63. this.panel1.BackColor = breakerTagData.booleanValue.Value ? Color.Red : Color.Green;
  64. }
  65. }
  66. }
  67. [Browsable(true), Category("Point")]
  68. public string BreakerTagId
  69. {
  70. get
  71. {
  72. return breakerTagId;
  73. }
  74. set
  75. {
  76. breakerTagId = value;
  77. }
  78. }
  79. }
  80. }