protected override List <IOptionEntry> generateEntries(CameraOptionsUI options, string libraryVersion)
        {
            List <IOptionEntry> entries = new List <IOptionEntry>();

            OptionsCategory GainCategory = new OptionsCategory("Gain");

            entries.Add(GainCategory);

            FloatEntry GainEntry = new FloatEntry("Gain", new Property <FlirProperties, FloatNode>(nameof(options.FakeProperties.Gain)), options.Stream);

            GainEntry.Parent = GainCategory;

            EnumEntry <GainAutoEnums> AutoGainEntry = new EnumEntry <GainAutoEnums>("Auto Gain", GainAutoEnums.Off, GainAutoEnums.NUM_GAINAUTO, new Property <FlirProperties, EnumNode <GainAutoEnums> >(nameof(options.FakeProperties.GainAuto)), options.Stream);

            AutoGainEntry.Parent = GainCategory;

            FloatEntry UpperGainEntry = new FloatEntry("  - Upper Limit", new Property <FlirProperties, FloatNode>(nameof(options.FakeProperties.AutoGainUpperLimit)), options.Stream);

            UpperGainEntry.Parent = GainCategory;

            FloatEntry LowerGainEntry = new FloatEntry("  - Lower Limit", new Property <FlirProperties, FloatNode>(nameof(options.FakeProperties.AutoGainLowerLimit)), options.Stream);

            LowerGainEntry.Parent = GainCategory;

            return(entries);
        }
Example #2
0
        protected override List <IOptionEntry> generateEntries(CameraOptionsUI options, string libraryVersion)
        {
            List <IOptionEntry> entries = new List <IOptionEntry>();

            OptionsCategory ExposureCategory = new OptionsCategory("Exposure");

            entries.Add(ExposureCategory);

            EnumEntry <ExposureAutoEnums> ExposureAutoEntry = new EnumEntry <ExposureAutoEnums>("Auto Exposure", ExposureAutoEnums.Continuous, ExposureAutoEnums.NUM_EXPOSUREAUTO, new Property <FlirProperties, EnumNode <ExposureAutoEnums> >(nameof(options.FakeProperties.ExposureAuto)), options.Stream);

            ExposureAutoEntry.Parent = ExposureCategory;

            FloatEntry UpperExposureEntry = new FloatEntry("  - Upper Limit", new Property <FlirProperties, FloatNode>(nameof(options.FakeProperties.ExposureAutoUpperLimit)), options.Stream);

            UpperExposureEntry.Parent = ExposureCategory;

            FloatEntry LowerExposureEntry = new FloatEntry("  - Lower Limit", new Property <FlirProperties, FloatNode>(nameof(options.FakeProperties.ExposureAutoLowerLimit)), options.Stream);

            LowerExposureEntry.Parent = ExposureCategory;

            FloatEntry ExposureTimeEntry = new FloatEntry("Exposure Time", new Property <FlirProperties, FloatNode>(nameof(options.FakeProperties.ExposureTime)), options.Stream);

            ExposureTimeEntry.Parent = ExposureCategory;

            FloatEntry ExposureTimeAbsEntry = new FloatEntry("Absolute Exposure Time", new Property <FlirProperties, FloatNode>(nameof(options.FakeProperties.ExposureTimeAbs)), options.Stream);

            ExposureTimeAbsEntry.Parent = ExposureCategory;

            return(entries);

            /*
             * ExposureMode = new EnumNode<ExposureModeEnums>(camera, "ExposureMode");
             */
        }
Example #3
0
        private void categoryListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int index = categoryListBox.SelectedIndex;

            if (generalOptionsPanel == null || conversationOptionsPanel == null)
            {
                return;
            }

            if (index == 0)
            {
                _CurrentCategory = OptionsCategory.General;
            }
            else if (index == 1)
            {
                _CurrentCategory = OptionsCategory.ConversationView;
            }
            else if (index == 2)
            {
                _CurrentCategory = OptionsCategory.Phone;
            }
            else
            {
                throw new ArgumentOutOfRangeException();
            }

            DisplayCurrentCategory();
        }
Example #4
0
        private void EventLoop()
        {
            OptionsCategory CategoryOfOptionSelected = 0;

            while (CategoryOfOptionSelected != OptionsCategory.ExitTheProgram)
            {
                DummyConsole.Clear();
                MenuDisplay.DisplayingMenu();
                CategoryOfOptionSelected = SelectorOption.SelectingOption();
            }
        }
        public void OptionExecuting_CallingMethod_ReturnsOptionsCategoryNormalOption()
        {
            var MockOfConsole = new Mock <IFakeConsole>();

            MockOfConsole.Setup(m => m.KeyAvailable()).Returns(true);
            var BinaryClock = new BinaryClock.BinaryClockOption(MockOfConsole.Object, null);

            OptionsCategory Result = BinaryClock.OptionExecuting();

            Assert.AreEqual(OptionsCategory.NormalOption, Result);
        }
Example #6
0
        public void OptionExecuting_SimulationOfPressingEnterKey_ReturnsOptionsCategoryExitTheProgram()
        {
            var FakeConsole            = new Mock <IFakeConsole>();
            var ConsoleKeyInfoForEnter = new ConsoleKeyInfo((char)13, ConsoleKey.Enter, false, false, false);

            FakeConsole.Setup(m => m.ReadKey()).Returns(ConsoleKeyInfoForEnter);
            var Option = new Exit.ExitOption(FakeConsole.Object);

            OptionsCategory Result = Option.OptionExecuting();

            Assert.AreEqual(OptionsCategory.ExitTheProgram, Result);
        }
        public void UserDecidesWhatToDoNext_SimulationOfPressingKey2_ReturnsOptionsCategoryNormalOption()
        {
            var MockOfConsole         = new Mock <IFakeConsole>();
            var ConsoleKeyInfoForKey2 = new ConsoleKeyInfo('2', ConsoleKey.D2, false, false, false);

            MockOfConsole.Setup(m => m.ReadKey()).Returns(ConsoleKeyInfoForKey2);
            var ProgramExecution = new DecisionOnFurtherCourseOfProgram(null, MockOfConsole.Object, null);

            OptionsCategory Result = ProgramExecution.UserDecidesWhatToDoNext();

            Assert.AreEqual(OptionsCategory.NormalOption, Result);
        }
Example #8
0
        public void OptionExecuting_SimulationOfPressingKeyOtherThanEnter_ReturnsOptionsCategoryCanceledExit()
        {
            var FakeConsole          = new Mock <IFakeConsole>();
            var ConsoleKeyInfoForKey = new ConsoleKeyInfo('0', ConsoleKey.D0, false, false, false);

            FakeConsole.Setup(m => m.ReadKey()).Returns(ConsoleKeyInfoForKey);
            var Option = new Exit.ExitOption(FakeConsole.Object);

            OptionsCategory Result = Option.OptionExecuting();

            Assert.AreEqual(OptionsCategory.CanceledExit, Result);
        }
        public void SelectingOption_SimulationOfPressingWrongKey_ReturnsOptionsCategoryWrong()
        {
            var MockOfConsole             = new Mock <IFakeConsole>();
            var ConsoleKeyInfoForWrongKey = new ConsoleKeyInfo('0', ConsoleKey.D0, false, false, false);

            MockOfConsole.Setup(m => m.ReadKey()).Returns(ConsoleKeyInfoForWrongKey);

            var ListOfOptions  = new List <IMenuOption>();
            var SelectorOption = new Menu.SelectorOption(ListOfOptions, MockOfConsole.Object);

            OptionsCategory Result = SelectorOption.SelectingOption();

            Assert.AreEqual(OptionsCategory.Wrong, Result);
        }
        public OptionsDialogView(IDisplayOptions displayOptions, IPhoneSelectOptions phoneSelectOptions)
        {
            InitializeComponent();
            _DisplayOptions = displayOptions;
            _PhoneSelectOptions = phoneSelectOptions;

            _GeneralOptionsData = new OptionsCategoryData("General", generalOptionsPanel);
            _ConversationViewOptionsData = new OptionsCategoryData("Conversation View", conversationOptionsPanel);
            _PhoneOptionsData = new OptionsCategoryData("Phone", phoneOptionsPanel);

            _CurrentCategory = OptionsCategory.General;

            Loaded += delegate
                {
                    DisplayCurrentCategory();
                    InitializeFields();
                };
        }
        public void UserDecidesWhatToDoNext_SimulationOfPressingKey3_ReturnsExpectedValue
            (OptionsCategory Expected)
        {
            var MockOfConsole         = new Mock <IFakeConsole>();
            var ConsoleKeyInfoForKey3 = new ConsoleKeyInfo('3', ConsoleKey.D3, false, false, false);

            MockOfConsole.Setup(m => m.ReadKey()).Returns(ConsoleKeyInfoForKey3);

            var MockOfExit = new Mock <IMenuOption>();

            MockOfExit.Setup(m => m.OptionExecuting()).Returns(Expected);

            var ProgramExecution = new DecisionOnFurtherCourseOfProgram(null, MockOfConsole.Object, MockOfExit.Object);

            OptionsCategory Result = ProgramExecution.UserDecidesWhatToDoNext();

            Assert.AreEqual(Expected, Result);
        }
Example #12
0
        public OptionsDialogView(IDisplayOptions displayOptions, IPhoneSelectOptions phoneSelectOptions)
        {
            InitializeComponent();
            _DisplayOptions     = displayOptions;
            _PhoneSelectOptions = phoneSelectOptions;

            _GeneralOptionsData          = new OptionsCategoryData("General", generalOptionsPanel);
            _ConversationViewOptionsData = new OptionsCategoryData("Conversation View", conversationOptionsPanel);
            _PhoneOptionsData            = new OptionsCategoryData("Phone", phoneOptionsPanel);

            _CurrentCategory = OptionsCategory.General;

            Loaded += delegate
            {
                DisplayCurrentCategory();
                InitializeFields();
            };
        }
Example #13
0
        protected override List <IOptionEntry> generateEntries(CameraOptionsUI options, string libraryVersion)
        {
            List <IOptionEntry> entries = new List <IOptionEntry>();

            OptionsCategory InfoCategory = new OptionsCategory("Info");

            entries.Add(InfoCategory);

            ConstantValueEntry LibraryVersionEntry = new ConstantValueEntry("Library Version", libraryVersion);

            LibraryVersionEntry.Parent = InfoCategory;

            StringEntry VendorNameEntry = new StringEntry("Vendor Name", new Property <FlirProperties, StringNode>(nameof(options.FakeProperties.DeviceVendorName)), options.Stream);

            VendorNameEntry.Parent = InfoCategory;

            StringEntry ModelName = new StringEntry("Model Name", new Property <FlirProperties, StringNode>(nameof(options.FakeProperties.DeviceModelName)), options.Stream);

            ModelName.Parent = InfoCategory;

            return(entries);
        }
        public void SelectingOption_SimulationOfPressingCorrectKey_ReturnsSameValueAsOptionExecutingMethod
            ([Values] OptionsCategory ExpectedValue)
        {
            var MockOfOption = new Mock <IMenuOption>();

            MockOfOption.Setup(m => m.OptionExecuting()).Returns(ExpectedValue);

            var ListOfOptions = new List <IMenuOption>
            {
                MockOfOption.Object
            };

            var MockOfConsole        = new Mock <IFakeConsole>();
            var ConsoleKeyInfoForKey = new ConsoleKeyInfo('1', ConsoleKey.D1, false, false, false);

            MockOfConsole.Setup(m => m.ReadKey()).Returns(ConsoleKeyInfoForKey);

            var SelectorOption = new Menu.SelectorOption(ListOfOptions, MockOfConsole.Object);

            var Result = SelectorOption.SelectingOption();

            Assert.AreEqual(ExpectedValue, Result);
        }
        private void categoryListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int index = categoryListBox.SelectedIndex;

            if (generalOptionsPanel == null || conversationOptionsPanel == null)
            {
                return;
            }

            if (index == 0)
            {
                _CurrentCategory = OptionsCategory.General;
            }
            else if (index == 1)
            {
                _CurrentCategory = OptionsCategory.ConversationView;
            }
            else if (index == 2)
            {
                _CurrentCategory = OptionsCategory.Phone;
            }
            else
            {
                throw new ArgumentOutOfRangeException();
            }

            DisplayCurrentCategory();
        }
Example #16
0
 private void switchCategory(OptionsCategory category)
 {
     _currentCategory = category;
 }
Example #17
0
 private void switchCategory(OptionsCategory category)
 {
     _currentCategory = category;
 }