コード例 #1
0
        private void Instance_RobotStatusChanged(object sender, RobotStatusChangedEventArgs e)
        {
            switch (e.CurrentRobotState)
            {
            case RobotState.Auton:
                notifyRobotState(Constants.AUTON);
                break;

            case RobotState.Teleop:
                notifyRobotState(Constants.TELEOP);
                break;

            default:
                notifyRobotState(Constants.DISABLED);
                break;
            }
        }
コード例 #2
0
ファイル: ControlLoop.cs プロジェクト: Dylan-Watson/FRC-2017
 private void Instance_RobotStatusChanged(object sender, RobotStatusChangedEventArgs e)
 {
     if (e.CurrentRobotState == RobotState.Auton || e.CurrentRobotState == RobotState.Teleop)
     {
         finished = false;
         cancel   = false;
         thread   = new Thread(backgroundLoop);
         thread.Start();
         Started?.Invoke(this, new EventArgs());
     }
     else
     {
         if (thread != null && thread.IsAlive)
         {
             Abort(RobotStatus.Instance);
         }
     }
 }
コード例 #3
0
 /// <summary>
 ///     Disposes of the instance if the robot state changes
 /// </summary>
 /// <param name="sender">The object invoking the method</param>
 /// <param name="e">RobotStatusChanged Arguments passed</param>
 private void Instance_RobotStatusChanged(object sender, RobotStatusChangedEventArgs e)
 {
     Report.Warning("WatchDog disposed due to robot state change.");
     Dispose();
 }