Exemple #1
0
 private void Out_MouseLeave(object sender, MouseEventArgs e)
 {
     if (changeEnable || handControlEnable)
     {
         Gpio gpio = e.Source as Gpio;
         gpio.Background = null;
     }
 }
Exemple #2
0
 private void Out_MouseEnter(object sender, MouseEventArgs e)
 {
     if (changeEnable || handControlEnable)
     {
         Gpio gpio = e.Source as Gpio;
         if (handControlEnable && gpio.Name.Contains("Out"))
         {
             gpio.Background = Brushes.Green;
         }
         else if (changeEnable)
         {
             gpio.Background = Brushes.Green;
         }
     }
 }
Exemple #3
0
 public WindowSetOut(Gpio vystup)
 {
     InitializeComponent();
     this.vystup = vystup;
     DataContext = this;
 }
Exemple #4
0
 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     vystup = gpioTmp;
     this.Close();
 }
 public WindowSetIn(Gpio vstup)
 {
     InitializeComponent();
     this.vstup  = vstup;
     this.Title += ":  " + vstup.GpIn.nazev;
 }
Exemple #6
0
        private void GGpio_Dbl_click(object sender, MouseButtonEventArgs e)
        {
            if (changeEnable)
            {
                Gpio       gpio = e.Source as Gpio;
                StackPanel stp  = gpio.Parent as StackPanel;



                if (stp.Uid == "in")
                {
                    gpio.GpIn = gpioData.inputs[int.Parse(gpio.Uid)];
                    WindowSetIn setIn = new WindowSetIn(gpio);
                    setIn.ShowDialog();
                }

                else
                {
                    gpio.GpOut = gpioData.outputs[int.Parse(gpio.Uid)];
                    WindowSetOut setOut = new WindowSetOut(gpio);
                    setOut.ShowDialog();
                }
            }
            else if (handControlEnable)
            {
                Gpio gpio = e.Source as Gpio;
                if (gpio.Name.Contains("In"))
                {
                    return;
                }
                StackPanel stp = gpio.Parent as StackPanel;
                int        pom = int.Parse(gpio.Uid);
                if (stp.Uid == "in")
                {
                    if (VSTUPY[pom] == 0)
                    {
                        VSTUPY[pom] = 1;
                        comBluetooth.send("M-I-" + int.Parse(gpio.Uid) + "-1 \n");
                    }

                    else
                    {
                        VSTUPY[pom] = 0;
                        comBluetooth.send("M-I-" + int.Parse(gpio.Uid) + "-0 \n");
                    }
                }
                else if (stp.Uid == "out")
                {
                    if (VYSTUPY[pom] == 0)
                    {
                        VYSTUPY[pom] = 1;
                        comBluetooth.send("M-O-" + int.Parse(gpio.Uid) + "-1 \n");
                    }

                    else
                    {
                        VYSTUPY[pom] = 0;
                        comBluetooth.send("M-O-" + int.Parse(gpio.Uid) + "-0 \n");
                    }
                }
            }
        }