ExternalRotationTask constructor

ExternalRotationTask({
  1. required String identifier,
  2. SromMeasure? measure,
})

Constructs the ExternalRotationTask and initializes all required steps and configurations. Sets up the SROM external rotation test sequence, sensor configuration, and probe.

Implementation

ExternalRotationTask({required super.identifier, SromMeasure? measure}) : super(steps: []) {
  // Use provided measure or default
  this.measure = measure ?? this.measure;

  // Configure the SROM test (sensor location, sampling rates, etc)
  config = SromConfig(
    sensorLocation: SensorLocation.upperArm,
    gyroscopeSamplingRate: 104.0,
    useAccelerometer: false,
    useGyroscope: true,
    useMagnetometer: false,
  );

  // Initialize the probe with Movesense sensor and config
  probe = MobilityProbe(
    config: config,
    sensor: MovesenseSensor(),
  );

  // Build the complete test sequence with all required steps
  steps.addAll([
    // Introduction and overview step
    RPInstructionStep(
      identifier: 'intro',
      title: 'srom_test_title_external_rotation',
      text: 'srom_test_description_external_rotation',
    ),
    // Preparation step (equipment, positioning, etc)
    ExternalRotationPreparationStep(identifier: 'external_rotation_preparation', title: 'preparation'),
    // Test instructions and procedure explanation
    ExternalRotationInstructionsStep(identifier: 'external_rotation_instructions', title: 'instructions'),
    // Countdown timer before test execution
    RPTimerStep(
      identifier: 'prepare',
      title: 'get_ready',
      timeout: const Duration(seconds: 3),
      autoSkip: true,
    ),
    // Main SROM test execution step
    _buildSromTestStep(),
    // Result display step
    SromResultStep(identifier: 'srom_result_external_rotation', title: 'test_completed', text: 'test_completed_rotation')
  ]);
}