PyPLECS Web GUI Guide¶
Complete guide to the PyPLECS web monitoring interface.
Overview¶
The PyPLECS Web GUI provides a browser-based interface for:
- π Real-time monitoring of simulation queue and status
- π Submit simulations with parameter configuration
- πΎ Cache management with statistics and controls
- π Performance analytics and speedup tracking
- βοΈ Configuration editing (planned)
- π‘ Live updates via WebSocket
Built with FastAPI, Jinja2, and modern web technologies.
Table of Contents¶
- Getting Started
- Dashboard
- Simulations Page
- Cache Page
- Settings Page
- WebSocket Live Updates
- Keyboard Shortcuts
- Troubleshooting
Getting Started¶
Starting the Web GUI¶
# Method 1: Entry point (recommended)
pyplecs-gui
# Method 2: Direct module
python -m pyplecs.webgui
# Method 3: Python script
python start_webgui.py
# Custom port
pyplecs-gui --port 5001
# Custom host (bind to all interfaces)
pyplecs-gui --host 0.0.0.0
Expected output:
INFO: Started server process
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:5000
Accessing the Interface¶
Open your browser to: http://localhost:5000
Supported Browsers: - β Chrome/Chromium (recommended) - β Firefox - β Edge - β Safari - β οΈ Internet Explorer (not supported)
First Time Setup¶
- Start PLECS with XML-RPC enabled
- PLECS > Preferences > Remote Control > Enable
-
Default port: 1080
-
Run setup wizard (if not done already)
-
Start Web GUI
-
Open browser to http://localhost:5000
You should see the dashboard with system status.
Dashboard¶
The main dashboard provides at-a-glance monitoring.
Layout¶
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β PyPLECS Dashboard [Status] β
βββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββ ββββββββββββββ βββββββββββββββ
β β Queue β β Cache β β System ββ
β β Status β β Stats β β Info ββ
β ββββββββββββββ ββββββββββββββ βββββββββββββββ
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ
β β Active Simulations (Real-time) ββ
β β [====================> ] 75% ββ
β β Task: abc123... | Running | 7.5s elapsed ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ
β β Recent Completions ββ
β β β
Task def456... | Completed | 8.2s ββ
β β β
Task ghi789... | Completed | 7.9s ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββ
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
Widgets¶
Queue Status Card¶
- Pending: Tasks waiting in queue
- Running: Currently executing simulations
- Completed: Successfully finished tasks
- Failed: Tasks that encountered errors
- Avg Duration: Average simulation time
Example:
ββββββββββββββββββββ
β Queue Status β
ββββββββββββββββββββ€
β Pending: 5 β
β Running: 2 β
β Completed: 1523 β
β Failed: 12 β
β Avg: 8.5s β
ββββββββββββββββββββ
Cache Stats Card¶
- Hit Rate: Percentage of cache hits
- Total Entries: Number of cached simulations
- Disk Usage: Cache storage size
- Speedup: Performance improvement from caching
Example:
ββββββββββββββββββββ
β Cache Stats β
ββββββββββββββββββββ€
β Hit Rate: 76.1% β
β Entries: 2001 β
β Size: 145 MB β
β Speedup: 5.2x β
ββββββββββββββββββββ
System Info Card¶
- PLECS: Connection status
- Version: PyPLECS version
- Uptime: Server uptime
- CPU Cores: Available cores for parallelization
Example:
ββββββββββββββββββββ
β System Info β
ββββββββββββββββββββ€
β PLECS: Connected β
β Version: 1.0.0 β
β Uptime: 1h 23m β
β Cores: 4 β
ββββββββββββββββββββ
Real-Time Updates¶
Dashboard updates automatically via WebSocket: - β‘ Live progress bars for running simulations - π Auto-refresh queue statistics - π Instant updates when simulations complete
Status indicators: - π’ Green: Healthy, PLECS connected - π‘ Yellow: Warning, high queue depth - π΄ Red: Error, PLECS disconnected
Simulations Page¶
Submit and manage simulations.
Submit New Simulation¶
Form Fields:
- Model File (required)
- Path to
.plecsfile - Can be absolute or relative to working directory
-
Autocomplete suggests recent models
-
Parameters (optional)
- JSON format:
{"Vi": 12.0, "Vo": 5.0, "fsw": 100000} -
Or key-value editor:
-
Output Variables (optional)
- Comma-separated:
Vo, IL, Iin -
Leave empty to return all variables
-
Priority (optional, default: NORMAL)
- CRITICAL: Highest priority
- HIGH: Important simulations
- NORMAL: Default
-
LOW: Background jobs
-
Metadata (optional)
- Custom JSON:
{"user": "engineer@company.com", "project": "buck_design"}
Example:
βββββββββββββββββββββββββββββββββββββββββββββββ
β Submit Simulation β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β Model File: [models/buck.plecs ] π β
β β
β Parameters: β
β βββββββββββββββββββββββββββββββββββββββββββ β
β β { β β
β β "Vi": 12.0, β β
β β "Vo": 5.0 β β
β β } β β
β βββββββββββββββββββββββββββββββββββββββββββ β
β β
β Priority: [NORMAL βΌ] β
β β
β [Submit Simulation] β
βββββββββββββββββββββββββββββββββββββββββββββββ
After Submission:
β
Simulation submitted successfully!
Task ID: abc123-def456-ghi789
Status: Queued
Priority: NORMAL
[View Status] [View Results (when ready)]
Batch Submission¶
For parameter sweeps or multiple simulations:
Batch Mode:
βββββββββββββββββββββββββββββββββββββββββββββββ
β Batch Submission β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β Model File: [models/buck.plecs ] π β
β β
β Parameter Sweep: β
β Variable: [Vi ] β
β Start: [12 ] β
β Stop: [48 ] β
β Step: [6 ] β
β β
β Or paste JSON array: β
β βββββββββββββββββββββββββββββββββββββββββββ β
β β [ β β
β β {"Vi": 12.0}, β β
β β {"Vi": 24.0}, β β
β β {"Vi": 48.0} β β
β β ] β β
β βββββββββββββββββββββββββββββββββββββββββββ β
β β
β [Submit Batch (3 simulations)] β
βββββββββββββββββββββββββββββββββββββββββββββββ
After Batch Submission:
β
Batch submitted: 3 simulations
Task IDs:
- abc123-def456-ghi789 (Queued)
- jkl012-mno345-pqr678 (Queued)
- stu901-vwx234-yza567 (Queued)
[Monitor All] [Export Results (when ready)]
Simulation Queue View¶
Table:
βββββββββββββββ¬βββββββββββ¬βββββββββ¬βββββββββββ¬βββββββββββ¬ββββββββββ
β Task ID β Status β Prio β Model β Started β Actions β
βββββββββββββββΌβββββββββββΌβββββββββΌβββββββββββΌβββββββββββΌββββββββββ€
β abc123... β Running β HIGH β buck.pl β 10:30:05 β [View] β
β def456... β Queued β NORMAL β buck.pl β -- β [Cancel]β
β ghi789... β Complete β HIGH β boost.pl β 10:29:45 β [View] β
β jkl012... β Failed β LOW β buck.pl β 10:28:30 β [Retry] β
βββββββββββββββ΄βββββββββββ΄βββββββββ΄βββββββββββ΄βββββββββββ΄ββββββββββ
Filters: - Status: All / Queued / Running / Completed / Failed - Priority: All / CRITICAL / HIGH / NORMAL / LOW - Model: [Dropdown of recent models] - Date Range: Last hour / Last day / Last week / Custom
Actions: - View: See details and results - Cancel: Cancel queued/running simulation - Retry: Re-submit failed simulation - Clone: Submit similar simulation with modified parameters
Cache Page¶
Manage simulation result cache.
Cache Statistics¶
Overview:
βββββββββββββββββββββββββββββββββββββββββββββββ
β Cache Performance β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β Hit Rate: ββββββββββββββββββββ 76.1% β
β β
β Hits: 1523 β
β Misses: 478 β
β Total: 2001 β
β β
β Disk Usage: 145.7 MB / 1000 MB (14.6%) β
β β
β Oldest Entry: 2025-01-20 08:00:00 β
β Newest Entry: 2025-01-25 10:30:00 β
β β
β Estimated Speedup: 5.2x β
β Time Saved: 3h 42m β
βββββββββββββββββββββββββββββββββββββββββββββββ
Cache Entries¶
Table:
ββββββββββββββ¬ββββββββββ¬βββββββββββββ¬ββββββββββ¬ββββββββ
β Model β Params β Created β Accessedβ Size β
ββββββββββββββΌββββββββββΌβββββββββββββΌββββββββββΌββββββββ€
β buck.plecs β Vi=12.0 β Jan 25 10h β 5 times β 72 KB β
β buck.plecs β Vi=24.0 β Jan 25 10h β 3 times β 71 KB β
β boost.plecsβ Vi=48.0 β Jan 24 15h β 1 time β 68 KB β
ββββββββββββββ΄ββββββββββ΄βββββββββββββ΄ββββββββββ΄ββββββββ
Cache Management¶
Actions:
Clear Cache Confirmation:
β οΈ Warning: Clear Cache?
This will delete 2001 cache entries (145.7 MB).
Simulations will need to re-run until cache rebuilds.
[Cancel] [Confirm Clear]
Cache Settings¶
Configuration Panel:
βββββββββββββββββββββββββββββββββββββββββββββββ
β Cache Settings β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β β Caching Enabled β
β β
β Storage Format: [Parquet βΌ] β
β (parquet, hdf5, csv) β
β β
β Compression: [Snappy βΌ] β
β (snappy, gzip, lz4, none) β
β β
β TTL (Time to Live): β
β [24] hours (0 = infinite) β
β β
β Max Cache Size: β
β [1000] MB (0 = unlimited) β
β β
β [Save Settings] β
βββββββββββββββββββββββββββββββββββββββββββββββ
Settings Page¶
Note: Full settings UI is planned for v1.x. Current version: read-only config display.
Current Implementation¶
Configuration Display:
βββββββββββββββββββββββββββββββββββββββββββββββ
β Configuration β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β PLECS: β
β Executable: C:/Program Files/... β
β XML-RPC Port: 1080 β
β β
β Orchestration: β
β Max Concurrent: 4 β
β Batch Size: 4 β
β Retry Attempts: 3 β
β β
β Cache: β
β Enabled: Yes β
β Format: Parquet β
β Compression: Snappy β
β β
β [Edit config/default.yml manually] β
β [Reload Configuration] β
βββββββββββββββββββββββββββββββββββββββββββββββ
Planned (v1.x)¶
Editable Settings UI: - Inline editing of configuration - Validation before save - Hot-reload without restart - Import/export configuration - Multiple configuration profiles
WebSocket Live Updates¶
The Web GUI uses WebSocket for real-time updates without polling.
How It Works¶
- Browser connects to
ws://localhost:5000/ws - Server pushes updates when events occur:
- Simulation status changes
- Queue depth changes
- Cache hit/miss events
- System status changes
- UI updates instantly without refresh
Events¶
Simulation Status Update:
{
"type": "simulation_update",
"task_id": "abc123-def456-ghi789",
"status": "running",
"progress": 0.75,
"elapsed_seconds": 7.5
}
Queue Update:
Cache Hit:
Connection Status¶
Indicator (top-right): - π’ Connected: Live updates active - π‘ Reconnecting: Temporary connection loss - π΄ Disconnected: No live updates (manual refresh needed)
Auto-reconnect: Browser automatically reconnects if connection drops.
Keyboard Shortcuts¶
Navigate faster with keyboard shortcuts:
Global¶
?- Show keyboard shortcut help/- Focus search boxEsc- Close modal/dialog
Navigation¶
g d- Go to Dashboardg s- Go to Simulations pageg c- Go to Cache pageg t- Go to Settings page
Actions¶
n- New simulationb- Batch submissionr- Refresh dataCtrl+Enter- Submit form
Table Navigation¶
j/β- Next rowk/β- Previous rowEnter- View selected
Enable keyboard shortcuts: Settings > Keyboard Shortcuts > On
Troubleshooting¶
Issue: "Cannot connect to server"¶
Symptoms:
Solutions: 1. Check server is running:
-
Verify port not in use:
-
Try different port:
Issue: "PLECS disconnected"¶
Symptoms: - π΄ Red status indicator - "PLECS: Disconnected" in system info
Solutions: 1. Start PLECS manually
- Enable XML-RPC in PLECS:
- PLECS > Preferences > Remote Control
- Check "Enable XML-RPC server"
-
Port: 1080 (default)
-
Check firewall: Allow port 1080
-
Verify config:
Issue: "WebSocket disconnected"¶
Symptoms: - π‘ Yellow connection indicator - No real-time updates
Solutions: 1. Check browser console (F12): - Look for WebSocket errors
-
Refresh page (F5)
-
Clear browser cache:
- Ctrl+Shift+Delete
-
Clear cached files
-
Try different browser:
-
Chrome/Firefox recommended
-
Check proxy settings:
- WebSocket may be blocked by proxy
- Try direct connection
Issue: "Simulation not appearing in queue"¶
Symptoms: - Submitted simulation doesn't show in queue
Solutions: 1. Check for errors in submission response
- Verify model file path is correct:
- Use absolute path
-
Check file exists:
ls models/buck.plecs -
Check browser console (F12) for JavaScript errors
-
Refresh page to force update
Issue: "Slow page loading"¶
Symptoms: - Page takes >5 seconds to load - Sluggish UI
Solutions: 1. Clear cache (browser)
-
Reduce queue size in config:
-
Check system resources:
- High CPU/memory usage
-
Close other applications
-
Disable animations (if supported in settings)
Performance Tips¶
For Best Experience¶
-
Use Chrome or Firefox (best WebSocket performance)
-
Keep queue manageable (<1000 tasks)
-
Clear old cache entries periodically
-
Use batch submission for parameter sweeps (faster than individual submissions)
-
Monitor in background while working in other tools
Remote Access¶
Access Web GUI from other machines:
-
Start with external host:
-
Open firewall port 5000
-
Access from remote machine:
β οΈ Security Warning: No authentication in v1.0.0. Use VPN or SSH tunnel for remote access.
SSH Tunnel (secure remote access):
# On remote machine
ssh -L 5000:localhost:5000 user@pyplecs-server
# Then access http://localhost:5000 in browser
Advanced Features¶
API Integration¶
Web GUI is built on top of REST API. You can: - Submit via Web GUI, monitor via API - Submit via API, monitor via Web GUI - Mix Web GUI and programmatic access
See API.md for API documentation.
Custom Dashboards¶
Web GUI exposes WebSocket endpoint for custom dashboards:
// Connect to WebSocket
const ws = new WebSocket('ws://localhost:5000/ws');
// Handle updates
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
updateCustomDashboard(data);
};
Build custom monitoring tools using the same data stream.
Configuration¶
Web GUI settings in config/default.yml:
webgui:
host: "0.0.0.0" # Bind to all interfaces
port: 5000 # Web GUI port
debug: false # Debug mode (auto-reload)
template_dir: "templates" # Custom templates
static_dir: "static" # Custom static files
Environment Variables:
export PYPLECS_WEBGUI_HOST="0.0.0.0"
export PYPLECS_WEBGUI_PORT="5001"
export PYPLECS_WEBGUI_DEBUG="true"
pyplecs-gui
Support¶
- GitHub Issues: https://github.com/tinix84/pyplecs/issues
- Email: tinix84@gmail.com
- Documentation: See README.md
Monitor your simulations in style with PyPLECS Web GUI! π