Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/smv-injector-slint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: SMV Injector Slint Shell

on:
push:
paths:
- 'apps/smv_injector_slint/**'
- '.github/workflows/smv-injector-slint.yml'
pull_request:
paths:
- 'apps/smv_injector_slint/**'
- '.github/workflows/smv-injector-slint.yml'

permissions:
contents: read

jobs:
native-shell-build:
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Slint build dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
ninja-build \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxkbcommon-dev \
libfontconfig-dev \
libssl-dev

- name: Select Rust 1.92
shell: bash
run: |
rustup toolchain install 1.92.0 --profile minimal
rustup default 1.92.0
rustc --version

- name: Configure native Slint shell
shell: bash
run: |
cmake -S apps/smv_injector_slint \
-B build-smv-slint \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release

- name: Build native Slint shell
shell: bash
run: |
cmake --build build-smv-slint \
--target arstack_smv_slint_shell \
--parallel 2
52 changes: 52 additions & 0 deletions apps/smv_injector_slint/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
cmake_minimum_required(VERSION 3.21)

project(ARStack61850SmvSlintShell
VERSION 0.1.0
DESCRIPTION "Native Slint UX shell for the ARStack61850 SMV Injector"
LANGUAGES CXX)

option(ARSTACK_SLINT_FETCH "Fetch Slint from source when no installed package is found" ON)
set(ARSTACK_SLINT_VERSION "1.17.1" CACHE STRING "Preferred Slint C++ version")

find_package(Slint ${ARSTACK_SLINT_VERSION} CONFIG QUIET)

if(NOT Slint_FOUND)
if(NOT ARSTACK_SLINT_FETCH)
message(FATAL_ERROR
"Slint ${ARSTACK_SLINT_VERSION} was not found. Install the Slint C++ SDK, set CMAKE_PREFIX_PATH, "
"or configure with -DARSTACK_SLINT_FETCH=ON.")
endif()

include(FetchContent)
FetchContent_Declare(
Slint
GIT_REPOSITORY https://github.com/slint-ui/slint.git
GIT_TAG v${ARSTACK_SLINT_VERSION}
SOURCE_SUBDIR api/cpp)
FetchContent_MakeAvailable(Slint)
endif()

add_executable(arstack_smv_slint_shell
src/main.cpp
src/serial_device.cpp)

target_compile_features(arstack_smv_slint_shell PRIVATE cxx_std_20)
target_link_libraries(arstack_smv_slint_shell PRIVATE Slint::Slint)

slint_target_sources(arstack_smv_slint_shell
ui/app-window.slint)

if(WIN32)
add_custom_command(TARGET arstack_smv_slint_shell POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_RUNTIME_DLLS:arstack_smv_slint_shell>
$<TARGET_FILE_DIR:arstack_smv_slint_shell>
COMMAND_EXPAND_LISTS
COMMENT "Copying Slint runtime dependencies")
endif()

if(MSVC)
target_compile_options(arstack_smv_slint_shell PRIVATE /W4 /permissive-)
else()
target_compile_options(arstack_smv_slint_shell PRIVATE -Wall -Wextra -Wpedantic)
endif()
86 changes: 86 additions & 0 deletions apps/smv_injector_slint/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# ARStack61850 SMV Injection Studio

Native Slint desktop workstation for fast IEC 61850-9-2 Sampled Values injection.

The interface combines the fast numeric workflow of professional test equipment with a modern, calm three-view workspace. It uses original ARStack61850 styling and does not copy OMICRON or ARSVIN product assets.

## Operator workflow

- Quick Manual table for 4 voltage and 4 current channels.
- Arrow keys move between magnitude, angle, and frequency cells.
- Enter validates and commits; focus selects the complete value for immediate replacement.
- Invalid values remain focused and never reach the device command path.
- Live Apply transmits validated edits to the next coherent generation.
- Phasor and waveform views update from the effective editor state.
- Start, running timer, Stop, TX sequence, and publisher state remain visible during injection.
- Status History and Overload Monitor live in a collapsible lower dock.
- Lucide icons provide a consistent command vocabulary.

## Native controller

The C++ controller owns validation and Windows serial transport. The current command protocol is:

```text
SET <channel> <magnitude-counts> <phase-millidegrees> 0
FREQ <millihertz>
ENABLE <channel> <0|1>
START
STOP
ZERO
SHOW
```

Default validation limits are 0-10,000 A RMS, 0-1,000,000 V RMS, -360 to 360 degrees, and 1-1,000 Hz. Profile identity and layout changes remain a STOP -> validate -> deploy operation; mutable values use the live-control path.

## Windows quick start

Requirements: CMake 3.21+, a C++20 MSVC toolchain, and Rust 1.92+ when Slint is fetched from source.

From the repository root:

```powershell
.\apps\smv_injector_slint\run.cmd
```

On systems with a `D:` drive, the launcher defaults to:

```text
D:\Build\arstack61850-smv-slint
D:\Tools\Slint\1.17.1
```

Override either location with `ARSTACK_BUILD_DIR` or `ARSTACK_SLINT_DEPS_DIR`. The CMake target copies `slint_cpp.dll` beside the executable after every successful Windows build, preventing a missing-runtime startup error.

## Manual build

```powershell
cmake -S apps/smv_injector_slint -B build-smv-slint -DCMAKE_BUILD_TYPE=Release
cmake --build build-smv-slint --target arstack_smv_slint_shell --config Release
```

Set `-DARSTACK_SLINT_FETCH=OFF` to require an installed Slint C++ package.

## Architecture boundary

```text
Slint workstation views
|
v
C++ validation and presentation controller
|---------------------------|
v v
profile compiler serial device control
| |
+-------------+-------------+
v
ESP32-P4 mutable state
|
v
realtime SMV publisher
```

The UI is never the realtime waveform scheduler.

## Third-party assets

Toolbar and dock icons are from [Lucide](https://lucide.dev/) under the ISC License. The license text is stored in `assets/lucide/LICENSE`.
43 changes: 43 additions & 0 deletions apps/smv_injector_slint/assets/lucide/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
ISC License

Copyright (c) 2026 Lucide Icons and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

---

The following Lucide icons are derived from the Feather project:

airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out

The MIT License (MIT) (for the icons listed above)

Copyright (c) 2013-present Cole Bemis

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
18 changes: 18 additions & 0 deletions apps/smv_injector_slint/assets/lucide/chart-no-axes-combined.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions apps/smv_injector_slint/assets/lucide/check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions apps/smv_injector_slint/assets/lucide/chevron-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions apps/smv_injector_slint/assets/lucide/circle-check-big.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions apps/smv_injector_slint/assets/lucide/circle-slash-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions apps/smv_injector_slint/assets/lucide/file-play.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions apps/smv_injector_slint/assets/lucide/list-tree.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions apps/smv_injector_slint/assets/lucide/orbit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions apps/smv_injector_slint/assets/lucide/panels-top-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading