/* This is the header file containing the declaration of the Wickens_device class that inherits from Device_processor. It declares which of the Device_processor interface functions it will implement, and also declares all of the private member variables and functions needed to provide the proper behavior. */ #ifndef WICKENS_DEVICE_H #define WICKENS_DEVICE_H #include "Device_processor.h" #include "Symbol.h" #include "Geometry.h" #include "Symbol.h" #include "Output_tee.h" #include "Statistics.h" #include #include namespace GU = Geometry_Utilities; class Wickens_device : public Device_processor { public: // constructor Wickens_device(const std::string& id, Output_tee& ot); // standard function interface for EPIC application virtual void initialize(); virtual void set_parameter_string(const std::string&); virtual std::string get_parameter_string() const; // event interface - override virtual functions implemented in this class virtual void accept_event(Smart_Pointer); virtual void handle_event(Smart_Pointer); virtual void handle_event(Smart_Pointer); virtual void handle_event(Smart_Pointer); // override just to suppress the default messages virtual void handle_event(Smart_Pointer) {} virtual void handle_event(Smart_Pointer) {} private: // display variables GU::Point target_location; GU::Size target_size; GU::Point stimulus_location; GU::Size Stimulus_circle_size; GU::Point cursor_location; long forcing_function_time_start; GU::Point previous_ff_value; GU::Cartesian_vector control_input; bool new_control_input; int stimulus_number; Symbol stimulus_name; // experimental conditions std::string condition_string; int n_trials; std::vector separation_levels; double stimulus_separation; std::vector tracking_levels; Symbol tracking_difficulty; Forcing_function_base * forcing_function; Forcing_function_easy ff_easy; Forcing_function_difficult ff_difficult; // data states int separation_index; int tracking_index; int trial; enum Choice_stimuli_t {LEFT_ARROW, RIGHT_ARROW}; Choice_stimuli_t choice_stimulus; long choice_stimulus_onset; bool response_made; bool sampling_error; bool cursor_movement_enabled; Current_rms_error current_rms; void output_statistics(); Current_mean current_rt; // setup functions void parse_condition_string(); void start_experiment(); void initialize_block(); void start_block(); void end_block(); void stop_experiment(); // event functions void update_cursor_position(); void start_choice_trial(); void sample_error(); void stop_error_sampling(); }; #endif