Android
Версия 2.0.0 для телефонов и планшетов Android: одно приложение вместо настольных программ пакета. Расчётный код тот же, что в Windows-версии 5.0 и Linux-версии 2.0.
Код: github.com/klimov-kn/TMC_Suite_Android.
Что входит
| Настольная программа | В приложении | Что делает |
|---|---|---|
| PlanarRT_H | ядро H | расчёт, H-поляризация |
| PlanarRT_X | ядро X | расчёт, X-мода, подмагниченная плазма |
| TMCGROUT | график S-матрицы | |S|, потери, КСВН, фаза, разворот фазы |
| TMC_DN | график ДН | диаграмма направленности, КНД, КИП |
| TMCROS | график сигналов | сигналы на портах во времени |
| FieldView | экран «Поле» | поле по тактам в 3D, экспорт GIF |
| TPL Designer | вкладка TPL Designer | задание без набора текста, библиотека образцов |
Система: Android 9 и новее, процессор arm64-v8a.
Установка
Пошаговая установка — на странице «Установка».
Приложение
Четыре вкладки: «Задачи», «TPL Designer», «Результаты», «Справка». Экраны написаны на Qt Quick (QML), общие цвета и размеры заданы в одном файле src/app/qml/Theme.qml. Интерфейс на русском и английском: язык выбирается по системе и меняется в «Справке».
Ядра на телефоне
Ядро — отдельный процесс, а не часть приложения: H и X содержат одинаковые имена классов и не компонуются вместе. Обе программы лежат в APK под именами libtmc_rth.so и libtmc_rtx.so, потому что запускать файлы Android разрешает только из каталога нативных библиотек приложения.
Служба переднего плана держит расчёт при выключенном экране. Класс KernelRunner запускает ядро, читает ход из потоков вывода и показывает его на экране и в уведомлении. Кнопка «Остановить» посылает сигнал SIGTERM, и ядро завершается с кодом 3.
Код расчёта лежит в src/win_src. Слой src/kernels/compat подставляет типы Windows, а tmc_textmode.cpp повторяет текстовый режим файлов Windows: окончания строк CRLF и имена без учёта регистра. Только на Android кадр мгновенного поля пишется во временный файл и заменяет прежний переименованием, поэтому экран «Поле» не видит недописанных кадров.
Расчёта на видеокарте на Android нет: мобильные видеокарты редко поддерживают двойную точность, которую требует расчёт.
Жесты
Один разбор касаний на графики и поле: класс TouchGesture в src/ui/touchgesture.h.
| Жест | На графике | В поле |
|---|---|---|
| Один палец | сдвиг | поворот сцены |
| Щипок | масштаб вокруг точки между пальцами | то же |
| Два пальца вместе | сдвиг | сдвиг |
| Касание | ближайшая точка кривой | — |
| Двойное касание | исходный вид | исходный вид |
Щипок не вызывает скачка, а после него оставшийся палец ничего не двигает, пока не будут отпущены все пальцы.
TPL Designer
Шаги: «Задание», «Геометрия», «Объекты», «Считать», «Вывод», «Проверка». Ядро генератора заданий то же, что в Windows-версии.
На шаге «Геометрия» по умолчанию включён инструмент «Обзор»: палец двигает вид, а касание выбирает объект. Двигать объект можно инструментом «Выбор». Если объекты лежат друг на друге, каждое следующее касание берёт следующий объект. Кнопка «несколько» собирает группу: её можно двигать, копировать, удалять, а линии соединять в одну фигуру.
На шаге «Считать» отмечаются входы: один прогон даёт один столбец S-матрицы. Там же задаются варианты геометрии и поворот объекта по шагам. Шаг «Проверка» показывает кольцо памяти телефона: занято, сетка расчёта, накопление ДН, свободно.
Библиотека образцов показывает картинки, параметры, паспорт и числа ядра. Своё задание можно сохранить в «Мои образцы». Модели STL и OBJ из папки задачи импортируются как срез плоскостью; STEP на телефоне не читается.
Графики
Форматы файлов те же, что у настольных программ. Каждый график показывает несколько рядов и может сравнивать расчёты на одной оси. КНД и КИП считаются на сетке, густота которой зависит от размера решётки, как в Windows-версии 5.0.
Поле
Экран «Поле» рисуется через Qt RHI: на телефоне это Vulkan или OpenGL ES. Кадры записываются во время расчёта в файл .ex.frames, поэтому их можно листать вперёд и назад и выгружать в GIF.
Файлы
Папки заданий выбираются системным окном Android. Расчёт идёт в рабочей копии внутри приложения, а результаты копируются обратно в выбранную папку.
Платформенный слой
Различия систем собраны в классе Platform (src/app/platform.h): platform_android.cpp для телефона и platform_desktop.cpp для настольной сборки. Служба расчёта и выбор папок написаны на Java: platforms/android/src.
Сборка из исходников
Сборка идёт на Windows. Нужны Qt 6.11.1 (mingw_64 и android_arm64_v8a), JDK 21, Android SDK с платформой 36 и NDK 27.2.12479018.
$cmake = "C:\Qt\Tools\CMake_64\bin\cmake.exe"
& $cmake --preset android-arm64-release
& $cmake --build --preset android-arm64-release --target apk aab
Предупреждений компилятора при сборке нет. Подробности — в файле README репозитория.
Отличия от версии для Windows
Код расчёта и форматы файлов те же: задание, посчитанное на одной системе, открывается на другой. Нет расчёта на видеокарте и чтения STEP. Настройки цветов, шрифтов и печать настольных окон на телефоне не нужны и не перенесены.
Известные ограничения
Размер задачи ограничен памятью телефона: около 32 байт на узел в ядре H и 96 байт на узел в ядре X. Сетки от миллиона узлов на телефоне не замерялись.
Android
Version 2.0.0 for Android phones and tablets: one app in place of the desktop programs of the package. The computational code is the same as in the Windows edition 5.0 and the Linux edition 2.0.
Code: github.com/klimov-kn/TMC_Suite_Android.
What is included
| Desktop program | In the app | What it does |
|---|---|---|
| PlanarRT_H | kernel H | calculation, H-polarization |
| PlanarRT_X | kernel X | calculation, X-mode, magnetized plasma |
| TMCGROUT | S-matrix chart | |S|, losses, VSWR, phase, unwrapped phase |
| TMC_DN | pattern chart | radiation pattern, directivity, aperture efficiency |
| TMCROS | signals chart | port signals over time |
| FieldView | Field screen | field step by step in 3D, GIF export |
| TPL Designer | TPL Designer tab | a task without typing, sample library |
System: Android 9 or newer, arm64-v8a processor.
Installation
Step-by-step installation is on the Installation page.
The app
Four tabs: Tasks, TPL Designer, Results, Help. The screens are written in Qt Quick (QML), the shared colours and sizes are in one file, src/app/qml/Theme.qml. The interface is in Russian and English: the language follows the system and can be changed in Help.
Kernels on the phone
A kernel is a separate process, not a part of the app: H and X have the same class names and cannot be linked together. Both programs are in the APK as libtmc_rth.so and libtmc_rtx.so, because Android runs files only from the native library folder of the app.
A foreground service keeps the calculation running with the screen off. The KernelRunner class starts the kernel, reads the progress from its output streams and shows it on the screen and in the notification. The Stop button sends SIGTERM, and the kernel ends with code 3.
The computational code is in src/win_src. The src/kernels/compat layer provides the Windows types, and tmc_textmode.cpp repeats the Windows text file mode: CRLF line endings and case-insensitive names. On Android only, a frame of the instantaneous field is written to a temporary file and replaces the previous one by renaming, so the Field screen never sees an unfinished frame.
There is no calculation on a video card on Android: mobile video cards rarely support the double precision the calculation needs.
Gestures
Charts and the field share one touch parser: the TouchGesture class in src/ui/touchgesture.h.
| Gesture | On a chart | In the field |
|---|---|---|
| One finger | move | turn the scene |
| Pinch | zoom around the point between the fingers | the same |
| Two fingers together | move | move |
| Tap | nearest point of a curve | — |
| Double tap | initial view | initial view |
A pinch causes no jump, and after it the remaining finger moves nothing until all fingers are lifted.
TPL Designer
The steps: Task, Geometry, Objects, Compute, Output, Check. The task generator is the same as in the Windows edition.
On the Geometry step the View tool is on by default: a finger moves the view, and a tap selects an object. Objects are moved with the Select tool. When objects overlap, each next tap takes the next object. The several button makes a group: it can be moved, copied and deleted, and lines can be joined into one shape.
On the Compute step you tick the ports: one run gives one column of the S-matrix. Geometry variants and object rotation by steps are there too. The Check step shows the memory ring of the phone: used, calculation grid, pattern accumulation, free.
The sample library shows pictures, parameters, the passport and the kernel numbers. Your own task can be saved to My samples. STL and OBJ models from the task folder are imported as a slice by a plane; STEP is not read on the phone.
Charts
File formats are the same as in the desktop programs. Each chart shows several series and can compare calculations on one axis. Directivity and aperture efficiency are computed on a grid whose density depends on the array size, as in the Windows edition 5.0.
Field
The Field screen is drawn through Qt RHI: Vulkan or OpenGL ES on a phone. Frames are recorded during the calculation into the .ex.frames file, so they can be stepped back and forth and exported to GIF.
Files
Task folders are chosen in the Android system window. The calculation runs in a working copy inside the app, and the results are copied back to the chosen folder.
Platform layer
The system differences are collected in the Platform class (src/app/platform.h): platform_android.cpp for the phone and platform_desktop.cpp for the desktop build. The calculation service and the folder picker are written in Java: platforms/android/src.
Building from source
The build runs on Windows. It needs Qt 6.11.1 (mingw_64 and android_arm64_v8a), JDK 21, the Android SDK with platform 36 and NDK 27.2.12479018.
$cmake = "C:\Qt\Tools\CMake_64\bin\cmake.exe"
& $cmake --preset android-arm64-release
& $cmake --build --preset android-arm64-release --target apk aab
The build gives no compiler warnings. More details are in the repository README.
Differences from the Windows version
The computational code and file formats are the same: a task calculated on one system opens on another. There is no calculation on a video card and no STEP reading. Colour and font settings and printing of the desktop windows are not needed on a phone and are not transferred.
Known limitations
The task size is limited by the phone memory: about 32 bytes per node in kernel H and 96 bytes per node in kernel X. Grids of a million nodes and more have not been measured on a phone.