-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
63 additions
and
62 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
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
35 changes: 17 additions & 18 deletions
35
telemetry/src/main/kotlin/org/strykeforce/thirdcoast/telemetry/Inventory.kt
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 |
---|---|---|
@@ -1,29 +1,28 @@ | ||
package org.strykeforce.thirdcoast.telemetry | ||
|
||
import okio.BufferedSink | ||
import org.strykeforce.thirdcoast.telemetry.item.Item | ||
import org.strykeforce.thirdcoast.telemetry.item.Measurable | ||
import java.io.IOException | ||
|
||
/** Represents the inventory of robot hardware and subsystems that can have telemetry streaming. */ | ||
interface Inventory { | ||
|
||
/** | ||
* Gets an item by its inventory ID. The inventory ID is an index to an item in inventory and | ||
* should **not** be confused with the device ID of the underlying device the `Item` | ||
* represents. | ||
* | ||
* @param id the inventory ID to look up. | ||
* @return the found Item. | ||
*/ | ||
fun itemForId(id: Int): Item | ||
/** | ||
* Gets a measurable item by its inventory ID. The inventory ID is an index to a measurable item in inventory and | ||
* should **not** be confused with the device ID of the underlying device the `Measurable` represents. | ||
* | ||
* @param id the inventory ID to look up. | ||
* @return the found Measurable item. | ||
*/ | ||
fun itemForId(id: Int): Measurable | ||
|
||
/** | ||
* Writes the grapher-format JSON inventory to the supplied sink. | ||
* | ||
* @param sink the sink to write to. | ||
* @throws IOException if an IO error occurs during writing. | ||
*/ | ||
@Throws(IOException::class) | ||
fun writeInventory(sink: BufferedSink) | ||
/** | ||
* Writes the grapher-format JSON inventory to the supplied sink. | ||
* | ||
* @param sink the sink to write to. | ||
* @throws IOException if an IO error occurs during writing. | ||
*/ | ||
@Throws(IOException::class) | ||
fun writeInventory(sink: BufferedSink) | ||
|
||
} |
4 changes: 2 additions & 2 deletions
4
telemetry/src/main/kotlin/org/strykeforce/thirdcoast/telemetry/RobotInventory.kt
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package org.strykeforce.thirdcoast.telemetry | ||
|
||
import org.strykeforce.thirdcoast.telemetry.item.Item | ||
import org.strykeforce.thirdcoast.telemetry.item.Measurable | ||
|
||
/** Default implementation of [Inventory] for a robot. */ | ||
class RobotInventory(items: Collection<Item>) : AbstractInventory(items) | ||
class RobotInventory(items: Collection<Measurable>) : AbstractInventory(items) |
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
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
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
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