Skip to content

Commit

Permalink
Move kotlin files into their own directory (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
njooma authored Jun 27, 2024
1 parent c533726 commit 0b2ac34
Show file tree
Hide file tree
Showing 17 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

group 'com.viam'
version '0.0.4'
version '0.0.5-SNAPSHOT'

repositories {
google()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class ResourceManager implements Closeable {
// register well-known subtypes
// COMPONENTS
Registry.registerSubtype(new ResourceRegistration<>(
Board.getSUBTYPE(),
Board.SUBTYPE,
BoardServiceGrpc.SERVICE_NAME,
BoardRPCService::new,
BoardRPCClient::new
Expand All @@ -78,7 +78,7 @@ public class ResourceManager implements Closeable {
GripperRPCClient::new
));
Registry.registerSubtype(new ResourceRegistration<>(
Motor.getSUBTYPE(),
Motor.SUBTYPE,
MotorServiceGrpc.SERVICE_NAME,
MotorRPCService::new,
MotorRPCClient::new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ typealias Tick = StreamTicksResponse
*/
abstract class Board(name: String) : Component(SUBTYPE, named(name)) {
companion object {
@JvmStatic
@JvmField
val SUBTYPE =
Subtype(Subtype.NAMESPACE_RDK, Subtype.RESOURCE_TYPE_COMPONENT, "board")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import java.util.*
import kotlin.time.DurationUnit
import kotlin.time.toDuration

class BoardRPCService(private val manager: ResourceManager) : BoardServiceGrpc.BoardServiceImplBase(),
internal class BoardRPCService(private val manager: ResourceManager) : BoardServiceGrpc.BoardServiceImplBase(),
ResourceRPCService<Board> {

override fun setGPIO(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import com.viam.sdk.core.component.Component
import com.viam.sdk.core.resource.Resource
import com.viam.sdk.core.resource.Subtype
import com.viam.sdk.core.robot.RobotClient
import java.util.*

/**
* A [Motor] represents a physical motor
Expand All @@ -17,7 +16,7 @@ abstract class Motor(name: String) : Component(SUBTYPE, named(name)) {
value class Properties(val positionReporting: Boolean)

companion object {
@JvmStatic
@JvmField
val SUBTYPE = Subtype(Subtype.NAMESPACE_RDK, Subtype.RESOURCE_TYPE_COMPONENT, "motor")

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.viam.sdk.core.resource.ResourceRPCService
import io.grpc.stub.StreamObserver
import java.util.*

class MotorRPCService(private val manager: ResourceManager) : MotorServiceGrpc.MotorServiceImplBase(),
internal class MotorRPCService(private val manager: ResourceManager) : MotorServiceGrpc.MotorServiceImplBase(),
ResourceRPCService<Motor> {

override fun setPower(
Expand Down

0 comments on commit 0b2ac34

Please sign in to comment.