update exe GUI build

This commit is contained in:
ykcheungab
2026-06-21 12:01:34 +08:00
parent 258948bcb7
commit 7feae9550e
18 changed files with 862 additions and 173 deletions
+29 -18
View File
@@ -3,15 +3,13 @@ Finger dashboard layout — edit this file to define the panel hierarchy and siz
Structure:
┌─ toolbar ─────────────────────────────────────────────┐
├─ TOP (stretch: top_stretch) ──────────────────────────┤
│ ┌ mesh ─┬─ arrows ─┬─ charts ─┐ (left → right) │
│ └───────┴───────────┴─────────┘ │
├─ LOG (stretch: log_stretch) ──────────────────────────┤
└───────────────────────────────────────────────────────┘
┌─ toolbar ─────────────────────────────────────────────────────┐
├─ mesh ─┬─ charts ─┬─ settings ────────────────────────────────┤
│ ├─ log ────┤ │
└────────┴──────────┴─────────────────────────────────────────┘
Each panel uses explicit width_px and height_px.
top_stretch / log_stretch control how extra vertical space is shared on resize.
charts_log_stretch / log_stretch control charts vs log height inside the charts column.
MeshLighting (below) controls the 3D mesh panel sun light:
azimuth_deg — horizontal angle in degrees (0° = +X, 90° = +Y)
@@ -37,8 +35,7 @@ Performance (3D dashboard; edit DashboardLayout defaults):
mesh_async_render — background mesh render (Linux only; Windows uses sync)
Edit TOP_ROW.slots to reorder or resize panels; set ``enabled=False`` to hide a panel (e.g. arrows).
Edit PANEL_SETUP to change top vs log proportions.
Edit LOG_CONFIG for live status line and log panel appearance.
Log sits under charts only (not under mesh). Settings is the rightmost column.
"""
from __future__ import annotations
@@ -51,7 +48,7 @@ from viz.contact_arrow import ContactArrowStyle, DEFAULT_CONTACT_ARROW_STYLE
from viz.flow_arrow import FlowArrowStyle
from viz.render_2d import ArrowBackground, ArrowCanvasColors
PanelId = Literal["mesh", "arrows", "charts", "log"]
PanelId = Literal["mesh", "arrows", "charts", "log", "settings"]
@dataclass(frozen=True)
@@ -76,20 +73,21 @@ class PanelRow:
@dataclass(frozen=True)
class PanelSetup:
"""Full panel hierarchy: top row + bottom log."""
"""Full panel hierarchy: top row + log nested under charts."""
top_row: PanelRow
log_panel: PanelSlot
top_stretch: int = 5
charts_log_stretch: int = 5
log_stretch: int = 1
# --- Top strip: mesh | arrows | charts (edit order and sizes here) ---
# --- Top strip: mesh | arrows? | charts | settings (edit order and sizes here) ---
TOP_ROW = PanelRow(
slots=(
PanelSlot("mesh", "3D mesh", width_px=500, height_px=500),
PanelSlot("mesh", "3D mesh", width_px=600, height_px=600),
PanelSlot("arrows", "UV Unrolled", width_px=500, height_px=500, enabled=False),
PanelSlot("charts", "Force charts", width_px=500, height_px=500),
PanelSlot("charts", "Force charts", width_px=400, height_px=500),
PanelSlot("settings", "Settings", width_px=200, height_px=0),
),
)
@@ -98,7 +96,7 @@ LOG_PANEL = PanelSlot("log", "Log", width_px=0, height_px=100)
PANEL_SETUP = PanelSetup(
top_row=TOP_ROW,
log_panel=LOG_PANEL,
top_stretch=5,
charts_log_stretch=5,
log_stretch=1,
)
@@ -225,8 +223,8 @@ class DashboardLayout:
panel_setup: PanelSetup = PANEL_SETUP
window_title: str = "Orisys Finger Dashboard"
window_width: int = 1000
window_height: int = 600
window_width: int = 1100
window_height: int = 620
root_margin_px: int = 6
root_spacing_px: int = 6
@@ -279,6 +277,15 @@ class DashboardLayout:
return slot
return None
def charts_column_height_px(self) -> int:
"""Total height of the charts column (charts + log when enabled)."""
charts = self.top_slot("charts")
height = charts.height_px
log = self.panel_setup.log_panel
if log.enabled and log.height_px > 0:
height += log.height_px
return height
def top_slot(self, panel_id: PanelId) -> PanelSlot:
for slot in self.panel_setup.top_row.slots:
if slot.id == panel_id:
@@ -293,6 +300,10 @@ class DashboardLayout:
def arrows_panel_title(self) -> str:
return self.top_slot("arrows").title
@property
def settings_panel_title(self) -> str:
return self.top_slot("settings").title
LAYOUT = DashboardLayout()