Ejemplo n.º 1
0
        private void PinCheckStates()
        {
            if (GpioUtility.GetNormalFeedState() == true)
            {
                btnFastFeedValve.Background = new SolidColorBrush(Colors.Green);
            }
            else
            {
                btnFastFeedValve.Background = new SolidColorBrush(Colors.Red);
            }
            if (GpioUtility.GetDribbleFeedState() == true)
            {
                btnDribbleFeedValve.Background = new SolidColorBrush(Colors.Green);
            }
            else
            {
                btnDribbleFeedValve.Background = new SolidColorBrush(Colors.Red);
            }
            if (GpioUtility.GetAirSupplyState() == true)
            {
                btnAirSupplyValve.Background = new SolidColorBrush(Colors.Green);
            }
            else
            {
                btnAirSupplyValve.Background = new SolidColorBrush(Colors.Red);
            }

            if (GpioUtility.GetOverWeightState() == true)
            {
                btnOverWeightLight.Background = new SolidColorBrush(Colors.Green);
            }
            else
            {
                btnOverWeightLight.Background = new SolidColorBrush(Colors.Red);
            }
            if (GpioUtility.GetNormalWeightState() == true)
            {
                btnNormalWeightLight.Background = new SolidColorBrush(Colors.Green);
            }
            else
            {
                btnNormalWeightLight.Background = new SolidColorBrush(Colors.Red);
            }
            if (GpioUtility.GetUnderWeightState() == true)
            {
                btnUnderWeightLight.Background = new SolidColorBrush(Colors.Green);
            }
            else
            {
                btnUnderWeightLight.Background = new SolidColorBrush(Colors.Red);
            }
        }
Ejemplo n.º 2
0
        private void btnFastFeedValve_Click(object sender, RoutedEventArgs e)
        {
            if (GpioUtility.GetNormalFeedState() == true)
            {
                GpioUtility.closeNormalFeedValve();
            }
            else
            {
                GpioUtility.openNormalFeedValve();
            }

            Task.Delay(1000);

            if (GpioUtility.GetNormalFeedState() == true)
            {
                btnFastFeedValve.Background = new SolidColorBrush(Colors.Green);
            }
            else
            {
                btnFastFeedValve.Background = new SolidColorBrush(Colors.Red);
            }
        }