示例#1
0
        public Form1()
        {
            InitializeComponent();

            DriveCtrl driveCtrl      = new DriveCtrl(Constants.IODriveCtrl);
            MotorCtrl motorCtrlLeft  = new MotorCtrl(Constants.IOMotorCtrlLeft);
            MotorCtrl motorCtrlRight = new MotorCtrl(Constants.IOMotorCtrlRight);

            this.driveCtrlView.DriveCtrl      = driveCtrl;
            this.motorCtrlViewLeft.MotorCtrl  = motorCtrlLeft;
            this.motorCtrlViewRight.MotorCtrl = motorCtrlRight;
        }
示例#2
0
        public Form1()
        {
            InitializeComponent();


            DriveCtrl driveCtrl = new DriveCtrl(0xF330);

            driveCtrlView.DriveCtrl = driveCtrl;
            MotorCtrl motorCtrlLeft  = new MotorCtrl(0xF328);
            MotorCtrl motorCtrlRight = new MotorCtrl(0xF320);

            motorCtrlView1.MotorCtrl = motorCtrlLeft;
            motorCtrlView2.MotorCtrl = motorCtrlRight;
        }
示例#3
0
        /// <summary>
        /// Process-Loop beenden und die Motorencontroller zurücksetzen => Motoren halten an
        /// </summary>
        public void Dispose()
        {
            if (!_disposed)
            {
                _run = false; // Drive-Thread beenden
                _thread.Join();

                MotorCtrlLeft.Dispose();  // linkes Motorenobjekt disposen
                MotorCtrlRight.Dispose(); // rechtes Motorenobjekt disposen

                DriveCtrl.Dispose();      // DriveCtrl disposen => HW-Motorencontroller werden zurückgesetzt und Motoren laufen aus
                _disposed = true;
            }
        }
示例#4
0
        public Form1()
        {
            InitializeComponent();
            if (Constants.IsWinCE)
            {
                _driveControl      = new DriveCtrlHW(Constants.IODriveCtrl);
                _leftMotorControl  = new MotorCtrlHW(Constants.IOMotorCtrlLeft);
                _rightMotorControl = new MotorCtrlHW(Constants.IOMotorCtrlRight);
            }
            else
            {
                _driveControl      = new DriveCtrlSim();
                _leftMotorControl  = new MotorCtrlSim();
                _rightMotorControl = new MotorCtrlSim();
            }

            leftMotorCtrlView.MotorCtrl  = _leftMotorControl;
            rightMotorCtrlView.MotorCtrl = _rightMotorControl;
            driveCtrlView.DriveCtrl      = _driveControl;
        }