#pragma once #include #include #include #include namespace fgc { // One camera setting as the VimbaX Viewer exported it. struct SettingEntry { std::string name; std::string value; std::string selector; // "" unless the Viewer nested it in a }; // The settings a Viewer XML holds, in file order. // // These are NEVER applied: the program hands the XML itself to the Vimba X SDK, // which is what guarantees the camera gets exactly the combination the GUI // validated. This parse exists only to render a human-readable record and to // diff one export against the previous one. struct CameraSettings { std::string model; // std::string device_id; std::vector entries; // features, in order }; // Parse a VimbaX Viewer settings export. Only the block is read: // the /stream sections describe the host's transport layer, not the // sensor. Throws std::runtime_error naming the problem if the file is missing or // does not look like a Viewer export. CameraSettings parseCameraSettingsXml(const std::string& path); // Render the human-readable record written beside the XML. `xml_name` and // `hash_label` go in the header so the file says what it came from. std::string renderSettingsRecord(const CameraSettings& s, const std::string& xml_name, const std::string& hash_label); // Read back a record written by renderSettingsRecord. Returns the recorded hash // label (empty if the file is absent or has none) and the settings it listed, so // a regeneration can report what actually changed. struct SettingsRecord { std::string hash_label; std::vector entries; }; SettingsRecord readSettingsRecord(const std::string& path); // Human-readable difference between two settings lists, one line per change: // "AcquisitionFrameRate 10 -> 8", "+ Gamma 1.2 (new)", "- Sharpness (removed)". // Empty when they match. std::vector diffSettings(const std::vector& before, const std::vector& after); } // namespace fgc