From e3ea2304eff5ffcd9fc1b96fd52a7aa5014ae157 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Sun, 11 Apr 2021 15:12:09 +0300 Subject: [PATCH] package rename --- README.md | 2 +- build.gradle.kts | 2 +- .../mipt/npm/controls}/api/Device.kt | 0 .../mipt/npm/controls}/api/DeviceHub.kt | 0 .../mipt/npm/controls}/api/Socket.kt | 0 .../mipt/npm/controls}/api/descriptors.kt | 0 .../mipt/npm/controls}/base/DeviceAction.kt | 0 .../mipt/npm/controls}/base/DeviceBase.kt | 4 +++ .../mipt/npm/controls}/base/DeviceProperty.kt | 0 .../npm/controls}/base/TypedDeviceProperty.kt | 0 .../npm/controls}/base/actionDelegates.kt | 0 .../controls}/base/devicePropertyDelegates.kt | 0 .../mipt/npm/controls}/base/misc.kt | 0 .../controls}/controllers/DeviceController.kt | 0 .../controls}/controllers/DeviceManager.kt | 0 .../controls}/controllers/HubController.kt | 0 .../npm/controls}/messages/DeviceMessage.kt | 0 .../mipt/npm/controls}/ports/Port.kt | 0 .../mipt/npm/controls}/ports/PortProxy.kt | 0 .../controls}/ports/SynchronousPortHandler.kt | 0 .../mipt/npm/controls}/ports/phrases.kt | 0 .../npm/controls}/controllers/delegates.kt | 0 .../mipt/npm/controls}/ports/TcpPort.kt | 0 .../mipt/npm/controls}/ports/PortIOTest.kt | 0 .../dataforge/control/client/TangoPayload.kt | 24 ------------------ .../mipt/npm/controls/client/TangoPayload.kt | 24 ++++++++++++++++++ .../mipt/npm/controls}/client/magixClient.kt | 0 controls-magix-server/build.gradle.kts | 21 ++++++++++++++++ .../mipt/npm/controls}/serial/SerialPort.kt | 0 .../mipt/npm/controls}/server/conversions.kt | 0 .../npm/controls}/server/deviceWebServer.kt | 0 .../mipt/npm/controls}/ports/KtorTcpPort.kt | 0 .../npm/controls}/demo/DemoControllerView.kt | 2 +- .../mipt/npm/controls}/demo/DemoDevice.kt | 0 .../npm/controls}/demo/demoDeviceServer.kt | 0 .../controls}/demo/generateMessageSchema.kt | 0 docs/uml/device-properties.puml | 25 +++++++++++++++++++ gradle/wrapper/gradle-wrapper.properties | 2 +- magix/magix-server/build.gradle.kts | 2 +- .../pimotionmaster/PiMotionMasterApp.kt | 7 ++++-- settings.gradle.kts | 5 ++-- 41 files changed, 87 insertions(+), 33 deletions(-) rename controls-core/src/commonMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/api/Device.kt (100%) rename controls-core/src/commonMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/api/DeviceHub.kt (100%) rename controls-core/src/commonMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/api/Socket.kt (100%) rename controls-core/src/commonMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/api/descriptors.kt (100%) rename controls-core/src/commonMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/base/DeviceAction.kt (100%) rename controls-core/src/commonMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/base/DeviceBase.kt (98%) rename controls-core/src/commonMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/base/DeviceProperty.kt (100%) rename controls-core/src/commonMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/base/TypedDeviceProperty.kt (100%) rename controls-core/src/commonMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/base/actionDelegates.kt (100%) rename controls-core/src/commonMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/base/devicePropertyDelegates.kt (100%) rename controls-core/src/commonMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/base/misc.kt (100%) rename controls-core/src/commonMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/controllers/DeviceController.kt (100%) rename controls-core/src/commonMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/controllers/DeviceManager.kt (100%) rename controls-core/src/commonMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/controllers/HubController.kt (100%) rename controls-core/src/commonMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/messages/DeviceMessage.kt (100%) rename controls-core/src/commonMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/ports/Port.kt (100%) rename controls-core/src/commonMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/ports/PortProxy.kt (100%) rename controls-core/src/commonMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/ports/SynchronousPortHandler.kt (100%) rename controls-core/src/commonMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/ports/phrases.kt (100%) rename controls-core/src/jvmMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/controllers/delegates.kt (100%) rename controls-core/src/jvmMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/ports/TcpPort.kt (100%) rename controls-core/src/jvmTest/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/ports/PortIOTest.kt (100%) delete mode 100644 controls-magix-client/src/commonMain/kotlin/hep/dataforge/control/client/TangoPayload.kt create mode 100644 controls-magix-client/src/commonMain/kotlin/ru/mipt/npm/controls/client/TangoPayload.kt rename controls-magix-client/src/commonMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/client/magixClient.kt (100%) create mode 100644 controls-magix-server/build.gradle.kts rename controls-serial/src/main/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/serial/SerialPort.kt (100%) rename controls-server/src/main/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/server/conversions.kt (100%) rename controls-server/src/main/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/server/deviceWebServer.kt (100%) rename controls-tcp/src/jvmMain/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/ports/KtorTcpPort.kt (100%) rename demo/src/main/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/demo/DemoControllerView.kt (98%) rename demo/src/main/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/demo/DemoDevice.kt (100%) rename demo/src/main/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/demo/demoDeviceServer.kt (100%) rename demo/src/main/kotlin/{hep/dataforge/control => ru/mipt/npm/controls}/demo/generateMessageSchema.kt (100%) create mode 100644 docs/uml/device-properties.puml diff --git a/README.md b/README.md index 0177832..f8746e0 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Among other things, you can: ### `dataforge-control-core` module packages - `api` - defines API for device management. The main class here is -[`Device`](controls-core/src/commonMain/kotlin/hep/dataforge/control/api/Device.kt). +[`Device`](controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/api/Device.kt). Generally, a Device has Properties that can be read and written. Also, some Actions can optionally be applied on a device (may or may not affect properties). diff --git a/build.gradle.kts b/build.gradle.kts index 6711893..de93677 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,7 +4,7 @@ plugins { kotlin("js") apply false } -val dataforgeVersion: String by extra("0.4.0-dev-2") +val dataforgeVersion: String by extra("0.4.0-dev-8") val ktorVersion: String by extra(ru.mipt.npm.gradle.KScienceVersions.ktorVersion) val rsocketVersion by extra("0.12.0") diff --git a/controls-core/src/commonMain/kotlin/hep/dataforge/control/api/Device.kt b/controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/api/Device.kt similarity index 100% rename from controls-core/src/commonMain/kotlin/hep/dataforge/control/api/Device.kt rename to controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/api/Device.kt diff --git a/controls-core/src/commonMain/kotlin/hep/dataforge/control/api/DeviceHub.kt b/controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/api/DeviceHub.kt similarity index 100% rename from controls-core/src/commonMain/kotlin/hep/dataforge/control/api/DeviceHub.kt rename to controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/api/DeviceHub.kt diff --git a/controls-core/src/commonMain/kotlin/hep/dataforge/control/api/Socket.kt b/controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/api/Socket.kt similarity index 100% rename from controls-core/src/commonMain/kotlin/hep/dataforge/control/api/Socket.kt rename to controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/api/Socket.kt diff --git a/controls-core/src/commonMain/kotlin/hep/dataforge/control/api/descriptors.kt b/controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/api/descriptors.kt similarity index 100% rename from controls-core/src/commonMain/kotlin/hep/dataforge/control/api/descriptors.kt rename to controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/api/descriptors.kt diff --git a/controls-core/src/commonMain/kotlin/hep/dataforge/control/base/DeviceAction.kt b/controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/base/DeviceAction.kt similarity index 100% rename from controls-core/src/commonMain/kotlin/hep/dataforge/control/base/DeviceAction.kt rename to controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/base/DeviceAction.kt diff --git a/controls-core/src/commonMain/kotlin/hep/dataforge/control/base/DeviceBase.kt b/controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/base/DeviceBase.kt similarity index 98% rename from controls-core/src/commonMain/kotlin/hep/dataforge/control/base/DeviceBase.kt rename to controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/base/DeviceBase.kt index 23a29e1..047521c 100644 --- a/controls-core/src/commonMain/kotlin/hep/dataforge/control/base/DeviceBase.kt +++ b/controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/base/DeviceBase.kt @@ -24,6 +24,10 @@ public data class LogEntry(val content: String, val priority: Int = 0) @Suppress("EXPERIMENTAL_API_USAGE") public abstract class DeviceBase(override val context: Context) : Device { + override val scope: CoroutineScope by lazy { + CoroutineScope(context.coroutineContext + Job(context.coroutineContext[Job])) + } + private val _properties = HashMap() public val properties: Map get() = _properties private val _actions = HashMap() diff --git a/controls-core/src/commonMain/kotlin/hep/dataforge/control/base/DeviceProperty.kt b/controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/base/DeviceProperty.kt similarity index 100% rename from controls-core/src/commonMain/kotlin/hep/dataforge/control/base/DeviceProperty.kt rename to controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/base/DeviceProperty.kt diff --git a/controls-core/src/commonMain/kotlin/hep/dataforge/control/base/TypedDeviceProperty.kt b/controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/base/TypedDeviceProperty.kt similarity index 100% rename from controls-core/src/commonMain/kotlin/hep/dataforge/control/base/TypedDeviceProperty.kt rename to controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/base/TypedDeviceProperty.kt diff --git a/controls-core/src/commonMain/kotlin/hep/dataforge/control/base/actionDelegates.kt b/controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/base/actionDelegates.kt similarity index 100% rename from controls-core/src/commonMain/kotlin/hep/dataforge/control/base/actionDelegates.kt rename to controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/base/actionDelegates.kt diff --git a/controls-core/src/commonMain/kotlin/hep/dataforge/control/base/devicePropertyDelegates.kt b/controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/base/devicePropertyDelegates.kt similarity index 100% rename from controls-core/src/commonMain/kotlin/hep/dataforge/control/base/devicePropertyDelegates.kt rename to controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/base/devicePropertyDelegates.kt diff --git a/controls-core/src/commonMain/kotlin/hep/dataforge/control/base/misc.kt b/controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/base/misc.kt similarity index 100% rename from controls-core/src/commonMain/kotlin/hep/dataforge/control/base/misc.kt rename to controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/base/misc.kt diff --git a/controls-core/src/commonMain/kotlin/hep/dataforge/control/controllers/DeviceController.kt b/controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/controllers/DeviceController.kt similarity index 100% rename from controls-core/src/commonMain/kotlin/hep/dataforge/control/controllers/DeviceController.kt rename to controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/controllers/DeviceController.kt diff --git a/controls-core/src/commonMain/kotlin/hep/dataforge/control/controllers/DeviceManager.kt b/controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/controllers/DeviceManager.kt similarity index 100% rename from controls-core/src/commonMain/kotlin/hep/dataforge/control/controllers/DeviceManager.kt rename to controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/controllers/DeviceManager.kt diff --git a/controls-core/src/commonMain/kotlin/hep/dataforge/control/controllers/HubController.kt b/controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/controllers/HubController.kt similarity index 100% rename from controls-core/src/commonMain/kotlin/hep/dataforge/control/controllers/HubController.kt rename to controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/controllers/HubController.kt diff --git a/controls-core/src/commonMain/kotlin/hep/dataforge/control/messages/DeviceMessage.kt b/controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/messages/DeviceMessage.kt similarity index 100% rename from controls-core/src/commonMain/kotlin/hep/dataforge/control/messages/DeviceMessage.kt rename to controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/messages/DeviceMessage.kt diff --git a/controls-core/src/commonMain/kotlin/hep/dataforge/control/ports/Port.kt b/controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/ports/Port.kt similarity index 100% rename from controls-core/src/commonMain/kotlin/hep/dataforge/control/ports/Port.kt rename to controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/ports/Port.kt diff --git a/controls-core/src/commonMain/kotlin/hep/dataforge/control/ports/PortProxy.kt b/controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/ports/PortProxy.kt similarity index 100% rename from controls-core/src/commonMain/kotlin/hep/dataforge/control/ports/PortProxy.kt rename to controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/ports/PortProxy.kt diff --git a/controls-core/src/commonMain/kotlin/hep/dataforge/control/ports/SynchronousPortHandler.kt b/controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/ports/SynchronousPortHandler.kt similarity index 100% rename from controls-core/src/commonMain/kotlin/hep/dataforge/control/ports/SynchronousPortHandler.kt rename to controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/ports/SynchronousPortHandler.kt diff --git a/controls-core/src/commonMain/kotlin/hep/dataforge/control/ports/phrases.kt b/controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/ports/phrases.kt similarity index 100% rename from controls-core/src/commonMain/kotlin/hep/dataforge/control/ports/phrases.kt rename to controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/ports/phrases.kt diff --git a/controls-core/src/jvmMain/kotlin/hep/dataforge/control/controllers/delegates.kt b/controls-core/src/jvmMain/kotlin/ru/mipt/npm/controls/controllers/delegates.kt similarity index 100% rename from controls-core/src/jvmMain/kotlin/hep/dataforge/control/controllers/delegates.kt rename to controls-core/src/jvmMain/kotlin/ru/mipt/npm/controls/controllers/delegates.kt diff --git a/controls-core/src/jvmMain/kotlin/hep/dataforge/control/ports/TcpPort.kt b/controls-core/src/jvmMain/kotlin/ru/mipt/npm/controls/ports/TcpPort.kt similarity index 100% rename from controls-core/src/jvmMain/kotlin/hep/dataforge/control/ports/TcpPort.kt rename to controls-core/src/jvmMain/kotlin/ru/mipt/npm/controls/ports/TcpPort.kt diff --git a/controls-core/src/jvmTest/kotlin/hep/dataforge/control/ports/PortIOTest.kt b/controls-core/src/jvmTest/kotlin/ru/mipt/npm/controls/ports/PortIOTest.kt similarity index 100% rename from controls-core/src/jvmTest/kotlin/hep/dataforge/control/ports/PortIOTest.kt rename to controls-core/src/jvmTest/kotlin/ru/mipt/npm/controls/ports/PortIOTest.kt diff --git a/controls-magix-client/src/commonMain/kotlin/hep/dataforge/control/client/TangoPayload.kt b/controls-magix-client/src/commonMain/kotlin/hep/dataforge/control/client/TangoPayload.kt deleted file mode 100644 index d545105..0000000 --- a/controls-magix-client/src/commonMain/kotlin/hep/dataforge/control/client/TangoPayload.kt +++ /dev/null @@ -1,24 +0,0 @@ -package space.kscience.dataforge.control.client - -public sealed class TangoPayload( - val host: String, - val device: String, - val name: String, - val timestamp: Long? = null, - val quality: String = "VALID", - val event: String? = null, -// val input: Any? = null, -// val output: Any? = null, -// val errors: Iterable?, -) - -public class TangoAttributePayload( - host: String, - device: String, - name: String, - val value: Any? = null, - timestamp: Long? = null, - quality: String = "VALID", - event: String? = null, - errors: Iterable?, -) : TangoPayload(host, device, name, timestamp, quality, event) \ No newline at end of file diff --git a/controls-magix-client/src/commonMain/kotlin/ru/mipt/npm/controls/client/TangoPayload.kt b/controls-magix-client/src/commonMain/kotlin/ru/mipt/npm/controls/client/TangoPayload.kt new file mode 100644 index 0000000..8bce776 --- /dev/null +++ b/controls-magix-client/src/commonMain/kotlin/ru/mipt/npm/controls/client/TangoPayload.kt @@ -0,0 +1,24 @@ +package space.kscience.dataforge.control.client + +//public sealed class TangoPayload( +// val host: String, +// val device: String, +// val name: String, +// val timestamp: Long? = null, +// val quality: String = "VALID", +// val event: String? = null, +//// val input: Any? = null, +//// val output: Any? = null, +//// val errors: Iterable?, +//) +// +//public class TangoAttributePayload( +// host: String, +// device: String, +// name: String, +// val value: Any? = null, +// timestamp: Long? = null, +// quality: String = "VALID", +// event: String? = null, +// errors: Iterable?, +//) : TangoPayload(host, device, name, timestamp, quality, event) \ No newline at end of file diff --git a/controls-magix-client/src/commonMain/kotlin/hep/dataforge/control/client/magixClient.kt b/controls-magix-client/src/commonMain/kotlin/ru/mipt/npm/controls/client/magixClient.kt similarity index 100% rename from controls-magix-client/src/commonMain/kotlin/hep/dataforge/control/client/magixClient.kt rename to controls-magix-client/src/commonMain/kotlin/ru/mipt/npm/controls/client/magixClient.kt diff --git a/controls-magix-server/build.gradle.kts b/controls-magix-server/build.gradle.kts new file mode 100644 index 0000000..c9963fc --- /dev/null +++ b/controls-magix-server/build.gradle.kts @@ -0,0 +1,21 @@ +plugins { + id("ru.mipt.npm.gradle.mpp") + `maven-publish` +} + +kscience{ + useSerialization { + json() + } +} + +kotlin { + sourceSets { + commonMain { + dependencies { + implementation(project(":magix:magix-server")) + implementation(project(":controls-core")) + } + } + } +} \ No newline at end of file diff --git a/controls-serial/src/main/kotlin/hep/dataforge/control/serial/SerialPort.kt b/controls-serial/src/main/kotlin/ru/mipt/npm/controls/serial/SerialPort.kt similarity index 100% rename from controls-serial/src/main/kotlin/hep/dataforge/control/serial/SerialPort.kt rename to controls-serial/src/main/kotlin/ru/mipt/npm/controls/serial/SerialPort.kt diff --git a/controls-server/src/main/kotlin/hep/dataforge/control/server/conversions.kt b/controls-server/src/main/kotlin/ru/mipt/npm/controls/server/conversions.kt similarity index 100% rename from controls-server/src/main/kotlin/hep/dataforge/control/server/conversions.kt rename to controls-server/src/main/kotlin/ru/mipt/npm/controls/server/conversions.kt diff --git a/controls-server/src/main/kotlin/hep/dataforge/control/server/deviceWebServer.kt b/controls-server/src/main/kotlin/ru/mipt/npm/controls/server/deviceWebServer.kt similarity index 100% rename from controls-server/src/main/kotlin/hep/dataforge/control/server/deviceWebServer.kt rename to controls-server/src/main/kotlin/ru/mipt/npm/controls/server/deviceWebServer.kt diff --git a/controls-tcp/src/jvmMain/kotlin/hep/dataforge/control/ports/KtorTcpPort.kt b/controls-tcp/src/jvmMain/kotlin/ru/mipt/npm/controls/ports/KtorTcpPort.kt similarity index 100% rename from controls-tcp/src/jvmMain/kotlin/hep/dataforge/control/ports/KtorTcpPort.kt rename to controls-tcp/src/jvmMain/kotlin/ru/mipt/npm/controls/ports/KtorTcpPort.kt diff --git a/demo/src/main/kotlin/hep/dataforge/control/demo/DemoControllerView.kt b/demo/src/main/kotlin/ru/mipt/npm/controls/demo/DemoControllerView.kt similarity index 98% rename from demo/src/main/kotlin/hep/dataforge/control/demo/DemoControllerView.kt rename to demo/src/main/kotlin/ru/mipt/npm/controls/demo/DemoControllerView.kt index e515d1a..1670610 100644 --- a/demo/src/main/kotlin/hep/dataforge/control/demo/DemoControllerView.kt +++ b/demo/src/main/kotlin/ru/mipt/npm/controls/demo/DemoControllerView.kt @@ -18,7 +18,7 @@ class DemoController : Controller(), ContextAware { var device: DemoDevice? = null var server: ApplicationEngine? = null - override val context = Global.context("demoDevice") + override val context = Global.buildContext("demoDevice") fun init() { context.launch { diff --git a/demo/src/main/kotlin/hep/dataforge/control/demo/DemoDevice.kt b/demo/src/main/kotlin/ru/mipt/npm/controls/demo/DemoDevice.kt similarity index 100% rename from demo/src/main/kotlin/hep/dataforge/control/demo/DemoDevice.kt rename to demo/src/main/kotlin/ru/mipt/npm/controls/demo/DemoDevice.kt diff --git a/demo/src/main/kotlin/hep/dataforge/control/demo/demoDeviceServer.kt b/demo/src/main/kotlin/ru/mipt/npm/controls/demo/demoDeviceServer.kt similarity index 100% rename from demo/src/main/kotlin/hep/dataforge/control/demo/demoDeviceServer.kt rename to demo/src/main/kotlin/ru/mipt/npm/controls/demo/demoDeviceServer.kt diff --git a/demo/src/main/kotlin/hep/dataforge/control/demo/generateMessageSchema.kt b/demo/src/main/kotlin/ru/mipt/npm/controls/demo/generateMessageSchema.kt similarity index 100% rename from demo/src/main/kotlin/hep/dataforge/control/demo/generateMessageSchema.kt rename to demo/src/main/kotlin/ru/mipt/npm/controls/demo/generateMessageSchema.kt diff --git a/docs/uml/device-properties.puml b/docs/uml/device-properties.puml new file mode 100644 index 0000000..2b3c5ae --- /dev/null +++ b/docs/uml/device-properties.puml @@ -0,0 +1,25 @@ +@startuml +participant Physical +participant Logical +participant Remote + +group Asynchronous update + Physical -> Logical: Notify changed + Logical -> Remote: Send event +end + +group Timed update + Logical -> Logical: Timed check + Logical -> Physical: Request value + Physical -> Logical: Respond + Logical --> Remote: Send event if changed +end + +group Request update + Remote -> Logical: Request value + Logical --> Physical: Request if needed + Physical --> Logical: Respond + Logical -> Remote: Force send event +end + +@enduml \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index da9702f..f371643 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/magix/magix-server/build.gradle.kts b/magix/magix-server/build.gradle.kts index 69e7947..e9ffdb3 100644 --- a/magix/magix-server/build.gradle.kts +++ b/magix/magix-server/build.gradle.kts @@ -12,7 +12,7 @@ kscience { val dataforgeVersion: String by rootProject.extra val rsocketVersion: String by rootProject.extra -val ktorVersion: String = "1.5.3" +val ktorVersion: String = ru.mipt.npm.gradle.KScienceVersions.ktorVersion dependencies{ api(project(":magix:magix-api")) diff --git a/motors/src/main/kotlin/ru/mipt/npm/devices/pimotionmaster/PiMotionMasterApp.kt b/motors/src/main/kotlin/ru/mipt/npm/devices/pimotionmaster/PiMotionMasterApp.kt index 463ad6a..8cce497 100644 --- a/motors/src/main/kotlin/ru/mipt/npm/devices/pimotionmaster/PiMotionMasterApp.kt +++ b/motors/src/main/kotlin/ru/mipt/npm/devices/pimotionmaster/PiMotionMasterApp.kt @@ -12,6 +12,7 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Job import kotlinx.coroutines.launch import space.kscience.dataforge.context.Global +import space.kscience.dataforge.context.fetch import space.kscience.dataforge.control.controllers.DeviceManager import space.kscience.dataforge.control.controllers.installing import tornadofx.* @@ -20,10 +21,12 @@ class PiMotionMasterApp : App(PiMotionMasterView::class) class PiMotionMasterController : Controller() { //initialize context - val context = Global.context("piMotionMaster") + val context = Global.buildContext("piMotionMaster"){ + plugin(DeviceManager) + } //initialize deviceManager plugin - val deviceManager: DeviceManager = context.plugins.load(DeviceManager) + val deviceManager: DeviceManager = context.fetch(DeviceManager) // install device val motionMaster: PiMotionMasterDevice by deviceManager.installing(PiMotionMasterDevice) diff --git a/settings.gradle.kts b/settings.gradle.kts index f4d01b9..14e7573 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,6 +1,6 @@ pluginManagement { - val kotlinVersion = "1.4.32" - val toolsVersion = "0.9.3" + val kotlinVersion = "1.5.0-M2" + val toolsVersion = "0.9.5-dev" repositories { mavenLocal() @@ -35,6 +35,7 @@ include( ":magix:magix-service", ":magix:magix-java-client", ":controls-magix-client", + ":controls-magix-server", ":motors" )