Skip to content

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

Notifications You must be signed in to change notification settings

mk590901/Java-HSM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java HSM App

Is demonstrates the use and access to HSM elements in a Java 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, two compilers are implemented: for dart and for java. An example of using this code in dart applications is the project https://github.com/mk590901/Touch-Tracker. This project discusses the use of automatically generated code in a Java 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 Java.

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.

Java 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 Java application
java.mp4

Conclusion

Adding a Java compiler allows to extend the scope of QHsm approach in Java apps. Maybe additional compilers may be implemented in future.

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages