Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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:

  1. Schema Definition: All test structures are defined in project.json.
  2. Code Generation: Auto-generates typed Rust structs and TypeScript interfaces.
  3. Real-Time Collection: The control program pushes cycle data via IPC (non-blocking).
  4. Asynchronous Storage: The ResultsServelet handles disk I/O, UTC timestamping, and checksumming.
  5. 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

PropertyDescription
nameThe internal key for the data field.
typeData type (e.g., f32, u32, string, bool).
unitsOptional unit string for display in the UI.
requiredIf true, the UI will prevent starting a test until a value is entered.
sourceLink 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.