Lightweight SCADA device servers and integrations in Kotlin-Multiplatform
Go to file
2024-05-15 17:48:24 +06:00
.github/workflows Documentation update 2023-05-03 11:05:54 +03:00
.space Fix ktor imports 2022-01-18 17:37:25 +03:00
controls-constructor add templating script 2024-05-15 17:48:24 +06:00
controls-core Fixed part of motionMaster 2024-05-12 14:14:31 +03:00
controls-jupyter upfixes 2024-04-29 18:38:14 +06:00
controls-magix Merge branch 'dev' into support/update_dependencies 2024-04-29 18:09:22 +06:00
controls-modbus make device stop suspended to properly await for lifecycle event. 2024-05-10 11:33:00 +03:00
controls-opcua make device stop suspended to properly await for lifecycle event. 2024-05-10 11:33:00 +03:00
controls-pi make device stop suspended to properly await for lifecycle event. 2024-05-10 11:33:00 +03:00
controls-plc4x upfixes 2024-04-29 18:38:14 +06:00
controls-ports-ktor make device stop suspended to properly await for lifecycle event. 2024-05-10 11:33:00 +03:00
controls-serial make device stop suspended to properly await for lifecycle event. 2024-05-10 11:33:00 +03:00
controls-server upfixes 2024-04-29 18:38:14 +06:00
controls-storage make device stop suspended to properly await for lifecycle event. 2024-05-10 11:33:00 +03:00
controls-vision upfixes 2024-04-29 18:38:14 +06:00
demo Fixed part of motionMaster 2024-05-12 14:14:31 +03:00
docs Update to PiPlugin logic 2023-09-18 09:00:04 +03:00
gradle Update plotly version 2024-04-29 18:28:14 +03:00
magix make device stop suspended to properly await for lifecycle event. 2024-05-10 11:33:00 +03:00
.gitignore Add rsocket service 2020-11-03 18:54:52 +03:00
.gitmodules Add magix-rfc as a submodule 2023-02-25 10:55:21 +03:00
.space.kts Clean up property access syntax 2023-05-07 11:13:42 +03:00
build.gradle.kts add templating script 2024-05-15 17:48:24 +06:00
CHANGELOG.md Refactor ports 2024-03-31 16:13:02 +03:00
gradle.properties Update constructor api 2024-03-18 09:30:41 +03:00
gradlew Migrate to K-1.4.0 2020-08-31 12:40:49 +03:00
gradlew.bat Migrate to K-1.4.0 2020-08-31 12:40:49 +03:00
ktstemplate_generator.kts add templating script 2024-05-15 17:48:24 +06:00
LICENSE Initial commit 2020-02-16 15:34:06 +03:00
README.md add templating script 2024-05-15 17:48:24 +06:00
settings.gradle.kts Move all-things to Compose 2024-05-11 17:56:28 +03:00

JetBrains Research

Controls.kt

Controls.kt (former DataForge-control) is a data acquisition framework (work in progress). It is based on DataForge, a software framework for automated data processing. This repository contains a prototype of API and simple implementation of a slow control system, including a demo.

Controls.kt uses some concepts and modules of DataForge, such as Meta (tree-like value structure).

To learn more about DataForge, please consult the following URLs:

DataForge-control is a Kotlin-multiplatform application. Asynchronous operations are implemented with kotlinx.coroutines library.

Materials and publications

Features

Among other things, you can:

  • Describe devices and their properties.
  • Collect data from devices and execute arbitrary actions supported by a device.
  • Property values can be cached in the system and requested from devices as needed, asynchronously.
  • Connect devices to event bus via bidirectional message flows.

Example view of a demo:

Documentation

Modules

controls-constructor

A low-code constructor for composite devices simulation

Maturity: PROTOTYPE

controls-core

Core interfaces for building a device server

Maturity: EXPERIMENTAL

Features:

  • device : Device API with subscription (asynchronous and pseudo-synchronous properties)
  • deviceMessage : Specification for messages used to communicate between Controls-kt devices.
  • deviceHub : Grouping of devices into local tree-like hubs.
  • deviceSpec : Mechanics and type-safe builders for devices. Including separation of device specification and device state.
  • deviceManager : DataForge DI integration for devices. Includes device builders.
  • ports : Working with asynchronous data sending and receiving raw byte arrays

controls-jupyter

Maturity: EXPERIMENTAL

controls-magix

Magix service for binding controls devices (both as RPC client and server)

Maturity: EXPERIMENTAL

Features:

  • controlsMagix : Connect a DeviceManage with one or many devices to the Magix endpoint
  • DeviceClient : A remote connector to Controls-kt device via Magix

controls-modbus

A plugin for Controls-kt device server on top of modbus-rtu/modbus-tcp protocols

Maturity: EXPERIMENTAL

Features:

  • modbusRegistryMap : Type-safe modbus registry map. Allows to define both single-register and multi-register entries (using DataForge IO). Automatically checks consistency.
  • modbusProcessImage : Binding of slave (server) modbus device to Controls-kt device
  • modbusDevice : A device with additional methods to work with modbus registers.

controls-opcua

A client and server connectors for OPC-UA via Eclipse Milo

Maturity: EXPERIMENTAL

Features:

  • opcuaClient : Connect a Controls-kt as a client to OPC UA server
  • opcuaServer : Create an OPC UA server on top of Controls-kt device (or device hub)

controls-pi

Utils to work with controls-kt on Raspberry pi

Maturity: EXPERIMENTAL

controls-ports-ktor

Implementation of byte ports on top os ktor-io asynchronous API

Maturity: PROTOTYPE

controls-serial

Implementation of direct serial port communication with JSerialComm

Maturity: EXPERIMENTAL

controls-server

A combined Magix event loop server with web server for visualization.

Maturity: PROTOTYPE

controls-storage

An API for stand-alone Controls-kt device or a hub.

Maturity: PROTOTYPE

controls-vision

Dashboard and visualization extensions for devices

Maturity: PROTOTYPE

demo

Maturity: EXPERIMENTAL

magix

Maturity: EXPERIMENTAL

controls-storage/controls-xodus

An implementation of controls-storage on top of JetBrains Xodus.

Maturity: PROTOTYPE

demo/all-things

Maturity: EXPERIMENTAL

demo/car

Maturity: EXPERIMENTAL

demo/constructor

Maturity: EXPERIMENTAL

demo/echo

Maturity: EXPERIMENTAL

demo/magix-demo

Maturity: EXPERIMENTAL

demo/many-devices

Maturity: EXPERIMENTAL

demo/mks-pdr900

Maturity: EXPERIMENTAL

demo/motors

Maturity: EXPERIMENTAL

magix/magix-api

A kotlin API for magix standard and some zero-dependency magix services

Maturity: EXPERIMENTAL

magix/magix-java-endpoint

Java API to work with magix endpoints without Kotlin

Maturity: EXPERIMENTAL

magix/magix-mqtt

MQTT client magix endpoint

Maturity: PROTOTYPE

magix/magix-rabbit

RabbitMQ client magix endpoint

Maturity: PROTOTYPE

magix/magix-rsocket

Magix endpoint (client) based on RSocket

Maturity: EXPERIMENTAL

magix/magix-server

A magix event loop implementation in Kotlin. Includes HTTP/SSE and RSocket routes.

Maturity: EXPERIMENTAL

magix/magix-storage

Magix history database API

Maturity: PROTOTYPE

magix/magix-zmq

ZMQ client endpoint for Magix

Maturity: EXPERIMENTAL

magix/magix-storage/magix-storage-xodus

Maturity: PROTOTYPE

demo module

The demo includes a simple mock device with a few properties changing as sin and cos of the current time. The device is configurable via a simple TornadoFX-based control panel. You can run a demo by executing application/run Gradle task.

The graphs are displayed using plotly.kt library.

Templates

This feature required kotlin to be installed in your system. Read more

You may run gradle task generateKTStemplates instead of raw launch, but it will work slowly. Sample ./gradlew generateKTStemplates

This project supports generating of files from .ktstemplate. files. Current docs:

Using

  • Create file contains .ktstemplate in its name
  • Write variables before the first H* (starting with #) section
  • Launch kotlin ${thisscriptname} with required args

File sample

first = hello
second = world

# Sample

This is sample of $first $second

Will have next result:

# Sample

This is sample of hello world

Launch

This script accept next args:

[...paths] [--plain] [--recursive]

Where:

  • ...paths - Paths to the files-templates or folders with files-templates
  • --plain - will look only into the folders from paths
  • --recursive - (default) will look into the folders from paths and recursively in subfolders