Ejemplo n.º 1
0
        public static bool CheckTurningOnInternalState(RadioModel model, out IList <string> errors)
        {
            var state = new Dictionary <string, Check>(LearningFactory.InitialState);

            state.Remove("TurningOn");

            return(LearningFactory.CheckState(model, state, out errors));
        }
Ejemplo n.º 2
0
        protected override void SomethingChanged()
        {
            base.SomethingChanged();

            if (LearningFactory.CheckInitialState(Model, out var _))
            {
                OnStepCompleted();
            }
        }
Ejemplo n.º 3
0
        public static bool CheckButtonInputConditions(RadioModel model, out IList <string> errors)
        {
            var state = new Dictionary <string, Check>(LearningFactory.InitialState)
            {
                ["TurningOn"] = new Check(m => m.TurningOn.Value == SwitcherState.Enabled, "Питание должно быть включено"),
            };

            return(LearningFactory.CheckState(model, state, out errors));
        }
        public static bool CheckRecordState(RadioModel model, out IList <string> errors)
        {
            var state = new Dictionary <string, Check>(LearningFactory.WorkingState)
            {
                ["RecordWork"] = new Check(m => m.RecordWork.Value == RecordWorkState.Record,
                                           "Переключатель ЗАПИСЬ-РАБОТА должен быть в положении ЗАПИСЬ"),
            };

            return(LearningFactory.CheckState(model, state, out errors));
        }
Ejemplo n.º 5
0
        public override Message GetErrorDescription()
        {
            var innerMessages = new List <Message>();

            if (!LearningFactory.CheckInitialState(Model, out var errors))
            {
                errors.ForEach(x => innerMessages.Add(new Message {
                    Header = x
                }));
            }

            return(new Message {
                Header = "Установка исходного положения", Messages = innerMessages
            });
        }
Ejemplo n.º 6
0
        public LearningBl(RadioModel model, Action completed, Action <int> stepChanged, StepsTypes learningType)
        {
            var learningFactory = new LearningFactory();

            _completed   = completed;
            _stepChanged = stepChanged;
            _model       = model;

            _learnings.Add(learningFactory.CreatePreparationToWorkLearning());
            _learnings.Add(learningFactory.CreatePerformanceTestLearning());
            _learnings.Add(learningFactory.CreateSettingFrequencies());

            InitAll();

            SetCurrentLearning(learningType);
        }
Ejemplo n.º 7
0
        public static bool CheckWorkingState(RadioModel model, out IList <string> errors)
        {
            var state = new Dictionary <string, Check>(LearningFactory.WorkingState);

            return(LearningFactory.CheckState(model, state, out errors));
        }