Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
da8229b2
Commit
da8229b2
authored
Mar 01, 2021
by
Whitfield, Ross
Browse files
Change exception to NotImplementedError
parent
f9415307
Changes
2
Hide whitespace changes
Inline
Side-by-side
Framework/DataObjects/src/LeanPeak.cpp
View file @
da8229b2
...
...
@@ -112,7 +112,7 @@ LeanPeak::LeanPeak(const Geometry::IPeak &ipeak)
* @param id :: ID of detector at the centre of the peak.
*/
void
LeanPeak
::
setDetectorID
([[
maybe_unused
]]
int
id
)
{
throw
std
::
runtime_e
rror
(
throw
Exception
::
NotImplementedE
rror
(
"LeanPeak::setDetectorID(): Can't set detectorID on LeanPeak"
);
}
...
...
@@ -128,19 +128,21 @@ int LeanPeak::getDetectorID() const { return -1; }
*/
void
LeanPeak
::
setInstrument
([
[
maybe_unused
]]
const
Geometry
::
Instrument_const_sptr
&
inst
)
{
throw
std
::
runtime_e
rror
(
throw
Exception
::
NotImplementedE
rror
(
"LeanPeak::setInstrument(): Can't set instrument on LeanPeak"
);
}
//----------------------------------------------------------------------------------------------
/** Return a shared ptr to the detector at center of peak. */
Geometry
::
IDetector_const_sptr
LeanPeak
::
getDetector
()
const
{
throw
std
::
runtime_error
(
"LeanPeak::getDetector(): Has no detector ID"
);
throw
Exception
::
NotImplementedError
(
"LeanPeak::getDetector(): Has no detector ID"
);
}
/** Return a shared ptr to the instrument for this peak. */
Geometry
::
Instrument_const_sptr
LeanPeak
::
getInstrument
()
const
{
throw
std
::
runtime_error
(
"LeanPeak::setInstrument(): Has no instrument"
);
throw
Exception
::
NotImplementedError
(
"LeanPeak::setInstrument(): Has no instrument"
);
}
// -------------------------------------------------------------------------------------
...
...
@@ -230,7 +232,7 @@ void LeanPeak::setQLabFrame(
void
LeanPeak
::
setSamplePos
([[
maybe_unused
]]
double
samX
,
[[
maybe_unused
]]
double
samY
,
[[
maybe_unused
]]
double
samZ
)
{
throw
std
::
runtime_error
(
"not implemented
"
);
throw
Exception
::
NotImplementedError
(
"LeanPeak has no sample information
"
);
}
/** Set sample position
...
...
@@ -238,19 +240,19 @@ void LeanPeak::setSamplePos([[maybe_unused]] double samX,
* @param XYZ :: vector x,y,z-> samplePos(x), samplePos(y), samplePos(z)
*/
void
LeanPeak
::
setSamplePos
([[
maybe_unused
]]
const
Mantid
::
Kernel
::
V3D
&
XYZ
)
{
throw
std
::
runtime_error
(
"not implemented
"
);
throw
Exception
::
NotImplementedError
(
"LeanPeak has no sample information
"
);
}
// -------------------------------------------------------------------------------------
/** Return the detector position vector */
Mantid
::
Kernel
::
V3D
LeanPeak
::
getDetPos
()
const
{
throw
std
::
runtime_error
(
"not implemented
"
);
throw
Exception
::
NotImplementedError
(
"LeanPeak has no detector information
"
);
}
// -------------------------------------------------------------------------------------
/** Return the sample position vector */
Mantid
::
Kernel
::
V3D
LeanPeak
::
getSamplePos
()
const
{
throw
std
::
runtime_error
(
"not implemented
"
);
throw
Exception
::
NotImplementedError
(
"LeanPeak has no sample information
"
);
}
// -------------------------------------------------------------------------------------
...
...
@@ -287,7 +289,9 @@ LeanPeak &LeanPeak::operator=(const LeanPeak &other) {
*
* @return true if the detector ID was found.
*/
bool
LeanPeak
::
findDetector
()
{
throw
std
::
runtime_error
(
"not implemented"
);
}
bool
LeanPeak
::
findDetector
()
{
throw
Exception
::
NotImplementedError
(
"LeanPeak has no detector information"
);
}
/**
* Performs the same algorithm as findDetector() but uses a pre-existing
...
...
@@ -299,7 +303,7 @@ bool LeanPeak::findDetector() { throw std::runtime_error("not implemented"); }
*/
bool
LeanPeak
::
findDetector
([
[
maybe_unused
]]
const
InstrumentRayTracer
&
tracer
)
{
throw
std
::
runtime_error
(
"not implemented
"
);
throw
Exception
::
NotImplementedError
(
"LeanPeak has no detector information
"
);
}
/**
...
...
Framework/DataObjects/test/LeanPeakTest.h
View file @
da8229b2
...
...
@@ -34,13 +34,15 @@ public:
TS_ASSERT_EQUALS
(
p
.
getQLabFrame
(),
V3D
())
TS_ASSERT_EQUALS
(
p
.
getDetectorID
(),
-
1
)
TS_ASSERT_THROWS
(
p
.
getDetector
(),
const
std
::
runtime_error
&
)
TS_ASSERT_THROWS
(
p
.
getInstrument
(),
const
std
::
runtime_error
&
)
TS_ASSERT_THROWS
(
p
.
findDetector
(),
const
std
::
runtime_error
&
)
TS_ASSERT_THROWS
(
p
.
getDetectorPosition
(),
const
std
::
runtime_error
&
)
TS_ASSERT_THROWS
(
p
.
getDetectorPositionNoCheck
(),
const
std
::
runtime_error
&
)
TS_ASSERT_THROWS
(
p
.
getDetPos
(),
const
std
::
runtime_error
&
)
TS_ASSERT_THROWS
(
p
.
getSamplePos
(),
const
std
::
runtime_error
&
)
TS_ASSERT_THROWS
(
p
.
getDetector
(),
const
Exception
::
NotImplementedError
&
)
TS_ASSERT_THROWS
(
p
.
getInstrument
(),
const
Exception
::
NotImplementedError
&
)
TS_ASSERT_THROWS
(
p
.
findDetector
(),
const
Exception
::
NotImplementedError
&
)
TS_ASSERT_THROWS
(
p
.
getDetectorPosition
(),
const
Exception
::
NotImplementedError
&
)
TS_ASSERT_THROWS
(
p
.
getDetectorPositionNoCheck
(),
const
Exception
::
NotImplementedError
&
)
TS_ASSERT_THROWS
(
p
.
getDetPos
(),
const
Exception
::
NotImplementedError
&
)
TS_ASSERT_THROWS
(
p
.
getSamplePos
(),
const
Exception
::
NotImplementedError
&
)
TS_ASSERT
(
std
::
isnan
(
p
.
getTOF
()))
TS_ASSERT
(
std
::
isnan
(
p
.
getScattering
()))
TS_ASSERT
(
std
::
isnan
(
p
.
getAzimuthal
()))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment