コード例 #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);
            }
        }
コード例 #2
0
        private void btnDribbleFeedValve_Click(object sender, RoutedEventArgs e)
        {
            if (GpioUtility.GetDribbleFeedState() == true)
            {
                GpioUtility.closeDribbleFeedValve();
            }
            else
            {
                GpioUtility.openDribbleFeedValve();
            }

            Task.Delay(1000);
            if (GpioUtility.GetDribbleFeedState() == true)
            {
                btnDribbleFeedValve.Background = new SolidColorBrush(Colors.Green);
            }
            else
            {
                btnDribbleFeedValve.Background = new SolidColorBrush(Colors.Red);
            }
        }