Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move kotlin files into their own directory #43

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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