| 245 | } |
| 246 | |
| 247 | void IpcClient::send_export_buffer_request(const std::string& variable_name, |
| 248 | int format, |
| 249 | const std::vector<float>& contrast) { |
| 250 | oid::MessageComposer composer; |
| 251 | composer.push(oid::MessageType::ExportBufferRequest) |
| 252 | .push(variable_name) |
| 253 | .push(format); |
| 254 | // Fixed 8-float contrast layout on the wire (mirrors the Qt sender, |
| 255 | // MessageHandler::request_export_buffer): pad missing entries with |
| 256 | // 0.0f, ignore any beyond the 8th. |
| 257 | for (int i = 0; i < 8; ++i) { |
| 258 | const float value = |
| 259 | static_cast<std::size_t>(i) < contrast.size() ? contrast[i] : 0.0F; |
| 260 | composer.push(value); |
| 261 | } |
| 262 | composer.send(transport_); |
| 263 | } |
| 264 | |
| 265 | void IpcClient::set_session_state_callback( |
| 266 | std::function<void(const std::string& json)> cb) { |