Polefig export to *.pol files seems to be broken
The export for Polefig in *.pol
files seems to be permanently disabled (see Screenshot)
A look in the source code reveals:
ExportPolefig::ExportPolefig()
: DialogMultisave{
"ePol", "Pole figure export", QStringList{"dat", "lst", "csv", "pol"}, "peak",
gSession->peaksSettings.size() > 0}
{
setFormatEnabled("pol", gSession->params.interpolParams.isStandardInterpolation());
setFormatToolTip("pol", "Intensities only, with reference to interpolated standard grid");
}
The export for this format is enabled/disabled by the gSession->params.interpolParams.isStandardInterpolation()
method
bool InterpolParams::isStandardInterpolation() const
{
if (!enabled.val())
return false;
for (double step : {1.0, 2.0, 5.0})
if (stepAlpha.val() == step && stepBeta.val() == step)
return true;
return false;
}
enabled.val() == true
is one of the conditions necessary for isStandardInterpolation()
to also return true. And here is where I see a potential bug in Steca since this enabled
is initialized with false
and its value is never changed again.
Therefore an easy fix would be:
ExportPolefig::ExportPolefig()
: DialogMultisave{
"ePol", "Pole figure export", QStringList{"dat", "lst", "csv", "pol"}, "peak",
gSession->peaksSettings.size() > 0}
{
gSession->params.interpolParams.enabled.setVal(true); // solves problem
setFormatEnabled("pol", gSession->params.interpolParams.isStandardInterpolation());
setFormatToolTip("pol", "Intensities only, with reference to interpolated standard grid");
}
But I'm not sure what the intention was.