Add read-after-write for DeviceBase property writers

This commit is contained in:
Alexander Nozik 2023-09-24 13:29:15 +03:00
parent a337daee93
commit 34e7dd2c6d
3 changed files with 23 additions and 12 deletions

View File

@ -2,6 +2,26 @@
## Unreleased ## Unreleased
### Added
### Changed
### Deprecated
### Removed
### Fixed
### Security
## 0.2.2-dev-1 - 2023-09-24
### Changed
- updating logical state in `DeviceBase` is now protected and called `propertyChanged()`
- `DeviceBase` tries to read property after write if the writer does not set the value.
## 0.2.1 - 2023-09-24
### Added ### Added
- Core interfaces for building a device server - Core interfaces for building a device server
- Magix service for binding controls devices (both as RPC client and server) - Magix service for binding controls devices (both as RPC client and server)
@ -20,13 +40,3 @@
- A magix event loop implementation in Kotlin. Includes HTTP/SSE and RSocket routes. - A magix event loop implementation in Kotlin. Includes HTTP/SSE and RSocket routes.
- Magix history database API - Magix history database API
- ZMQ client endpoint for Magix - ZMQ client endpoint for Magix
### Changed
### Deprecated
### Removed
### Fixed
### Security

View File

@ -147,7 +147,8 @@ public abstract class DeviceBase<D : Device>(
property.writeMeta(self, value) property.writeMeta(self, value)
// perform read after writing if the writer did not set the value // perform read after writing if the writer did not set the value
if (logicalState[propertyName] == null) { if (logicalState[propertyName] == null) {
readPropertyOrNull(propertyName) val meta = property.readMeta(self)
propertyChanged(propertyName, meta)
} }
} }

View File

@ -24,7 +24,7 @@ dependencies {
implementation("io.ktor:ktor-client-cio:$ktorVersion") implementation("io.ktor:ktor-client-cio:$ktorVersion")
implementation("no.tornado:tornadofx:1.7.20") implementation("no.tornado:tornadofx:1.7.20")
implementation("space.kscience:plotlykt-server:0.5.3") implementation("space.kscience:plotlykt-server:0.6.0")
// implementation("com.github.Ricky12Awesome:json-schema-serialization:0.6.6") // implementation("com.github.Ricky12Awesome:json-schema-serialization:0.6.6")
implementation(spclibs.logback.classic) implementation(spclibs.logback.classic)
} }