Initial commit
This commit is contained in:
commit
caf209981a
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
book
|
6
book.toml
Normal file
6
book.toml
Normal file
@ -0,0 +1,6 @@
|
||||
[book]
|
||||
authors = ["chernov"]
|
||||
language = "en"
|
||||
multilingual = false
|
||||
src = "src"
|
||||
title = "Controls-kt"
|
14
src/01-introduction/README.md
Normal file
14
src/01-introduction/README.md
Normal file
@ -0,0 +1,14 @@
|
||||
# Introduction
|
||||
|
||||
<div class="warning">
|
||||
🚧 Черновой вариант. Здесь нет осмысленного текста. только наброски.
|
||||
</div>
|
||||
|
||||
Общие слова
|
||||
|
||||
|
||||
## Key features
|
||||
- async
|
||||
- dynamic structures under the hood (to do not mess with tools like CORBA, Protobuf)
|
||||
- interoperation with [Tango-CS](../advanced/tango-interop.md)
|
||||
|
75
src/02-getting-started/01-setup.md
Normal file
75
src/02-getting-started/01-setup.md
Normal file
@ -0,0 +1,75 @@
|
||||
# Setting up the project
|
||||
For quick start we provide a minimal working [boilerplate](https://github.com/kapot65/controls-kt-boilerplate) project with controls-kt. We are going to use it as a base for our tutorial. Follow the next preparation steps:
|
||||
```shell
|
||||
git clone https://github.com/kapot65/controls-kt-boilerplate.git
|
||||
```
|
||||
After cloning you will have a project structure like this:
|
||||
```
|
||||
controls-kt-boilerplate/
|
||||
├── build.gradle.kts
|
||||
├── gradle.properties
|
||||
├── README.md
|
||||
├── settings.gradle.kts
|
||||
└── src
|
||||
├── commonMain
|
||||
│ └── kotlin
|
||||
│ └── devices
|
||||
│ └── IDemoDevice.kt
|
||||
├── jsMain
|
||||
│ ├── kotlin
|
||||
│ │ └── Main.kt
|
||||
│ └── resources
|
||||
│ └── index.html
|
||||
└── jvmMain
|
||||
└── kotlin
|
||||
├── devices
|
||||
│ └── DemoDevice.kt
|
||||
└── Server.kt
|
||||
```
|
||||
This is a common kotlin mutliplatform project with enabled `jvm` and `js` targets and some controls-kt dependencies:
|
||||
- ./src/commonMain/kotlin/devices/IDemoDevice.kt - contains a demo device interface and specification of its properties and actions.
|
||||
- ./src/jvmMain/kotlin/devices/DemoDevice.kt - contains a demo device implementation.
|
||||
- ./src/jvmMain/kotlin/Server.kt file contains a magix server with embed device manager with installed demo device.
|
||||
- ./src/jsMain/kotlin/Main.kt - contains a simple controls-kt client example.
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="warning">🚧 Work in progress
|
||||
|
||||
? WASM supported ?
|
||||
|
||||
? What is the recommended way to use kotlin multiplatform project with controls-kt ?
|
||||
</div>
|
||||
|
||||
In this section we are going to work with kotlin multiplatform project.
|
||||
|
||||
If you plan to use only one platfrom (jvm/native/js) you can use regular kotlin project to simplify your SCADA architecture.
|
||||
|
||||
|
||||
<!-- Вариант 1: переделка kotlin/JVM проекта в kotlin multiplatform
|
||||
сделать
|
||||
- ? как подключить Compose
|
||||
-->
|
||||
|
||||
<!-- Вариант 2: создание проекта с помощью Kotlin Multiplatform Wizard
|
||||
|
||||
## Initialize kotlin project from Idea
|
||||
First you need to create project base with [Kotlin Multiplatform Wizard](https://kmp.jetbrains.com/)
|
||||
<div class="warning">avoid dashes in project name</div>
|
||||
- check `Server` and `Web` checkboxes
|
||||
- optionally check `Desktop` if you plan to use desktop graphics.
|
||||
|
||||
Generated project will have structure like: -->
|
||||
|
||||
<!-- выбран 1 вариант [обсуждение](https://mm.sciprog.center/controls/channels/controls-kt)
|
||||
|
||||
жду новой версии controls-kt для бойлерплейта
|
||||
-->
|
||||
|
||||
<!-- добавить секцию для людей, которые имеют опыт с kotlin/multiplatform и собираются создать проект вручную
|
||||
|
||||
какие модули нужны и для чего
|
||||
какие реализации сейчас есть
|
||||
-->
|
||||
|
5
src/02-getting-started/02-define-device-spec.md
Normal file
5
src/02-getting-started/02-define-device-spec.md
Normal file
@ -0,0 +1,5 @@
|
||||
# Define the device specification
|
||||
|
||||
|
||||
## Device interface
|
||||
|
25
src/02-getting-started/README.md
Normal file
25
src/02-getting-started/README.md
Normal file
@ -0,0 +1,25 @@
|
||||
This chapter contains step-by-step tutorial teaching you how to use basic controls-kt functionality:
|
||||
- define device specification (device properties, actions)
|
||||
- create controls-kt event loop
|
||||
- read/write device properties
|
||||
- execute device actions
|
||||
|
||||
During this chapter we are going to create a simple device that simulates a simple attractor in 2D space defined by the following differential equations:
|
||||
```
|
||||
dx/dt = y - ax^2
|
||||
dy/dt = -x - y
|
||||
```
|
||||
The device will have the following properties:
|
||||
- (x, y) - coordinates as current step
|
||||
- a - parameter of the attractor
|
||||
and the following action:
|
||||
- reset - reset the coordinates
|
||||
|
||||
|
||||
## Prerequisites
|
||||
- Tutorial assumes that you use IntelliJ IDEA as your IDE as currently it's the only way to work with Kotlin Multiplatform projects.
|
||||
<!-- - Examples in tutorial is based on [controls-kt-experiments](https://github.com/kapot65/controls-kt-experiments) project. -->
|
||||
|
||||
<!-- You can clone it and follow the tutorial or use your own project. (переделать)-->
|
||||
|
||||
<!-- Придумать простое демо (желательно поинтереснее SinCos) устройство для этой секции -->
|
1
src/02-getting-started/setup.md
Normal file
1
src/02-getting-started/setup.md
Normal file
@ -0,0 +1 @@
|
||||
# Setting up the project
|
3
src/03-reference/README.md
Normal file
3
src/03-reference/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
<div class="warning">
|
||||
🚧 Work in progress
|
||||
</div>
|
3
src/03-reference/actions.md
Normal file
3
src/03-reference/actions.md
Normal file
@ -0,0 +1,3 @@
|
||||
<div class="warning">
|
||||
🚧 Work in progress
|
||||
</div>
|
3
src/03-reference/properties.md
Normal file
3
src/03-reference/properties.md
Normal file
@ -0,0 +1,3 @@
|
||||
<div class="warning">
|
||||
🚧 Work in progress
|
||||
</div>
|
0
src/04-advanced/README.md
Normal file
0
src/04-advanced/README.md
Normal file
44
src/04-advanced/dev-build.md
Normal file
44
src/04-advanced/dev-build.md
Normal file
@ -0,0 +1,44 @@
|
||||
# Use the latest build from the development branch
|
||||
|
||||
Currently controls-kt is under active development. If you want to use the latest build from the development branch, you can do the following steps:
|
||||
|
||||
1. Clone the repository:
|
||||
```bash
|
||||
git clone -b dev https://git.sciprog.center/kscience/controls-kt.git
|
||||
```
|
||||
2. Change the [version](https://git.sciprog.center/kscience/controls-kt/src/commit/5b655a9354de5ddb4be25ee9e6be876f14f10b87/build.gradle.kts#L16) in your `build.gradle.kts` file to new unique:
|
||||
```kotlin
|
||||
allprojects {
|
||||
// ...
|
||||
version = "0.3.0-dev-6-19-02-24-local"
|
||||
// ...
|
||||
}
|
||||
```
|
||||
3. Execute `publishToMavenLocal` task:
|
||||
```bash
|
||||
./gradlew publishToMavenLocal
|
||||
```
|
||||
or from Idea Gradle panel:
|
||||
|
||||
![publishToMavenLocal](./images/publishToMavenLocal.png)
|
||||
|
||||
Latest version of the library will be published to your local maven repository.
|
||||
4. In your project add mavenLocal() to your repositories:
|
||||
```kotlin
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
// ...
|
||||
}
|
||||
```
|
||||
5. Add the dependencies you need using the unique version you set in p2:
|
||||
```kotlin
|
||||
// ...
|
||||
dependencies {
|
||||
implementation("space.kscience:controls-core:0.3.0-dev-6-19-02-24-local")
|
||||
// ...
|
||||
}
|
||||
// ...
|
||||
```
|
||||
|
||||
|
BIN
src/04-advanced/images/publishToMavenLocal.png
Normal file
BIN
src/04-advanced/images/publishToMavenLocal.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
3
src/04-advanced/messages.md
Normal file
3
src/04-advanced/messages.md
Normal file
@ -0,0 +1,3 @@
|
||||
<div class="warning">
|
||||
🚧 Work in progress
|
||||
</div>
|
7
src/04-advanced/tango-interop.md
Normal file
7
src/04-advanced/tango-interop.md
Normal file
@ -0,0 +1,7 @@
|
||||
# Interoperability with Tango
|
||||
|
||||
<div class="warning">
|
||||
🚧 Work in progress
|
||||
</div>
|
||||
|
||||
|
16
src/04-advanced/work-with-c.md
Normal file
16
src/04-advanced/work-with-c.md
Normal file
@ -0,0 +1,16 @@
|
||||
# Work with c libraries
|
||||
|
||||
<div class="warning">
|
||||
🚧 Work in progress
|
||||
</div>
|
||||
|
||||
Controls-kt can be used in kotlin native projects. As long as your devices drivers have c interface, you can controls-kt as SCADA system for your devices.
|
||||
|
||||
## setting up kotlin native project
|
||||
🚧 Work in progress
|
||||
|
||||
## using c libraries in kotlin native
|
||||
🚧 Work in progress
|
||||
|
||||
drawbacks:
|
||||
- even in final binaries is fully native you still need to have jvm installed on your machine to run gradle tasks
|
14
src/SUMMARY.md
Normal file
14
src/SUMMARY.md
Normal file
@ -0,0 +1,14 @@
|
||||
# Summary
|
||||
|
||||
- [Introduction](./01-introduction/README.md)
|
||||
- [Getting started](./02-getting-started/README.md)
|
||||
- [Setting up the project](./02-getting-started/01-setup.md)
|
||||
- [Define device spec](./02-getting-started/02-define-device-spec.md)
|
||||
- [Reference Guide](./03-reference/README.md)
|
||||
- [Device Properties](./03-reference/properties.md)
|
||||
- [Device Actions](./03-reference/actions.md)
|
||||
- [Advanced usage](./04-advanced/README.md)
|
||||
- [Use latest dev build](./04-advanced/dev-build.md)
|
||||
- [Work with c](./04-advanced/work-with-c.md)
|
||||
- [Interoperability with Tango](./04-advanced/tango-interop.md)
|
||||
- [Message API](./04-advanced/messages.md)
|
Loading…
Reference in New Issue
Block a user