jfjoch_viewer: opens the serial XFEL inputs, and the files of one dataset together
The viewer reads what rugnux reads: HDF5 files with a /metadata panel table, Cheetah CXI single-panel stacks and LCLS-I XTC streams, by their content as the raw sweeps are. The open dialog takes several files; they are one dataset (as on rugnux's command line), and a CrystFEL geometry file among them is their module geometry. The images are shown in detector units, at the geometry the files state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015CeEGgpKdfkCTJb3YNMJcu
This commit is contained in:
1 parent
ebce906025
commit
f2e93d847c
5 files changed
+62
-6
No files matched your search
@@ -259,19 +259,32 @@ void JFJochViewerMenu::acknowledgementsSelected() {
|
||||
}
|
||||
|
||||
void JFJochViewerMenu::openSelected() {
|
||||
QString fileName = QFileDialog::getOpenFileName(
|
||||
// Several files are one dataset: the files of a serial XFEL run (SACLA HDF5, CXI, XTC), opened as
|
||||
// rugnux opens them, with a CrystFEL geometry file among them taken as their module geometry.
|
||||
const QStringList fileNames = QFileDialog::getOpenFileNames(
|
||||
this,
|
||||
"Open File", // Dialog title
|
||||
"Open File(s)", // Dialog title
|
||||
"", // Default folder
|
||||
// A CBF is one frame per file: picking any frame opens the sweep it belongs to.
|
||||
"HDF5 Master Files (*_master.h5 *_process.h5);; HDF5 Files (*.h5);; CBF Images (*.cbf *.cbf.gz);; CCD Images (*.img *.mccd *.smv);;All Files (*)"
|
||||
"HDF5 Master Files (*_master.h5 *_process.h5);; HDF5 Files (*.h5);; CBF Images (*.cbf *.cbf.gz);; CCD Images (*.img *.mccd *.smv);; XFEL Stills (*.h5 *.cxi *.xtc *.geom);;All Files (*)"
|
||||
);
|
||||
|
||||
if (!fileName.isEmpty())
|
||||
if (!fileNames.isEmpty()) {
|
||||
// Qt returns '/'-separated paths even on Windows, but HDF5's H5Fopen needs native separators
|
||||
// to recognise a UNC path (\\host\share, e.g. the WSL2 filesystem): '//host/share' is rejected,
|
||||
// while 'C:/...' still works, which is exactly the reported symptom. No-op on Linux.
|
||||
emit fileOpenSelected(QDir::toNativeSeparators(fileName), 0, 1, false);
|
||||
QStringList native;
|
||||
for (const auto &f: fileNames)
|
||||
native << QDir::toNativeSeparators(f);
|
||||
emit fileListSelected(native);
|
||||
QString first = native.front();
|
||||
for (const auto &f: native)
|
||||
if (!f.endsWith(".geom")) {
|
||||
first = f;
|
||||
break;
|
||||
}
|
||||
emit fileOpenSelected(first, 0, 1, false);
|
||||
}
|
||||
}
|
||||
|
||||
void JFJochViewerMenu::closeSelected() {
|
||||
|
||||
Reference in new issue
Block a user