API Reference¶
GeckoCIRCUITS provides multiple interfaces for automation, integration, and programmatic control.
Available Interfaces¶
-
Java RMI-based interface for MATLAB integration
-
REST API (Planned)
HTTP-based API for web integration and automation (designed, implementation pending)
-
Built-in scripting language for automation
Interface Comparison¶
| Feature | Remote (RMI) | REST API* | GeckoSCRIPT |
|---|---|---|---|
| Language | Java/MATLAB | Any | Built-in |
| Real-time | Yes | No | Yes |
| Network | Local/Remote | HTTP | Local |
| Complexity | Medium | Low | Low |
| Best for | MATLAB integration | Web apps | Quick automation |
- REST API is currently in design phase, implementation is pending.
Quick Start¶
GeckoSCRIPT (Built-in)¶
// Parameter sweep example
for (D = 0.2; D <= 0.8; D += 0.1) {
setParameter("PWM.1", "dutyCycle", D);
runSimulation();
Vout = getMeasurement("SCOPE.1", "ch1_avg");
print("D=" + D + ", Vout=" + Vout);
}
MATLAB (RMI)¶
% Connect to GeckoCIRCUITS
gecko = GeckoRemoteInterface('localhost', 1099);
% Load and run
gecko.loadCircuit('buck.ipes');
gecko.setParameter('PWM.1', 'dutyCycle', 0.5);
gecko.runSimulation();
vout = gecko.getMeasurement('Vout');
Python (REST API - Planned)¶
import requests
# Run simulation (when REST API is implemented)
response = requests.post('http://localhost:8080/api/simulate', json={
'circuit': 'buck.ipes',
'parameters': {'D': 0.5}
})
results = response.json()
print(f"Vout = {results['Vout']}")
cURL (REST API - Planned)¶
# Get simulation status (when REST API is implemented)
curl http://localhost:8080/api/status
# Run simulation
curl -X POST http://localhost:8080/api/simulate \
-H "Content-Type: application/json" \
-d '{"circuit": "buck.ipes", "time": 0.01}'
Core API Methods¶
Circuit Control¶
| Method | Description |
|---|---|
loadCircuit(path) | Load circuit file |
saveCircuit(path) | Save current circuit |
runSimulation() | Start simulation |
stopSimulation() | Stop running simulation |
resetSimulation() | Reset to initial state |
Parameter Access¶
| Method | Description |
|---|---|
setParameter(component, param, value) | Set component parameter |
getParameter(component, param) | Get component parameter |
setGlobalParameter(name, value) | Set global variable |
Data Retrieval¶
| Method | Description |
|---|---|
getMeasurement(scope, channel) | Get scope measurement |
getWaveform(scope, channel) | Get time-series data |
exportData(path, format) | Export to file |