Skip to content

Commit

Permalink
add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fodfodfod committed Oct 28, 2023
1 parent 8cffa9b commit 067af2f
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 14 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ repositories {
4. Find dependencies block and add ```implementation name:'[insert name of JAR here, omit the .jar]'``` after the ```implementation wpi.java.vendor.java()``` line

5. Add ```!libs/*.jar``` to your .gitignore to allow the file to be added to your repo. (or analagous action for other version tracking software)

## Example Code
Example code is availible in [examples.md](/examples.md)
31 changes: 31 additions & 0 deletions examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Code for Creating a Questionarie
Import the Library
``` java
import shuffleboardlib.Question;
import shuffleboardlib.Questionnaire;

public class DriverStation extends ShuffleboardTabBase{
private Questionnaire questionnaire;

public DriverStation(){
//create a hashmap to store the options if the robot is in the left position
HashMap<String, Question> leftPieceNumber = new HashMap<>();
//add items to the hashmap, the first arguement is the answer, the next is a question
//the question arguements are the question, a Hashmap<String, Question> for the answers, a boolean for if it is the last question on that path of the tree, and if it is the output for the questionaire
leftPieceNumber.put("1", new Question("1 piece", null, true, "LeftOne"));
leftPieceNumber.put("2", new Question("2 piece", null, true, "LeftTwo"));
Question leftPieceNumberQuestion = new Question("How many pieces?", leftPieceNumber, false, null);

//create a hashmap for the answers to the root question
HashMap<String, Question> answersHashMap = new HashMap<>();
answersHashMap.put("left", leftPieceNumberQuestion);
answersHashMap.put("middle", new Question ("middle", null, true, "midCone"));

Question rootQuestion = new Question("starting position", answersHashMap, false, null);

questionnaire = new Questionnaire("Driver Station", rootQuestion, 5);

}
}
```

6 changes: 4 additions & 2 deletions fancybuild.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
./gradlew build

mv lib/build/libs/lib.jar ../2023Robot/libs/ShuffleboardLib.jar
#mv lib/build/libs/lib.jar ../SwerveDrive/libs/ShuffleboardLib.jar
#Replace SwerveDrive with the name of project you would like to build to
#project must be in the same directory as ShuffleboardLib
mv lib/build/libs/lib.jar ../SwerveDrive/libs/ShuffleboardLib.jar

10 changes: 0 additions & 10 deletions lib/src/main/java/shuffleboardlib/Library.java

This file was deleted.

3 changes: 1 addition & 2 deletions lib/src/test/java/shuffleboardlib/LibraryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

public class LibraryTest {
@Test public void someLibraryMethodReturnsTrue() {
Library classUnderTest = new Library();
assertTrue("someLibraryMethod should return 'true'", classUnderTest.someLibraryMethod());
assertTrue("someLibraryMethod should return 'true'", true);
}

@Test public void createQuestionaire(){
Expand Down

0 comments on commit 067af2f

Please sign in to comment.