All done for 0.2.0 release

This commit is contained in:
Alexander Nozik 2023-08-23 16:21:11 +03:00
parent 641daec7e9
commit 990e4794a1
47 changed files with 399 additions and 337 deletions

32
CHANGELOG.md Normal file
View File

@ -0,0 +1,32 @@
# Changelog
## Unreleased
### Added
- Core interfaces for building a device server
- Magix service for binding controls devices (both as RPC client and server)
- A plugin for Controls-kt device server on top of modbus-rtu/modbus-tcp protocols
- A client and server connectors for OPC-UA via Eclipse Milo
- Implementation of byte ports on top os ktor-io asynchronous API
- Implementation of direct serial port communication with JSerialComm
- A combined Magix event loop server with web server for visualization.
- An API for stand-alone Controls-kt device or a hub.
- An implementation of controls-storage on top of JetBrains Xodus.
- A kotlin API for magix standard and some zero-dependency magix services
- Java API to work with magix endpoints without Kotlin
- MQTT client magix endpoint
- RabbitMQ client magix endpoint
- Magix endpoint (client) based on RSocket
- A magix event loop implementation in Kotlin. Includes HTTP/SSE and RSocket routes.
- Magix history database API
- ZMQ client endpoint for Magix
### Changed
### Deprecated
### Removed
### Fixed
### Security

View File

@ -43,7 +43,7 @@ Example view of a demo:
### [controls-core](controls-core)
>
> Core interfaces for building a device server
>
> **Maturity**: EXPERIMENTAL
>
@ -51,140 +51,150 @@ Example view of a demo:
> - [device](controls-core/src/commonMain/kotlin/space/kscience/controls/api/Device.kt) : Device API with subscription (asynchronous and pseudo-synchronous properties)
> - [deviceMessage](controls-core/src/commonMain/kotlin/space/kscience/controls/api/DeviceMessage.kt) : Specification for messages used to communicate between Controls-kt devices.
> - [deviceHub](controls-core/src/commonMain/kotlin/space/kscience/controls/api/DeviceHub.kt) : Grouping of devices into local tree-like hubs.
> - [deviceSpec](controls-core/src/commonMain/kotlin/space/kscience/controls/spec) : Mechanics and type-safe builders for devices. Including separation of device specification and device state.
> - [deviceManager](controls-core/src/commonMain/kotlin/space/kscience/controls/manager) : DataForge DI integration for devices. Includes device builders.
> - [ports](controls-core/src/commonMain/kotlin/space/kscience/controls/ports) : Working with asynchronous data sending and receiving raw byte arrays
### [controls-magix-client](controls-magix-client)
>
### [controls-magix](controls-magix)
> Magix service for binding controls devices (both as RPC client and server)
>
> **Maturity**: EXPERIMENTAL
>
> **Features:**
> - [controlsMagix](controls-magix/src/commonMain/kotlin/space/kscience/controls/client/controlsMagix.kt) : Connect a `DeviceManage` with one or many devices to the Magix endpoint
> - [DeviceClient](controls-magix/src/commonMain/kotlin/space/kscience/controls/client/DeviceClient.kt) : A remote connector to Controls-kt device via Magix
### [controls-modbus](controls-modbus)
>
> A plugin for Controls-kt device server on top of modbus-rtu/modbus-tcp protocols
>
> **Maturity**: EXPERIMENTAL
>
> **Features:**
> - [modbusRegistryMap](controls-modbus/src/main/kotlin/space/kscience/controls/modbus/ModbusRegistryMap.kt) : Type-safe modbus registry map. Allows to define both single-register and multi-register entries (using DataForge IO).
Automatically checks consistency.
> - [modbusProcessImage](controls-modbus/src/main/kotlin/space/kscience/controls/modbus/DeviceProcessImage.kt) : Binding of slave (server) modbus device to Controls-kt device
> - [modbusDevice](controls-modbus/src/main/kotlin/space/kscience/controls/modbus/ModbusDevice.kt) : A device with additional methods to work with modbus registers.
### [controls-opcua](controls-opcua)
>
> A client and server connectors for OPC-UA via Eclipse Milo
>
> **Maturity**: EXPERIMENTAL
>
> **Features:**
> - [opcuaClient](controls-opcua/src/main/kotlin/space/kscience/controls/opcua/client) : Connect a Controls-kt as a client to OPC UA server
> - [opcuaServer](controls-opcua/src/main/kotlin/space/kscience/controls/opcua/server) : Create an OPC UA server on top of Controls-kt device (or device hub)
### [controls-pi](controls-pi)
>
> Utils to work with controls-kt on Raspberry pi
>
> **Maturity**: EXPERIMENTAL
### [controls-ports-ktor](controls-ports-ktor)
>
> Implementation of byte ports on top os ktor-io asynchronous API
>
> **Maturity**: EXPERIMENTAL
> **Maturity**: PROTOTYPE
### [controls-serial](controls-serial)
>
> Implementation of direct serial port communication with JSerialComm
>
> **Maturity**: EXPERIMENTAL
### [controls-server](controls-server)
>
> A combined Magix event loop server with web server for visualization.
>
> **Maturity**: EXPERIMENTAL
> **Maturity**: PROTOTYPE
### [controls-storage](controls-storage)
>
> An API for stand-alone Controls-kt device or a hub.
>
> **Maturity**: PROTOTYPE
### [demo](demo)
>
>
> **Maturity**: EXPERIMENTAL
### [magix](magix)
>
>
> **Maturity**: EXPERIMENTAL
### [controls-storage/controls-xodus](controls-storage/controls-xodus)
>
> An implementation of controls-storage on top of JetBrains Xodus.
>
> **Maturity**: PROTOTYPE
### [demo/all-things](demo/all-things)
>
>
> **Maturity**: EXPERIMENTAL
### [demo/car](demo/car)
>
>
> **Maturity**: EXPERIMENTAL
### [demo/echo](demo/echo)
>
>
> **Maturity**: EXPERIMENTAL
### [demo/magix-demo](demo/magix-demo)
>
>
> **Maturity**: EXPERIMENTAL
### [demo/many-devices](demo/many-devices)
>
>
> **Maturity**: EXPERIMENTAL
### [demo/mks-pdr900](demo/mks-pdr900)
>
>
> **Maturity**: EXPERIMENTAL
### [demo/motors](demo/motors)
>
>
> **Maturity**: EXPERIMENTAL
### [magix/magix-api](magix/magix-api)
>
> A kotlin API for magix standard and some zero-dependency magix services
>
> **Maturity**: EXPERIMENTAL
### [magix/magix-java-client](magix/magix-java-client)
>
### [magix/magix-java-endpoint](magix/magix-java-endpoint)
> Java API to work with magix endpoints without Kotlin
>
> **Maturity**: EXPERIMENTAL
### [magix/magix-mqtt](magix/magix-mqtt)
>
> MQTT client magix endpoint
>
> **Maturity**: PROTOTYPE
### [magix/magix-rabbit](magix/magix-rabbit)
>
> RabbitMQ client magix endpoint
>
> **Maturity**: PROTOTYPE
### [magix/magix-rsocket](magix/magix-rsocket)
>
> Magix endpoint (client) based on RSocket
>
> **Maturity**: EXPERIMENTAL
### [magix/magix-server](magix/magix-server)
>
> A magix event loop implementation in Kotlin. Includes HTTP/SSE and RSocket routes.
>
> **Maturity**: EXPERIMENTAL
### [magix/magix-storage](magix/magix-storage)
>
> Magix history database API
>
> **Maturity**: EXPERIMENTAL
> **Maturity**: PROTOTYPE
### [magix/magix-zmq](magix/magix-zmq)
>
> ZMQ client endpoint for Magix
>
> **Maturity**: EXPERIMENTAL
### [magix/magix-storage/magix-storage-xodus](magix/magix-storage/magix-storage-xodus)
>
>
> **Maturity**: PROTOTYPE

View File

@ -13,7 +13,7 @@ val xodusVersion by extra("2.0.1")
allprojects {
group = "space.kscience"
version = "0.2.0-dev-2"
version = "0.2.0"
repositories{
maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev")
}

View File

@ -1,39 +1,33 @@
# Module controls-core
Core interfaces for building a device server
## Features
- [device](src/commonMain/kotlin/space/kscience/controls/api/Device.kt) : Device API with subscription (asynchronous and pseudo-synchronous properties)
- [deviceMessage](src/commonMain/kotlin/space/kscience/controls/api/DeviceMessage.kt) : Specification for messages used to communicate between Controls-kt devices.
- [deviceHub](src/commonMain/kotlin/space/kscience/controls/api/DeviceHub.kt) : Grouping of devices into local tree-like hubs.
- [deviceSpec](src/commonMain/kotlin/space/kscience/controls/spec) : Mechanics and type-safe builders for devices. Including separation of device specification and device state.
- [deviceManager](src/commonMain/kotlin/space/kscience/controls/manager) : DataForge DI integration for devices. Includes device builders.
- [ports](src/commonMain/kotlin/space/kscience/controls/ports) : Working with asynchronous data sending and receiving raw byte arrays
## Usage
## Artifact:
The Maven coordinates of this project are `space.kscience:controls-core:0.2.0-dev-2`.
The Maven coordinates of this project are `space.kscience:controls-core:0.2.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'space.kscience:controls-core:0.2.0-dev-2'
}
```
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
//uncomment to access development builds
//maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev")
mavenCentral()
}
dependencies {
implementation("space.kscience:controls-core:0.2.0-dev-2")
implementation("space.kscience:controls-core:0.2.0")
}
```

View File

@ -1,8 +1,14 @@
import space.kscience.gradle.Maturity
plugins {
id("space.kscience.gradle.mpp")
`maven-publish`
}
description = """
Core interfaces for building a device server
""".trimIndent()
val dataforgeVersion: String by rootProject.extra
kscience {
@ -22,25 +28,41 @@ kscience {
readme{
maturity = Maturity.EXPERIMENTAL
feature("device", ref = "src/commonMain/kotlin/space/kscience/controls/api/Device.kt"){
"""
Device API with subscription (asynchronous and pseudo-synchronous properties)
""".trimIndent()
}
}
readme{
feature("deviceMessage", ref = "src/commonMain/kotlin/space/kscience/controls/api/DeviceMessage.kt"){
"""
Specification for messages used to communicate between Controls-kt devices.
""".trimIndent()
}
}
readme{
feature("deviceHub", ref = "src/commonMain/kotlin/space/kscience/controls/api/DeviceHub.kt"){
"""
Grouping of devices into local tree-like hubs.
""".trimIndent()
}
feature("deviceSpec", ref = "src/commonMain/kotlin/space/kscience/controls/spec"){
"""
Mechanics and type-safe builders for devices. Including separation of device specification and device state.
""".trimIndent()
}
feature("deviceManager", ref = "src/commonMain/kotlin/space/kscience/controls/manager"){
"""
DataForge DI integration for devices. Includes device builders.
""".trimIndent()
}
feature("ports", ref = "src/commonMain/kotlin/space/kscience/controls/ports"){
"""
Working with asynchronous data sending and receiving raw byte arrays
""".trimIndent()
}
}

View File

@ -1,32 +1,29 @@
# Module controls-magix-client
# Module controls-magix
Magix service for binding controls devices (both as RPC client and server)
## Features
- [controlsMagix](src/commonMain/kotlin/space/kscience/controls/client/controlsMagix.kt) : Connect a `DeviceManage` with one or many devices to the Magix endpoint
- [DeviceClient](src/commonMain/kotlin/space/kscience/controls/client/DeviceClient.kt) : A remote connector to Controls-kt device via Magix
Magix service for binding controls devices (both as RPC client and server
## Usage
## Artifact:
The Maven coordinates of this project are `space.kscience:controls-magix-client:0.2.0-dev-2`.
The Maven coordinates of this project are `space.kscience:controls-magix:0.2.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'space.kscience:controls-magix-client:0.2.0-dev-2'
}
```
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
//uncomment to access development builds
//maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev")
mavenCentral()
}
dependencies {
implementation("space.kscience:controls-magix-client:0.2.0-dev-2")
implementation("space.kscience:controls-magix:0.2.0")
}
```

View File

@ -1,3 +1,5 @@
import space.kscience.gradle.Maturity
plugins {
id("space.kscience.gradle.mpp")
`maven-publish`
@ -21,5 +23,17 @@ kscience {
}
readme {
maturity = Maturity.EXPERIMENTAL
feature("controlsMagix", ref = "src/commonMain/kotlin/space/kscience/controls/client/controlsMagix.kt"){
"""
Connect a `DeviceManage` with one or many devices to the Magix endpoint
""".trimIndent()
}
feature("DeviceClient", ref = "src/commonMain/kotlin/space/kscience/controls/client/DeviceClient.kt"){
"""
A remote connector to Controls-kt device via Magix
""".trimIndent()
}
}

View File

@ -2,31 +2,30 @@
A plugin for Controls-kt device server on top of modbus-rtu/modbus-tcp protocols
## Features
- [modbusRegistryMap](src/main/kotlin/space/kscience/controls/modbus/ModbusRegistryMap.kt) : Type-safe modbus registry map. Allows to define both single-register and multi-register entries (using DataForge IO).
Automatically checks consistency.
- [modbusProcessImage](src/main/kotlin/space/kscience/controls/modbus/DeviceProcessImage.kt) : Binding of slave (server) modbus device to Controls-kt device
- [modbusDevice](src/main/kotlin/space/kscience/controls/modbus/ModbusDevice.kt) : A device with additional methods to work with modbus registers.
## Usage
## Artifact:
The Maven coordinates of this project are `space.kscience:controls-modbus:0.2.0-dev-2`.
The Maven coordinates of this project are `space.kscience:controls-modbus:0.2.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'space.kscience:controls-modbus:0.2.0-dev-2'
}
```
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
//uncomment to access development builds
//maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev")
mavenCentral()
}
dependencies {
implementation("space.kscience:controls-modbus:0.2.0-dev-2")
implementation("space.kscience:controls-modbus:0.2.0")
}
```

View File

@ -1,3 +1,5 @@
import space.kscience.gradle.Maturity
plugins {
id("space.kscience.gradle.jvm")
`maven-publish`
@ -12,3 +14,26 @@ dependencies {
api(projects.controlsCore)
api("com.ghgande:j2mod:3.1.1")
}
readme{
maturity = Maturity.EXPERIMENTAL
feature("modbusRegistryMap", ref = "src/main/kotlin/space/kscience/controls/modbus/ModbusRegistryMap.kt"){
"""
Type-safe modbus registry map. Allows to define both single-register and multi-register entries (using DataForge IO).
Automatically checks consistency.
""".trimIndent()
}
feature("modbusProcessImage", ref = "src/main/kotlin/space/kscience/controls/modbus/DeviceProcessImage.kt"){
"""
Binding of slave (server) modbus device to Controls-kt device
""".trimIndent()
}
feature("modbusDevice", ref = "src/main/kotlin/space/kscience/controls/modbus/ModbusDevice.kt"){
"""
A device with additional methods to work with modbus registers.
""".trimIndent()
}
}

View File

@ -12,7 +12,7 @@ import space.kscience.controls.spec.set
import space.kscience.controls.spec.useProperty
public class DeviceProcessImageBuilder<D : Device>(
public class DeviceProcessImageBuilder<D : Device> internal constructor(
private val device: D,
public val image: ProcessImageImplementation,
) {
@ -201,7 +201,9 @@ public class DeviceProcessImageBuilder<D : Device>(
}
/**
* Bind the device to Modbus slave (server) image.
*/
public fun <D : Device> D.bindProcessImage(
openOnBind: Boolean = true,
binding: DeviceProcessImageBuilder<D>.() -> Unit,

View File

@ -1,32 +1,29 @@
# Module controls-opcua
A client and server connectors for OPC-UA via Eclipse Milo
## Features
- [opcuaClient](src/main/kotlin/space/kscience/controls/opcua/client) : Connect a Controls-kt as a client to OPC UA server
- [opcuaServer](src/main/kotlin/space/kscience/controls/opcua/server) : Create an OPC UA server on top of Controls-kt device (or device hub)
## Usage
## Artifact:
The Maven coordinates of this project are `space.kscience:controls-opcua:0.2.0-dev-2`.
The Maven coordinates of this project are `space.kscience:controls-opcua:0.2.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'space.kscience:controls-opcua:0.2.0-dev-2'
}
```
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
//uncomment to access development builds
//maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev")
mavenCentral()
}
dependencies {
implementation("space.kscience:controls-opcua:0.2.0-dev-2")
implementation("space.kscience:controls-opcua:0.2.0")
}
```

View File

@ -1,11 +1,17 @@
import space.kscience.gradle.Maturity
plugins {
id("space.kscience.gradle.jvm")
`maven-publish`
}
description = """
A client and server connectors for OPC-UA via Eclipse Milo
""".trimIndent()
val ktorVersion: String by rootProject.extra
val miloVersion: String = "0.6.9"
val miloVersion: String = "0.6.10"
dependencies {
api(projects.controlsCore)
@ -17,3 +23,19 @@ dependencies {
testImplementation(spclibs.kotlinx.coroutines.test)
}
readme{
maturity = Maturity.EXPERIMENTAL
feature("opcuaClient", ref = "src/main/kotlin/space/kscience/controls/opcua/client"){
"""
Connect a Controls-kt as a client to OPC UA server
""".trimIndent()
}
feature("opcuaServer", ref = "src/main/kotlin/space/kscience/controls/opcua/server"){
"""
Create an OPC UA server on top of Controls-kt device (or device hub)
""".trimIndent()
}
}

View File

@ -1,32 +1,23 @@
# Module controls-pi
Utils to work with controls-kt on Raspberry pi
## Usage
## Artifact:
The Maven coordinates of this project are `space.kscience:controls-pi:0.2.0-dev-2`.
The Maven coordinates of this project are `space.kscience:controls-pi:0.2.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'space.kscience:controls-pi:0.2.0-dev-2'
}
```
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
//uncomment to access development builds
//maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev")
mavenCentral()
}
dependencies {
implementation("space.kscience:controls-pi:0.2.0-dev-2")
implementation("space.kscience:controls-pi:0.2.0")
}
```

View File

@ -3,6 +3,10 @@ plugins {
`maven-publish`
}
description = """
Utils to work with controls-kt on Raspberry pi
""".trimIndent()
dependencies{
api(project(":controls-core"))
api("com.pi4j:pi4j-ktx:2.4.0") // Kotlin DSL

View File

@ -1,32 +1,23 @@
# Module controls-ports-ktor
Implementation of byte ports on top os ktor-io asynchronous API
## Usage
## Artifact:
The Maven coordinates of this project are `space.kscience:controls-ports-ktor:0.2.0-dev-2`.
The Maven coordinates of this project are `space.kscience:controls-ports-ktor:0.2.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'space.kscience:controls-ports-ktor:0.2.0-dev-2'
}
```
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
//uncomment to access development builds
//maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev")
mavenCentral()
}
dependencies {
implementation("space.kscience:controls-ports-ktor:0.2.0-dev-2")
implementation("space.kscience:controls-ports-ktor:0.2.0")
}
```

View File

@ -1,11 +1,21 @@
import space.kscience.gradle.Maturity
plugins {
id("space.kscience.gradle.jvm")
`maven-publish`
}
description = """
Implementation of byte ports on top os ktor-io asynchronous API
""".trimIndent()
val ktorVersion: String by rootProject.extra
dependencies {
api(projects.controlsCore)
api("io.ktor:ktor-network:$ktorVersion")
}
readme{
maturity = Maturity.PROTOTYPE
}

View File

@ -1,32 +1,23 @@
# Module controls-serial
Implementation of direct serial port communication with JSerialComm
## Usage
## Artifact:
The Maven coordinates of this project are `space.kscience:controls-serial:0.2.0-dev-2`.
The Maven coordinates of this project are `space.kscience:controls-serial:0.2.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'space.kscience:controls-serial:0.2.0-dev-2'
}
```
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
//uncomment to access development builds
//maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev")
mavenCentral()
}
dependencies {
implementation("space.kscience:controls-serial:0.2.0-dev-2")
implementation("space.kscience:controls-serial:0.2.0")
}
```

View File

@ -1,9 +1,17 @@
import space.kscience.gradle.Maturity
plugins {
id("space.kscience.gradle.jvm")
`maven-publish`
}
description = "Implementation of direct serial port communication with JSerialComm"
dependencies{
api(project(":controls-core"))
implementation("com.fazecast:jSerialComm:2.10.3")
}
readme{
maturity = Maturity.EXPERIMENTAL
}

View File

@ -1,32 +1,23 @@
# Module controls-server
A magix event loop server with web server for visualization.
A combined Magix event loop server with web server for visualization.
## Usage
## Artifact:
The Maven coordinates of this project are `space.kscience:controls-server:0.2.0-dev-2`.
The Maven coordinates of this project are `space.kscience:controls-server:0.2.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'space.kscience:controls-server:0.2.0-dev-2'
}
```
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
//uncomment to access development builds
//maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev")
mavenCentral()
}
dependencies {
implementation("space.kscience:controls-server:0.2.0-dev-2")
implementation("space.kscience:controls-server:0.2.0")
}
```

View File

@ -1,10 +1,12 @@
import space.kscience.gradle.Maturity
plugins {
id("space.kscience.gradle.jvm")
`maven-publish`
}
description = """
A magix event loop server with web server for visualization.
A combined Magix event loop server with web server for visualization.
""".trimIndent()
val dataforgeVersion: String by rootProject.extra
@ -20,4 +22,8 @@ dependencies {
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
implementation("io.ktor:ktor-server-html-builder:$ktorVersion")
implementation("io.ktor:ktor-server-status-pages:$ktorVersion")
}
readme{
maturity = Maturity.PROTOTYPE
}

View File

@ -1,32 +1,23 @@
# Module controls-storage
An API for stand-alone Controls-kt device or a hub.
## Usage
## Artifact:
The Maven coordinates of this project are `space.kscience:controls-storage:0.2.0-dev-2`.
The Maven coordinates of this project are `space.kscience:controls-storage:0.2.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'space.kscience:controls-storage:0.2.0-dev-2'
}
```
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
//uncomment to access development builds
//maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev")
mavenCentral()
}
dependencies {
implementation("space.kscience:controls-storage:0.2.0-dev-2")
implementation("space.kscience:controls-storage:0.2.0")
}
```

View File

@ -5,6 +5,10 @@ plugins {
val dataforgeVersion: String by rootProject.extra
description = """
An API for stand-alone Controls-kt device or a hub.
""".trimIndent()
kscience{
jvm()
js()

View File

@ -1,32 +1,23 @@
# Module controls-xodus
An implementation of controls-storage on top of JetBrains Xodus.
## Usage
## Artifact:
The Maven coordinates of this project are `space.kscience:controls-xodus:0.2.0-dev-2`.
The Maven coordinates of this project are `space.kscience:controls-xodus:0.2.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'space.kscience:controls-xodus:0.2.0-dev-2'
}
```
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
//uncomment to access development builds
//maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev")
mavenCentral()
}
dependencies {
implementation("space.kscience:controls-xodus:0.2.0-dev-2")
implementation("space.kscience:controls-xodus:0.2.0")
}
```

View File

@ -5,6 +5,10 @@ plugins {
val xodusVersion: String by rootProject.extra
description = """
An implementation of controls-storage on top of JetBrains Xodus.
""".trimIndent()
dependencies {
api(projects.controlsStorage)
implementation("org.jetbrains.xodus:xodus-entity-store:$xodusVersion")

View File

@ -33,6 +33,7 @@ import space.kscience.plotly.server.show
import space.kscince.magix.zmq.ZmqMagixFlowPlugin
import kotlin.random.Random
import kotlin.time.Duration
import kotlin.time.Duration.Companion.ZERO
import kotlin.time.Duration.Companion.milliseconds
@ -48,7 +49,7 @@ class MassDevice(context: Context, meta: Meta) : DeviceBySpec<MassDevice>(MassDe
val value by doubleProperty { randomValue }
override suspend fun MassDevice.onOpen() {
doRecurring(10.milliseconds) {
doRecurring((meta["delay"].int ?: 10).milliseconds) {
read(value)
}
}
@ -68,6 +69,7 @@ suspend fun main() {
repeat(numDevices) {
context.launch(newFixedThreadPoolContext(2, "Device${it}")) {
delay(1)
val deviceContext = Context("Device${it}") {
plugin(DeviceManager)
}
@ -89,6 +91,8 @@ suspend fun main() {
plot(renderer = container) {
layout {
title = "Latest event"
xaxis.title = "Device number"
yaxis.title = "Maximum latency in ms"
}
bar {
launch(Dispatchers.IO) {
@ -97,18 +101,23 @@ suspend fun main() {
val mutex = Mutex()
val latest = HashMap<String, Duration>()
val max = HashMap<String, Duration>()
monitorEndpoint.subscribe(DeviceManager.magixFormat).onEach { (magixMessage, payload) ->
mutex.withLock {
val delay = Clock.System.now() - payload.time!!
latest[magixMessage.sourceEndpoint] = Clock.System.now() - payload.time!!
max[magixMessage.sourceEndpoint] =
maxOf(delay, max[magixMessage.sourceEndpoint] ?: ZERO)
}
}.launchIn(this)
while (isActive) {
delay(200)
mutex.withLock {
val sorted = latest.mapKeys { it.key.substring(6).toInt() }.toSortedMap()
val sorted = max.mapKeys { it.key.substring(6).toInt() }.toSortedMap()
latest.clear()
max.clear()
x.numbers = sorted.keys
y.numbers = sorted.values.map { it.inWholeMilliseconds / 1000.0 + 0.0001 }
}

View File

@ -10,4 +10,4 @@ publishing.sonatype=false
org.gradle.configureondemand=true
org.gradle.jvmargs=-Xmx4096m
toolsVersion=0.14.8-kotlin-1.8.20
toolsVersion=0.14.10-kotlin-1.9.0

View File

@ -1,4 +0,0 @@
# Module magix

View File

View File

@ -1,32 +1,23 @@
# Module magix-api
A kotlin API for magix standard and some zero-dependency magix services
## Usage
## Artifact:
The Maven coordinates of this project are `space.kscience:magix-api:0.2.0-dev-2`.
The Maven coordinates of this project are `space.kscience:magix-api:0.2.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'space.kscience:magix-api:0.2.0-dev-2'
}
```
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
//uncomment to access development builds
//maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev")
mavenCentral()
}
dependencies {
implementation("space.kscience:magix-api:0.2.0-dev-2")
implementation("space.kscience:magix-api:0.2.0")
}
```

View File

@ -1,8 +1,14 @@
import space.kscience.gradle.Maturity
plugins {
id("space.kscience.gradle.mpp")
`maven-publish`
}
description = """
A kotlin API for magix standard and some zero-dependency magix services
""".trimIndent()
kscience {
jvm()
js()
@ -13,3 +19,6 @@ kscience {
}
}
readme{
maturity = Maturity.EXPERIMENTAL
}

View File

@ -1,32 +0,0 @@
# Module magix-java-client
## Usage
## Artifact:
The Maven coordinates of this project are `space.kscience:magix-java-client:0.2.0-dev-2`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'space.kscience:magix-java-client:0.2.0-dev-2'
}
```
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}
dependencies {
implementation("space.kscience:magix-java-client:0.2.0-dev-2")
}
```

View File

@ -0,0 +1,23 @@
# Module magix-java-endpoint
Java API to work with magix endpoints without Kotlin
## Usage
## Artifact:
The Maven coordinates of this project are `space.kscience:magix-java-endpoint:0.2.0`.
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
//uncomment to access development builds
//maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev")
mavenCentral()
}
dependencies {
implementation("space.kscience:magix-java-endpoint:0.2.0")
}
```

View File

@ -1,5 +1,6 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import space.kscience.gradle.KScienceVersions
import space.kscience.gradle.Maturity
plugins {
java
@ -7,6 +8,10 @@ plugins {
`maven-publish`
}
description = """
Java API to work with magix endpoints without Kotlin
""".trimIndent()
dependencies {
implementation(project(":magix:magix-rsocket"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-jdk9:${KScienceVersions.coroutinesVersion}")
@ -23,4 +28,8 @@ tasks.withType<KotlinCompile>{
kotlinOptions {
freeCompilerArgs -= "-Xjdk-release=11"
}
}
readme{
maturity = Maturity.EXPERIMENTAL
}

View File

@ -11,7 +11,7 @@ import java.util.concurrent.Flow;
*
* @param <T>
*/
public interface MagixClient<T> {
public interface JMagixEndpoint<T> {
void broadcast(MagixMessage msg) throws IOException;
Flow.Publisher<MagixMessage> subscribe();
@ -22,8 +22,8 @@ public interface MagixClient<T> {
* @param port port of magix server event loop
* @return the client
*/
static MagixClient<JsonElement> rSocketTcp(String host, int port) {
return ControlsMagixClient.Companion.rSocketTcp(host, port);
static JMagixEndpoint<JsonElement> rSocketTcp(String host, int port) {
return KMagixEndpoint.Companion.rSocketTcp(host, port);
}
/**
@ -32,7 +32,7 @@ public interface MagixClient<T> {
* @param port port of magix server event loop
* @param path context path for WS connection
*/
static MagixClient<JsonElement> rSocketWs(String host, int port, String path) {
return ControlsMagixClient.Companion.rSocketWs(host, port, path);
static JMagixEndpoint<JsonElement> rSocketWs(String host, int port, String path) {
return KMagixEndpoint.Companion.rSocketWs(host, port, path);
}
}

View File

@ -9,10 +9,10 @@ import space.kscience.magix.rsocket.rSocketWithTcp
import space.kscience.magix.rsocket.rSocketWithWebSockets
import java.util.concurrent.Flow
internal class ControlsMagixClient<T>(
internal class KMagixEndpoint<T>(
private val endpoint: MagixEndpoint,
private val filter: MagixMessageFilter,
) : MagixClient<T> {
) : JMagixEndpoint<T> {
override fun broadcast(msg: MagixMessage): Unit = runBlocking {
endpoint.broadcast(msg)
@ -25,22 +25,22 @@ internal class ControlsMagixClient<T>(
fun <T> rSocketTcp(
host: String,
port: Int,
): ControlsMagixClient<T> {
): KMagixEndpoint<T> {
val endpoint = runBlocking {
MagixEndpoint.rSocketWithTcp(host, port)
}
return ControlsMagixClient(endpoint, MagixMessageFilter())
return KMagixEndpoint(endpoint, MagixMessageFilter())
}
fun <T> rSocketWs(
host: String,
port: Int,
path: String = "/rsocket"
): ControlsMagixClient<T> {
): KMagixEndpoint<T> {
val endpoint = runBlocking {
MagixEndpoint.rSocketWithWebSockets(host, port, path)
}
return ControlsMagixClient(endpoint, MagixMessageFilter())
return KMagixEndpoint(endpoint, MagixMessageFilter())
}
}
}

View File

@ -6,27 +6,18 @@ MQTT client magix endpoint
## Artifact:
The Maven coordinates of this project are `space.kscience:magix-mqtt:0.2.0-dev-2`.
The Maven coordinates of this project are `space.kscience:magix-mqtt:0.2.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'space.kscience:magix-mqtt:0.2.0-dev-2'
}
```
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
//uncomment to access development builds
//maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev")
mavenCentral()
}
dependencies {
implementation("space.kscience:magix-mqtt:0.2.0-dev-2")
implementation("space.kscience:magix-mqtt:0.2.0")
}
```

View File

@ -6,27 +6,18 @@ RabbitMQ client magix endpoint
## Artifact:
The Maven coordinates of this project are `space.kscience:magix-rabbit:0.2.0-dev-2`.
The Maven coordinates of this project are `space.kscience:magix-rabbit:0.2.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'space.kscience:magix-rabbit:0.2.0-dev-2'
}
```
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
//uncomment to access development builds
//maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev")
mavenCentral()
}
dependencies {
implementation("space.kscience:magix-rabbit:0.2.0-dev-2")
implementation("space.kscience:magix-rabbit:0.2.0")
}
```

View File

@ -6,27 +6,18 @@ Magix endpoint (client) based on RSocket
## Artifact:
The Maven coordinates of this project are `space.kscience:magix-rsocket:0.2.0-dev-2`.
The Maven coordinates of this project are `space.kscience:magix-rsocket:0.2.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'space.kscience:magix-rsocket:0.2.0-dev-2'
}
```
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
//uncomment to access development builds
//maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev")
mavenCentral()
}
dependencies {
implementation("space.kscience:magix-rsocket:0.2.0-dev-2")
implementation("space.kscience:magix-rsocket:0.2.0")
}
```

View File

@ -1,3 +1,5 @@
import space.kscience.gradle.Maturity
plugins {
id("space.kscience.gradle.mpp")
`maven-publish`
@ -35,4 +37,8 @@ kotlin {
}
}
}
}
readme {
maturity = Maturity.EXPERIMENTAL
}

View File

@ -6,27 +6,18 @@ A magix event loop implementation in Kotlin. Includes HTTP/SSE and RSocket route
## Artifact:
The Maven coordinates of this project are `space.kscience:magix-server:0.2.0-dev-2`.
The Maven coordinates of this project are `space.kscience:magix-server:0.2.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'space.kscience:magix-server:0.2.0-dev-2'
}
```
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
//uncomment to access development builds
//maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev")
mavenCentral()
}
dependencies {
implementation("space.kscience:magix-server:0.2.0-dev-2")
implementation("space.kscience:magix-server:0.2.0")
}
```

View File

@ -1,3 +1,5 @@
import space.kscience.gradle.Maturity
plugins {
id("space.kscience.gradle.jvm")
`maven-publish`
@ -28,4 +30,8 @@ dependencies{
api("io.rsocket.kotlin:rsocket-ktor-server:$rsocketVersion")
api("io.rsocket.kotlin:rsocket-transport-ktor-tcp:$rsocketVersion")
}
readme{
maturity = Maturity.EXPERIMENTAL
}

View File

@ -6,27 +6,18 @@ Magix history database API
## Artifact:
The Maven coordinates of this project are `space.kscience:magix-storage:0.2.0-dev-2`.
The Maven coordinates of this project are `space.kscience:magix-storage:0.2.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'space.kscience:magix-storage:0.2.0-dev-2'
}
```
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
//uncomment to access development builds
//maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev")
mavenCentral()
}
dependencies {
implementation("space.kscience:magix-storage:0.2.0-dev-2")
implementation("space.kscience:magix-storage:0.2.0")
}
```

View File

@ -1,3 +1,5 @@
import space.kscience.gradle.Maturity
plugins {
id("space.kscience.gradle.mpp")
`maven-publish`
@ -21,3 +23,7 @@ kscience {
api(spclibs.kotlinx.datetime)
}
}
readme{
maturity = Maturity.PROTOTYPE
}

View File

@ -6,27 +6,18 @@
## Artifact:
The Maven coordinates of this project are `space.kscience:magix-storage-xodus:0.2.0-dev-2`.
The Maven coordinates of this project are `space.kscience:magix-storage-xodus:0.2.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'space.kscience:magix-storage-xodus:0.2.0-dev-2'
}
```
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
//uncomment to access development builds
//maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev")
mavenCentral()
}
dependencies {
implementation("space.kscience:magix-storage-xodus:0.2.0-dev-2")
implementation("space.kscience:magix-storage-xodus:0.2.0")
}
```

View File

@ -6,27 +6,18 @@ ZMQ client endpoint for Magix
## Artifact:
The Maven coordinates of this project are `space.kscience:magix-zmq:0.2.0-dev-2`.
The Maven coordinates of this project are `space.kscience:magix-zmq:0.2.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'space.kscience:magix-zmq:0.2.0-dev-2'
}
```
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
//uncomment to access development builds
//maven("https://maven.pkg.jetbrains.space/spc/p/sci/dev")
mavenCentral()
}
dependencies {
implementation("space.kscience:magix-zmq:0.2.0-dev-2")
implementation("space.kscience:magix-zmq:0.2.0")
}
```

View File

@ -1,3 +1,5 @@
import space.kscience.gradle.Maturity
plugins {
id("space.kscience.gradle.jvm")
`maven-publish`
@ -12,3 +14,7 @@ dependencies {
api("org.slf4j:slf4j-api:2.0.6")
api("org.zeromq:jeromq:0.5.2")
}
readme {
maturity = Maturity.EXPERIMENTAL
}

View File

@ -54,7 +54,7 @@ include(
":magix:magix-api",
":magix:magix-server",
":magix:magix-rsocket",
":magix:magix-java-client",
":magix:magix-java-endpoint",
":magix:magix-zmq",
":magix:magix-rabbit",
":magix:magix-mqtt",