📄 drivemotor.c
字号:
/******************************************************************************\
*
* File: DriveMotor.C
* Creation date: June 23, 2008 10:30
* Latest update: July 09, 2008 16:39
* Author: ClassBuilder
* XXXX
* Purpose: Method implementations of class 'DriveMotor'
* CB version: ClassBuilder Version 2.9 (PR523)
*
* Modifications: @INSERT_MODIFICATIONS(* )
* July 05, 2008 21:07 Chijinliang
* Deleted method 'Start'
* July 05, 2008 21:03 Chijinliang
* Updated code of method 'DriveMotor'
* July 05, 2008 20:28 Chijinliang
* Added method 'GetSpeed'
* Updated interface of method 'SetSpeed'
* Updated member 'm_speed'
* June 25, 2008 19:10 Chijinliang
* Updated code of method 'Reverse'
* June 24, 2008 19:59 Chijinliang
* Updated code of method 'Stop'
* Updated code of method 'Start'
* June 23, 2008 14:03 Chijinliang
* Updated code of method 'GetVehicleSpeed'
* Updated interface of method 'SetVehicleSpeed'
* Updated code of method 'DriveMotor'
* Updated member 'm_vehicleSpeed'
* June 23, 2008 13:42 Chijinliang
* Deleted inheritance 'Motor'
* Added method 'Reverse'
* Added method 'Forward'
* Added method 'Brake'
* Updated code of method 'SetVehicleSpeed'
* Updated code of method 'Stop'
* Updated code of method 'Start'
* Updated code of method '~DriveMotor'
* Updated code of method 'DriveMotor'
* June 23, 2008 10:30 Chijinliang
* Added method 'DestructorInclude'
* Added method 'ConstructorInclude'
* Added method 'GetVehicleSpeed'
* Added method 'SetVehicleSpeed'
* Added method 'Stop'
* Added method 'Start'
* Added method '~DriveMotor'
* Added method 'DriveMotor'
* Added inheritance 'Motor'
* Added member 'm_vehicleSpeed'
*
* Copyright 2008, XXXXX
* All rights are reserved. Reproduction in whole or part is prohibited
* without the written consent of the copyright owner.
*
\******************************************************************************/
// Master include file
#include "JASTInTime.h"
using namespace JASTInTime;
/*
Constructor method.
*/
DriveMotor::DriveMotor()
{
ConstructorInclude();
m_speed = 0;
}
/*
Destructor method.
*/
DriveMotor::~DriveMotor()
{
Stop();
DestructorInclude();
}
const void DriveMotor::Brake() const
{
motor_a_dir(brake);
}
const void DriveMotor::Forward() const
{
motor_a_dir(fwd);
}
const void DriveMotor::Reverse() const
{
motor_a_dir(rev);
}
const void DriveMotor::Stop() const
{
motor_a_dir(::off);
}
/*
Method which must be called first in a constructor.
*/
void DriveMotor::ConstructorInclude()
{
}
/*
Method which must be called first in a destructor.
*/
void DriveMotor::DestructorInclude()
{
}
// Methods for the relation(s) of the class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -