UserVarCurrentValue.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using Sunny.UI;
  11. namespace Scada
  12. {
  13. public partial class UserVarCurrentValue : UIUserControl
  14. {
  15. public UserVarCurrentValue()
  16. {
  17. InitializeComponent();
  18. }
  19. // 设置设备名称
  20. private string deviceVarName = "名称";
  21. [Description("设置或获取设备变量名称")]
  22. [Category("自定义属性")]
  23. [Browsable(true)]
  24. public string DeviceVarName
  25. {
  26. get { return deviceVarName; }
  27. set
  28. {
  29. deviceVarName = value;
  30. this.lbl_Name.Text = value;
  31. }
  32. }
  33. private float varValue;
  34. [Description("设置或获取设备变量值")]
  35. [Category("自定义属性")]
  36. [Browsable(true)]
  37. public float VarValue
  38. {
  39. get { return varValue; }
  40. set
  41. {
  42. varValue = value;
  43. this.dl_Value.Value = varValue;
  44. }
  45. }
  46. private string unit = "单位";
  47. [Description("设置或获取单位")]
  48. [Category("自定义属性")]
  49. [Browsable(true)]
  50. public string Unit
  51. {
  52. get { return unit; }
  53. set
  54. {
  55. unit = value;
  56. this.lbl_Unit.Text = unit;
  57. }
  58. }
  59. private string variableName = "";
  60. [Browsable(true)]
  61. [Category("自定义属性")]
  62. [Description("获取变量名称")]
  63. public string VariableName
  64. {
  65. get { return variableName; }
  66. set { variableName = value; }
  67. }
  68. }
  69. }