Discovery lab rules
- Capitalize the first letter of every word except the first one. Ex: testVariable
- Final variables are all upper case and words are separated with an under score. Ex: TEST_FINAL_VAR
- For class names capitalize the first letter of every word. Ex: TestClass
- To create a manager class put the Manager word and the the end. Ex: TestManager
- To create a status class put the Status word at the end. Ex: TestStatus
- Use this to reference instances inside your own class. But not for static instances.
- Use super to reference upper label instances.
- Use descriptive names for variables
Version Control using Eclipse
How to set up the telebot project on eclipse.
- Create a bit bucket account.
- Download the git plug in for eclipse:
- On eclipse, go to: help->Install new software
- Add this link: http://download.eclipse.org/egit/updates
- You should get an invitation to join the telebot repository. Go to your bitbucket inbox to accept it.
- Import the telebot project:
- Go to: File->Import->Git->Projects from git
- At the 'Import your project from git window' copy paste the telebot repository URL from your bitbucket account.
- Enter your password and click Next.
- Eclipse will ask you if you want to create a new project: Select New project wizard and click Next.
- Eclipse should have created a directory with the repository. At the new project wizard window uncheck Use default location and browse to the directory of that repository. Select it as the source code for the new project you are about to create. (Do not use the default location).
Version control rules and procedures.
- Before making any changes pull from remote repository:
- Right click on the project and select: Team->Pull.
- Resolve any conflicts and commit.
- To commit right click project and: Team->Commit..., Then write a message and click Commit.
- Right click project and select. Team->Switch to->New Branch...
- Give a name, select merge and click Finish.
- To merge first switch to master branch.
- Right click on project and select: Team->Merge...
- Select your branch and click Merge.
- Delete your old branch.
- Right click the project and select: Team->Remote->Push.
- Select 'Configured remote repository' and click Next.
- At the 'Source ref:' select master[branch].
- At the 'Destination ref:' select master[branch].
- After you have selected the Sourse and Destination click Add Spec.
- Click Finish.
Working with Telebot project
The telebot software uses Managers to control micro-controllers and Statuses to communicate between operator and robot.
How to create a Manager class
- Create a new class and extend the Manager abstract class.
- Implement the execute() method.
- Implement the getDeviceSignal() method.
- Click here for manager example.
How to create a Status class
- Create a new class and extend the Status abstract class.
- Implement the copy(Status argStatus) method.
- Implement the printData() method.
- Click here for status example.
How to create a Serial Parser class
- To create a serial parser implement the SerialParserInterface.
- Implement the setStream(InputStream input, OutputStream output) method. This will give you access to communicate to your device.
- To implement your serial parser inside your Manager use the assignInOutStreamsToParser(SerialParserInterface parser) method. See manager tutorial for how to set up DefaultParser (Included in the Telebot core project).
- Click here for serial parser example.