Exemplo n.º 1
0
        public WorkingCapacityPage()
        {
            InitializeComponent();


            _subscribeMouseMove = false;

            SetButtons();
            SetLines();
            SetTooltips();

            IsVisibleChanged += WorkingPage_IsVisibleChanged;

            var conditions = new Conditions();

            conditions
            .Add(() => Radio.Model.WorkMode.Value == WorkModeState.Simplex)
            .Add(() => Math.Abs(Radio.Model.Noise.Value - 1.0) < 0.001)
            .Add(() => Radio.Model.Scale.Value == Turned.On && Radio.Model.Power.Value == Turned.On)
            .Add(() => Radio.Model.Tangent.Value == Turned.On)
            .Add(() => Math.Abs(Radio.Model.Volume.Value - 1.0) < 0.001)
            .Add(() => Radio.Model.Range.Value == RangeState.SmoothRange1)
            .Add(() =>
            {
                if (_isFirstTimeFrequencyChanged)
                {
                    return(Radio.Model.Frequency.Value > 21);
                }
                _isFirstTimeFrequencyChanged = true;
                return(false);
            })
            .Add(() => Radio.Model.Noise.Value < 0.5)
            .Add(() => Radio.Model.WorkMode.Value == WorkModeState.StandbyReception)
            .Add(() => Radio.Model.Tone.Value == Turned.On)
            .Add(() => Radio.Model.WorkMode.Value == WorkModeState.Simplex)
            .Add(() => Radio.Model.Tangent.Value == Turned.On)
            .Add(() => Radio.Model.Antenna.Value > 0.8)
            .Add(() => Radio.Model.Tone.Value == Turned.On)
            .Add(() => Radio.Model.Clamps[0].Value == ClampState.Fixed &&
                 Radio.Model.Clamps[1].Value == ClampState.Fixed &&
                 Radio.Model.Clamps[2].Value == ClampState.Fixed &&
                 Radio.Model.Clamps[3].Value == ClampState.Fixed)
            .Add(() => Radio.Model.Antenna.Value > 0.8)
            .Add(() => Radio.Model.Range.Value == RangeState.FixedFrequency4)
            .Add(() => Radio.Model.Power.Value == Turned.Off);

            InitializeControls();

            _checker              = new SequenceStepChecker(conditions, new WorkingSubscribesInitializer(Radio.Model));
            _checker.StepChanged += Checker_StepChanged;
            _checker.Start();

            var blackouts = new WorkingPageBlackouts(ForBlackouts_Path, canvas);

            blackouts.SetPanels(LeftStackPanel, RightStackPanel);
        }
Exemplo n.º 2
0
        public TuningPage()
        {
            InitializeComponent();

            _subscribeMouseMove = false;

            SetButtons();
            SetLines();
            SetTooltips();

            InitializeControls();

            IsVisibleChanged += TuningPage_IsVisibleChanged;

            var conditions = new Conditions();

            conditions
            .Add(() => Radio.Model.WorkMode.Value == WorkModeState.Simplex)   // simplex
            .Add(() => Math.Abs(Radio.Model.Noise.Value - 1.0) < 0.001)       // noise
            .Add(() => Radio.Model.Voltage.Value == 0)                        // voltage
            .Add(() => Radio.Model.Scale.Value == Turned.On)                  //scale
            .Add(() => Radio.Model.Power.Value == Turned.On)                  // power
            .Add(() => Math.Abs(Radio.Model.Volume.Value - 1.0) < 0.001)      // volume
            .Add(() => Radio.Model.Range.Value == RangeState.FixedFrequency1) // range
            .Add(() => Radio.Model.Clamps[0].Value == ClampState.Unfixed)     // clamps on
            .Add(() => Radio.Model.Clamps[0].Value == ClampState.Fixed)       // clamps off
            .Add(() => Radio.Model.SubFixFrequency[0].Value == Turned.On)     // subfixfrequency
            .Add(() => Radio.Model.Tangent.Value == Turned.On)                // prd
            .Add(() => Radio.Model.Antenna.Value > 0.8 &&
                 Radio.Model.AntennaFixer.Value == ClampState.Fixed)          // antenna
            .Add(() => Radio.Model.Tangent.Value == Turned.Off);              // tangent off
            //.Add(() => Radio.Model.Range.Value == RangeState.FixedFrequency4); // repeat (maybe doesn't need)

            _checker              = new SequenceStepChecker(conditions, new TuningSubscribesInitializer(Radio.Model));
            _checker.StepChanged += Checker_StepChanged;
            _checker.Start();


            var blackouts = new TuningPageBlackouts(ForBlackouts_Path, canvas);

            blackouts.SetPanels(Left_StackPanel, Right_StackPanel);
        }