Commit Graph
10 Commits
Author SHA1 Message Date
ew8bakandClaude Opus 4.8 388687d684 fix(macos): масштаб канвы берём у окна контрола, а не у главного экрана
backingScaleFactor главного экрана врёт, когда окно лежит на другом
мониторе. Спрашиваем масштаб у NSWindow того NSView, которому принадлежит
паинтбокс: это ровно то число, в котором Cocoa рисует эту канву, и оно
меняется само при перетаскивании окна между мониторами.

Objective-C по-прежнему живёт только в MacScale; наружу торчит
кроссплатформенная GetControlScale, которая на Windows/Linux сворачивается
в Result := 1.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 21:20:53 +03:00
ew8bakandClaude Opus 4.8 fd8769898a fix(macos): S-метр, линейка и зумбар больше не мылятся на Retina
Cocoa рисует канву в физических пикселях, TBitmap всегда 1x, поэтому кадр,
собранный в offscreen-битмап логического размера, растягивался вдвое.

PlatformUtils.GetScreenScale возвращает 2 на Retina и 1 на остальных
платформах. Масштаб — обычная переменная, а не условная компиляция: на
Windows/Linux умножение на 1 даёт прежние числа, а на канву кадр кладётся
через Draw, как и раньше (StretchDraw только при масштабе > 1).

В SMeterView, RulerView и PanZoomBar битмап растёт в S раз, пиксельные
константы, размеры шрифтов и толщина пера умножаются на S. Перо важно
отдельно: иначе на Retina все риски стали бы вдвое тоньше.

RulerView кэширует битмап, поэтому смена масштаба сбрасывает кэш.
PanZoomBar.ThumbGeom получил параметр AScale: отрисовка зовёт его с
физической шириной, хит-тест мыши — с логической, код мыши не менялся.

Objective-C изолирован в MacScale.pas: {$MODESWITCH OBJECTIVEC1} несовместим
с {$MODE Delphi}, а DWARF-3 (-gw3, Debug-режим lazbuild) роняет FPC 3.2.4 с
internal error 200609171 на любых Objective-C типах — отсюда {$DEBUGINFO OFF}.

Замер после правки: 37.5% CPU против 38% базовых, отрисовка этих трёх
элементов ниже уровня шума в профиле.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 19:09:53 +03:00
ew8bakandClaude Opus 4.8 406f32b52c feat(platform): --opengl можно включить переменной EWSDR_OPENGL
Бандл под LaunchServices не может передать argv, поэтому GL-режим
включался через bash-обёртку в CFBundleExecutable. Теперь тот же
переключатель читается из окружения, что позволяет задать его в
Info.plist через LSEnvironment и обойтись без обёртки.

Разбор аргументов командной строки не изменён.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 18:31:15 +03:00
ew8bakandClaude Fable 5 4733ddab58 feat(opengl): переход на LazOpenGLContextEx — GL-рендер в нативном Wayland
Пакет LazOpenGLContext заменён на LazOpenGLContextEx (форк в
../lazOpengl): Qt6-бэкенд работает поверх настоящего QOpenGLWidget
(своя C++-либа libqlclglwidget) вместо GLX-контекста на winId(),
поэтому --opengl теперь работает в нативной Wayland-сессии, а под
ws=qt6 открывается путь на Windows/macOS.

- uses OpenGLContext -> OpenGLContextEx (класс TOpenGLControl тот же)
- удалена заглушка QtPlatformAllowsOpenGLControls с советом про
  XWayland: больше не нужна
- рантайм-зависимость: libqlclglwidget.so рядом с бинарником
  (сборка: make -C ../lazOpengl/csrc install-app APPDIR=bin/x86_64-linux)

Проверено на живом эфире (QO-100): спектр/водопад через GL под
Wayland и xcb, прозрачность FBO-альфы починена в обёртке (forceOpaque).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:56:46 +03:00
Uladzimir KarpenkaandClaude Opus 4.8 de234b56e5 Phase 5 (D4): headless daemon entry point (ewsdrd)
ewsdrd.lpr — a console daemon that runs TRadioController + TWebAdapter WITHOUT
TMainForm/LCL, proving the Phase-5 goal: web-only headless operation. THeadlessHost
wires the data-path callbacks to the controller, the web command handlers to the
adapter (lifecycle ones marshalled to the main thread via FCtrl.Invoke =
TThread.Synchronize), opens WDSP synchronously, autostarts the saved device, and
runs a CheckSynchronize + periodic PushState loop. SIGINT/SIGTERM → graceful
StopAndDisconnect (persist + Run=0).

To keep the controller graph truly LCL-free, PlatformUtils now guards its only
Forms dependency (Screen.PixelsPerInch in CurrentScreenDPI) behind {$IFNDEF
HEADLESS}; the GUI build is byte-identical (HEADLESS undefined). build-ewsdrd.sh
compiles the headless graph from source with -Mobjfpc (nested comments) -dHEADLESS
into a separate lib-headless/ output dir, untouching the GUI .ppu.

Verified: builds clean; runs headless, web server up (HTTP 401 = serving), no LCL;
SIGINT shuts down gracefully. Radio-connect + web round-trip need hardware to test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 15:26:44 +03:00
ew8bakandClaude Sonnet 4.6 e9f4bf1732 fix Windows config dir: use %APPDATA% env var directly
FPC's GetAppConfigDir on Windows falls back to the exe directory
if the shell API call fails, which breaks installs in Program Files.
Read %APPDATA% from the environment variable instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02 17:03:14 +03:00
ew8bakandClaude Sonnet 4.6 710abce288 use %APPDATA%\ewsdr on Windows instead of exe directory
Program Files is read-only for normal users; GetAppConfigDir(False)
returns the proper per-user config location on all platforms.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02 15:52:11 +03:00
Uladzimir Karpenka 4f127a30ad fix macOS build 2026-05-28 15:59:49 +03:00
ew8bakandClaude Sonnet 4.6 9716b88b0c Extract helpers into BoardUtils, WisdomBuilder, UISync, PlatformUtils
- BoardUtils: BoardTypeName (removes duplication with DeviceForm)
- WisdomBuilder: TWisdomBuildThread + TWisdomProgressDialog
- UISync: TDeviceFoundSync/TStatusUISync/TDDCSeqSync via callbacks
  (avoids circular dependency, removes TObject casts)
- PlatformUtils: HasOpenGLSpectrumSwitch + CurrentScreenDPI

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 19:15:51 +03:00
ew8bak 762fad420e Guard OpenGL mode on native Wayland 2026-05-26 11:06:55 +03:00