Files
Jungfraujoch/reader/FileNamePatterns.h
leonarski_fandClaude Opus 5.5 4c322b3e39 jfjoch_viewer: list every format it opens in the file browser and the open dialog
The file browser listed only *_master.h5, *_process.h5 and *.cbf, and the open
dialog had no filter covering frames numbered in their extension, so a marCCD or
ADSC sweep written as name.001 / name.0001 was invisible in both, as were .cbf.gz,
.mccd, .osc, .sfrm, .nxs, .cxi and .xtc in the browser.

One list of wildcards (reader/FileNamePatterns.h) now serves both: the HDF5
masters and processing results, .nxs, .cxi, .xtc, the raw frame extensions and
frame numbers of three to five digits. The open dialog offers it first as
"All supported", plus any .h5 and .geom for the files of an XFEL run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HVeDQrPqZ52Tp6rzzZGxf3
2026-11-20 02:41:11 +01:00

21 lines
1.0 KiB
C++

// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <string>
#include <vector>
// The files the viewer lists as openable, as wildcards in the QDir name-filter syntax. Only what is
// listed is decided here: the readers tell the formats apart by content (.img is miniCBF, marCCD or
// SMV depending on the writer).
//
// An HDF5 dataset is opened by its master or its processing result, never by the _data_NNNNNN.h5
// shards a master links to. A raw frame is one image per file, and naming any frame opens its whole
// sweep; the marCCD and ADSC software number a frame in its extension ("name.001", "name.0001").
inline const std::vector<std::string> OPENABLE_FILE_PATTERNS = {
"*_master.h5", "*_process.h5", "*.nxs", "*.cxi", "*.xtc",
"*.cbf", "*.cbf.gz", "*.img", "*.mccd", "*.marccd", "*.tif", "*.tiff", "*.smv", "*.osc", "*.sfrm",
"*.[0-9][0-9][0-9]", "*.[0-9][0-9][0-9][0-9]", "*.[0-9][0-9][0-9][0-9][0-9]"
};