Discovery Lab Rules

Discovery lab rules

Naming rules:

  1. Capitalize the first letter of every word except the first one. Ex: testVariable
  2. Final variables are all upper case and words are separated with an under score. Ex: TEST_FINAL_VAR
  3. For class names capitalize the first letter of every word. Ex: TestClass
  4. To create a manager class put the Manager word and the the end. Ex: TestManager
  5. To create a status class put the Status word at the end. Ex: TestStatus
  6. Use this to reference instances inside your own class. But not for static instances.
  7. Use super to reference upper label instances.
  8. Use descriptive names for variables

Version Control using Eclipse

How to set up the telebot project on eclipse.

  1. Create a bit bucket account.
  2. Download the git plug in for eclipse:
  3. You should get an invitation to join the telebot repository. Go to your bitbucket inbox to accept it.
  4. 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.

  1. 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.
  2. To modify the project create a new branch.
    • Right click project and select. Team->Switch to->New Branch…
    • Give a name, select merge and click Finish.
  3. Make any changes in your own local branch. And commit.
  4. After you have tested your code you can merge your work with the master branch.
    • 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.
  5. After merge you should have only the master branch.
  6. Push the master branch to the remote repository.
    • 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.