An open API service indexing awesome lists of open source software.

https://github.com/mk590901/kotlin-hsm

The repository contains a project of HSM oriented application in Kotlin for Android. App uses code elements automatically generated by the HSM editor when compiling the graphical scheme in Kotlin.
https://github.com/mk590901/kotlin-hsm

automatic-generation compiler hsm kotlin-android

Last synced: about 1 year ago
JSON representation

The repository contains a project of HSM oriented application in Kotlin for Android. App uses code elements automatically generated by the HSM editor when compiling the graphical scheme in Kotlin.

Awesome Lists containing this project

README

          

# Kotlin HSM App
Is demonstrates the use and access to HSM elements in a Kotlin application.

## Goal
A page, conventionally called the compilation service, has been added to the HSM editor (currently a private project - https://github.com/mk590901/qhsm_editor_app, linkedin - https://www.linkedin.com/posts/michael-kanzieper-52931612_hsm-dart-flutter-activity-7241391192653938689-DUiV/?utm_source=share&utm_medium=member_desktop). It is designed to translate the HSM graphical scheme into the target code. At the moment, three compilers are implemented: for __Dart__, __Java__ and __Kotlin__. An example of using this code in __Dart__ applications is the project https://github.com/mk590901/Touch-Tracker, in __Java__ - https://github.com/mk590901/Java-HSM. This project discusses the use of automatically generated code in a __Kotlin__ app for Android.

Note: the HSM example from the book __Practical Statecharts in C/C++__, charter __4.2 An Annotated Example__ p.95 was chosen as the testing scheme.

## Project structure

The project includes the following parts, grouped into separate groups:
### QHsm core
Locates in folder __hsm__, which contains two base classes _QEvent_ and _QHsm_ - __porting__ of the framework of __Miro Samek__ for __Kotlin__.

### Generated code
Subfolder __implementation__ contains classes generated by the __QHsm editor__. It's probably worth noting that they weren't edited.

### Auxiliary elements
- Folder __interfaces__ contains a set of interfaces created for access to __QHsm__, as well as for interaction of internal objects of the framework with each other.
- Folder __support__ contains auxiliary classes that provide implementation of the previously mentioned interfaces.

### Kotlin App
These are three classes: _MainActivity_, _ButtonAdapter_ and _StringAdapter_, which provide the functionality of the Android application as described in the __App overview__ section.

## App overview
Android app is designed to demonstrate the transitions of the above HSM scheme (pay attention on __note__ reference) under the influence of events. The upper part of the application contains a dynamic list of QHsm transitions. The events list implemented as buttons list is located at the bottom of the screen. The application has minimal functional capabilities. It only demonstrates the connection and reflection of the processes inside __QHsm__ by the application widgets.

## Movie
The movie consists of three parts:
- Compilation of the __HSM__ scheme by QHsm editor
- Demonstration of generated classes
- Execution of the __Kotlin__ application

https://github.com/user-attachments/assets/fcc279b0-f4cb-4ef6-a335-dccabbb27e44

## Conclusion
Adding a __Kotlin__ compiler allows to extend the scope of __QHsm__ approach in __Kotlin__ apps.