//W przypadku gdy okno ComTool zostało zamknięte kasuje odniesienie do niego w głównym oknie
 private void JogOpWindowClosed(object sender, WindowClosedEventArgs e)
 {
     if (jogOp != null)
     {
         jogOp.WindowClosed -= JogOpWindowClosed;
         jogOp = null;
         AddToLog("Jog Operator window closed.");
     }
 }
 //Uruchamia okno Jog Operator lub jeżeli jest ono uruchomione aktywuje je
 private void JogOperatorButton_Click(object sender, RoutedEventArgs e)
 {
     if (jogOp is null)
     {
         jogOp = new JogOperator(ref robotData);
         jogOp.WindowClosed += JogOpWindowClosed;
         jogOp.DataSend     += SendToRobot;
         if (serialPort.IsOpen)
         {
             jogOp.ConnectionInfoLbl.Content = "connected";
         }
         else
         {
             jogOp.ConnectionInfoLbl.Content = "disconnected";
         }
         jogOp.Show();
         AddToLog("Jog Operator window opened.");
     }
     else
     {
         jogOp.Activate();
     }
 }