コード例 #1
0
ファイル: Drive.cs プロジェクト: Grodien/HsluRobot
        /// <summary>
        /// Initialisiert den Antrieb des Roboters
        /// </summary>
        public Drive()
        {
            _tracksToRun = new List<Track>();

              // Antrieb initialisieren
              if (Constants.IsWinCE)
              {
              DriveCtrl = new DriveCtrlHW(Constants.IODriveCtrl);
              MotorCtrlLeft = new MotorCtrlHW(Constants.IOMotorCtrlLeft);
              MotorCtrlRight = new MotorCtrlHW(Constants.IOMotorCtrlRight);
              }
              else
              {
            DriveCtrl = new DriveCtrlSim();
            MotorCtrlLeft = new MotorCtrlSim();
            MotorCtrlRight = new MotorCtrlSim();
              }

              // Beschleunigung festlegen
              DriveCtrl.Power = true;
              MotorCtrlLeft.Acceleration = 10f;
              MotorCtrlRight.Acceleration = 10f;
              Position = new PositionInfo(0f, 0f, 90);

              // Prozess-Thread erzeugen und starten
              _thread = new Thread(RunTracks) {IsBackground = true, Priority = ThreadPriority.Highest};
              _thread.Start();
        }
コード例 #2
0
ファイル: Drive.cs プロジェクト: Grodien/HsluRobot
        /// <summary>
        /// Initialisiert den Antrieb des Roboters
        /// </summary>
        public Drive()
        {
            _tracksToRun = new List <Track>();

            // Antrieb initialisieren
            if (Constants.IsWinCE)
            {
                DriveCtrl      = new DriveCtrlHW(Constants.IODriveCtrl);
                MotorCtrlLeft  = new MotorCtrlHW(Constants.IOMotorCtrlLeft);
                MotorCtrlRight = new MotorCtrlHW(Constants.IOMotorCtrlRight);
            }
            else
            {
                DriveCtrl      = new DriveCtrlSim();
                MotorCtrlLeft  = new MotorCtrlSim();
                MotorCtrlRight = new MotorCtrlSim();
            }

            // Beschleunigung festlegen
            DriveCtrl.Power             = true;
            MotorCtrlLeft.Acceleration  = 10f;
            MotorCtrlRight.Acceleration = 10f;
            Position = new PositionInfo(0f, 0f, 90);

            // Prozess-Thread erzeugen und starten
            _thread = new Thread(RunTracks)
            {
                IsBackground = true, Priority = ThreadPriority.Highest
            };
            _thread.Start();
        }