Commit Graph
20 Commits
Author SHA1 Message Date
suter_aandClaude Opus 5.5 adc991f72f musrview, musrFT, musrt0: show their own window/dock icon instead of the generic ROOT one.
Build and Deploy Documentation / build-and-deploy (push) Successful in 26s
The ROOT canvas sets the macro_s.xpm icon and WM_CLASS "ROOT". Set a compiled-in
xpm icon and a per-tool class hint, and install matching .desktop files and icons.
Since desktops only search XDG data dirs, .desktop files and icons (incl. musredit)
are now installed to MUSRFIT_XDG_DATADIR (default: prefix share for /usr and
/usr/local, ~/.local/share for prefixes under $HOME, /usr/local/share otherwise).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 21:24:40 +02:00
suter_aandClaude Opus 5 618e96fb00 fix musrview ctest failures on macOS: RGB order and path buffers
Build and Deploy Documentation / build-and-deploy (push) Successful in 27s
Three unrelated issues made the musrview_check tests fail on macOS while
passing on Linux.

1. Unspecified argument evaluation order

   TColor::GetColor(rand.Integer(255), rand.Integer(255), rand.Integer(255))

   evaluates its (side-effecting) arguments in an unspecified order: clang
   goes left-to-right, gcc right-to-left, so the same seed yielded RGB on
   one platform and BGR on the other. Visible whenever more runs are
   plotted than the startup xml colour list provides, e.g.
   test-histo-HAL9500.msr with 16 runs against 10 colours.

   The rgb values are now drawn into separate variables first. This keeps
   the clang result and changes gcc to match, hence the regenerated
   reference PNG for musrview-histo-HAL9500 (99.94% of the differing
   pixels were exact R<->B swaps).

   Fixed in PMusrCanvas, PFourierCanvas and both mupp PMuppCanvas copies.

2. Fixed size path buffers

   char fileName[128] plus strncpy(dst, src, sizeof(dst)) truncates *and*
   leaves the buffer unterminated once the path reaches the buffer size.
   musrview then failed on a 132 character msr-path in doc/examples/ViewOpts.
   musrFT and musrt0 were worse: an unbounded strcpy of the startup file
   path into char startup_path_name[128], i.e. a stack buffer overflow.

   All path/filename buffers in the drivers are now std::string:
   musrview, musrFT, musrt0, musrfit, any2many, addRun, dump_header.
   PMusrCanvas::SaveGraphicsAndQuit() takes const Char_t* accordingly.

   Along the way in the same files:
   - msr2msr_replace() wrote a 256 byte line into char temp[128]
   - msr2msr assembled "cp"/"rm" shell commands from paths in a 256 byte
     buffer; replaced by std::filesystem
   - msr2msr and addRun read lines with getline(buf, N), which silently
     abandons the rest of the file on the first over-long line
   - addRun: bound the unbounded sscanf "%s" to "%255s"
   - dropped scratch buffers that only held a string literal, in favour of
     TString::ReplaceAll(const char*, const char*)

3. musrview_check.py left its PNGs behind on failure

   The two early error returns skipped the cleanup, and since generated
   PNGs were identified by "not in the pre-run snapshot", one leftover file
   permanently masked the real output of that test: musrview overwrites the
   stale PNG, so it was there, just filtered out. One failure thus poisoned
   every later run (30 of the 37 observed failures) after a 15 s poll each.

   Cleanup now runs in a finally block on every exit path, and generated
   PNGs are detected by mtime instead, which sees rewritten leftovers while
   staying safe for a sibling test running concurrently under ctest -j.
   Also dropped the MUSRVIEW_PNG_DIR env var and its tmp-dir fallback: it
   is read nowhere in src/, so the fallback was dead code that guaranteed
   the full 15 s poll before every "no PNGs found" failure.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-29 19:44:50 +02:00
suter_a 4de660788d updated the copyright info.
Build and Deploy Documentation / build-and-deploy (push) Successful in 26s
2026-01-25 07:42:29 +01:00
suter_a f8a2d646dc improve the doxygen docu.
Build and Deploy Documentation / build-and-deploy (push) Successful in 19s
2025-11-13 08:36:42 +01:00
suter_a 4a20d805dd updated the copyright info. 2025-01-30 11:15:42 +01:00
suter_a 79c8be54bf update of the copyright info. 2024-02-03 19:58:11 +01:00
suter_a 4b561b1f15 get rid of raw pointers for PFourierCanvas where it makes sense. 2023-10-18 14:21:15 +02:00
suter_a fe32046c21 updated the copyright info. 2023-01-05 10:24:31 +01:00
suter_a e6e951e8f4 update the copyright info. 2021-03-29 08:22:38 +02:00
suter_a 10271dab9a update of the copyright info. 2020-04-29 09:05:40 +02:00
suter_a 795cd75b1e modernized code to C++11 and newer.
This allows to analyze the code by external code analyzers. Since a lot is adopted,
the version is changed to 1.4.3
2019-04-16 15:34:49 +02:00
suter_a 63516fc499 added a first version of a optimized phase correction for the real Fourier transform 2016-12-18 10:37:50 +01:00
suter_a f7834aaead added class PFTPhaseCorrection which allows to calculate the phase optimzied real part of the Fourier transform. musrFT is already using it, for musrview it is still missing. 2016-11-29 11:16:45 +01:00
suter_a 8e399fa04e first steps towards asymmetry RRF fit. 2016-01-15 17:16:07 +01:00
suter_a f58cbf1874 added a yet experimental feature of a phase 'optimized' real Fourier transform. 2015-09-24 15:33:47 +02:00
suter_a 8cc07318eb some more bug fixing for average per data set. 2015-02-26 13:15:29 +01:00
suter_a c938589286 implemented an average-per-data-set option for musrFT. 2015-02-23 16:30:14 +01:00
suter_a ca48941deb bug fixing towards a musrFT feature complete state. 2015-02-17 12:46:30 +01:00
suter_a e097cc3119 added data export from the GUI menu. 2015-02-16 07:30:57 +01:00
suter_a 2d2594c903 first almost feature complete version of musrFT 2015-02-13 16:56:19 +01:00