Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class OutControl
- {
- //---------Первая группа---------//
- public const byte Call = 0x00;
- public const byte Nop = 0x01;
- public const byte Alarm = 0x02;
- public const byte Warning = 0x03;
- public const byte Nol = 0x04;
- public const byte Action = 0x05;
- public const byte Pull = 0x06;
- //---------Вторая группа---------//
- public const byte Push = 0x00;
- public const byte Buzzer = 0x01;
- public const byte Temp = 0x02;
- public const byte Ring = 0x03;
- public const byte SwitchOff = 0x04;
- public const byte SwitchOn = 0x05;
- public const byte Reverse = 0x06;
- public const byte Reserve = 0x07;
- //-------Опкоды для записи в определенный блок------//
- public const byte FirstBlock = 0x06;
- public const byte SecondBlock = 0x07;
- }
- static void Main(string[] args)
- {
- Facade facade = new Facade();
- facade.SetData(Model.OutControl.Buzzer, true);
- }
- public class Facade
- {
- private Model.OutControl _outs;
- public Facade()
- {
- _outs = new Model.OutControl();
- }
- public void SetData(byte outs, bool action)
- {
- switch (как можно перелючать?)
- {
- case ?:
- _outs.Set(Model.OutControl.FirstBlock, outs, action);
- break;
- case ?:
- _outs.Set(Model.OutControl.SecondBlock, outs, action);
- break;
- }
- }
- }
Add Comment
Please, Sign In to add comment