Skip to content

Commit

Permalink
Merge commit '922b8507735e76e37bdb0fb4d20232629d52c805' into 7363_vat…
Browse files Browse the repository at this point in the history
…es_paraview_4p3

Conflicts:
	Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/MdViewerWidget.cpp
  • Loading branch information
quantumsteve committed Mar 17, 2015
2 parents 248f353 + 922b850 commit b7d4209
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 9 deletions.
9 changes: 9 additions & 0 deletions Code/Mantid/Framework/API/src/FrameworkManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ void FrameworkManagerImpl::UpdateInstrumentDefinitions()
/// Sends startup information about OS and Mantid version
void FrameworkManagerImpl::SendStartupUsageInfo()
{
// see whether or not to send
int sendStartupUsageInfo = 0;
int retVal = Kernel::ConfigService::Instance().getValue(
"usagereports.enabled", sendStartupUsageInfo);
if ((retVal == 0) || (sendStartupUsageInfo == 0)) {
return; // exit early
}

// do it
try
{
IAlgorithm* algSendStartupUsage = this->createAlgorithm("SendUsage");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class DSFinterp1DTestTest(unittest.TestCase):

def generateWorkspaces(self, nf, startf, df, e=False):
def generateWorkspaces(self, nf, startf, df, e=False, seed=10):
'''Helper function. Generates input workspaces for testing
Generates a set of one-histogram workspaces, each containing a Lorentzian. Also
Expand All @@ -20,14 +20,18 @@ def generateWorkspaces(self, nf, startf, df, e=False):
df: separation between consecutive theoretical HWHM
[e]: if true, the theoretical HWHM and the actual HWHM used to construct
the lorentzian are different by a random amount.
[seed]: seed for the random generators. Default to 10.
Returns:
fvalues: list of theoretical HWHM
InputWorkspaces: names of the generated InputWorkspaces
xvalues: energy domains
HWHM: the HWHM of the target lorentzian against which we fit, stored
in workspace of name "targetW"
'''
from random import random
import random
random.seed(seed)
numpy.random.seed(seed)
n=200
dE = 0.004 #typical spacing for QENS experiments in BASIS, in meV
xvalues = dE * numpy.arange(-n, n)
Expand All @@ -38,7 +42,7 @@ def generateWorkspaces(self, nf, startf, df, e=False):
HWHM = f# half-width at half maximum
# Impose uncertainty in the Lorentzian by making its actual HWHM different than the theoretical one
if e:
HWHM += 2*df*(0.5-random()) # add uncertainty as big as twice the step between consecutive HWHM!!!
HWHM += 2*df*(0.5-random.random()) # add uncertainty as big as twice the step between consecutive HWHM!!!
if HWHM < 0: HWHM = f
yvalues = 1/numpy.pi * HWHM / (HWHM*HWHM + xvalues*xvalues) * (1.1 - 0.2*numpy.random.rand(2*n)) #10% random noise
evalues = yvalues*0.1*numpy.random.rand(2*n) # errors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ void MdViewerWidget::setupPluginMode()
this->setupMainView();
}


/**
* This function connects ParaView's data loader the given action.
* @param action the action to connect data loading to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,25 @@ ThreeSliceView::ThreeSliceView(QWidget *parent) : ViewBase(parent)
{
this->ui.setupUi(this);

// We need to load the QuadView.dll plugin. The Windows system requires the full
// We need to load the QuadView plugin
QString quadViewLibrary;
#ifdef Q_OS_WIN32
// Windows requires the full
// path information. The DLL is located in the apropriate executeable path of paraview.
const Poco::Path paraviewPath(Mantid::Kernel::ConfigService::Instance().getParaViewPath());

Poco::Path quadViewFullPath(paraviewPath, QUADVIEW_LIBRARY.toStdString());

QString quadViewLibrary(quadViewFullPath.toString().c_str());
quadViewLibrary = quadViewFullPath.toString().c_str();
#else
quadViewLibrary = QUADVIEW_LIBRARY;
#endif

// Need to load plugin
pqPluginManager* pm = pqApplicationCore::instance()->getPluginManager();
QString error;
pm->loadExtension(pqActiveObjects::instance().activeServer(),
quadViewLibrary, &error, false);

g_log.debug() << "Loading QuadView.dll from " << quadViewLibrary.toStdString() << "\n";
g_log.debug() << "Loading QuadView library from " << quadViewLibrary.toStdString() << "\n";

this->mainView = this->createRenderView(this->ui.mainRenderFrame,
QString("QuadView"));
Expand Down

0 comments on commit b7d4209

Please sign in to comment.