-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from pacoito123/untested
2019-08-19 Merge
- Loading branch information
Showing
18 changed files
with
549 additions
and
681 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
src/main/java/org/usfirst/lib6647/oi/ControllerProfiles.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package org.usfirst.lib6647.oi; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
import org.usfirst.lib6647.subsystem.RobotMap; | ||
|
||
/** | ||
* Class holding instances of objects required to read values from a JSON file, | ||
* for {@link JController} usage. | ||
*/ | ||
public class ControllerProfiles { | ||
|
||
private static ControllerProfiles m_instance = null; | ||
|
||
/** | ||
* Creates static {@link ControllerProfiles} instance. | ||
*/ | ||
public static void createInstance(String filePath) { | ||
m_instance = new ControllerProfiles(filePath); | ||
} | ||
|
||
/** | ||
* Gets static {@link ControllerProfiles} instance. | ||
* | ||
* @return static {@link ControllerProfiles} instance | ||
*/ | ||
public static ControllerProfiles getInstance() { | ||
return m_instance; | ||
} | ||
|
||
/** JSON {@link ObjectMapper} for {@link JController JControllers}. */ | ||
private final ObjectMapper mapper; | ||
/** Path to JSON file. */ | ||
private final String filePath; | ||
|
||
/** | ||
* Constructor for {@link RobotMap}. Initializes {@link #filePath} and | ||
* {@link #mapper}. | ||
* | ||
* @param filePath | ||
*/ | ||
public ControllerProfiles(String filePath) { | ||
this.filePath = filePath; | ||
mapper = new ObjectMapper(); | ||
} | ||
|
||
/** | ||
* Get {@link ObjectMapper} instance. | ||
* | ||
* @return mapper | ||
*/ | ||
public ObjectMapper getMapper() { | ||
return mapper; | ||
} | ||
|
||
/** | ||
* Get {@link #filePath} for JSON file. | ||
* | ||
* @return filePath | ||
*/ | ||
public String getFilePath() { | ||
return filePath; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package org.usfirst.lib6647.subsystem; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
/** | ||
* Class holding instances of objects required to read values from a JSON file, | ||
* for {@link SuperSubsystem} usage. | ||
*/ | ||
public class RobotMap { | ||
|
||
private static RobotMap m_instance = null; | ||
|
||
/** | ||
* Creates static {@link RobotMap} instance. | ||
*/ | ||
public static void createInstance(String filePath) { | ||
m_instance = new RobotMap(filePath); | ||
} | ||
|
||
/** | ||
* Gets static {@link RobotMap} instance. | ||
* | ||
* @return static {@link RobotMap} instance | ||
*/ | ||
public static RobotMap getInstance() { | ||
return m_instance; | ||
} | ||
|
||
/** JSON {@link ObjectMapper} for {@link SuperSubsystem SuperSubsystems}. */ | ||
private final ObjectMapper mapper; | ||
/** Path to JSON file. */ | ||
private final String filePath; | ||
|
||
/** | ||
* Constructor for {@link RobotMap}. Initializes {@link #filePath} and | ||
* {@link #mapper}. | ||
* | ||
* @param filePath | ||
*/ | ||
public RobotMap(String filePath) { | ||
this.filePath = filePath; | ||
mapper = new ObjectMapper(); | ||
} | ||
|
||
/** | ||
* Get {@link ObjectMapper} instance. | ||
* | ||
* @return mapper | ||
*/ | ||
public ObjectMapper getMapper() { | ||
return mapper; | ||
} | ||
|
||
/** | ||
* Get {@link #filePath} for JSON file. | ||
* | ||
* @return filePath | ||
*/ | ||
public String getFilePath() { | ||
return filePath; | ||
} | ||
} |
Oops, something went wrong.