Guest User

Untitled

a guest
Feb 18th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. public class OutControl
  2. {
  3. //---------Первая группа---------//
  4.  
  5. public const byte Call = 0x00;
  6. public const byte Nop = 0x01;
  7. public const byte Alarm = 0x02;
  8. public const byte Warning = 0x03;
  9. public const byte Nol = 0x04;
  10. public const byte Action = 0x05;
  11. public const byte Pull = 0x06;
  12.  
  13. //---------Вторая группа---------//
  14.  
  15. public const byte Push = 0x00;
  16. public const byte Buzzer = 0x01;
  17. public const byte Temp = 0x02;
  18. public const byte Ring = 0x03;
  19. public const byte SwitchOff = 0x04;
  20. public const byte SwitchOn = 0x05;
  21. public const byte Reverse = 0x06;
  22. public const byte Reserve = 0x07;
  23.  
  24. //-------Опкоды для записи в определенный блок------//
  25.  
  26. public const byte FirstBlock = 0x06;
  27. public const byte SecondBlock = 0x07;
  28. }
  29.  
  30. static void Main(string[] args)
  31. {
  32. Facade facade = new Facade();
  33.  
  34. facade.SetData(Model.OutControl.Buzzer, true);
  35. }
  36.  
  37. public class Facade
  38. {
  39. private Model.OutControl _outs;
  40.  
  41. public Facade()
  42. {
  43. _outs = new Model.OutControl();
  44. }
  45.  
  46. public void SetData(byte outs, bool action)
  47. {
  48. switch (как можно перелючать?)
  49. {
  50. case ?:
  51. _outs.Set(Model.OutControl.FirstBlock, outs, action);
  52. break;
  53.  
  54. case ?:
  55. _outs.Set(Model.OutControl.SecondBlock, outs, action);
  56. break;
  57. }
  58. }
  59. }
Add Comment
Please, Sign In to add comment