Closed FMassin closed 6 years ago
How is vsevent->azGap
initialized if it is not populated from the origin quality? I can't find anything.
I though the line https://github.com/SeisComP3/seiscomp3/blob/54a72de6623ebd3bfedc6e7ef691d070ef3bd9f2/src/sed/apps/scvsmag/scvsmag.h#L102
was somehow enough because it does compile and runs in playback and shows the new debug message I set up...
Yes, it does compile but the compiler has to initialize azGap somehow when you create a new Event object. Since azGap is not initialized explicitely, it depends on the compiler implementation how the initialization is done. Either populating the memory with zeros or just garbage. It is not deterministic.
It would be good to set a default value in the catch block.
Can you please squash both commits and prepend [scvsmag]
to your commit message, e.g.:
[scvsmag] Catch exception if origin.quality.azimuthalGap is not set
I was still thinking about using NaN as a default value... would that be accepted?
I was still thinking about using NaN as a default value... would that be accepted?
Accepted by whom? If the application adds test for such cases then yes. I would otherwise recommend an optional double. You can use that in SC3 easily with:
OPT(double) optionalValue;
if ( optionalValue )
cerr << *optionalValue << endl;
Thanks for the advice.
I cleaned my mess. Can it be merged ?
Thank you Jan!
Thanks Fred for the fix and the corrections.
A semicolon was missing, I added that. Neither of us has compiled the changes ;)
Sorry, I shouldn't use github's online editor... neither copy and paste !
Without this fix, scvsmag trash when an origin has no quality.azimuthalGap. I can happen: scanloc preliminary origins don't have quality.azimuthalGap.