コード例 #1
0
        public void DeleteStep(PercentageStep step)
        {
            LayoutDisplay.UnlockPanels(step.PanelIds);

            _profile.Steps.Remove(step);
            BuildStepList();
        }
コード例 #2
0
        public StepItemUserControl(PercentageProfileWindow parent, int stepNumber, PercentageStep percentageStep)
        {
            _parent         = parent;
            _percentageStep = percentageStep;

            Description = $"{Layout.Resources.Step} {stepNumber}";

            InitializeComponent();
            DataContext = this;
        }
コード例 #3
0
        protected BaseProcessPercentageEventTrigger(ITrigger trigger, Orchestrator orchestrator, string processName)
        {
            _trigger      = trigger;
            _orchestrator = orchestrator;
            _processName  = processName;

            var client = NanoleafClient.GetClientForDevice(_orchestrator.Device);

            _externalControlEndpoint = client.ExternalControlEndpoint;

            //Check if the user has somehow messed up their percentage profile, then we create a single step percentage profile
            if (_orchestrator.Device.PercentageProfile == null || _orchestrator.Device.PercentageProfile.Steps.Count == 0)
            {
                _percentageProfile = new PercentageProfile();
                var step = new PercentageStep();

                foreach (var panel in client.LayoutEndpoint.GetLayout().PanelPositions)
                {
                    step.PanelIds.Add(panel.PanelId);
                }

                _percentageProfile.Steps.Add(step);
                _percentagePerStep = 100f;
                _amountOfSteps     = 1;
            }
            else
            {
                _percentageProfile = _orchestrator.Device.PercentageProfile;
                _amountOfSteps     = _percentageProfile.Steps.Count;
                _percentagePerStep = 100f / _amountOfSteps;
            }

            var processCheckTimer = new Timer(60000);

            processCheckTimer.Elapsed  += CheckProcess;
            processCheckTimer.AutoReset = true;
            processCheckTimer.Start();

            _effectTimer           = new Timer(100);
            _effectTimer.Elapsed  += ApplyEffect;
            _effectTimer.AutoReset = true;
        }
コード例 #4
0
        private void Plus_Click(object sender, RoutedEventArgs e)
        {
            if (LayoutDisplay.SelectedPanelIds.Count <= 0)
            {
                return;
            }

            var newStep = new PercentageStep();

            foreach (var panelId in LayoutDisplay.SelectedPanelIds)
            {
                newStep.PanelIds.Add(panelId);
            }

            _profile.Steps.Add(newStep);

            BuildStepList();

            LayoutDisplay.LockPanels(LayoutDisplay.SelectedPanelIds);

            LayoutDisplay.ClearSelectedPanels();
        }