/** * @brief Update widgets when pickerLine is manually changed. Do not update if * the pickerLine moved so little that it did not positioned over a different * slice. * @param newEnergySelected the new energy retrieved from the pickerLine */ void SliceSelector::newIndexFromPickedEnergy(const double &newEnergySelected) { auto axis = m_loadedWorkspace->m_ws->getAxis(1); auto newSelectedIndex = axis->indexOfValue(newEnergySelected); if (m_selectedWorkspaceIndex != newSelectedIndex) { updateSelectedSlice(static_cast<int>(newSelectedIndex)); } }
/** * @brief Update the position of the picker line as a response to changes in the * SliceSelector, unless the energy being pointed to corresponds to the current * index. */ void SliceSelector::updatePickerLine() { auto energyBeingPointedTo = m_pickerLine->getMinimum(); auto axis = m_loadedWorkspace->m_ws->getAxis(1); auto indexBeingPointedTo = axis->indexOfValue(energyBeingPointedTo); if (m_selectedWorkspaceIndex != indexBeingPointedTo) { m_pickerLine->setMinimum(m_loadedWorkspace->m_energy); } }
int AMOldDetectorInfoSet::indexOf(AMOldDetectorInfo *detectorInfo) const{ return indexOfValue(detectorInfo); }
int AMDetectorSet::indexOf(AMDetector *detector) const{ return indexOfValue(detector); }
int AMControlSet::indexOf(AMControl* control) { return indexOfValue(control); }
int XStringMap::indexOfValue( const QString& value, int from) const { return indexOfValue( value.toUtf8(), from); }