Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Bit 0 - 1: Contrast (0=Low / 1 = Medium / 2=high)
- Bit 2 - 3: Speech volume (0=Low / 1 = Medium / 2 = High)
- Bit 4 – 5: Buzzer volume (0=Low / 1 = Medium / 2 = High)
- Bit 6: Entry/exit indication
- [Flags]
- public enum RKP
- {
- Contrast0 = 1, // bit 0
- Contrast1 = 2, // bit 1
- SpeechVolume2 = 4, // bit 2
- SpeechVolume3 = 8, // bit 3
- BuzzerVolume4 = 16, // bit 4
- BuzzerVolume5 = 32, // bit 5
- EntryExitIndication = 64, // bit 6
- }
- [Flags]
- public enum RKP
- {
- LowContrast = 0,
- MediumContrast = 1, // bit 0
- HighContrast = 2, // bit 1
- LowSpeechVolume = 0,
- MediumSpeechVolume = 4, // bit 2
- HighSpeechVolume = 8, // bit 3
- LowBuzzerVolume = 0,
- MediumBuzzerVolume = 16, // bit 4
- HighBuzzerVolume = 32, // bit 5
- ExitIndication = 0,
- EntryIndication = 64, // bit 6
- }
- contrastComboBox.ItemsSource = new[] { RKP.LowContrast, RKP.MediumContrast, RKP.HighContrast };
- contrastComboBox.SelectedItem = currentValue & (RKP.MediumContrast | RKP.HighContrast);
- //and so on for each combo box...
- //and when you want the result:
- RKP combinedFlag = (RKP)contrastComboBox.SelectedItem | //other combo box items
Add Comment
Please, Sign In to add comment