예제 #1
0
 /** report any comm/CAN errors if any occur */
 private void HandleErr(int status)
 {
     if (status != 0)
     {
         Reporting.SetError(status, Reporting.getHALErrorMessage(status));
     }
 }
예제 #2
0
        public bool GetAppliedSolenoidOutput(int idx, out bool enable)
        {
            int status = m_impl.GetSol(idx, out enable);

            if (status != 0)
            {
                Reporting.SetError(status, Reporting.getHALErrorMessage(status));
            }
            return(enable);
        }
예제 #3
0
        public void SetSolenoidOutput(int idx, bool enable)
        {
            int status = m_impl.SetEnableSol(idx, enable);

            if (status == 0)
            {
                /* save the value so caller can check what the target output is */
                _solen[idx] = enable;
            }
            else
            {
                Reporting.SetError(status, Reporting.getHALErrorMessage(status));
            }
        }
예제 #4
0
        protected static void Start(RobotApplication ra)
        {
            Instance = ra;
            /*first repeat call init until true */
            bool flag = false;

            while (!flag)
            {
                flag = Instance.RobotInit();
                System.Threading.Thread.Sleep(20);
            }
            /* now run loops */
            Instance.RunForever();
            Reporting.ConsolePrint("RunForever returned, this should not be allowed.");
        }
예제 #5
0
 /**
  * Called by the framework to run the robot.
  */
 public virtual void RunForever()
 {
     Reporting.ConsolePrint("RunForever needs to be implemented.");
 }