20 #ifndef DATA_RECORDER_H 21 #define DATA_RECORDER_H 24 #include <QListWidget> 59 return {{
"Recording Channel",
60 "This is the channel used by the Data Recorder to record on other " 73 return (this->endpoint == rhs.
endpoint)
87 std::unique_ptr<RT::OS::Fifo> m_fifo;
112 void buildBlockList();
113 void buildChannelList();
114 void changeDataFile();
115 void insertChannel();
116 void removeChannel();
119 void syncEnableRecordingButtons(
const QString& );
123 size_t downsample_rate {1};
124 std::vector<std::string> dataTags;
126 QGroupBox* channelGroup =
nullptr;
127 QGroupBox* stampGroup =
nullptr;
128 QGroupBox* sampleGroup =
nullptr;
129 QGroupBox* fileGroup =
nullptr;
130 QGroupBox* buttonGroup =
nullptr;
131 QGroupBox* listGroup =
nullptr;
133 QComboBox* blockList =
nullptr;
134 QComboBox* channelList =
nullptr;
135 QComboBox* typeList =
nullptr;
136 QListWidget* selectionBox =
nullptr;
137 QLabel* recordStatus =
nullptr;
138 QPushButton* addRecorderButton =
nullptr;
139 QPushButton* removeRecorderButton =
nullptr;
140 QPushButton* addTag =
nullptr;
142 QSpinBox* downsampleSpin =
nullptr;
144 QLineEdit* fileNameEdit =
nullptr;
145 QLineEdit* timeStampEdit =
nullptr;
146 QLineEdit* fileFormatEdit =
nullptr;
147 QLabel* fileSizeLbl =
nullptr;
148 QLabel* fileSize =
nullptr;
149 QLabel* trialLengthLbl =
nullptr;
150 QLabel* trialLength =
nullptr;
151 QLabel* trialNumLbl =
nullptr;
152 QLabel* trialNum =
nullptr;
153 QTimer* recording_timer =
nullptr;
155 QPushButton* startRecordButton =
nullptr;
156 QPushButton* stopRecordButton =
nullptr;
157 QPushButton* closeButton =
nullptr;
159 QTime starting_record_time;
175 void openFile(
const std::string& file_name);
192 std::atomic<bool> recording;
193 void append_new_trial();
194 void close_trial_group();
195 void open_trial_group();
196 static void save_data(hid_t data_id,
197 const std::vector<data_token_t>& data,
198 size_t packet_count);
199 hsize_t m_data_chunk_size =
static_cast<hsize_t
>(1000);
200 int m_compression_factor = 5;
203 hid_t file_handle = H5I_INVALID_HID;
204 hid_t trial_group_handle = H5I_INVALID_HID;
205 hid_t attribute_handle = H5I_INVALID_HID;
206 hid_t sync_group_handle = H5I_INVALID_HID;
207 hid_t async_group_handle = H5I_INVALID_HID;
208 hid_t sys_data_group_handle = H5I_INVALID_HID;
209 hid_t channel_datatype_handle = H5I_INVALID_HID;
215 std::unique_ptr<DataRecorder::Component> comp,
217 : channel(std::move(chan))
218 , component(std::move(comp))
219 , hdf5_data_handle(handle)
223 std::unique_ptr<DataRecorder::Component> component;
224 hid_t hdf5_data_handle;
228 std::string hdf5_filename;
229 std::vector<recorder_t> m_recording_channels_list;
230 std::shared_mutex m_channels_list_mut;
231 std::atomic<bool> open_file =
false;
RT::OS::Fifo * get_fifo()
Component(Widgets::Plugin *hplugin, const std::string &probe_name)
Panel & operator=(const Panel &)=delete
Panel & operator=(Panel &&)=delete
void updateDownsampleRate(size_t rate)
Panel(const Panel &)=delete
void startRecordClicked()
~Panel() override=default
void removeRecorders(IO::Block *block)
void process_data_worker()
int getTrialCount() const
void destroy_component(IO::endpoint endpoint)
int apply_tag(const std::string &tag)
Plugin & operator=(const Plugin &)=delete
Plugin & operator=(Plugin &&)=delete
void openFile(const std::string &file_name)
std::string getRecorderName(IO::endpoint endpoint)
void change_file(const std::string &file_name)
RT::OS::Fifo * getFifo(IO::endpoint endpoint)
int create_component(IO::endpoint endpoint)
DataRecorder::Component * getRecorderPtr(IO::endpoint endpoint)
void receiveEvent(Event::Object *event) override
Plugin(const Plugin &)=delete
std::string getOpenFilename() const
std::vector< record_channel > get_recording_channels()
constexpr size_t DEFAULT_BUFFER_SIZE
constexpr std::string_view MODULE_NAME
Widgets::FactoryMethods getFactories()
struct DataRecorder::record_channel record_channel
std::unique_ptr< Widgets::Plugin > createRTXIPlugin(Event::Manager *ev_manager)
struct DataRecorder::data_token_t data_token_t
std::vector< Widgets::Variable::Info > get_default_vars()
std::unique_ptr< Widgets::Component > createRTXIComponent(Widgets::Plugin *host_plugin)
Widgets::Panel * createRTXIPanel(QMainWindow *mwindow, Event::Manager *ev_manager)
std::vector< IO::channel_t > get_default_channels()
struct IO::endpoint endpoint
RT::OS::Fifo * data_source
bool operator!=(const record_channel &rhs) const
bool operator==(const record_channel &rhs) const