SysSettingPara.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. using System;
  2. using System.ComponentModel;
  3. using System.Windows.Forms;
  4. namespace BaseLibRWFile
  5. {
  6. public class SysSettingPara
  7. {
  8. private ushort iMotionCardIOPage = 1;
  9. private ushort iPLCIOPage = 1;
  10. private ushort iIOCardIOPage = 1;
  11. private ushort iRobotIOPage = 1;
  12. public static SysSettingPara Instance { set; get; } = new SysSettingPara();
  13. [Browsable(false)]
  14. public string StrSysSettingFilePath { get; } = $"{GlobalPara.BaseFilePath}\\Config\\SystemConfig.xml";
  15. [Category("界面")]
  16. [Description("手动CPK界面")]
  17. public bool CPK界面 { set; get; } = false;
  18. [Category("界面")]
  19. [Description("手动GRR界面")]
  20. public bool GRR界面 { set; get; } = false;
  21. [Category("界面")]
  22. [Description("手动网口界面")]
  23. public bool 网口界面 { set; get; } = false;
  24. [Category("界面")]
  25. [Description("手动串口界面")]
  26. public bool 串口界面 { set; get; } = false;
  27. [Category("IO页数")]
  28. [Description("轴卡IO界面页数")]
  29. public ushort 轴卡
  30. {
  31. get { return iMotionCardIOPage; }
  32. set
  33. {
  34. iMotionCardIOPage = value;
  35. if (iMotionCardIOPage > 10)
  36. {
  37. iMotionCardIOPage = 1;
  38. MessageBox.Show($"页数不能大于10","Tips");
  39. }
  40. }
  41. }
  42. [Category("IO页数")]
  43. [Description("PLCIO界面页数")]
  44. public ushort PLC
  45. {
  46. get { return iPLCIOPage; }
  47. set
  48. {
  49. iPLCIOPage = value;
  50. if (iPLCIOPage > 10)
  51. {
  52. iPLCIOPage = 1;
  53. MessageBox.Show($"页数不能大于10", "Tips");
  54. }
  55. }
  56. }
  57. [Category("IO页数")]
  58. [Description("机械手IO界面页数")]
  59. public ushort 机械手
  60. {
  61. get { return iRobotIOPage; }
  62. set
  63. {
  64. iRobotIOPage = value;
  65. if (iRobotIOPage > 10)
  66. {
  67. iRobotIOPage = 1;
  68. MessageBox.Show($"页数不能大于10", "Tips");
  69. }
  70. }
  71. }
  72. [Category("IO页数")]
  73. [Description("IO卡IO界面页数")]
  74. public ushort IO卡
  75. {
  76. get { return iIOCardIOPage; }
  77. set
  78. {
  79. iIOCardIOPage = value;
  80. if (iIOCardIOPage > 10)
  81. {
  82. iIOCardIOPage = 1;
  83. MessageBox.Show($"页数不能大于10", "Tips");
  84. }
  85. }
  86. }
  87. }
  88. }