Standardized Results System
The Standardized Results System provides a unified way to collect, store, and export test data across the entire AutoCore stack. By defining your test schema in project.json, you automatically get type-safe Rust code for your control program and dynamic forms for your React HMI.
Architecture Overview
The system is designed for high-performance industrial environments:
- Schema Definition: All test structures are defined in
project.json. - Code Generation: Auto-generates typed Rust structs and TypeScript interfaces.
- Real-Time Collection: The control program pushes cycle data via IPC (non-blocking).
- Asynchronous Storage: The
ResultsServelethandles disk I/O, UTC timestamping, and checksumming. - Filesystem-Based: Data is stored as standard JSON and JSONL files for maximum portability.
Configuration (project.json)
Test definitions are added to the test_definitions block. You can link fields to Global Memory (GM) variables using the source property to enable automatic data fetching.
{
"test_definitions": {
"impact_test": {
"project_fields": [
{ "name": "customer", "type": "string", "required": true }
],
"config_fields": [
{ "name": "drop_height", "type": "f32", "units": "mm", "source": "gm.drop_height_mm" },
{ "name": "specimen_id", "type": "string", "required": true }
],
"cycle_fields": [
{ "name": "drop_index", "type": "u32", "source": "gm.cycle_count" },
{ "name": "peak_g", "type": "f32", "source": "gm.total_peak_load" },
{ "name": "judgement", "type": "string" }
],
"results_fields": [
{ "name": "avg_peak_g", "type": "f32" }
]
}
}
}
Field Properties
| Property | Description |
|---|---|
name | The internal key for the data field. |
type | Data type (e.g., f32, u32, string, bool). |
units | Optional unit string for display in the UI. |
required | If true, the UI will prevent starting a test until a value is entered. |
source | Link to a GM FQDN. The code generator will auto-fetch this value during add_cycle(). |
Storage Structure
Results are stored in the datastore/results/ directory, organized by Project ID and Test ID (ISO Time String).
test.json: Metadata, config values, and a snapshot of the schema.cycles.jsonl: Append-only JSON Lines file containing all cycle data.raw_data/: Subdirectory for heavy arrays (e.g., high-speed DAQ traces).
Control Program Usage
The code generator creates a specific TestManager for every definition.
// 1. Initialize in your struct
struct MyProgram {
test_manager: ImpactTestManager,
}
// 2. Start a test (locks in metadata and config)
self.test_manager.start_test("my_project_123", ctx.client);
// 3. Push a cycle
// Fields with a "source" are fetched automatically from ctx.gm!
self.test_manager.add_cycle("GOOD".to_string(), ctx);
// 4. Update test-wide results
self.test_manager.update_results(11.2, ctx);
React HMI Integration
The @adcops/autocore-react library provides dynamic components that read the generated schema:
<TestSetupForm />: Automatically renders input boxes and handles validation.<ResultHistoryTable />: Fetches summaries and displays them in a grid.<ExportButton />: Triggers server-side generation of CSV or PDF reports.