Ejemplo n.º 1
0
    public IControlMode viewIControlMode2()
    {
        global::System.IntPtr cPtr = yarpPINVOKE.PolyDriver_viewIControlMode2(swigCPtr);
        IControlMode          ret  = (cPtr == global::System.IntPtr.Zero) ? null : new IControlMode(cPtr, false);

        return(ret);
    }
        private void applyChanges(object sender, RoutedEventArgs e)
        {
            try
            {
                // Stop the current control mode if there is one
                if (currentControlMode != null)
                {
                    currentControlMode.Stop();
                }

                TabItem tabItem = tabControl.SelectedItem as TabItem;
                if (tabItem.Name.ToString() == "AUTO")
                {
                    if (radioButtonCycleColour.IsChecked ?? false)
                    {
                        currentControlMode = new BlinkColourCyclerControlMode((int)sliderCycleRate.Value);
                        currentControlMode.Start();
                        lableStatusText.Content = "Colour cycle mode enabled";
                    }
                    else if (radioButtonFadeColour.IsChecked ?? false)
                    {
                        currentControlMode = new FadeColourCyclerControlMode((int)sliderFadeRate.Value);
                        currentControlMode.Start();
                        lableStatusText.Content = "Colour fade mode enabled";
                    }
                    else if (radioButtonCPUUsage.IsChecked ?? false)
                    {
                        currentControlMode = new CPUUsageIndicatorControlMode(2000); //TODO make configurable
                        currentControlMode.Start();
                        lableStatusText.Content = "CPU utilisation indicator mode enabled";
                    }
                }
                else
                {
                    if (radioButtonDisableLed.IsChecked ?? false)
                    {
                        LEDController.DisableLED();
                        lableStatusText.Content = "LED disabled";
                    }
                    else
                    {
                        LEDTransition transition = comboBoxTransition.SelectedItem as LEDTransition;
                        LEDColour     colour     = comboBoxColour.SelectedItem as LEDColour;
                        LEDController.SetLEDState(transition, colour);
                        lableStatusText.Content = $"LED set: {colour.DisplayName} - {transition.DisplayName}";
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Error setting LED: {ex.Message.ToString()}", "Error", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }
Ejemplo n.º 3
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(IControlMode obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Ejemplo n.º 4
0
 public void SetPausedMode(IControlMode mode)
 {
     _pausedMode = mode;
 }
 internal static HandleRef getCPtr(IControlMode obj)
 {
     return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }